/*-*-*-*-*-*-*-*-ADAPTACION PARA LOS NUEVOS TAG ($A) E IMPLEMENTACION DAP*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
var sh3kRedir='http://www.goodearth.com/freemusic.html';
var sh3kView='';
var sh3kInter='';
/*#VERSION#*/var theSRC=window.location.href.replace('index.html','');/*#/VERSION#*/
/*AQUI REEMPLAZAR LOS [RND] POR UN NUMERO RANDOMICO  [RND] = [DATETIME] */ 
var shNewWindow=0;
var startView=false;
/*-*-*-*-*-*-*-*-FIN PARA LOS NUEVOS TAG ($A) E IMPLEMENTACION DAP*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/


// V3
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
function shConfig()
{

	this.movieAntiCache=false;						
	this.shProduct="shoshkele";						
	this.browserPlataform="FULL";					
	this.shPosType = "CENTER";	
	this.whereToDock="";							
	this.whatToHide_IE="";							
	this.whatToHide_FF="";							
	this.formsToHide="";								
	this.hideAll="";								

	this.flashName='good_earth_peeladd.swf';		
			
	this.shTop=-105;										
	this.shLeft=0;//		
	this.shLefCenter=105; ///para shoskele.. 
	this.flashWidth=915;								
	this.flashHeight=963;	
	this.FlashVerNeeded=8;							
	this.wmodeMoz="transparent";					
	this.disablePreload=true;						
	
	this.politeFlash=false;							
	this.useReadyStateComplete=true;				
	this.useOnload=false;							
	
	this.useShfix=false;													
	this.interactionNames="";						

	this.clipFlashMoz="0,915,220,785";							

	/*-- TOCAR SOLO EN CASOS MUY ESPECIALES --*/
	this.iframeNoVisible=false;					
	/*----------------------------------------*/
}

function uvShosh(name)
{
	/*- Atributos -*/
	this.shLefCenter=0;
	this.shProduct="";
	this.flashWidth=0;
	this.flashHeight=0;
	this.shPosType="";
	this.whereToDock="";
	this.whereToDockObj="";
	this.whatToHide="";
	this.whatToHideObjs="";
	this.disablePreload=false;
	this.useReadyStateComplete=false;
	this.useOnload=false;
	this.useShfix=false;
	this.onloadOk=false;
	this.readyStateOk=false;
	this.shTop=0;
	this.shLeft=0;
	this.theSRC="";
	this.flashName="";
	this.ClickThroughURLs="";
	this.elFlash="";
	this.flashForLoadToMoz="";
	this.flashForLoadToMozElement="";
	this.elFlashElement="";
	this.shImgVisible="";
	this.shV1="";
	this.FlashVerNeeded=6;
	this.objectNumberSRC="http://s3.amazonaws.com/uv-campaigns/common/";
	this.shDaRandom=false;
	this.startView=false; 
	this.viewDoneFlag=false;
	this.getHideObjectsDone=-1;
	this.shNewWindow=0;
	this.interactionNames="";
	this.lasFlashVars="";
	this.iframeNoVisible=false;
	this.dynamicIframe="";
	this.movieAntiCache="";
	this.codigoAntiCache="";
	this.milisegHoy="";
	this.milisegDestino="";
	this.segundos="";
	/* - */

	this.polymorph="";
	this.browser=(navigator.userAgent.toLowerCase().indexOf('msie')>1)?"MSIE":(navigator.userAgent.toLowerCase().indexOf('firefox')>1)?"Moz":(navigator.userAgent.toLowerCase().indexOf('chrome')>1)?"Moz":(navigator.userAgent.toLowerCase().indexOf('safari')>1)?"Moz":navigator.appName.toUpperCase();
	this.OS=navigator.platform;		
	this.browserVer=(this.browser=="MSIE")?parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf('MSIE')+4)):0;
	this.flashVer=0; 
	this.shViewCount=0;
	this.sh3kView="";
	this.sh3kRedir="";
	this.sh3kInter="";
	this.isapi3kClickURL="";
	this.tr_view=new Array(); 
	this.tr_click=new Array(); 
	/* - */


	/*- Metodos -*/
	this.build=build;					
	this.start=start;					
	this.shFlashObj=shFlashObj;
	this.shWriteMainMovie=shWriteMainMovie;
	this.shWriteMainMovieMoz=shWriteMainMovieMoz;
	this.shPlayShoshkele=shPlayShoshkele;
	this.shCommand=shCommand;
	this.flashGetVar=flashGetVar;
	this.shFinish=shFinish;
	this.hideShow=hideShow;
	this.hideShowDock=hideShowDock;
	this.doAndGetAnclas=doAndGetAnclas;
	this.getHideObjects=getHideObjects;
	this.preLoad=preLoad;
	this.setOnloadDone=setOnloadDone;
	this.shFlashObjExpressionTop=shFlashObjExpressionTop;
	this.shFlashObjExpressionLeft=shFlashObjExpressionLeft;
	this.shGetFlashVer=shGetFlashVer;
	this.shGetFlashVerMoz=shGetFlashVerMoz;
	this.getObj=getObj;
	this.fixSh=fixSh;
	this.fixFlashvars=fixFlashvars;
	this.setLayOutPosition=setLayOutPosition;
	this.setLayOutPositionMoz=setLayOutPositionMoz;
	this.reSetLayOutPosition=reSetLayOutPosition;
	this.checkMovieLoaded=checkMovieLoaded;
	this.doHideAllTheseObjects=doHideAllTheseObjects;
	/* */
	this.shWritePingImgs=shWritePingImgs;
	this.shPingTo=shPingTo;
	this.shView=shView;
	this.shClick=shClick;
	this.reportClick=reportClick;
	this.shReport=shReport;
	this.shRnd=shRnd;
	/* */




	function build()
	{
		if(this.browser=="MSIE") 
		{
			if(shLaVentana.document.body) this.shLeft=shLaVentana.document.body.clientWidth-780;
		} 
		else if(this.browser=="Moz")
		{
			if(shLaVentana.document) this.shLeft=shLaVentana.document.body.clientWidth-796;
		}
		else 
		{
			this.shLeft==0;
		}

		this.shoshObjName=name;
		this.flashName+='?dominio='+document.domain;




		this.shProduct=this.shProduct.toLowerCase();
		this.shPosType=this.shPosType.toLowerCase();
		this.browserPlataform=this.browserPlataform.toLowerCase();
		this.mainSWFId="sh_all_anim_"+this.shoshObjName;
		this.mainSWFName="sh_all_anim_"+this.shoshObjName+"_name";
		// asigno a whatTohide lo que corresponda segun el browser
		if(this.browser=="MSIE")
			this.whatToHide=this.whatToHide_IE;
		else
			this.whatToHide=this.whatToHide_FF;
		//---|
		///////////////////////
		if (this.whereToDock.length>0)
		{
			this.whereToDock=this.whereToDock.split(";");
			if (this.whereToDock[this.whereToDock.length-1].length<1) this.whereToDock.length--;
			for(var tmpI=0;tmpI<this.whereToDock.length;tmpI++)
			{
				this.whereToDock[tmpI]=this.whereToDock[tmpI].split(",");
				try
				{
					this.whereToDock[tmpI][0]=this.whereToDock[tmpI][0].toUpperCase();
					if (this.whereToDock[tmpI][0]=="OBJECT" && this.browser!="MSIE")
						this.whereToDock[tmpI][0]="EMBED";
					if (this.whereToDock[tmpI][0]=="EMBED" && this.browser=="MSIE")
						this.whereToDock[tmpI][0]="OBJECT";
				}
				catch(e){}
			}
		}
		if (this.whatToHide.length>0) // normalizo whatTohide
		{
			this.whatToHide=this.whatToHide.split(";");
			if (this.whatToHide[this.whatToHide.length-1].length<1) this.whatToHide.length--;
			for(var tmpI=0;tmpI<this.whatToHide.length;tmpI++)
			{
				this.whatToHide[tmpI]=this.whatToHide[tmpI].split(",");
				try
				{
					this.whatToHide[tmpI][0]=this.whatToHide[tmpI][0].toUpperCase();
					if (this.whatToHide[tmpI][0]=="OBJECT" && this.browser!="MSIE")
						this.whatToHide[tmpI][0]="EMBED";
					if (this.whatToHide[tmpI][0]=="EMBED" && this.browser=="MSIE")
						this.whatToHide[tmpI][0]="OBJECT";
				}
				catch(e){}
			}
		}
		if (this.formsToHide.length>0) // normalizo formsToHide
		{
			this.formsToHide=this.formsToHide.split(";");
			if (this.formsToHide[this.formsToHide.length-1].length<1) this.formsToHide.length--;
			for(var tmpI=0;tmpI<this.formsToHide.length;tmpI++)
			{
				this.formsToHide[tmpI]=this.formsToHide[tmpI].split(",");
				try
				{
					this.formsToHide[tmpI][0]=this.formsToHide[tmpI][0].toUpperCase();
				}
				catch(e){}
			}
		}
		////////////////////////
		if (this.interactionNames.length>0)
		{
			this.interactionNames=this.interactionNames.split(";");
		}
		if (this.ClickThroughURLs.length>0)
		{
			this.ClickThroughURLs=this.ClickThroughURLs.split("}"); // viene de sh3kRedir separado por llaves }
			/*-- Saco el /c de la isapi que esta en la primera URL --*/
			var tmpDir=0;
			for (var tmpI=0;tmpI<3;tmpI++)
				tmpDir=this.ClickThroughURLs[0].indexOf("$",tmpDir+1);
			if(tmpDir>0)
			{
				this.isapi3kClickURL=this.ClickThroughURLs[0].substring(0,tmpDir+1);
			}
			/*-- Lo agrego a los demas CT, salvo el primero porque ya lo tenia y escapeo --*/
			for (var tmpH=0;tmpH<this.ClickThroughURLs.length;tmpH++)
			{
				this.ClickThroughURLs[tmpH]=escape(this.ClickThroughURLs[tmpH]);
				this.ClickThroughURLs[tmpH]=this.ClickThroughURLs[tmpH].replace(/%5B\s*timestamp\s*%5D/gi, "[timestamp]").replace(/%5B\s*datetime\s*%5D/gi, "[datetime]");
				if (tmpH>0)
					this.ClickThroughURLs[tmpH]=this.isapi3kClickURL+this.ClickThroughURLs[tmpH];
			}
			/*-- --*/
		}
		if (this.browser=="Moz")
		{
			this.readyStateOk=true;
			if (this.useReadyStateComplete)
					this.useOnload=true;
		}
		if(this.useOnload)
		{
			if (this.browser=="MSIE")
				shLaVentana.attachEvent("onload", onloadDone); // tengo que usar una funcion EXTERNA al objeto ya que si uso this. intancia otro objeto nuevo.
			else
				shLaVentana.addEventListener("load", onloadDone, false);
		}
		else
			this.onloadOk=true;

		if(this.useShfix && this.browser=="MSIE")
		{
			shLaVentana.attachEvent("onresize", doShfix);
			shLaVentana.attachEvent("onscroll", doShfix);
		}

		for (var tmpI=0;tmpI<10;tmpI++) // tomo los tr_views y los tr_click
		{
			this.tr_view[tmpI]=window["tr_view"+tmpI];
			this.tr_click[tmpI]=window["tr_click"+tmpI];
		}
		this.sh3kView=sh3kView;
		this.sh3kRedir=sh3kRedir;
		this.sh3kInter=sh3kInter;
		if (this.browser!="MSIE")
			this.polymorph="Moz";
		if(this.browser=="MSIE" && this.browserVer<6)
			this.iframeNoVisible=true;
		
		if (this.clipFlashMoz.length>6)
			this.clipFlashMoz=this.clipFlashMoz.split(",");
		else
			this.clipFlashMoz=false;
		this["shGetFlashVer"+this.polymorph]();
	}

	function shFlashObj()
	{
		var error=false;
		var resultado="";
		if (!error)
		{
			if (this.flashVer>=this.FlashVerNeeded)
			{
				var lasFlashVarsTag="";
				var lasFlashVars="";
				if (this.ClickThroughURLs.length>0)
				{
					if (this.browser=="Moz")
						lasFlashVarsTag=" flashvars='";
					else 
						lasFlashVarsTag="<param name='flashvars' value='";
					for(var tmpI=0;tmpI<this.ClickThroughURLs.length;tmpI++)
						lasFlashVars+="SH_JS_CTURL"+(tmpI+1)+"="+this.ClickThroughURLs[tmpI].replace(/\[.*timestamp.*\]/gi, this.shRnd()).replace(/\[.*datetime.*\]/gi, this.shRnd())+","+this.shNewWindow+"&";
					lasFlashVars=lasFlashVars.substr(0,lasFlashVars.length-1);
					lasFlashVarsTag+=lasFlashVars+"'>";
				}
				this.lasFlashVars=lasFlashVars;
				if (this.browser=="Moz") {
					this.elFlash='<EMBED ID="'+this.mainSWFId+'" STYLE="position:absolute;z-index:1000;display:inline;top:-3000px;left:-3000px;" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0" width="'+this.flashWidth+'" height="'+this.flashHeight+'" src="'+this.theSRC+this.flashName+'" quality=high LOOP="false" wmode="'+this.wmodeMoz+'" AllowScriptAccess="always" '+lasFlashVarsTag+'></EMBED>';
					this.flashForLoadToMoz='<EMBED ID="'+this.mainSWFId+'_Load" name="'+this.mainSWFName+'_Load" STYLE="position:absolute;top:-3000px;left:-3000px;z-index:1;display:inline;" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0" width="'+this.flashWidth+'" height="'+this.flashHeight+'" src="'+this.theSRC+this.flashName+'" quality=high LOOP="false" wmode="transparent" AllowScriptAccess="always" '+lasFlashVarsTag+'></EMBED>';
					
					this.shWriteMainMovieMoz(); 
				}
				else {
					this.elFlash='<OBJECT ID="'+this.mainSWFId+'" STYLE="position:absolute;z-index:99999;display:none;" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0" width="'+this.flashWidth+'" height="'+this.flashHeight+'"><PARAM NAME=movie VALUE="'+this.theSRC+this.flashName+'"><PARAM NAME=quality VALUE=high><PARAM NAME="LOOP" VALUE="false"><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME=SALIGN VALUE=T><PARAM NAME=MENU VALUE=FALSE><PARAM NAME="AllowScriptAccess" VALUE="always">'+lasFlashVarsTag+'</OBJECT>';
					this.shWriteMainMovie(); 
				}
				
			}
		}
		else
			window.setTimeout("shLaVentana['"+this.shoshObjName+"'].shFlashObj()",20);
	}

	function shFlashObjExpressionTop()
	{
		var obj = this.whereToDockObj[0], shY = 0, shX = 0, shT=0;

		while(obj)
		{
			if(this.sumarMargenesClient)
			{
				if (obj.tagName.toLowerCase()!="body" && this.browser=="MSIE" )
					shT += obj.clientTop;
			}
			shY += obj.offsetTop;
			obj = obj.offsetParent;
		}
		return(shY+shT+this.shTop);
	}

	function shFlashObjExpressionLeft()
	{
		var obj = this.whereToDockObj[0], shY = 0, shX = 0, shT=0;

		while(obj)
		{
			if(this.sumarMargenesClient)
			{
				if (obj.tagName.toLowerCase()!="body" && this.browser=="MSIE")
					shT += obj.clientLeft;
			}
			shX += obj.offsetLeft;
			obj = obj.offsetParent;
		}

		if(this.browser=="MSIE") 
		{
			if(shLaVentana.document.body) this.shLeft=shLaVentana.document.body.clientWidth-780;
		} 
		else if(this.browser=="Moz")
		{
			if(shLaVentana.document) this.shLeft=shLaVentana.document.body.clientWidth-796;
		}
		else 
		{
			this.shLeft==0;
		}
		alert(shX+'+'+shT+'+'+this.shLeft);
		return(shX+shT+this.shLeft);
	}

	function fixSh() { try{ window.setTimeout("shLaVentana.document.getElementById('"+this.mainSWFId+"').style.posWidth = ("+this.flashWidth+"-1);",100); window.setTimeout("shLaVentana.document.getElementById('"+this.mainSWFId+"').style.posWidth = "+this.flashWidth+";",200); } catch(e){} }
	function fixFlashvars() { setTimeout("shLaVentana.document.getElementById('"+this.mainSWFId+"').flashvars='"+this.lasFlashVars+"';",10); setTimeout("shLaVentana.document.getElementById('"+this.mainSWFId+"').flashvars='"+this.lasFlashVars+"';",100); setTimeout("shLaVentana.document.getElementById('"+this.mainSWFId+"').flashvars='"+this.lasFlashVars+"';",500); }
	function start() { this.build(); this.shWritePingImgs(); this.preLoad(); if (this.startView) this.shView(); this["doAndGetAnclas"](); }


	function shWriteMainMovie()
	{
		if (this.shPosType!="none")
		{
			if(this.movieAntiCache) this.codigoAntiCache="?rnd="+this.shRnd(); 

			var newFlash = shLaVentana.document.createElement("embed");
			newFlash.setAttribute("type","application/x-shockwave-flash");
			newFlash.setAttribute("id",this.mainSWFId);
			newFlash.setAttribute("name",this.mainSWFId);
			newFlash.setAttribute("width",this.flashWidth);
			newFlash.setAttribute("height",this.flashHeight);
			newFlash.setAttribute("wmode",this.wmodeMoz);
			newFlash.setAttribute("allowScriptAccess","always");
			newFlash.setAttribute("src",this.theSRC+this.flashName+this.codigoAntiCache);
			newFlash.setAttribute("flashvars",this.lasFlashVars);
			newFlash.style.position="absolute";
			newFlash.style.display="none";
			newFlash.style.zIndex=99999;
			this.elFlashElement=newFlash;
			
			shLaVentana.document.body.insertBefore(this.elFlashElement,shLaVentana.document.body.firstChild);
			window.attachEvent("onunload", unloadDone);
			this.shPlayShoshkele();
		}
		else
		{
			this.hideShow("hide");
			if (this.shPosType=="docked") // si esta dockeado
				this.hideShowDock("hide") // llamo a la funcion que oculta, si debe, el ancla
		}
	}
	
	function shWriteMainMovieMoz()
	{
		if (this.shPosType!="none")
		{	
			/*************************     ****************************/

			// lo hago con createElement porque FF hace el preload mas rapido que si fuera un document.write de un string.
			var newFlashLoad = shLaVentana.document.createElement("EMBED");
			newFlashLoad.setAttribute("type","application/x-shockwave-flash");
			newFlashLoad.setAttribute("id",this.mainSWFId+'_Load');
			newFlashLoad.setAttribute("name",this.mainSWFName+'_Load');
			newFlashLoad.setAttribute("src",this.theSRC+this.flashName);
			newFlashLoad.setAttribute("wmode","transparent"); //para que no haga play( sobretodo si tiene audio)
			newFlashLoad.style.position="absolute";
			newFlashLoad.style.top="-3000px";
			newFlashLoad.style.left="-3000px";
			this.flashForLoadToMozElement=newFlashLoad;

			var newFlash = shLaVentana.document.createElement("EMBED");
			newFlash.setAttribute("type","application/x-shockwave-flash");
			newFlash.setAttribute("id",this.mainSWFId);
			newFlash.setAttribute("name",this.mainSWFId);
			newFlash.setAttribute("width",this.flashWidth);
			newFlash.setAttribute("height",this.flashHeight);
			newFlash.setAttribute("wmode",this.wmodeMoz);
			newFlash.setAttribute("allowScriptAccess","always");
			newFlash.setAttribute("src",this.theSRC+this.flashName);
			newFlash.setAttribute("flashvars",this.lasFlashVars);
			newFlash.style.position="absolute";
			newFlash.style.display="none";
			newFlash.style.zIndex=99999;
			this.elFlashElement=newFlash;
			
			/*************************     ****************************/

			shLaVentana.document.body.insertBefore(this.flashForLoadToMozElement,shLaVentana.document.body.firstChild);
			shLaVentana.document.body.insertBefore(this.elFlashElement,shLaVentana.document.body.firstChild);
			window.addEventListener("unload", unloadDone, false);
			window.addEventListener("load", loadDoneFI, false);
			this.shPlayShoshkele();
		}
		else
		{
			this.hideShow("hide");
			if (this.shPosType=="docked") // si esta dockeado
				this.hideShowDock("hide") // llamo a la funcion que oculta, si debe, el ancla
		}
	}

	function shPlayShoshkele()
	{
		//top.shLaVentana=shLaVentana;
		var movieIsLoaded=this.checkMovieLoaded();
		var siAnclayEstaVisible=false;
		
		if ((!this.whereToDockObj[0]) || (this.whereToDockObj[0] && this.whereToDockObj[0].offsetWidth>0))
				siAnclayEstaVisible=true;
		
		if (siAnclayEstaVisible && (movieIsLoaded || this.politeFlash))
		{
			
			this.shCommand();
			if (this.shProduct=="shoshkele")
				this.hideShow("hide");
			this["setLayOutPosition"+this.polymorph]();
			if (this.shPosType=="docked") // si esta dockeado
				this.hideShowDock("hide"); // llamo a la funcion que oculta, si debe, el ancla
			if (this.browser=="Moz")
			{
				this.reSetLayOutPosition();
				this.intervalReposition=window.setInterval("shLaVentana['"+this.shoshObjName+"'].reSetLayOutPosition()",200);
			}
			shLaVentana[shoshObjName].hoy=new Date();
			shLaVentana.document.getElementById(this.mainSWFId).style.display="inline";
			shLaVentana.document.getElementById(this.mainSWFId).style.position="absolute";
			this.fixFlashvars();
			this.shView();

		}
		else
		{
			if (this.browser=="Moz")
			{
				/* esto es porque a veces en FF no se renderiza el SWF, con esto si */
				try{this.reSetLayOutPosition();}
				catch(e){}
			}
			window.setTimeout("shLaVentana['"+this.shoshObjName+"'].shPlayShoshkele()",50);
		}
	}

	function shCommand()
	{
		var shResult = false;
		if((shResult=this.flashGetVar('SH_JS_COLLAPSE')))
		{
			this.shReport("_COLLAPSE_");
			this.creativeSizeState="COLLAPSE";
			shLaVentana.document.getElementById(this.mainSWFId).style.display='none';
			shLaVentana.document.getElementById(this.mainSWFId).style.display='inline';
			
			this.shFinish(); 
			//if (this.clipFlashMoz && this.browser=="Moz")
				shLaVentana.document.getElementById(this.mainSWFId).style.clip="rect("+this.clipFlashMoz[0]+"px,"+this.clipFlashMoz[1]+"px,"+this.clipFlashMoz[2]+"px,"+this.clipFlashMoz[3]+"px)";

		}
		if((shResult=this.flashGetVar('SH_JS_EXPAND')))
		{
		
			this.shReport("_EXPAND_");
			this.creativeSizeState="EXPANDED";		
			this.hideShow("hide");
			//if (this.clipFlashMoz && this.browser=="Moz")
				shLaVentana.document.getElementById(this.mainSWFId).style.clip="rect(0px,"+this.flashWidth+"px,"+this.flashHeight+"px,0px)";
		}
		if((shResult=this.flashGetVar('SH_JS_CLOSE')))
		{
			if (this.browser=="Moz")
				shLaVentana.document.getElementById(this.mainSWFId).display='none';

		}
		if((shResult=this.flashGetVar('SH_JS_INTER')))
		{
			this.shReport(shResult);
		}
		if((shResult=this.flashGetVar('SH_JS_CTURL')))
		{
			var ctPos=(shResult-1);
			if (this.interactionNames.length>0)
			{
				try
				{
					var elReporte=this.interactionNames[ctPos];
					this.shReport(elReporte);
				}
				catch(e)
				{}
			}
			if (this.shNewWindow==0) // si es same window redireccionamos desde DHTML
				setTimeout('shLaVentana.document.location.href="'+unescape(this.ClickThroughURLs[ctPos])+'";',800);
			this.reportClick(); // Debo reportar un click.
		}
		if((shResult=this.flashGetVar('SH_JS_FINISH')))
		{
			if (this.shProduct=="shoshkele")
				shLaVentana.document.getElementById(this.mainSWFId).style.display='none';  //solo shoshkele
			this.shFinish();
		}
		if((shResult=this.flashGetVar('SH_JS_LANDING')))
		{
			if (this.doScrollCollapsed)
				this.doScroll(1);
			this.shFinish();
			if (this.clipFlashMoz && this.browser=="Moz")
				shLaVentana.document.getElementById(this.mainSWFId).style.clip="rect("+this.clipFlashMoz[0]+"px,"+this.clipFlashMoz[1]+"px,"+this.clipFlashMoz[2]+"px,"+this.clipFlashMoz[3]+"px)";
		}
		window.setTimeout("shLaVentana['"+this.shoshObjName+"'].shCommand()",20);
	}

	function doAndGetAnclas() { allDone=false; if (this.shProduct=="shoshkele") { if (this.shPosType=="docked") { var tmpZ=0; while(tmpZ<this.whereToDock.length && !allDone) { try { elObjetoDock=this.getObj(this.whereToDock[tmpZ][0],this.whereToDock[tmpZ][1],this.whereToDock[tmpZ][2],this.whereToDock[tmpZ][3]); if (elObjetoDock) { this.whereToDockObj=new Array(elObjetoDock,this.whereToDock[tmpZ][4],this.whereToDock[tmpZ][5]); allDone=true; } } catch(e){} tmpZ++; } if (!allDone) window.setTimeout("shLaVentana['"+this.shoshObjName+"'].doAndGetAnclas()",2000); } else allDone=true; } if (allDone && (this.browser=="MSIE" || (this.browser=="Moz" && this.browserPlataform=="full"))) { this.getHideObjects(); this["shFlashObj"]();}}
	function flashGetVar(shFlashVarName){ var flashValue=""; if(this.checkMovieLoaded()) { try{ flashValue=shLaVentana.document.getElementById(this.mainSWFId).GetVariable(shFlashVarName); if(flashValue) shLaVentana.document.getElementById(this.mainSWFId).SetVariable(shFlashVarName,""); } catch(e) { var dummy="no se pudo leer del flash"; }} return flashValue; }
	function shFinish() { this.hideShow("show"); if (this.shPosType=="docked")  this.hideShowDock("show"); }
	function hideShowDock(theAction){ theAction=theAction.toLowerCase(); var error=false; if(theAction=="show" && this.whereToDockObj[0] && this.whereToDockObj[2]==1) { try { this.whereToDockObj[0].style.visibility='visible'; } catch(e) { error=true; } } if(theAction=="hide" && this.whereToDockObj[0] && this.whereToDockObj[1]==1) {  try { this.whereToDockObj[0].style.visibility='hidden';} catch(e) { error=true;}}}
	function hideShow(theAction) { var error=false; if (theAction=="hide")theAction="hidden"; else if (theAction=="show")theAction="visible"; else {theAction="";this.error+=" /*ERROR*/ Error en el parametro de la funcion hideShow"; error=true;} this.doHideAllTheseObjects(theAction); for (var tmpI=0;tmpI<this.whatToHideObjs.length;tmpI++) { try { if(this.whatToHideObjs[tmpI].length==2 && (!this.whatToHideObjs[tmpI].tagName || this.whatToHideObjs[tmpI].tagName.toLowerCase()!="select")) { for(var tmpH=0;tmpH<shLaVentana.document.getElementsByTagName(this.whatToHideObjs[tmpI][0]).length;tmpH++) { shLaVentana.document.getElementsByTagName(this.whatToHideObjs[tmpI][0])[tmpH].style.visibility=theAction; } } else this.whatToHideObjs[tmpI].style.visibility=theAction; } catch(e) { error=true; } } if (error) { window.setTimeout("shLaVentana['"+this.shoshObjName+"'].hideShow('"+theAction+"')",100);} }
	function getHideObjects() { var whatToHideObjsLarry=new Array(); if (this.whatToHide.length && this.formsToHide.length<1) this.getHideObjectsDone=1; else this.getHideObjectsDone=0; var objectCounter=0; for (var tmpI=0;tmpI<this.whatToHide.length;tmpI++) { try { tmpObj=this.getObj(this.whatToHide[tmpI][0],this.whatToHide[tmpI][1],this.whatToHide[tmpI][2],this.whatToHide[tmpI][3]); whatToHideObjsLarry[objectCounter]; if(tmpObj) { whatToHideObjsLarry[objectCounter]=tmpObj; objectCounter++; if(this.getHideObjectsDone!=-1) this.getHideObjectsDone=1; } else this.getHideObjectsDone=-1; } catch(e) { this.getHideObjectsDone=-1; } } for (var tmpI=0;tmpI<this.formsToHide.length;tmpI++) { try { tmpObj=this.getObj(this.formsToHide[tmpI][0],this.formsToHide[tmpI][1]); if(tmpObj) { whatToHideObjsLarry[objectCounter]=tmpObj; objectCounter++; if(this.getHideObjectsDone!=-1) this.getHideObjectsDone=1; } else this.getHideObjectsDone=-1; }catch(e){this.getHideObjectsDone=-1;} } this.whatToHideObjs=whatToHideObjsLarry; if(this.creativeSizeState=="EXPANDED")  this.hideShow("hide"); if (this.getHideObjectsDone<0) window.setTimeout("shLaVentana['"+this.shoshObjName+"'].getHideObjects()",20); }
	function doHideAllTheseObjects(theAction) { whatToHide=this.hideAll.split(";"); for (var tmpI=0;tmpI<whatToHide.length;tmpI++) { try {laClase=whatToHide[tmpI].toUpperCase(); for(var tmpH=0;tmpH<shLaVentana.document.getElementsByTagName(laClase).length;tmpH++) { if(shLaVentana.document.getElementsByTagName(laClase)[tmpH].id.indexOf("sh_all_anim_")<0) { if(theAction=="hidden") { pepe = new String(""+shLaVentana.document.getElementsByTagName(laClase)[tmpH].style.visibility); switch(pepe) { case "hidden" : lastVisibility="hidden";break; case "inherit" : lastVisibility="inherit";break; default : lastVisibility="visible";break; } shLaVentana.document.getElementsByTagName(laClase)[tmpH].lastVisibility=lastVisibility; shLaVentana.document.getElementsByTagName(laClase)[tmpH].style.visibility=theAction; } if(theAction=="visible") { shLaVentana.document.getElementsByTagName(laClase)[tmpH].style.visibility=shLaVentana.document.getElementsByTagName(laClase)[tmpH].lastVisibility;} } } } catch(e){}}}
	function getObj(theTags,param1,param2,thePos){theTags=theTags.toUpperCase().split(','); var ObjCounter=0,losObjetos,theObjectToReturn=false; for (var shA=0;shA<theTags.length;shA++){ losObjetos=theTags[shA]=="IMG"?shLaVentana.document.images:shLaVentana.document.getElementsByTagName?shLaVentana.document.getElementsByTagName(theTags[shA]):shLaVentana.document.all.tags?shLaVentana.document.all.tags(theTags[shA]):false; if (losObjetos) {for (var shI=0;shI<losObjetos.length;shI++) { if (theTags[shA]=="INPUT" || theTags[shA]=="SELECT") { if(param1.toUpperCase()=="NULL"){ theObjectToReturn=new Array(theTags[shA],param1); break; } else { if(losObjetos[shI].name==param1) {theObjectToReturn=losObjetos[shI]; break; } } } else { if((( parseInt(losObjetos[shI].style.width)==param1 && parseInt(losObjetos[shI].style.height)==param2) ||(losObjetos[shI].width==param1 && losObjetos[shI].height==param2) || (losObjetos[shI].offsetWidth==param1 && losObjetos[shI].offsetHeight==param2))&&ObjCounter++==thePos) { theObjectToReturn=losObjetos[shI]; break; } } } ObjCounter=0; if(theObjectToReturn) break; } } return theObjectToReturn;}
	function preLoad() { if (!this.disablePreload && this.flashVer>=this.FlashVerNeeded) { if(this.browser=="MSIE") document.write('<OBJECT STYLE="position:absolute;top:-2000;left:-2000;z-index:1;display:none;" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0" width="1" height="1"><PARAM NAME=movie VALUE="'+this.theSRC+this.flashName+'"><PARAM NAME=quality VALUE=high><PARAM NAME="LOOP" VALUE="false"><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME=SALIGN VALUE=T><PARAM NAME=MENU VALUE=FALSE><PARAM NAME=PLAY VALUE=FALSE><PARAM NAME="AllowScriptAccess" VALUE="always"><\/OBJECT>');}}
	function setOnloadDone() { this.onloadOk=true; if(this.intervalReposition) clearTimeout(this.intervalReposition); }
	function shGetFlashVer() { var ver; try { var objAx=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); ver=objAx.GetVariable("$version");  ver=parseInt(ver.substring(ver.indexOf('WIN')+4)); } catch(e){ver=0;} this.flashVer=ver;}
	function shGetFlashVerMoz() { var flashinstalled = flashversion = 0; if (navigator.plugins && navigator.plugins.length) { var x = navigator.plugins["Shockwave Flash"]; if (x && x.description) flashversion = x.description.substr(x.description.indexOf('.')-2,2);} this.flashVer=parseInt(flashversion);}
	function setLayOutPosition()
	{
		   
			if ((this.shPosType=="docked"))
				
			{
				shLaVentana.document.getElementById(this.mainSWFId).style.top=shLaVentana[this.shoshObjName].shFlashObjExpressionTop()+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=shLaVentana[this.shoshObjName].shFlashObjExpressionLeft()+"px";
			}
			else if (this.shPosType=="center")
			{
				this.shLeft=this.shLefCenter;
				shLaVentana.document.getElementById(this.mainSWFId).style.top=this.shTop+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=((shLaVentana.document.body.clientWidth-this.flashWidth)/2)+this.shLeft+"px";
			}
			else if (this.shPosType=="fixed")
			{
				this.shLeft=this.shLefCenter;
				shLaVentana.document.getElementById(this.mainSWFId).style.top=this.shTop+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=this.shLeft+"px"
			}
	
	}
	function setLayOutPositionMoz() { if ((this.shPosType=="center" || this.shPosType=="docked")) { this.reSetLayOutPosition(); shLaVentana.addEventListener("resize", onresizeDone, false); } else if (this.shPosType=="fixed") { shLaVentana.document.getElementById(this.mainSWFId).style.top=this.shTop+"px"; shLaVentana.document.getElementById(this.mainSWFId).style.left=this.shLeft+"px"; } }
	function reSetLayOutPosition() 
	{
			this.shLeft=200;
			if ((this.shPosType=="docked"))
				
			{
				shLaVentana.document.getElementById(this.mainSWFId).style.top=shLaVentana[this.shoshObjName].shFlashObjExpressionTop()+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=shLaVentana[this.shoshObjName].shFlashObjExpressionLeft()+"px";
			}
			else if (this.shPosType=="center")
			{
				this.shLeft=this.shLefCenter;
				shLaVentana.document.getElementById(this.mainSWFId).style.top=this.shTop+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=((shLaVentana.document.body.clientWidth-this.flashWidth)/2)+this.shLeft+"px";
			}
			else if (this.shPosType=="fixed")
			{
				this.shLeft=this.shLefCenter;
				shLaVentana.document.getElementById(this.mainSWFId).style.top=this.shTop+"px";
				shLaVentana.document.getElementById(this.mainSWFId).style.left=this.shLeft+"px"
			}
	}
	function checkMovieLoaded(){try{if (this.browser=="MSIE") var Xload=shLaVentana.document.getElementById(this.mainSWFId).PercentLoaded(); else var Xload=shLaVentana.document.getElementById(this.mainSWFId+"_Load").PercentLoaded(); if (Xload>99) return true; } catch(e){} return false; }
	function shWritePingImgs() { if(this.browser=="MSIE") { var shPingers=''; for(var shI=0;shI<10;shI++) shPingers+='<IMG  style="display:none;" NAME="shViewBox_'+this.shoshObjName+'_'+shI+'" HEIGHT=1 WIDTH=1 SRC="'+this.objectNumberSRC+'invisible.gif">'; shPingers='<DIV ID="allThePings_'+this.shoshObjName+'" STYLE="position:absolute;top:-200px;display:none;">'+shPingers+'</DIV>'; document.write(shPingers); } }
	function shPingTo(whichVar){if(whichVar && (whichVar.indexOf(".")!=-1)){whichVar=whichVar.replace(/\[.*timestamp.*\]/gi, this.shRnd()); whichVar=whichVar.replace(/\[.*datetime.*\]/gi, this.shRnd());  (new Image()).src = whichVar;}}
	function shView(){ if (!this.viewDoneFlag) { this.viewDoneFlag=true; for(var shI=0;shI<10;shI++) { if(this.tr_view[shI]) this.shPingTo(this.tr_view[shI]); }}}
	function shClick() { var elTarget=this.shNewWindow; elTarget="_top";alert(elTarget); var laURLCt=this.ClickThroughURLs[0]; laURLCt=laURLCt.replace(/\[.*timestamp.*\]/gi, this.shRnd()); laURLCt=laURLCt.replace(/\[.*datetime.*\]/gi, this.shRnd()); laURLCt=unescape(laURLCt); window.open(laURLCt,elTarget,""); this.reportClick(); }
	function reportClick() { for(var shI=0;shI<10;shI++) { if(this.tr_click[shI]) this.shPingTo(this.tr_click[shI]); }}
	function shReport(intName) { intName=this.sh3kInter.replace(/\[.*interaction.*\]/gi,intName)+'$'+this.shRnd(1); this.shPingTo(intName);}
	function shRnd(){ if (!this.shDaRandom) this.shDaRandom=parseInt(Math.random()*99999)+1; return shRnd.arguments.length==0?this.shDaRandom:parseInt(Math.random()*99999)+1;}
}
shLaVentana=window;
if (window.theIndex)
	shLaVentana=parent.parent;
shLaVentana.shLaVentana=shLaVentana;

function onloadDone(){var tmpH=1;while ((tmpH<99) && shLaVentana["shosh_"+tmpH]){try{shLaVentana["shosh_"+tmpH].setOnloadDone();}catch(e){}tmpH++;}}
function onresizeDone(){var tmpH=1;while ((tmpH<99) && shLaVentana["shosh_"+tmpH]) {try{shLaVentana["shosh_"+tmpH].reSetLayOutPosition();}catch(e){};tmpH++;}}
function unloadDone(){
		this.ahora = new Date();
		this.milisegHoy = Date.parse(shLaVentana[shoshObjName].hoy);
		this.milisegDestino = Date.parse(this.ahora);
		this.segundos = (this.milisegDestino - this.milisegHoy)/1000;
		this.segundos=this.segundos.toString();
		if(this.segundos.length==1) this.segundos="00"+this.segundos.toString();
		else if(this.segundos.length==2) this.segundos="0"+this.segundos.toString();
		shLaVentana[shoshObjName].shReport("_EXPOSURE-"+this.segundos.toString()+"_");

var tmpH=1;while ((tmpH<99) && shLaVentana["shosh_"+tmpH]) { try{shLaVentana["shosh_"+tmpH].c();}catch(e){};tmpH++;}}
function loadDoneFI(){var tmpH=1;while ((tmpH<99) && shLaVentana["shosh_"+tmpH]){try{shLaVentana["shosh_"+tmpH].doOnloadDoneFI();}catch(e){}tmpH++;}}
function doShfix(){var tmpH=1;while ((tmpH<99) && shLaVentana["shosh_"+tmpH]){try{shLaVentana["shosh_"+tmpH].fixSh();}catch(e){}tmpH++;}}

tmpH=1;
while ((tmpH<99) && shLaVentana["shosh_"+tmpH]){tmpH++;}
if (tmpH<99) shoshObjName="shosh_"+tmpH;
shLaVentana[shoshObjName] = new uvShosh(shoshObjName);
shLaVentana[shoshObjName].theSRC=theSRC;
shLaVentana[shoshObjName].startView=startView;
shLaVentana[shoshObjName].shNewWindow=shNewWindow;
shLaVentana[shoshObjName].ClickThroughURLs=sh3kRedir;
/* *********************************** */
var tmpObj=new shConfig();
for (var shI in tmpObj)
	shLaVentana[shoshObjName][shI]=tmpObj[shI];
shLaVentana[shoshObjName].start();
/* *********************************** */



