//http://www.featureblend.com/license.txt
var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{"name":"ShockwaveFlash.ShockwaveFlash.7","version":function(obj){return getActiveXVersion(obj);}},{"name":"ShockwaveFlash.ShockwaveFlash.6","version":function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj);}catch(err){}
return version;}},{"name":"ShockwaveFlash.ShockwaveFlash","version":function(obj){return getActiveXVersion(obj);}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version");}catch(err){}
return version;};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name);}catch(err){obj={activeXError:true};}
return obj;};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{"raw":str,"major":parseInt(versionArray[0].split(" ")[1],10),"minor":parseInt(versionArray[1],10),"revision":parseInt(versionArray[2],10),"revisionStr":versionArray[2]};};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{"raw":str,"major":parseInt(majorMinor[0],10),"minor":parseInt(majorMinor[1],10),"revisionStr":revisionStr,"revision":parseRevisionStrToInt(revisionStr)};};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision;};self.majorAtLeast=function(version){return self.major>=version;};self.minorAtLeast=function(version){return self.minor>=version;};self.revisionAtLeast=function(version){return self.revision>=version;};self.versionAtLeast=function(major){var properties=[self.major,self.minor,self.revision];var len=Math.min(properties.length,arguments.length);for(i=0;i<len;i++){if(properties[i]>=arguments[i]){if(i+1<len&&properties[i]==arguments[i]){continue;}else{return true;}}else{return false;}}};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type='application/x-shockwave-flash';var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true;}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(!obj.activeXError){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr;}}}}}();};FlashDetect.JS_RELEASE="1.0.4";

function insertMainNav(the_domain, the_page_ID, currentPage, currentSub, theXml){	
	navPath="http://"+the_domain+"/common/flash/header.swf";
	the_xml_path="http://"+the_domain+"/interface/getNavXML.php?page_ID="+the_page_ID;

	theXml = theXml.replace('"', '%22');

	var_string=	"the_xml="+theXml+
			"&navPath="+navPath+
			"&currentPage="+currentPage+
			"&currentSub="+currentSub+
			"&the_path="+the_xml_path;	

	if(currentPage=="-1"){
		the_height="695";
		the_swf="FDL_shell.swf";
		the_wmode="opaque";
	} else {
		the_height="154";
		the_swf="header.swf";
		the_wmode="transparent";
	}

	the_code='';
	if(FlashDetect.installed){	
		the_code=the_code+'<OBJECT ID="flash_nav" NAME="flash_nav" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="900" HEIGHT="'+the_height+'" BORDER="0">';
		the_code=the_code+'	<PARAM NAME="movie" 	VALUE="http://'+the_domain+'/common/flash/'+the_swf+'">';
		the_code=the_code+'	<PARAM NAME="allowScriptAccess" VALUE="always"/>';
		the_code=the_code+'	<PARAM NAME="FlashVars" VALUE="'+var_string+'" >';	
		the_code=the_code+'	<PARAM NAME="quality" 	VALUE="high">';
		the_code=the_code+'	<PARAM NAME="bgcolor" 	VALUE="#FFFFFF">';
		the_code=the_code+'	<PARAM NAME="wmode" 	VALUE="transparent">';
		the_code=the_code+'<EMBED SRC="http://'+the_domain+'/common/flash/'+the_swf+'" ALLOWSCRIPTACCESS="always" ID="flash_nav" WMODE="transparent" NAME="flash_nav" FlashVars="'+var_string+'" QUALITY="high" TYPE="application/x-shockwave-flash" WIDTH="900" HEIGHT="'+the_height+'" BGCOLOR="#FFFAE4"></EMBED>';
		the_code=the_code+'</OBJECT>';
	} 

	document.write(the_code);
}

function insertNavFromGSN(the_domain){ insertMainNav(the_domain, "gsn", "5", "-1", "getFromServer"); }

if(!FlashDetect.installed){
	site_section="6"; the_url=" "+window.location;
	
	if(the_url.indexOf("home")!=-1)			{ site_section="0"; } 
	if(the_url.indexOf("our_company")!=-1)		{ site_section="1"; } 
	if(the_url.indexOf("maikai_program")!=-1)	{ site_section="2"; } 
	if(the_url.indexOf("our_community")!=-1)	{ site_section="3"; } 
	if(the_url.indexOf("our_newsletter")!=-1)	{ site_section="4"; } 
	if(the_url.indexOf("in_our_stores")!=-1)	{ site_section="5"; } 
	if(the_url.indexOf("weekly_ads")!=-1)		{ site_section="6"; } 
	if(the_url.indexOf("promotions")!=-1)		{ site_section="7"; } 
	if(the_url.indexOf("careers")!=-1)		{ site_section="8"; } 

	if( the_url.indexOf("gsnrecipes")!=-1 ){ the_domain="http://www.foodland.com"; } else { the_domain=""; }
	document.write("<SCR" + "IPT SRC=\""+the_domain+"/interface/getNonFlashParts.php?site_section="+site_section+"\" TYPE=\"text/javascript\"><SCR" + "IPT>");
}
