<!--
function getPage(x){
   switch (x) {
   case "login":
		window.location.href = '/registration/inline.aspx?hidLocation=' + location.pathname;
		break;
   case "home":
      window.location.href = '/';
      break;
   case "mypage":
      window.location.href = '/mypage.aspx';
      break;
   case "prizes":
      window.location.href = '/prizes.aspx';
      break;
   case "games":
      window.location.href = '/games.aspx';
      break;
   case "nutrition":
      window.location.href = 'http://www.nutnutrition.com';
      break;
   case "recipes":
      window.location.href = '/recipe.aspx';
      break;
   case "history":
      window.location.href = '/history.aspx';
      break;
   case "products":
      window.location.href = '/products.aspx';
      break;
   case "gallery":
      window.location.href = '/gallery.aspx';
      break;
   case "terms":
      winopen('http://www.kraftapps.com/legal/terms.asp?referrer=planters','Support','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,WIDTH=500,HEIGHT=500');
      break;
   case "contactus":
      window.location.href = '/contactus/contact.aspx?m=contact_us';
      break;
   case "privacy":
      //winopen('http://www.kraftapps.com/legal/privacy.asp?referrer=Planters','Support','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,WIDTH=500,HEIGHT=500');
      window.location.href = '/privacy.aspx';
      break;
  }
}

function winopen(wurl,wname,wfeatures)
{
   newWindow=window.open(wurl,wname,wfeatures)
}

function openTeaser()
{
	newWindow=window.open("teaser.aspx", "teaser","width=650,height=408,menubar=no,scrollbars=no,resizable=no,location=no,status=no,toolbar=no");
}

function open_window_sm(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();

}

function nutr_popup(url){
	popup=window.open(url,"NutritionInfo","toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=625,width=707");
	popup.focus();

}

function open_window_scroll(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();
}

function OpenRegWindow(strict) {
	if (strict == "1") {
		open_window_sm('/registration/bday.aspx?strict=1&newreg=1',575,475,'register');
	} else {
		open_window_sm('/registration/bday.aspx?strict=0&newreg=1',575,475,'register');
	}
}

function OpenLoginWindow(strict) {
	if (strict == "1") {
		//open_window_sm('/registration/login.aspx?strict=1',375,395,'login');
		open_window_sm('/registration/login.aspx?strict=1',575,475,'login');
	} else {
		//open_window_sm('/registration/login.aspx?strict=0',375,395,'login');
		open_window_sm('/registration/login.aspx?strict=0',575,475,'login');
	}
}

function OpenLoginFinish() {
	open_window_sm('/registration/login_update.htm',575,475,'login');
}

function OpenForgotWindow() {
	open_window_sm('/registration/forget.aspx',575,475,'forgot');
}

function OpenUpdateRegWindow(strict) {
	if (strict == "1") {
		open_window_sm('/registration/updatereg.aspx?strict=1&newreg=0&upd=1',575,475,'update')
	} else {
		open_window_sm('/registration/updatereg.aspx?strict=0&newreg=0&upd=1',575,475,'update')
	}
}

function OpenModifyRegWindow(strict) {
	if (strict == "1") {
		open_window_sm('/registration/modify.aspx?strict=1',350,395,'update')
	} else {
		open_window_sm('/registration/modify.aspx?strict=0',350,395,'update')
	}
}

function getMilliseconds() {

dot = new Date(0);
now = new Date();
t = (now - dot);
return(t);

}


function getHyperloadDcr(dcr){
dcr = dcr +"?" +getMilliseconds();
return dcr;

}

function PrintGameTag(dcr, width, height, bgcolor, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9, swlist, version, menu) {
	if (!(sw1)) { sw1 = ""; }
	if (!(sw2)) { sw2 = ""; }
	if (!(sw3)) { sw3 = ""; }
	if (!(sw4)) { sw4 = ""; }
	if (!(sw5)) { sw5 = ""; }
	if (!(sw6)) { sw6 = ""; }
	if (!(sw7)) { sw7 = ""; }
	if (!(sw8)) { sw8 = ""; }
	if (!(sw9)) { sw9 = ""; }
	if (!(swlist)) { swlist = ""; }

	document.write('<OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=' + version + '" WIDTH="' + width + '" HEIGHT="' + height + '">	');
	document.write('<PARAM NAME="SRC" VALUE="' + dcr + '">	');
	document.write('<PARAM NAME="BGCOLOR" VALUE="' + bgcolor + '">	');
	document.write('<PARAM NAME="SW1" VALUE="' + sw1 + '">	');
	document.write('<PARAM NAME="SW2" VALUE="' + sw2 + '">	');
	document.write('<PARAM NAME="SW3" VALUE="' + sw3 + '">	');
	document.write('<PARAM NAME="SW4" VALUE="' + sw4 + '">	');
	document.write('<PARAM NAME="SW5" VALUE="' + sw5 + '">	');
	document.write('<PARAM NAME="SW6" VALUE="' + sw6 + '">	');
	document.write('<PARAM NAME="SW7" VALUE="' + sw7 + '">	');
	document.write('<PARAM NAME="SW8" VALUE="' + sw8 + '">	');
	document.write('<PARAM NAME="SW9" VALUE="' + sw9 + '">	');
	document.write('<PARAM NAME="SWLIST" VALUE="' + swlist + '">	');
	if (menu == 0) {
		document.write('<PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'">	');
		document.write('<EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	} else {
		document.write('<PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'">	');
		document.write('<EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	}
	document.write('</OBJECT>');
}

function writeFlashTag(movie, width, height, bgcolor, paramstring) {
	document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">');
	source = movie
	if ((paramstring != null) && (paramstring != "")) {
		source = source + "?" + paramstring;
	}
	document.writeln('  <PARAM NAME=movie VALUE="' + source + '">');
	document.writeln('  <PARAM NAME=quality VALUE=high>'); 
	document.writeln('  <PARAM NAME=bgcolor VALUE="#' + bgcolor + '">');
	document.writeln('  <EMBED src="' + source + '" quality=high bgcolor="#' + bgcolor + '" WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.writeln('</OBJECT>');
}

function changeImages(id,name){

  if (document.images) {document.images[id].src=eval(name+".src"); }

}

var buttonCounter = 0;
function OneButtonClick() {
	if (buttonCounter == 0) {
		buttonCounter = 1;
		return true;
	} else {
		return false;
	}
}

function containsNoBad( instring ) {
    badChars = "<>";
    for (var i=0; i< instring.length; i++) {
       if (badChars.indexOf(instring.charAt(i)) != -1) {
          return false;
       }
    }
    return true;
}

function isAlphanumeric( instring ) {
    allowed = "_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    for (var i=0; i< instring.length; i++) {
       if (allowed.indexOf(instring.charAt(i)) == -1) {
          return false;
       }
    }
    return true;
}

function alertAlphaOnly(f) {
	alert("Please use letters and numbers only " + f + ".");
}

function alertBadChar(f) {
	alert("Please do not use illegal characters " + f + ".");
}

function setSliverLoc(v) {
   document.sliverForm.hidLocation.value = v;
}

function getSliverLoc() {
   v = document.sliverForm.hidLocation.value;
   if (v != "") {
      return v;
   } else {
      w = String(window.location.href);
      if ( w.indexOf("inline.aspx") != -1 ) {
         return "/default.aspx";
      } else {
         return window.location.href;
      }
   }
}

function sliverLogIn() {
   if (document.sliverForm.hidLocation.value == "") {
      setSliverLoc(window.location.href);
   }
   document.sliverForm.controlName.value = "/registration/inlineloginfrm";
   document.sliverForm.submit();
}

function sliverRegister() {
   if (document.sliverForm.hidLocation.value == "") {
      setSliverLoc(window.location.href);
   }
   document.sliverForm.controlName.value = "/registration/inlineregfrm";
   document.sliverForm.submit();
}

function sliverForgot() {
   if (document.sliverForm.hidLocation.value == "") {
      setSliverLoc(window.location.href);
   }
   document.sliverForm.controlName.value = "/registration/inlineforgotfrm";
   document.sliverForm.submit();
}

startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
        (" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// -->
