// Browser Info
function UFcheckBrowser(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase();
	this.dom=document.getElementById?1:0
	this.all=document.all?1:0;
	this.layers=document.layers?1:0;
	this.images=document.images?1:0;
	this.IE = navigator.appName=="Microsoft Internet Explorer"?1:0;
	this.NS = navigator.appName=="Netscape"?1:0;
	this.MAC = (this.agent.indexOf("mac")!=-1);
	//alert(navigation.appName);
	return this;
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
//alert(BrowserDetect.OS);
oUFBrowser=UFcheckBrowser();

function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); }
function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); }
function getAbsPos(elt,which) {
 iPos = 0;
 while (elt != null) {
  if( elt.style && elt.style.position == 'absolute' ) {
  iPos += parseInt(elt.style[which.toLowerCase()]);
} else {
  iPos += elt["offset" + which];
}
  elt = elt.offsetParent;
 }
 return iPos;
} 

function loadproduct(sProduct) {
	if(sProduct=="home") {
		sProduct="index";
	}
	self.location.href=sProduct+".aspx";

}

function willBrowserDisplayLayerOverFlash() {
	agt=navigator.userAgent.toLowerCase();
	if(typeof window.opera!="undefined"){
		if(/opera[\/ ][5-7]/.test(agt)){return false}
	}
	if(agt.indexOf("safari")>-1) { return false; }
	if(agt.indexOf("msie 5.23")>-1) { return false; }
	
	return true;
}

function drawFlashWarning() {
	if(!DetectFlashVer(8,0,0)) {
		if(document.getElementById) {
			oFlashWarning=document.getElementById("flashwarning");
			if(oFlashWarning) {
				oFlashWarning.style.top="0px";
				oFlashWarning.style.left="0px";
				oFlashWarning.style.top="0px";
				oFlashWarning.style.visibility="visible";
				oFlashWarning.style.display="block";
				oFlashWarning.style.width="100%";
				oFlashWarning.style.height="20px";
				oFlashWarning.innerHTML="&nbsp; It was detected that you are using an old version of the Flash plugin. For the best experience, <strong><a href=\"http://www.macromedia.com/go/getflash/\" target=\"_blank\">please download the latest version of Flash</a>.</strong>";
			}
		}
	}
}

function drawGalleryFlash(name) {
//alert(name);
        var sSWFHTML = '';
        if(DetectFlashVer(8,0,0)) {
				sSWFHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"325\" height=\"269\" align=\"middle\">\n";
				sSWFHTML+="<param name=\"allowScriptAccess\" value=\"Always\" />\n";
				sSWFHTML+="<param name=\"movie\" value=\"swf/player.swf\" />\n";
				sSWFHTML+="<param name=\"FlashVars\" value=\"clipName=" + name + "\" />\n";
				sSWFHTML+="<param name=\"quality\" value=\"high\" />\n";
				sSWFHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />\n";
				sSWFHTML+="<param name=\"wmode\" value=\"opaque\" />\n";
				sSWFHTML+="<embed src=\"swf/player.swf\" quality=\"high\" width=\"325\" height=\"269\" FlashVars=\"clipName=" + name + "\" align=\"middle\" allowScriptAccess=\"Always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"opaque\" />\n";
				sSWFHTML+="</object>\n";
			
		}

		document.getElementById('gallery_flash').innerHTML = sSWFHTML;
}

function loadHomepageFlash(sFrom) {
	var bSkip = new Boolean(0);
	if (Get_Cookie('skipIntro') == 'true') {
	    bSkip = 1;
	    sStr = '&skipIntro=1'
	} else {
	    bSkip = 0;
	}
	//this fixed a bug with the query string not always being URL encoded
	//TODO: fix the problem without this hack
	try{
    	while(sFrom.match(/\./) || sFrom.match(/-/))
    	{
	        sFrom=sFrom.replace("\.", "%2E");
	        sFrom=sFrom.replace("-", "%2D");
	    }
	}catch(e){
	
	}
	var sSWFHTML="";
	if ((typeof(sFrom) == 'undefined') || (sFrom == '')) {
		//sSWFPath = "swf/home_generic.swf";
		sSWFPath = "swf/home.swf";
	} else if ((sFrom == 'soyeaters%2Dmakebetterlovers%2Ecom') || (sFrom == 'soyeatersmakebetterlovers%2Ecom') || (sFrom == 'www%2Esoyeatersmakebetterlovers%2Ecom') || (sFrom == 'www%2Esoyeaters%2Dmakebetterlovers%2Ecom')) {
		sSWFPath = "swf/home_better_lovers.swf";
	} else if ((sFrom == 'ifyoucant%2Dpronounceit%2Ddont%2Deat%2Dit%2Ecom') || (sFrom == 'ifyoucantpronounceitdonteatit%2Ecom') || (sFrom == 'www%2Eifyoucantpronounceitdonteatit%2Ecom') || (sFrom == 'www%2Eifyoucant%2Dpronounceit%2Ddont%2Deat%2Dit%2Ecom')) {
		sSWFPath = "swf/home_pronounce.swf";
	} else if ((sFrom == 'hey%2Dman%2Dijustneedasnack%2Ecom') || (sFrom == 'heymanijustneedasnack%2Ecom') || (sFrom == 'www%2Eheymanijustneedasnack%2Ecom') || (sFrom == 'www%2Ehey%2Dman%2Dijustneedasnack%2Ecom')) {
		sSWFPath = "swf/home_snack.swf";
	} else if ((sFrom == 'yoga%2Dforyourmouth%2Ecom') || (sFrom == 'yogaforyourmouth%2Ecom') || (sFrom == 'yogaforyourmouth.com' ) || (sFrom == 'www%2Eyogaforyourmouth%2Ecom') || (sFrom == 'www%2Eyoga%2Dforyourmouth%2Ecom')) {
		sSWFPath = "swf/home_yoga_mouth.swf";
	} else {
		sSWFPath = "swf/home_generic.swf";
	}
	drawFlashWarning();	
	if(document.getElementById) {
		
		var currentTime = new Date();
        var month = currentTime.getMonth() + 1;
        var day = currentTime.getDate();
        var year = currentTime.getFullYear();
        var today = month + "/" + day + "/" + year;

		
			if(DetectFlashVer(8,0,0)) {
			
			//document.getElementById('index_content').style.display="none";
		    //document.getElementById('img_spacer').height = 35;
		    
				sSWFHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"873\" height=\"374\" align=\"middle\">\n";
				sSWFHTML+="<param name=\"allowScriptAccess\" value=\"Always\" />\n";
				sSWFHTML+="<param name=\"movie\" value=\""+sSWFPath+"\" />\n";
				sSWFHTML+="<param name=\"FlashVars\" value=\"sDate=" + today;
				if (bSkip) {
				    sSWFHTML+=sStr;
				}
				sSWFHTML+="\" />\n"
				sSWFHTML+="<param name=\"quality\" value=\"high\" />\n";
				sSWFHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />\n";
				sSWFHTML+="<param name=\"wmode\" value=\"opaque\" />\n";
				sSWFHTML+="<embed src=\""+sSWFPath+"\" quality=\"high\" width=\"873\" height=\"374\" FlashVars=\"sDate=" + today;
				if (bSkip) {
				    sSWFHTML+=sStr;
				}
				sSWFHTML+="\" align=\"middle\" allowScriptAccess=\"Always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"opaque\" />\n";
				sSWFHTML+="</object>\n";
			
		}
	}
    //document.getElementById('homepageFlash').innerHTML = sSWFHTML;
}

function loadProductsSWF(sDivID,sSWFPath,iWidth,iHeight,autogo) {

    
	if (BrowserDetect.browser == 'Safari') {
	    document.getElementById(sDivID).style.paddingTop = '3px';
	}
	if (BrowserDetect.browser == 'Firefox') {
	    if ((sSWFPath !== '/swf/soyjoy_home.swf') && (sSWFPath !== '/swf/quiz.swf')) {
	        document.getElementById(sDivID).style.marginTop = '-384px';
	    }
	}
	drawFlashWarning();	
	if(document.getElementById) {
		sSWFHTML="";
		oSWFDIV=document.getElementById(sDivID);
		if(oSWFDIV) {
			if(DetectFlashVer(8,0,0)) {
				sSWFHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+iWidth+"\" height=\""+iHeight+"\" align=\"middle\">\n";
				sSWFHTML+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
				sSWFHTML+="<param name=\"movie\" value=\""+sSWFPath+"\" />\n";
				sSWFHTML+="<param name=\"quality\" value=\"high\" />\n";
				sSWFHTML+="<param name=\"FlashVars\" value=\"autogo="+autogo+"\" />\n";
				//sSWFHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />\n";
				sSWFHTML+="<param name=\"wmode\" value=\"transparent\" />\n";
				sSWFHTML+="<embed src=\""+sSWFPath+"\" quality=\"high\" width=\""+iWidth+"\" height=\""+iHeight+"\"  align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\" />\n";
				sSWFHTML+="</object>\n";
			} else {
			    if (sSWFPath == '/swf/soyjoy_home.swf') {
			  
			        sSWFHTML+=" <img src=\"images/static_soyjoy.jpg\" width=\"430\" height=\"370\" border=\"0\" alt=\"SOYJOY Bars\" title=\"SOYJOY Bars\" usemap = #static_soyjoy />\n";
					sSWFHTML+="	        <map name=\"static_soyjoy\">\n";
                    sSWFHTML+="                    <area shape=Rect Coords=11,25,102,355 Href=\" http://soyjoydev.rpa.com/raisin-almond.aspx\"> \n";
                    sSWFHTML+="                    <area shape=Rect Coords=118,25,208,355 Href=\"http://soyjoydev.rpa.com/mango-coconut.aspx\"> \n";
                    sSWFHTML+="                    <area shape=Rect Coords=220,25,309,355 Href=\" http://soyjoydev.rpa.com/apple-walnut.aspx\"> \n";
                    sSWFHTML+="                    <area shape=Rect Coords=322,25,412,355 Href=\"http://soyjoydev.rpa.com/berry.aspx\"> \n";
                    sSWFHTML+="               </map>\n";
                    sSWFHTML+=" <img src=\"images/trans.gif\" width=\""+iWidth+"\" height=\"15\" />\n";
			        
			    } else {
			        sSWFHTML+="<img src=\"images/trans.gif\" width=\""+iWidth+"\" height=\""+iHeight+"\" />\n";
			    }
			}
			oSWFDIV.innerHTML=sSWFHTML;
		}
	}
}

function loadProductNavSWF(sDivID,sSWFPath,iWidth,iHeight,autogo) {
	return;
	drawFlashWarning();	
	if(document.getElementById) {
		sSWFHTML="";
		oSWFDIV=document.getElementById(sDivID);
		if(oSWFDIV) {
			if(DetectFlashVer(8,0,0)) {
				sSWFHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+iWidth+"\" height=\""+iHeight+"\" align=\"middle\">\n";
				sSWFHTML+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
				sSWFHTML+="<param name=\"movie\" value=\""+sSWFPath+"\" />\n";
				sSWFHTML+="<param name=\"quality\" value=\"high\" />\n";
				sSWFHTML+="<param name=\"FlashVars\" value=\"autogo="+autogo+"\" />\n";
				//sSWFHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />\n";
				sSWFHTML+="<param name=\"wmode\" value=\"transparent\" />\n";
				sSWFHTML+="<embed src=\""+sSWFPath+"\" quality=\"high\" FlashVars=\"autogo="+autogo+"\" width=\""+iWidth+"\" height=\""+iHeight+"\"  align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\" />\n";
				sSWFHTML+="</object>\n";
			} else {
				sSWFHTML+="<table width=\"440\">\n";
		        sSWFHTML+="<tr>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<span class=\"white\">Select a Flavor</span>\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"strawberry.aspx\" onmouseover=\"ChangeImage('img_pink','images/products/pink_over.gif'); UFChangeDivText('flavor_name','Strawberry');\" onmouseout=\"ChangeImage('img_pink','images/products/pink.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/pink.gif\" id=\"img_pink\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
                sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"peanut-chocolate-chip.aspx\" onmouseover=\"ChangeImage('img_brown','images/products/brown_over.gif'); UFChangeDivText('flavor_name','Peanut Chocolate Chip');\" onmouseout=\"ChangeImage('img_brown','images/products/brown.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/brown.gif\" id=\"img_brown\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"raisin-almond.aspx\" onmouseover=\"ChangeImage('img_purple','images/products/purple_over.gif'); UFChangeDivText('flavor_name','Raisin Almond');\" onmouseout=\"ChangeImage('img_purple','images/products/purple.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/purple.gif\" id=\"img_purple\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"mango-coconut.aspx\" onmouseover=\"ChangeImage('img_orange','images/products/orange_over.gif'); UFChangeDivText('flavor_name','Mango Coconut');\" onmouseout=\"ChangeImage('img_orange','images/products/orange.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/orange.gif\" id=\"img_orange\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"apple-walnut.aspx\" onmouseover=\"ChangeImage('img_green','images/products/green_over.gif'); UFChangeDivText('flavor_name','Apple');\" onmouseout=\"ChangeImage('img_green','images/products/green.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/green.gif\" id=\"img_green\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"berry.aspx\" onmouseover=\"ChangeImage('img_red','images/products/red_over.gif'); UFChangeDivText('flavor_name','Berry');\" onmouseout=\"ChangeImage('img_red','images/products/red.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/red.gif\" id=\"img_red\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td width=\"200\">\n";
			    sSWFHTML+="	<span class=\"white\"><div id=\"flavor_name\"></div></span>\n";
			    sSWFHTML+="</td>\n";
		        sSWFHTML+="</tr>\n";
	            sSWFHTML+="</table>\n";
			    }
			    oSWFDIV.innerHTML=sSWFHTML;
		}
	}
}

function loadProductNavSpreadSWF(sDivID,sSWFPath,iWidth,iHeight,autogo) {
	drawFlashWarning();	
	if(document.getElementById) {
		sSWFHTML="";
		oSWFDIV=document.getElementById(sDivID);
		if(oSWFDIV) {
			if(DetectFlashVer(8,0,0)) {
				sSWFHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+iWidth+"\" height=\""+iHeight+"\" align=\"middle\">\n";
				sSWFHTML+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
				sSWFHTML+="<param name=\"movie\" value=\""+sSWFPath+"\" />\n";
				sSWFHTML+="<param name=\"quality\" value=\"high\" />\n";
				sSWFHTML+="<param name=\"FlashVars\" value=\"autogo="+autogo+"\" />\n";
				//sSWFHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />\n";
				sSWFHTML+="<param name=\"wmode\" value=\"transparent\" />\n";
				sSWFHTML+="<embed src=\""+sSWFPath+"\" quality=\"high\" FlashVars=\"autogo="+autogo+"\" width=\""+iWidth+"\" height=\""+iHeight+"\"  align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\" />\n";
				sSWFHTML+="</object>\n";
			} else {
				sSWFHTML+="<table width=\"440\">\n";
				sSWFHTML+="<tr><td><div style='height:5px; font-size:0px;'></div></td></tr>";
		        sSWFHTML+="<tr>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<span class=\"productnav\">Select a Flavor</span>\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"strawberry.aspx\" onmouseover=\"ChangeImage('img_pink','images/products/pink_over.gif'); UFChangeDivText('flavor_name','Strawberry');\" onmouseout=\"ChangeImage('img_pink','images/products/pink.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/pink.gif\" id=\"img_pink\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
                sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"peanut-chocolate-chip.aspx\" onmouseover=\"ChangeImage('img_brown','images/products/brown_over.gif'); UFChangeDivText('flavor_name','Peanut Chocolate Chip');\" onmouseout=\"ChangeImage('img_brown','images/products/brown.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/brown.gif\" id=\"img_brown\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"raisin-almond.aspx\" onmouseover=\"ChangeImage('img_purple','images/products/purple_over.gif'); UFChangeDivText('flavor_name','Raisin Almond');\" onmouseout=\"ChangeImage('img_purple','images/products/purple.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/purple.gif\" id=\"img_purple\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"mango-coconut.aspx\" onmouseover=\"ChangeImage('img_orange','images/products/orange_over.gif'); UFChangeDivText('flavor_name','Mango Coconut');\" onmouseout=\"ChangeImage('img_orange','images/products/orange.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/orange.gif\" id=\"img_orange\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"apple-walnut.aspx\" onmouseover=\"ChangeImage('img_green','images/products/green_over.gif'); UFChangeDivText('flavor_name','Apple');\" onmouseout=\"ChangeImage('img_green','images/products/green.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/green.gif\" id=\"img_green\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"berry.aspx\" onmouseover=\"ChangeImage('img_red','images/products/red_over.gif'); UFChangeDivText('flavor_name','Berry');\" onmouseout=\"ChangeImage('img_red','images/products/red.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/red.gif\" id=\"img_red\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td width=\"200\">\n";
			    sSWFHTML+="	<span class=\"productnav\"><div id=\"flavor_name\"></div></span>\n";
			    sSWFHTML+="</td>\n";
		        sSWFHTML+="</tr>\n";
	            sSWFHTML+="</table>\n";
			    }
			    oSWFDIV.innerHTML=sSWFHTML;
		}
	}
}


function loadProductNavSpreadNonSWF(sDivID,sSWFPath,iWidth,iHeight,autogo) {
	if(document.getElementById) {
		sSWFHTML="";
		oSWFDIV=document.getElementById(sDivID);
		if(oSWFDIV) {
				sSWFHTML+="<table width=\"440\">\n";
				sSWFHTML+="<tr><td><div style='height:5px; font-size:0px;'></div></td></tr>";
		        sSWFHTML+="<tr>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<span class=\"productnav\">Select a Flavor</span>\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"strawberry.aspx\" onmouseover=\"ChangeImage('img_pink','images/products/pink_over.gif'); UFChangeDivText('flavor_name','Strawberry');\" onmouseout=\"ChangeImage('img_pink','images/products/pink.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/pink.gif\" id=\"img_pink\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
                sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"peanut-chocolate-chip.aspx\" onmouseover=\"ChangeImage('img_brown','images/products/brown_over.gif'); UFChangeDivText('flavor_name','Peanut Chocolate Chip');\" onmouseout=\"ChangeImage('img_brown','images/products/brown.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/brown.gif\" id=\"img_brown\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"raisin-almond.aspx\" onmouseover=\"ChangeImage('img_purple','images/products/purple_over.gif'); UFChangeDivText('flavor_name','Raisin Almond');\" onmouseout=\"ChangeImage('img_purple','images/products/purple.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/purple.gif\" id=\"img_purple\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"mango-coconut.aspx\" onmouseover=\"ChangeImage('img_orange','images/products/orange_over.gif'); UFChangeDivText('flavor_name','Mango Coconut');\" onmouseout=\"ChangeImage('img_orange','images/products/orange.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/orange.gif\" id=\"img_orange\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"apple-walnut.aspx\" onmouseover=\"ChangeImage('img_green','images/products/green_over.gif'); UFChangeDivText('flavor_name','Apple');\" onmouseout=\"ChangeImage('img_green','images/products/green.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/green.gif\" id=\"img_green\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td>\n";
			    sSWFHTML+="	<a href=\"berry.aspx\" onmouseover=\"ChangeImage('img_red','images/products/red_over.gif'); UFChangeDivText('flavor_name','Berry');\" onmouseout=\"ChangeImage('img_red','images/products/red.gif'); UFChangeDivText('flavor_name','');\"><img src=\"images/products/red.gif\" id=\"img_red\" border=\"0\">\n";
			    sSWFHTML+="</td>\n";
			    sSWFHTML+="<td width=\"200\">\n";
			    sSWFHTML+="	<span class=\"productnav\"><div id=\"flavor_name\"></div></span>\n";
			    sSWFHTML+="</td>\n";
		        sSWFHTML+="</tr>\n";
	            sSWFHTML+="</table>\n";
			    oSWFDIV.innerHTML=sSWFHTML;
		}
}
}
function benefitHome(sBenefitsState) {
	if(document.getElementById) {
		oBenefitsHomeImg=document.getElementById("benfits.home.img");
		if(oBenefitsHomeImg) {
			if(sBenefitsState=="hover" || sBenefitsState=="default") {
				oBenefitsHomeImg.src="images/"+sBenefitsState+".gif";
			}
		}
	}	
}

function faqHome(sFaqState) {
	if(document.getElementById) {
		oFAQHomeImg=document.getElementById("faq.home.img");
		if(oFAQHomeImg) {
			if(sFaqState=="hover" || sFaqState=="default") {
				oFAQHomeImg.src="images/"+sFaqState+".gif";
			}
		}
	}	
}


// ======


// Flash Player Version Detection - Rev 1.5
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "Always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;			
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
var sTopNavSelected="";
var aTopNavIDs = new Array("home","products","pressmain");
function topNavAction(sAction,sID){
	if(document.getElementById) {
		oTopNavImg=document.getElementById("topnav.img."+sID);
		oTopNavLink=document.getElementById("topnav.img."+sID);
		if(oTopNavImg && oTopNavLink) {
			if(sAction=="hover" || sAction=="default" || sAction== "active") {
				if(sTopNavSelected != sID) {
					oTopNavImg.src="images/"+sID+"-"+sAction+".gif";
					oTopNavLink.blur();
				}
				return true;     
			} else if(sAction=="click") {
				if(!willBrowserDisplayLayerOverFlash()) {
					return true;
				}
				clearLayers();
				topNavRestDefault();
				if(sTopNavSelected == sID) {
					sTopNavSelected = "";
				} else {
					sTopNavSelected = sID;
				}
				
				if(sTopNavSelected == sID) {
					oTopNavImg.src="images/"+sID+"-active.gif";
				} else {
					oTopNavImg.src="images/"+sID+"-default.gif";
				}
								
				/*if(oTopNavLink) {
					if(oTopNavLink.blur) {
						oTopNavLink.blur();
					}
				}*/
				
				return false;
			} 
		} 
	} 
	return false;
}

function topNavRestDefault() {
	if(document.getElementById) {
		for(iTDNRD=0;iTDNRD<aTopNavIDs.length;iTDNRD++) {
				oTDNRDImg=document.getElementById("topnav.img."+aTopNavIDs[iTDNRD]);
				if(oTDNRDImg) {
					oTDNRDImg.src="images/topnav/"+aTopNavIDs[iTDNRD]+"-default.gif";
				}

		}
	}

}

function bottomNavAction(sAction,sID){
	if(document.getElementById) {
		oBottomNavImg=document.getElementById("bottomnav.img."+sID);
		oBottomNavLink=document.getElementById("bottomnav.link."+sID);
		if(oBottomNavImg && oBottomNavLink) {
			if(sAction=="hover" || sAction=="default") {
				oBottomNavImg.src="images/"+sID+"-"+sAction+".gif";
				oBottomNavLink.blur();
				return true;
			} else if(sAction=="click") {
				if(!willBrowserDisplayLayerOverFlash()) {
					return true;
				}
				topNavRestDefault();
				sTopNavSelected = "";
				clearLayers();
				if(sID=="share") {
					oShareLayer=document.getElementById("spreadthesoyjoy");
					oContentLayer=document.getElementById("content");
					oShareModuleLayer=document.getElementById("bottomnav_try");
					
					
					if(oShareLayer && oContentLayer && oShareModuleLayer) {
						
						oShareModuleLayer.style.visibility="hidden";
						
						oShareLayer.style.display="inline";
						oShareLayer.style.visibility="visible";
						oShareLayer.style.left=getAbsX(oContentLayer)+13;
						oShareLayer.style.top=getAbsY(oContentLayer);
	
					}
				
				}
				
				oBottomNavLink.blur();
				return false;
			} 
		} 
	} 
	return false;
}


function NewTopNavAction(sAction,sID){
	if(document.getElementById) {
		oNewTopNavImg=document.getElementById("topnav.img."+sID);
		oNewTopNavLink=document.getElementById("topnav.link."+sID);
		if(oNewTopNavImg && oNewTopNavLink) {
			if(sAction=="hover" || sAction=="default") {
				oNewTopNavImg.src="images/topnav/"+sID+"-"+sAction+".gif";
				oNewTopNavLink.blur();
				return true;
			} else if(sAction=="click") {
				if(!willBrowserDisplayLayerOverFlash()) {
					return true;
				}
				topNavRestDefault();
				sTopNavSelected = "";
				clearLayers();
				
				oNewTopNavLink.blur();
				return false;
			} 
		} 
	} 
	return false;
}



function ChangeImage(sIMGName, sImageSRC, sLayerName) {
	if (oUFBrowser.images) {
		if (oUFBrowser.dom) { 
			document.getElementById(sIMGName).src = sImageSRC;
		} else if (oUFBrowser.layers) { 
			if (("" + sLayerName != "undefined") && (sLayerName != "")) {
				if ("" + document.layers[sLayerName] != "undefined") {
					document.layers[sLayerName].document.images[sIMGName].src = sImageSRC;
				}
			} else {
				if ("" + document.images[sIMGName] != "undefined") {
					document.images[sIMGName].src = sImageSRC;
				}
			}
		} else if (oUFBrowser.all) {
			document.images[sIMGName].src = sImageSRC;
		}
	}
}


// We need to make the window handler global so we can see its status at all times
var objNewWindow = null; // Popup window handler

function PopWin(strURL, strWindowName, intHeight, intWidth) {
	PopupWindowWithParams(strURL, strWindowName, intHeight, intWidth, 'directories=no,status=no,copyhistory=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes,left=0px,top=0px');
}

function PopupWindowWithParams(strURL, strWindowName, intHeight, intWidth, strParams) {

	if (objNewWindow != null) { // Popup windows HAS been opened in the past
        if (!objNewWindow.closed) {  // Popup window is still open
			// Close current window
            objNewWindow.close();
        }
    }
	// Open the new window
 	objNewWindow = window.open(strURL , strWindowName, 'width='+intWidth+',height='+intHeight+','+strParams);

}

function UFChangeDivText(sName , sText) {
	oUFBrowser=UFcheckBrowser();
	if (oUFBrowser.dom)  { 
		if (document.getElementById(sName)) {
			document.getElementById(sName).innerHTML = '';
			document.getElementById(sName).innerHTML = sText;
		}
	} else if (oUFBrowser.all) {
		if (document.all[sName]) {
			document.all[sName].innerHTML = '';
			document.all[sName].innerHTML = sText;
		}
	} else if (oUFBrowser.layers) {	
		if (document.layers[sName]) {
			document.layers[sName].document.open();
			document.layers[sName].document.writeln('');
			document.layers[sName].document.writeln(sText);
			document.layers[sName].document.close();
		}
	}
}

/*function imposeMaxLength(Object, MaxLen)
    {
      return (Object.value.length <= MaxLen);
    }*/
    
function imposeMaxLength(obj)
{
  var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)

} 

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime( today.getTime() );

    /*
    if the expires variable is set, make the correct 
    expires time, the current script below will set 
    it for x number of days, to make it for hours, 
    delete * 24, for minutes, delete * 60 * 24
    */
    if ( expires )
    {
    expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date( today.getTime() + (expires) );

    document.cookie = name + "=" +escape( value ) +
    ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
    ( ( path ) ? ";path=" + path : "" ) + 
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}


function Get_Cookie( name ) {
	
    var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ( ( !start ) &&
    ( name != document.cookie.substring( 0, name.length ) ) )
    {
    return null;
    }
    if ( start == -1 ) return null;
    var end = document.cookie.indexOf( ";", len );
    if ( end == -1 ) end = document.cookie.length;
    return unescape( document.cookie.substring( len, end ) );
}


function Delete_Cookie( name, path, domain ) {
    if ( Get_Cookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


 function GetQS(variable) {
	            var query = window.location.search.substring(1);
	              var vars = query.split("&");
	              for (var i=0;i<vars.length;i++) {
	                var pair = vars[i].split("=");
	                if (pair[0] == variable) {
	                  return pair[1];
	                }
	              }	  
                }
	    