function nutrition(theURL) {
	window.open(theURL,"nutrition","toolbar=no,menubar=no,scrollbars=yes,status=no,scrolling=yes,resizeable=0,width=365,height=500");
}

function legalWin() {
	legal = window.open("http://www.pg.com/terms.html","newwin","toolbar=no,menubar=no,scrollbars=yes,status=no,scrolling=yes,resizeable=0,width=800,height=350");
}

function privacyWin() {
	legal = window.open("http://www.pg.com/privacy.html","newwin","toolbar=no,menubar=no,status=no,scrollbars=yes,resizeable=0,width=800,height=350");
}

function popup(url) {
  var ad = window.open(url,'ad','scrollbars=0,resizable=0,status=0,width=250,height=280,top=25,left=25');
}
function ClearForm(){
	if(newsletter.email.value == "Enter E-mail"){
		newsletter.email.value = ""
	}
	else {
		return false;
	}
}
function formCheck(){
	if(newsletter.email.value == "Enter E-mail"){
		return false;
	}
	else{
		return true;
	}
}
//redirect underaged people to the home page
function jump_to_location(whichform) {
	age = whichform.Age.options[whichform.Age.selectedIndex].value;
	if (age == "12 or under") {
		document.location ="newsletter_sorry13.shtml";
		return false;
	}
	else{
		return true;
	}
}

function helpMe(){
	window.open('http://pgsnacks.custhelp.com/cgi-bin/pgsnacks.cfg/php/enduser/std_alp.php?p_prod_lvl1=52','','Height=500,Width=668,scrollbars=yes')
}
function helpMe2(){
	window.open('http://pgsnacks.custhelp.com/cgi-bin/pgsnacks.cfg/php/enduser/ask.php','','Height=500,Width=668,scrollbars=yes')
}

// used on the contact us page to set email address
function setEmail()
{
 var emails= new Array();
 emails["United Kingdom"]="ty9670@ethp904.eu.pg.com";
 emails["Australia"]="australiacr.im@pg.com";
 emails["Hong Kong"]="skiimf.im@pg.com";
 emails["Korea"]="vwsmile.im@pg.com";
 emails["Egypt"]="cnsmrr.im@pg.com";
 emails["Japan"]="pginfojp.im@pg.com";
 emails["New Zealand"]="australiacr.im@pg.com";
 emails["Venezuela"]="robles.c@pg.com";
 emails["Israel"]="sterarie@netvision.net.il";
 emails["France"]="frcr.im@pg.com";
 emails["Brazil"]="discpg.im@pg.com";
 emails["Mexico"]="mexico.pg@pg.com";
 emails["Germany"]="info@procter.de";
 emails["Ireland"]="ty9670@ethp904.eu.pg.com";
 emails["Belgium"]="Pgconsumentbe.im@pg.com";
 emails["Canada"]="pringlescan.im@pg.com";
 emails["Switzerland"]="pginfomailch.im@pg.com";
 emails["Hungary"]="Cespr.im@pg.com";
 emails["Finland"]="consumerse.im@pg.com";
 emails["Philippines"]="consumerphil.im@pg.com";
 emails["Sweden"]="consumerse.im@pg.com";
 emails["Poland"]="warconsumer.im@pg.com";
 emails["Czech Republic"]="spotrebitel.im@pg.com";
 emails["Argentina"]="ga.pgi@pg.com";
 emails["India"]="intouch.im@pg.com";
 emails["Slovak Republic"]="spotrebitel.im@pg.com";
 emails["Peru"]="alwaysperu.im@pg.com";
 emails["Thailand"]="thaicr.im@pg.com";
 emails["Netherlands"]="Pgconsumentnl.im@pg.com";
 emails["Colombia"]="srarobles.im@pg.com";
 emails["Norway"]="consumerse.im@pg.com";
 emails["Denmark"]="consumerse.im@pg.com";
 var key =  document.theForm.Country.value;
 var theEmail;
 eval ('theEmail = emails["' + key + '"]');
 if ( !theEmail ) {
  theEmail = "snkcr.im@pg.com";
 }
 
 theForm.recipient.value = theEmail;
 
}

//get the time to write on the gamers page
var ampm = " am"
theTime = new Date()
hour = theTime.getHours()
min = theTime.getMinutes()
if(min < 10){
	min = "0"+min
}
if(hour >= 12){
	hour = hour - 12
	ampm = " pm"
}

totalTime = hour + ":"+ min + ampm

function pollPop(){
	window.open('poll_pop.shtml','poll','width=186,height=210')
}
function cheetPop(URL){
	window.open(URL, 'cheet', 'width=350,height=300')
}
function spicyPop(){
	window.open('spicycajun.shtml', 'cheet', 'width=625,height=400')
}
function tearPop(){
	window.open('/tearjerker/pringlesTear.html', 'cheet', 'width=627,height=350')
}
function blastPop(){
	window.open('/popblaster.html', 'blast', 'width=600,height=400')
}
function whatisG4(){
	window.open('/whatisg4.html','g4','width=246,height=226')
}
function Certify(URL) {
  popupWin = window.open(URL, 'Participant', 'location=no,scrollbars,width=450,height=300')
  window.top.name = 'opener';
}
function sendToFriendCheck(form){
	if(!form.name.value){
		alert("Please fill in your name!");
		return false
	}
	else if(!form.friend_name.value){
		alert("Please fill in your friend's name!");
		return false
	}
	if(!form.email.value){
		alert("Please fill in your E-mail!");
		return false
	}
	else if(!form.target_email.value){
		alert("Please fill in your friend's E-mail!");
		return false
	}
	else{
		return true;
	}
}