document.cookie = 'TEGid=exp; expires=Mon, 31 Dec 2001 15:41:05 GMT; path=/; domain=www.cartoonnetwork.com';

<!--
//variety of basic functions
function preLoad(preLoad_path,preLoad_suffix,preLoad_images) {
	var preLoadArray = new Array();
	var arrayLength = preLoad_images.length;
	for (var i = 0; i < arrayLength; i++) {
		var file = preLoad_path + preLoad_images[i] + preLoad_suffix + ".gif";
		preLoadArray[i] = new Image();
		preLoadArray[i].src = file;
	}
}

function swapImage(roll_name,roll_path,roll_suffix) {
	if(document.images){
    	document.images[roll_name].src = roll_path + roll_name + roll_suffix + '.gif';
	}
}

function swapMultiImage(roll_name,roll_id,roll_path,roll_suffix) {
	if(document.images){
    	document.images[roll_name+roll_id].src = roll_path + roll_name + roll_suffix + '.gif';
	}
}

function emailFriend(){
	window.open('/games/email/index.html','email','width=300,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}


//assorted popups
function globalWindowOpen(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function shopPopUnder() {
	cookieName = "NoShopPopup";
	if(document.cookie.lastIndexOf(cookieName) < 0)	{
		expireDate =  new Date();
	    expireDate.setDate(expireDate.getDate()+1); 
		setCookie(cookieName, expireDate);
		document.cookie = name + '=true;';		
	globalWindowOpen('/gen/popads/general_exclude.html','ShopPopUnder','width=250,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
}

function setCookie(name, date) {
  document.cookie = name + '=true; expires=' + date.toGMTString();
}

function tvPopUp() {
	cookieName = "NoTVPopup";
	if(document.cookie.lastIndexOf(cookieName) < 0)	{
		expireDate =  new Date();
	    expireDate.setDate(expireDate.getDate()+1); 
		setCookie(cookieName, expireDate);
	globalWindowOpen('/gen/popads/general_exclude.html','tvPopUp','width=250,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
}

function ttPopUp() {
	cookieName = "NoTTPopup";
	if(document.cookie.lastIndexOf(cookieName) < 0)	{
		expireDate =  new Date();
	    expireDate.setDate(expireDate.getDate()+1); 
		setCookie(cookieName, expireDate);
	globalWindowOpen('/gen/popads/tt_exclude.html','ttPopUp','width=250,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
}
function launchToonflash()
{
	locString = location.href;
	aqs = location.search.substr(1);
	subaqstrings = aqs.split("&");
	if ((locString.indexOf('?') > -1) && (subaqstrings == "newsletter"))
	{
		window.open('/gen/toonflash/cartoon/verify_age.html','ToonFlash','width=300,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
}

function launchVidPlayer(vidStage, vidShow, vidClip) {
window.open('/tv_shows/video/index.html?'+vidStage+"&"+vidShow+"&"+vidClip,'video_player','width=615,height=390,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function test(){
	alert("Working");
}

//orbit global functions

function goOrbitPage(url) {
	var orbitLinkNewURL;
	if (dboard.isLoggedIn()) {
			orbitLinkNewURL = "http://" + dboard.SERVER_CO + url;
			location.href = orbitLinkNewURL;
	}
	
	else {
		if (url.indexOf (dboard.SERVER_CO) > -1) {
			escapedTargetURL = escape(url);
			}
			else {
				escapedTargetURL = escape("http://" + dboard.SERVER_CO +url);
				}
		orbitLinkNewURL = "http://" + dboard.SERVER_CO + "/jsp/login/mo.html?targetURL=" +  escapedTargetURL + "&origin=" + document.domain;
		globalWindowOpen(orbitLinkNewURL,'orbitReg','width=500,height=400,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
		}
}

function getOrbitHelp (context)
{
	if (context == "auctionzone")
	{
		orbitHelpLink = "http://cartoonorbit.cartoonnetwork.com/static/auction/actn_help.html";
	}
	if (context == "tradezone")
	{
		orbitHelpLink = "http://cartoonorbit.cartoonnetwork.com/static/collect/trade_help.html";
	}
	globalWindowOpen(orbitHelpLink,'orbitHelp','width=440,height=320,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
}

function go2Trading ()
{
	goOrbitPage("/servlet/NewCZone?owner=showcase");
}

// launch gToon game floor
function gToonPop (incomingPath,playerOne,playerTwo)
{
	gameHeight = screen.availHeight;
	gameWidth = screen.availWidth;
	if (incomingPath == "instantmatch")
	{
			gameUrl = '/servlet/InstantGameFloor?playerID1=' + playerOne + '&playerID2=' + playerTwo + '&game=instantMatch';
	}
	else
	{
			gameUrl = '/servlet/GameFloor?playerID1=' + playerOne + '&playerID2=' + playerTwo + '&game=challenge';
	}
	gameDims = 'left=0,top=0,width=' + gameWidth + ',height=' + gameHeight + ',directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no';
	globalWindowOpen(gameUrl,'gameFloor',gameDims);
	location.href = "/static/compete/back_exclude.html";
}

/// Dash board functionality
dboard = new Object();
dboard.init=function(){
	this.VERSION = 1;
	this.SERVER_CO="cartoonorbit.cartoonnetwork.com";
	this.SERVER_CN="www.cartoonnetwork.com";
	this.COOKIE_DOMAIN="cartoonnetwork.com";
	this.DIRECTORY_DB="/tools/media/login/";
	this.COOKIE_NAME="name";
	this.COOKIE_ID="userId";
	this.COOKIE_PASS="pswd";
	this.COOKIE_DB="dashboard";
	this.COOKIE_DB_DEL="&";
	this.COOKIE_STATIC=" expires=Sunday, 21-Mar-2010 23:59:59 GMT;";
	this.COOKIE_DELETE=" expires=Fri, 02-Jan-1970 00:00:00 GMT;";
	
	this.id=this.getCookieVal(this.COOKIE_DB,"db_id");
	this.name=this.getCookie(this.COOKIE_NAME);
	this.points=this.getCookieVal(this.COOKIE_DB,"db_points");
	this.pass= (this.getCookie(this.COOKIE_PASS) == null) ?null:this.getCookie(this.COOKIE_PASS).replace(/\//i, "%2F");
	this.refreshRate=(this.getCookieVal(this.COOKIE_DB,"db_refreshRate")==null)? 30:this.getCookieVal(this.COOKIE_DB,"db_refreshRate");
	this.lastRefresh= (this.getCookieVal(this.COOKIE_DB,"db_lastRefresh")==null) ? 0 : this.getCookieVal(this.COOKIE_DB,"db_lastRefresh");
	this.plot=this.getCookieVal(this.COOKIE_DB,"db_plot");
	this.guid= this.getCookie(this.COOKIE_ID);
}
dboard.isCOServer=function(){
	return(location.href.toLowerCase().indexOf(this.SERVER_CO)>-1);
}
dboard.getPropVal=function(sString,sProp,cDelim,cEnd){
	var match = (sString == null) ? null : sString.match(sProp + cDelim + "[^" +cEnd + "]*");
	return (match == null) ? null :match[0].split(cDelim)[1];
}
dboard.getCookie=function(sCookie){
	return this.getPropVal(document.cookie,sCookie,"=",";");
}
dboard.getCookieVal=function(sCookie,val){
	return this.getPropVal(this.getCookie(sCookie),val,":", "&");
}
dboard.setCookie=function(sCookieName, sVal, sCookieType){
	sCookieType = (sCookieType == null) ? "" : sCookieType;
	document.cookie = sCookieName+"="+sVal+ ";" + sCookieType+" path=/; domain=."+this.COOKIE_DOMAIN;
}
dboard.deleteCookie=function(sCookieName){
	this.setCookie(sCookieName, "", this.COOKIE_DELETE);
}
dboard.logOut=function(){
	this.deleteCookie(this.COOKIE_ID);
	this.deleteCookie(this.COOKIE_DB);
	this.lastRefresh=0;
	this.guid= null;
}
dboard.setDBData=function(id,points,plot,refreshRate,requestType){
	this.id=id;
	this.points=points;
	this.refreshRate=(refreshRate != null)? refreshRate : this.refreshRate;
	this.plot=plot;
	this.lastRefresh=new Date().getTime();

	var s="db_id:"+id+this.COOKIE_DB_DEL;
	s+="db_points:"+points+this.COOKIE_DB_DEL;
	s+="db_plot:"+plot+this.COOKIE_DB_DEL;
	s+="db_refreshRate:"+this.refreshRate+this.COOKIE_DB_DEL;
	s+="db_lastRefresh:"+new Date().getTime()+this.COOKIE_DB_DEL;
	this.setCookie(this.COOKIE_DB, s);
	
	if(requestType=="login") this.onLogin();
}
dboard.onLogin=function(){}
dboard.setGUID=function(s){
	this.guid=s.substring(0,s.indexOf("|"));
	this.setCookie(this.COOKIE_ID, s);
}
dboard.setName=function(name){
	this.name=escape(name);
	this.setCookie(this.COOKIE_NAME, escape(name), this.COOKIE_STATIC);
}
dboard.setPass=function(sPass){
	this.pass=sPass;
	this.setCookie(this.COOKIE_PASS, sPass, this.COOKIE_STATIC);
}
dboard.deletePass=function(){
	this.pass=null;
	this.deleteCookie(this.COOKIE_PASS);
}
dboard.isLoggedIn=function(){
	return (this.guid != null && this.id != null);
}
dboard.getParams=function(){
	var s="";
	s+="CN_id="+ this.id;
	s+="&CN_name="+this.name;
	s+="&CN_points="+this.points;
	s+="&CN_loggedIn="+this.isLoggedIn();
	s+="&CN_lastRefresh="+this.lastRefresh;
	s+="&CN_refreshRate="+this.refreshRate;
	s+="&CN_pass="+this.pass;
	s+="&CN_plot="+this.plot;
	s+="&CN_guid="+this.guid;
	s+="&CN_COserver="+this.SERVER_CO;
	s+="&";
	return s;
}
dboard.initPromo=function(sCode,encrypt){
	if (encrypt == "true" || encrypt == "t"){
		encrypt="true";
	} else {
		redemptionURL = "http://"+this.SERVER_CO+"/servlet/RedeemPromotionFixed?promotionCode="+sCode;
		encrypt="false";
	}
	
	if(this.isLoggedIn() == false){
		globalWindowOpen ('http://' + this.SERVER_CO + '/jsp/login/yfhp.html?value=null&targetURL=/servlet/RedeemPromotionFixed&orbitCode=' + sCode + '&encryptedCode=' + encrypt,'orbitReg','width=500,height=400,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
	} else {
		globalWindowOpen (redemptionURL,'orbitReg','width=500,height=400,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
	}
}
dboard.openWhatIs=function(){
	globalWindowOpen('http://'+this.SERVER_CO+"/jsp/login/wio.html?origin="+document.domain,'orbitReg','width=500,height=400,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
}
dboard.gotoUrl=function(sUrl, sServer){
	var fullUrl = (sServer == "CO") ? ("http://"+this.SERVER_CO + sUrl) : ("http://"+this.SERVER_CN + sUrl);
	location.href = fullUrl;
}
dboard.openRegistration=function(){
	globalWindowOpen('http://'+this.SERVER_CO+'/jsp/login/reg.html?origin='+document.domain,'orbitReg','width=500,height=400,directories=no,resizable=no,location=no,menubar=no,status=no,toolbar=no');
}
dboard.callJS = function(sStatement){
	eval(sStatement);
}
dboard.writeSWF=function(){
	var s='';
	s+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	s+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
	s+='width="770" height="82"><param name="movie" value="http://cartoonorbit.cartoonnetwork.com/tools/media/login/dboard_login.swf?CN_version='+this.VERSION+'"> ';
	s+='<param name="quality" value="high"><param name="menu" value="false">';
	s+='<param name="FlashVars" value="'+this.getParams()+'"><param name="bgcolor" value="#ffffff"><param name="wmode" value="transparent">';
	s+='<embed src="http://cartoonorbit.cartoonnetwork.com/tools/media/login/dboard_login.swf?CN_version='+this.VERSION+'" quality="high" menu="false" ';
	s+='wmode="transparent" bgcolor="#ffffff" width="770" height="82" type="application/x-shockwave-flash" FlashVars="'+this.getParams()+'" ';
	s+='pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
	s+='</embed></object>';
	document.write(s);
}
dboard.init(); 


function swapButtons(roll_name,roll_path,roll_ext){
			if(document.images)
			{
    			document.images[roll_name].src = roll_path + roll_name + roll_ext;
			}
}


//--- Funciones de cookie para gestionar sitios intermedios --
function check_cookie(variable,nextpath,targetpath){
		if (get_cookie(variable)==1) {
		seguir(targetpath);
		}
		else
		{
		document.location.href=nextpath + seguir_return(targetpath);
		}
}

function seguir(targetpath){
		var donde = window.location.search.substring(1);
		if (donde!='')
		{
		document.location.href=donde;
		}
		else
		{
		
			if (targetpath) 
				{
					document.location.href=targetpath;
				}
				else
				{
					document.location.href='http://www.cartoonnetwork.com/';
				}
		}
}
		
function seguir_return(targetpath){
		var donde = window.location.search.substring(1);

		if (donde!='')
		{
			return donde;
		}
		else
		{
		
			if (targetpath) 
					{
						return targetpath;
					}
					else
					{
						return 'http://www.cartoonnetwork.com/';
					}
		}
}
		
function get_cookie(name) {
	    var start = document.cookie.indexOf(name+"=");
	    var len = start+name.length+1;
	    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	    if (start == -1) return null;
    	var end = document.cookie.indexOf(";",len);
	    if (end == -1) end = document.cookie.length;
	    return unescape(document.cookie.substring(len,end));
}


function set_cookie(name,value,expires,path,domain,secure) {
		var path='/'
    	document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function check_option(formulario,nombre) {
		if (formulario.chkbox_option.checked) {
			var name = nombre;
			var value = 1;
			/* - EXPIRATION DATE START  - */
			var expires_date = new Date (); 
			expires_date.setTime(expires_date.getTime() + 1000 * 60 * 60 * 24 * 365); // add one year to it 
			/* - EXPIRATION DATE  END - */
			set_cookie(name,value,expires_date);
		}
		seguir();
}
//--- Fin de funciones de cookie para gestionar sitios intermedios --
function rollRow(cellID,newStyle,imgID,imgSrc){
	cellID.className = newStyle;
	document[imgID].src = imgSrc;
}