myhost = (window.location.host.indexOf("disney") != -1)?"disney":"global";

//Pop-Up Window
function DolOpenWin(the_window,win_name,args,what_return){
	this[win_name] = window.open(the_window,win_name,args);
	has_pop = SendCommand(win_name);
	if(!has_pop){
		try{
			eval(win_name).focus();
		}catch(e){
			has_pop = true;
		}
	}
	if(what_return);
	else return has_pop;
}
function SendCommand(wn){
	try{
		return(wn)?false:true;
	}catch(e){
		return true;
	}
}
//Gecko Detection
function IsGekko(){
	return(navigator.appName == "Netscape")?true:false
}
function GetTheVersion(gt){
	var gua = navigator.userAgent;
	if(gt == "Mozilla"){
		temp = gua.split("rv:");
		major_version = parseFloat(temp[1]);

	}
	else{
		var marker = gua.lastIndexOf("/");
		var subMe = gua.substr(marker + 1);
		var major_version = parseFloat(subMe);
	}
	return major_version;	
}
function PassVersion(bt,version,req_version){
	defaultAr = new Array(1.2,.1,7,85.8);
	this.strippedAppVersion = version
	if(req_version){
		reqAr = req_version.split(",");
		for(i=0;i<reqAr.length;i++){
			if(reqAr[i] == "" || reqAr[i] == 0) reqAr[i] = defaultAr[i];
			reqAr[i] = parseFloat(reqAr[i]);
		}
	}else{
		reqAr = defaultAr;
	}
	switch(bt){
		case "Mozilla":
			this.browser = "Mozilla";
			return(version >= reqAr[0])?true:false
		case "Firefox":
			this.browser = "Firefox";
			return(version >= .1)?true:false;
		case "Netscape":
			this.browser = "Netscape";
			return(version >= reqAr[2])?true:false;
		case "Safari":
			this.browser = "Safari";
			return(version >= reqAr[3])?true:false;
		case "default":
			return false;
		}
	return false;
}
function WhatGecko(){
	var use_agent = navigator.userAgent;
	if(use_agent.indexOf("Netscape") != -1) nua = "Netscape";
	else if(use_agent.indexOf("Safari") != -1) nua = "Safari";
	else if(use_agent.indexOf("Firefox") != -1) nua = "Firefox";
	else if(use_agent.indexOf("Mozilla/5.0") != -1) nua = "Mozilla";
	else return false;
	return nua;
}
function GeckoInterface(page_transition,req_version){
	var myGecko = WhatGecko();
	var theVersion = GetTheVersion(myGecko);
	var passBrowser = this.PassVersion(myGecko,theVersion,req_version);
	if(page_transition)return passBrowser;
	else{
		if(passBrowser)return true;

		goURL(defaultLP);
	}
}
// end geck detection
//SP2 Detection
function IsServicePack(){
	var ua = navigator.userAgent;
	if(ua.indexOf("SV1") != -1) return true;
	else return false;
}
//end SP2 Detection
function goURL(url){
	winLoc = window.location.toString();
	SetCookieUtil("detect_cookie","MB|" + winLoc);
	top.location.replace(url);
}
	
var today = new Date();
var expire = new Date(today.getTime() - 10);
var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
var oneMonth = new Date(today.getTime() + 30 * 24 * 60 *60 * 1000);
var oneWeek = new Date(today.getTime() + 7 * 24 * 60 *60 * 1000);
var twoWeek = new Date(today.getTime() + 14 * 24 * 60 *60 * 1000);
function deliverPopDisclaimer(mLink){
	var popDisclaimer=window.open("","disclaimer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=370,height=250,top=100,left=150,screenX=180,screenY=100");
	popDisclaimer.document.write ('<html><head><title>Disney.com - Disclaimer</title>');
	popDisclaimer.document.write ('<SCR'+'IPT TYPE="text/javascript" LANGUAGE="JavaScript">');
	popDisclaimer.document.write ('sendTimer = setTi'+'meout("sendToClientSide()",1500);closeTimer = setT'+'imeout("window.close()",18000);');
	popDisclaimer.document.write ('func'+'tion sendToCl'+'ientSide(){window.op'+'en("'+mLink+'"); this.focus();}');
	popDisclaimer.document.write ('</scr'+'ipt>');
	popDisclaimer.document.write ('</head><body bgcolor="#FFFFFF" text="#0065CE" link="#0065CE" vlink="#0065CE" alink="#0065CE" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>');
	popDisclaimer.document.write ('<table width="370" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="http://disney.go.com/spon'+'sors/images/disclaimer_top.gif" width="370" height="27" alt="" border="0"></td></tr><tr><td><table width="330" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><br><FONT FACE="Verdana,sans-serif" SIZE="2" COLOR="#0065CE"><b>The web site you are about to link to is not controlled by Disney Online and different terms of use and privacy policy will apply. By proceeding you agree and understand that Disney Online is not responsible for the site you are about to access.<br><br>');
	popDisclaimer.document.write ('If your page does not load within a few seconds, please <a href="'+mLink+'" target="_blank">click here</a> to open it.</b></FONT><br><br></td></tr></table>');
	popDisclaimer.document.write ('</td></tr><tr bgcolor="#0000CC"><td align="center" height="20"><a href="javascript:window.close();"><FONT FACE="Verdana,sans-serif" SIZE="1" COLOR="#FFFF00"><b>Close this window</b></font></a></td></tr></table>');
	popDisclaimer.document.write ('</body></html>');
	popDisclaimer.document.close();
}
function UpgradeFlash(arg,ie_land,set_cookie){
	if(!arg) var default_page = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
	else var default_page = arg;
	if(!ie_land) var default_land = "http://"+myhost+".go.com/detect/setup/ie/flash_landing.html";
	else var default_land = ie_land;
	if(this.hasActiveX){
		window.location = default_land;	
	}
	else deliverPopDisclaimer(default_page);
	if(set_cookie)SetCookieUtil("return_path",set_cookie,oneWeek);
	
}
function UpgradeShockwave(arg,ie_land,set_cookie){
	if(set_cookie)SetCookieUtil("return_path",set_cookie,oneWeek);
	if(!arg) var default_page = "http://sdc.shockwave.com/shockwave/download/download.cgi?";
	else var default_page = arg;
	if(!ie_land) var default_land = "http://"+myhost+".go.com/detect/setup/ie/shockwave.html";
	else var default_land = ie_land;
	if(this.hasActiveX)window.location = default_land;
	else deliverPopDisclaimer(default_page);
	
}
var nonbranded = "http://disney.go.com/detect/nonbranded.html";
function SetCookieUtil (name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +	((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "; path=/") + ((domain) ? "; domain=" + domain : "; domain=.go.com") +	((secure) ? "; secure" : "");
}
function PullVersionNumber(arg){
	var toReturn = arg.split(" ");
	for(var i=0;i<toReturn.length;i++){
		var num = toReturn[i];
		
		var num = parseFloat(num);
		if(num >= 1){
			return num;
		}
	
	}
	
}
function FindVersionNumber(){
	var ret;
	var version = navigator.userAgent;
	var versionAr = version.split(";");
	for(i=0;i<versionAr.length;i++){
		if(versionAr[i].indexOf("MSIE") != -1){
			ret = PullVersionNumber(versionAr[i]);
		}
	}
	return ret;
}

function GetActiveX(){
	hasActiveX=(navigator.userAgent.toLowerCase().indexOf("msie") != -1 && this.d_platForm.indexOf("Win") != -1)?true:false;
	return hasActiveX;

}

function SuperObj(val){
	this.d_appName = navigator.appName;
	this.UpgradeFlash = UpgradeFlash;
	this.UpgradeShockwave = UpgradeShockwave;
	this.d_appVersion = navigator.appVersion;
	this.d_platForm = navigator.platform;
	d_appName = this.d_appName;
	d_appVersion = this.d_appVersion;
	d_platForm = this.d_platForm;
	// addition 12-01-2004
	this.hasServicePack = false
	this.passGecko = false;
	// end addition
	this.GetActiveX = GetActiveX;
	this.hasActiveX = this.GetActiveX();
	if(navigator.userAgent.toLowerCase().indexOf("msie")!= -1) this.strippedAppVersion = FindVersionNumber();
	else this.strippedAppVersion = "other";
	//addition
	this.GeckoInterface = GeckoInterface;
	this.PassVersion = PassVersion
	this.browser = "";
	if(this.d_appName == "Netscape"){
		this.passGecko = this.GeckoInterface(val);
	}
	else if(this.d_appName.indexOf("Micro") != -1){
		this.hasServicePack = IsServicePack();
		if(navigator.platform.toLowerCase().indexOf("mac") != -1 &&(this.strippedAppVersion <= 5.22 && this.strippedAppVersion >= 5.2))goURL(defaultLP);
		this.browser = "ie";
	}
	//end additon
}
function CreateInterface(loc,val,gecko_val,gecko_require){
	de_prot = window.location.host;
	if(de_prot.indexOf("disney.go.com") != -1 || de_prot.indexOf("family.go.com") != -1)de_host = "disney";
	else de_host = "global"
	if(!loc){
		defaultLP = "http://"+de_host+".go.com/home/html/index.html";
			
	}
	else{
		defaultLP = loc;
			
	}
	browser_object = new SuperObj(gecko_val,gecko_require);
}