/****************************************************************/
/*  Disney.com Microchrome (Global Navigation)					
/*  Updated 1/29/2007											
/*  DO NOT EDIT OR MODIFY WITHOUT QA ENGINEERING APPROVAL
/*  CONTACT QA ENGINEERING FOR ISSUES
/****************************************************************/
var chromeLinkText=new Array("Movies","TV","Games","Music","Live Events","Travel","Shop","Mobile","Characters","For You","DXD"); 
var chromeLinkHref=new Array(	"http://home.disney.go.com/movies/index",
								"http://home.disney.go.com/tv/index",
								"http://home.disney.go.com/games/index",
								"http://home.disney.go.com/music/index",
								"http://home.disney.go.com/liveevents/index",
								"http://home.disney.go.com/travel/index",
								"http://home.disney.go.com/shopping/index?CMP=OTL-DcomMicro&att=MicroChrmShpTb",
								"http://home.disney.go.com/mobile/index",
								"http://home.disney.go.com/characters/index",
								"http://home.disney.go.com/foryou/index",
								"http://disney.go.com/dxd/index.html?channel=16928&transitionURL=swfs%2Fintros%2Fdxd_intro_home.swf&"); 

var chromeLinksPadding=4, chromeMidWidth=669, chromeLinkOffset=8, chromeLinkShOffset, chromeImgPath="", chromeSearchBgImg="right_search.png", chromeProto="http", chromeTransferURL="http://transfer.go.com/cgi/transfer.dll?srvc=dis&goto=", chromeStrictDTD=false, chromeFoo=false, chromeLooseDTD=false, chSysId="invalid", chPubId="invalid",chDcWrtInf="",chIsValidColor=false;
var chProtocol=window.location.protocol.toString(), chromeLocation=window.location.toString(), chAppVersion=navigator.appVersion.split("MSIE"), chBrwsrVer=parseFloat(chAppVersion[1]), chBrwsrAgnt=navigator.userAgent, chIsIE6=false, chIsIE7=false, chIsFirefox=false, chIsOpera=false, chIsSafari=false, chIsMac=false, chIsPC=false, chromeDebug=false;

function chRemoveSpaces(string){var tempStr=string;tempStr=tempStr.replace(/ /g,'');return tempStr;}
function chSpace2Plus(string){var tempStr=string;tempStr=tempStr.replace(/ /g,'+');return tempStr;}
function SetChromeOut(linkOut, chSearchForm){try{hitbox.Chrome_hbLink(linkOut);}catch(e){} try{if(chSearchForm.q.value.indexOf("Search Disney.com")!=-1){chSearchForm.q.value="";}}catch(e){} return true;}
function chCheckValidColor(hexColor){var strPattern=/^#([0-9a-f]{1,2}){3}$/i; chIsValidColor=strPattern.test(hexColor); return chIsValidColor;}
if((chBrwsrVer>=5.5&&chBrwsrVer<7)&&(document.body.filters)){chIsIE6=true;}if(navigator.userAgent.indexOf("MSIE")!=-1&&chBrwsrVer>6){chIsIE7=true;}if(navigator.userAgent.indexOf("Firefox")!=-1){chIsFirefox=true;}if(navigator.userAgent.indexOf("Opera")!=-1){chIsOpera=true;}if(navigator.userAgent.indexOf("Safari")!=-1){chIsSafari=true;}if(navigator.userAgent.indexOf("Macintosh")!=-1){chIsMac=true;}if(navigator.userAgent.indexOf("Windows")!=-1){chIsPC=true;}
chromeLocation=chromeLocation.toLowerCase();
if(chromeLocation.indexOf("http://disney.go.com/home/html/index.html")!=-1||chromeLocation.indexOf("http://disney.go.com/guestservices/upgrade/")!=-1)chromeFoo=true;
if(!document.getElementById&&!chromeFoo)top.location.replace("http://disney.go.com/home/html/index.html");
if(chromeLocation.indexOf("chdb=true")!=-1)chromeDebug=true;
try{if(!chromeColor){chromeColor="#cccccc";}}catch(e){chromeColor="#cccccc";}
chCheckValidColor(chromeColor); if(!chIsValidColor){chromeColor="#cccccc";}
try{if(!chromeWidth){chromeWidth=770;}}catch(e){chromeWidth=770;}
try{if(!noLinksChrome){noLinksChrome=true}}catch(e){noLinksChrome=false;}
if(chProtocol.indexOf("https")!=-1){chromeProto="https";}
chromeImgPath=chromeProto+"://disney.go.com/globalmedia/chrome/images";
//Firefox link offset check
try{chPubId=document.doctype.publicId}catch(e){}
try{
	chSysId=document.doctype.systemId; chSysId=chSysId.toLowerCase();
	if(chSysId.indexOf("www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd")!=-1&&chIsFirefox&&chIsPC){chromeLinkOffset=4;}
	if(chSysId.indexOf("www.w3.org/tr/html4/loose.dtd")!=-1&&chIsFirefox){chromeLinkOffset=10;}
}catch(e){}
//Set link Shadow offset. 
chromeLinkShOffset=chromeLinkOffset-11;
//Set proper widths for chrome and middle cell.
if(chromeWidth=="100%"){chromeWidth=994;} //100% widths are not allowed.  Set to 994 if 100% is declared.
if(parseInt(chromeWidth)<745){chromeWidth=745;}
chromeMidWidth=(parseInt(chromeWidth)-249);
if(chromeMidWidth>520){chromeLinksPadding=6;}
if(chromeMidWidth>600){chromeLinksPadding=10;}
if(chromeMidWidth>625){chromeLinksPadding=12;}
if(chromeMidWidth>675){chromeLinksPadding=14;}
if(chromeMidWidth>700){chromeLinksPadding=15;}
if(chromeMidWidth>744){chromeLinksPadding=17;}
if((chBrwsrAgnt.indexOf("Safari")!=-1)||noLinksChrome){chromeSearchBgImg="right.png";}

/******** BEGIN CHROME STYLE *******/
chromeColor = "#CCCCCC";

chromeMainTable="width:"+chromeWidth+"; height:31px; background-color:"+chromeColor+"; text-align:center; padding:0px; table-layout:auto; border:none; border-collapse:collapse ";
chromeContentConTable="width:"+chromeMidWidth+"px; height:25px; text-align:center; padding:0px; table-layout:auto; border:none; border-collapse:collapse ";

chromeBrandTd="width:92px; height:31px; vertical-align:top; text-align:left; background-repeat:no-repeat; ";
chromeMidTd="width:"+chromeMidWidth+"px; height:31px; vertical-align:top; text-align:center; background-repeat:repeat-x; ";
chromeSearchTd="width:157px; height:31px; vertical-align:top; text-align:right; padding:0px; background-repeat:no-repeat; ";
if(chIsIE6){
	chromeBrandTd=chromeBrandTd+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+chromeImgPath+"/left.png',sizingMethod='image'); ";
	chromeMidTd=chromeMidTd+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+chromeImgPath+"/mid_IE6.png',sizingMethod='crop'); ";
	chromeSearchTd=chromeSearchTd+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+chromeImgPath+"/"+chromeSearchBgImg+"',sizingMethod='image'); ";
}else{
	chromeBrandTd=chromeBrandTd+"background-image:url('"+chromeImgPath+"/left.png'); ";
	chromeMidTd=chromeMidTd+"background-image:url('"+chromeImgPath+"/mid.png'); ";
	chromeSearchTd=chromeSearchTd+"background-image:url('"+chromeImgPath+"/"+chromeSearchBgImg+"'); ";
}

chromeBrandCon="position:relative; "
chromeLinkDiv="position:relative; height:12px; z-index:150; top:"+chromeLinkOffset+"px; padding:0px; ";
chromeLinkShDiv="position:relative; height:12px; z-index:140; top:"+chromeLinkShOffset+"px; left:1px; color:#000000; padding:0px; background-color:transparent; ";
chromeLinkTextStyle="font:normal normal bold 10px/normal Arial; text-decoration:none; padding:0px; letter-spacing:0px; ";
chromeContentLinkCell="height:25px; padding:0px; ";
chromeContentDivider="position:relative; width:2px; height:20px; top:6px; padding:0px; ";
chromeContentDividerCell="height:12px; padding:0px "+chromeLinksPadding+"px; vertical-align:top; ";

chromeSearchTextField="position:relative; top:2px; left:-15px; border:none; padding:0px; ";
chromeSearchGoBtn="position:relative; top:7px; left:-3px; border:none; background-color:none; padding:0px; ";
chromeSearchInput="width:87px; height:12px; font:normal normal bold 9px/normal Arial; border:none; background-color:white; padding:0px; margin:0px; ";
chromeSearchGoBtnCls="width:26px; height:17px; border:none; background-color:transparent; padding:0px; ";

if(chromeDebug){document.write("<div style='position:absolute;z-index:200;top:100px;left:0px;width:400px;font:bold 9px arial;padding:5px;border:1px solid red;background-color:white;text-align:left;color:red;'>BEGIN<br><br>Browser: "+navigator.userAgent+"<br><br>Browser System ID: "+chSysId+"<br><br>Browser Public Id: "+chPubId+"<br><br>Chrome width: "+chromeWidth+"<br><br>Chrome mid width: "+chromeMidWidth+"<br><br>Chrome links padding: "+chromeLinksPadding+"<br><br>Chrome Link Offset: "+chromeLinkOffset+"<br><br>Chrome image path: "+chromeImgPath+"<br><br>Valid Chrome Color: "+chIsValidColor+"<br><br>Chrome Color: "+chromeColor+"<br><br>END</div>");}
chDcWrtInf=chDcWrtInf+"<style type='text/css'> a.chromeLink,a.chromeLink:hover,a.chromeLink:active,a.chromeLink:visited{padding:0px !important; text-decoration:none !important; background-color:transparent !important; } a.chromeLink,a.chromeLink:active,a.chromeLink:visited{color:#F4F4F4 !important;} a.chromeLink:hover{color:#F6D158 !important;}</style>";
chDcWrtInf=chDcWrtInf+'<form method="get" action="http://search.disney.go.com/exec/" style="margin:0px; padding:0px;" onSubmit="SetChromeOut(\'Search\',this)">';
chDcWrtInf=chDcWrtInf+'<table width="'+chromeWidth+'" height="31" cellspacing="0" cellpadding="0" align="center" border="0" style="'+chromeMainTable+'"><tr>';
chDcWrtInf=chDcWrtInf+'<td width="92" height="31" style="'+chromeBrandTd+'">';
if(!noLinksChrome){chDcWrtInf=chDcWrtInf+'<div id="'+chromeBrandCon+'"><a href="'+chromeTransferURL+'http://disney.go.com&name=g_micChrome_cl_home" style="position:relative; background-color:transparent !important;" onMouseDown="SetChromeOut(\'Home\')"><img src="'+chromeImgPath+'/clear.gif" width="70" height="25" border="0"></a></div>';}
chDcWrtInf=chDcWrtInf+'</td><td width="'+chromeMidWidth+'" height="31" style="'+chromeMidTd+'">';
if(!noLinksChrome){
	chDcWrtInf=chDcWrtInf+'<table width="'+chromeMidWidth+'" height="25" cellspacing="0" cellpadding="0" align="center" border="0" style="'+chromeContentConTable+'"><tr>';
	for(i=0;i<chromeLinkText.length;i++){
		chDcWrtInf=chDcWrtInf+'<td height="25" style="'+chromeContentLinkCell+'">';
		chLnkId=chRemoveSpaces(chromeLinkText[i]);
		chLnkHBId=chSpace2Plus(chromeLinkText[i]);
		chDcWrtInf=chDcWrtInf+'<div style="'+chromeLinkDiv+'"><a href="'+chromeTransferURL+chromeLinkHref[i]+'&name=g_micChrome_cl_'+chromeLinkText[i]+'" class="chromeLink" id="chromeLink'+chLnkId+'" target="_top" onMouseDown="SetChromeOut(\''+chLnkHBId+'\')"><span style="'+chromeLinkTextStyle+'">'+chromeLinkText[i]+'</span></a></div>';
		chDcWrtInf=chDcWrtInf+'<div style="'+chromeLinkShDiv+'"><span style="'+chromeLinkTextStyle+'">'+chromeLinkText[i]+'</span></div>';
		chDcWrtInf=chDcWrtInf+'</td>';
		if(i<chromeLinkText.length-1){
			if (chIsIE6) chDcWrtInf=chDcWrtInf+'<td height="25" style="'+chromeContentDividerCell+'"><span style="'+chromeContentDivider+'"><img src="'+chromeImgPath+'/clear.gif" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+chromeImgPath+'/divide.png\')"></span></td>';
			else chDcWrtInf=chDcWrtInf+'<td height="25" style="'+chromeContentDividerCell+'"><span style="'+chromeContentDivider+'"><img src="'+chromeImgPath+'/divide.png" width="2" height="20" border="0"></span></td>';
		}
	}
	chDcWrtInf=chDcWrtInf+'</tr></table>';
}
chDcWrtInf=chDcWrtInf+'</td><td width="157" height="31" style="'+chromeSearchTd+'">';
if(!noLinksChrome){
	chDcWrtInf=chDcWrtInf+'<span style="'+chromeSearchTextField+'"><input type="text" name="q" value="Search Disney.com" onClick="this.value=\'\'" style="'+chromeSearchInput+'"></span>';
	chDcWrtInf=chDcWrtInf+'<span style="'+chromeSearchGoBtn+'">';
	if(chIsIE6)chDcWrtInf=chDcWrtInf+'<input type="image" value="Go" src="'+chromeImgPath+'/clear.gif" alt="Go" style="'+chromeSearchGoBtnCls+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+chromeImgPath+'/goBtn.png\',sizingMethod=\'image\')">';
	else chDcWrtInf=chDcWrtInf+'<input type="image" value="Go" src="'+chromeImgPath+'/goBtn.png" alt="Go" style="'+chromeSearchGoBtnCls+'">';
	chDcWrtInf=chDcWrtInf+'</span>';
}
chDcWrtInf=chDcWrtInf+'</td></tr></table></form>';
/****** WRITE OUT CHROME HERE ******/
document.write(chDcWrtInf);
