// define Shockwave player version for writeShockwavePlayer (unless already defined)
if ( SHOCKWAVE_PLAYER_VERSION == null ) {
	var SHOCKWAVE_PLAYER_VERSION = "8,5,1,0";
}

//This is the global popDisclaimer function for ad served elements
var mLinkDest = "", popDisclaimer;
function sendToClientSide(){window.open(mLinkDest);popDisclaimer.window.focus();}
function deliverPopDisclaimer(mLink){
	mLinkDest = mLink;
	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 ('closeTimer = setT'+'imeout("window.close()",18000);');
	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();
	sendTimer = setTimeout("sendToClientSide()",1500);
}

// opens a window and returns the window
popUp = function (newwin, name, url,  options ) {
	// alert ( url +' '+ name +' '+ options);
	if ((newwin == null) || (newwin.closed == true)) {
		newwin = window.open( url, name, options);
	}
	
	// alert (newwin);
	newwin.focus();
	return newwin;
}

popTermsOfUse = function (  ) {
	if (this.windowTerms != null && !this.windowTerms.closed ) {
		this.windowTerms.close();
		this.windowTerms = null;
	}
		
	var width = 320;
	var height = 260;
	// positon on screen 
	var screenXW = 0;
	var screenYW = 0; 

	var options = "width="+width+",height="+height+",left=" + screenXW + ",top=" + screenYW + ",toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,screenX=" + screenXW + ",screenY=" + screenYW;
	
	var termsUrl = "/abckids/global/termsofuse.html"; 	
	termsUrl += "?width=" + width; 
	termsUrl += "&height=" + height; 
	
	this.windowTerms = popUp (this.windowTerms, "TermsOfUse", termsUrl, options );
}

function writeShockwavePlayer (sSrc,  iWidth, iHeight, sID, settings, doc) {
	if ( sSrc == null || iWidth == null || iWidth < 1 || iHeight == null || iHeight < 1 ) {
		// quit if required parameters are not set
		return;
	}

	// set defaults for optional parameters
	if ( sID == null ) {
		sID = '';
	}
	if ( settings == null ) {
		settings = {};
	}
	if (settings.quality == null ) {
		settings.quality = 'high';
	}
	if (settings.bgcolor == null ) {
		settings.bgcolor = '#FFFFFF';
	}

	if (doc == null ) {
		doc = document;
	}

	var sPlayer = '';
	var prop;

	// define object tag with required parameters
	sPlayer += '<object id="' + sID + '" classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=' + SHOCKWAVE_PLAYER_VERSION + '" ';
	sPlayer += 'width="' + iWidth + '" height="' + iHeight + '" >';
	sPlayer += '<param name="src" value="'+ sSrc +'" />';

	// add additional parameters
	for ( prop in settings ) {
		sPlayer += '<param name="' + prop + '" value="' + settings[prop] + '" /> ';
	}

	// define embed tag with required parameters
	sPlayer += '<embed SRC="' + sSrc + '" width="' + iWidth + '" height="' + iHeight +'" ';
	//sPlayer += 'swliveconnect="FALSE" ';
	sPlayer += 'type="application/x-director" ';
	sPlayer += 'PLUGINSPAGE="http:/'+'/www.macromedia.com/shockwave/download/" ';

	// define optional parameters
	for ( prop in settings ) {
		sPlayer += prop + '="' + settings[prop] + '" ';
	}

	// close embed & object tags
	sPlayer += '></embed></object>';

	doc.write (sPlayer);
}