// If document.domain contains the word stagin, we insert the new navigation. if not we use the standard.

if (!barwidth)
	{
	var barwidth = "750";
	}
	
if (!pagecolour) 
	{
	var pagecolour = "FFFFFF";
	var pc = "null";
	} else {
	var pc = pagecolour;
	}

dom=document.domain;
if (dom.match("staging")&& document.cookie.indexOf("internal")!=-1) 
	{
var pagecolour = "003399";
		// The JS file is a shim to replace the existing synergy bar javascript
		
		// 1st write out the div the menu will be displayed in
		document.write("<div id=\"disneysynergynav\"></div>");
		// write out the include for the chrome
		// TODO: insert the path to the disney.co.XX server where the chrome.js is hosted
		document.write('<script language="JavaScript" src="scripts/chrome.js" type="text/javascript" ></script>');
		
		// build an object to store the requirements for the chrome
		var synergyNav = {
			divid:"disneysynergynav"
		};
		try {
			synergyNav.widthToUse=barwidth*1;
		} catch(e1) {
			synergyNav.widthToUse=null;
		}
		try {
			synergyNav.pagecolour=pagecolour;
		} catch(e2) {
			synergyNav.pagecolour=null;
		}

	}
	else 
	{
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" width="' + barwidth + '" height="37"  align="center">');
		document.write('<param name="movie" value="http://navbar.disneyinternational.com/sitewidemenu2.swf?bw=' + barwidth + '&bc=' + pc + '&configuredNodeId=sitenav&baseurl=/&xmlConfigPath=http://www.disney.dk/emea_top_navigation/navigation.jsp">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="BGCOLOR" value="#' + pagecolour + '">');
		document.write('<param name="SCALE" value="noscale">');
		document.write('<embed src="http://navbar.disneyinternational.com/sitewidemenu2.swf?bw=' + barwidth + '&bc=' + pc + '&configuredNodeId=sitenav&baseurl=/&xmlConfigPath=http://www.disney.dk/emea_top_navigation/navigation.jsp"  align="center" height="37" width="' + barwidth + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#' + pagecolour + '" scale="noscale"></embed>');
		document.write('<param name=wmode value=Opaque></object>');
	}

