/*********************TRATAMIENTO DE IMAGENES********************/

inicio_on = new Image ( );
inicio_off = new Image ( );
inicio_on.src = "/images/euro/2008/Inicio_ON.gif";
inicio_off.src = "/images/euro/2008/Inicio_OFF.gif";

equipo_on = new Image ( );
equipo_off = new Image ( );
equipo_on.src = "/images/euro/2008/Equipos_ON.gif";
equipo_off.src = "/images/euro/2008/Equipos_OFF.gif";

grupo_on = new Image ( );
grupo_off = new Image ( );
grupo_on.src = "/images/euro/2008/Grupos_ON.gif";
grupo_off.src = "/images/euro/2008/Grupos_OFF.gif";

calendario_on = new Image ( );
calendario_off = new Image ( );
calendario_on.src = "/images/euro/2008/Calendario_ON.gif";
calendario_off.src = "/images/euro/2008/Calendario_OFF.gif";

historia_on = new Image ( );
historia_off = new Image ( );
historia_on.src = "/images/euro/2008/Historia_ON.gif";
historia_off.src = "/images/euro/2008/Historia_OFF.gif";

figura_on = new Image ( );
figura_off = new Image ( );
figura_on.src = "/images/euro/2008/Figuras_ON.gif";
figura_off.src = "/images/euro/2008/Figuras_OFF.gif";

sede_on = new Image ( );
sede_off = new Image ( );
sede_on.src = "/images/euro/2008/Sedes_ON.gif";
sede_off.src = "/images/euro/2008/Sedes_OFF.gif";

multimedia_on = new Image ( );
multimedia_off = new Image ( );
multimedia_on.src = "/images/euro/2008/Multimedia_ON.gif";
multimedia_off.src = "/images/euro/2008/Multimedia_OFF.gif";

glosario_on = new Image ( );
glosario_off = new Image ( );
glosario_on.src = "/images/euro/2008/Glosario_ON.gif";
glosario_off.src = "/images/euro/2008/Glosario_OFF.gif";

credito_on = new Image ( );
credito_off = new Image ( );
credito_on.src = "/images/euro/2008/Creditos_ON.gif";
credito_off.src = "/images/euro/2008/Creditos_OFF.gif";


function ver_on(menu){	
	if (menu=="1")
		document.getElementById("1").src=inicio_on.src;
	else if (menu=="2")	
		document.getElementById("2").src=equipo_on.src;
	else if (menu=="3")	
		document.getElementById("3").src=grupo_on.src;
	else if (menu=="4")	
		document.getElementById("4").src=calendario_on.src;
	else if (menu=="5")	
		document.getElementById("5").src=historia_on.src;
	else if (menu=="6")	
		document.getElementById("6").src=figura_on.src;
	else if (menu=="7")	
		document.getElementById("7").src=sede_on.src;
	else if (menu=="8")	
		document.getElementById("8").src=multimedia_on.src;
	else if (menu=="9")	
		document.getElementById("9").src=glosario_on.src;
	else if (menu=="10")	
		document.getElementById("10").src=credito_on.src;
}






function ver_off(menu){
	if (menu=="1")
		document.getElementById("1").src=inicio_off.src;
	else if (menu=="2")	
		document.getElementById("2").src=equipo_off.src;
	else if (menu=="3")	
		document.getElementById("3").src=grupo_off.src;
	else if (menu=="4")	
		document.getElementById("4").src=calendario_off.src;
	else if (menu=="5")	
		document.getElementById("5").src=historia_off.src;
	else if (menu=="6")	
		document.getElementById("6").src=figura_off.src;
	else if (menu=="7")	
		document.getElementById("7").src=sede_off.src;
	else if (menu=="8")	
		document.getElementById("8").src=multimedia_off.src;
	else if (menu=="9")	
		document.getElementById("9").src=glosario_off.src;
	else if (menu=="10")	
		document.getElementById("10").src=credito_off.src;
}

/****************FIN TRATAMIENTO DE IMAGENES********************/


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function borde(id,tipo){
//tipo==1 prender borde
//tipo==2 apagar borde

	if (tipo=='1'){
		document.getElementById(id).className="indice_foto_ama";
	}else{
		document.getElementById(id).className="indice_foto";
	}
}

function moveright_a(){
	if (iens6&&parseInt(crossobj3.style.left)>=(contentheight3*(-1)+2200))
		crossobj3.style.left=parseInt(crossobj3.style.left)-speed2+"px"
	moverightvar=setTimeout("moveright_a()",20)
}

function moveleft_a(){
	if (iens6&&parseInt(crossobj3.style.left)<=0)
	crossobj3.style.left=parseInt(crossobj3.style.left)+speed2+"px"
	moveleftvar=setTimeout("moveleft_a()",20)
}

function getcontent_height3_a(){
	contentheight3=crossobj3.offsetWidth
}

function moveright_ax(id){
	obj = document.getElementById(id);
	if (iens6&&parseInt(obj.style.left)>=(obj.offsetWidth*(-1)+230))
		obj.style.left=parseInt(obj.style.left)-speed2+"px"
	moverightvar=setTimeout("moveright_ax('"+id+"')",20)
}

function moveleft_ax(id){
	obj = document.getElementById(id);
	if (iens6&&parseInt(obj.style.left)<=0)
	obj.style.left=parseInt(obj.style.left)+speed2+"px"
	moveleftvar=setTimeout("moveleft_ax('"+id+"')",20)
}


function show_video(campo,texto) {
	if (campo == "titlea") {
		document.getElementById(campo).innerHTML = "<img src=\"/images/aniversario/99/Icono_Video.gif\" width=\"14\" height=\"8\" align=\"left\" class=\"pt6\"/>";
		document.getElementById(campo).innerHTML += document.getElementById(texto).innerHTML;
	}
	
	document.getElementById(campo).innerHTML = document.getElementById(texto).innerHTML;
}


 function isMSIEBrowser() {
 	return (navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('opera')==-1 && document.all);
 }
 
 var CONTEXT_PATH='http://www.eluniversal.com/ajax'
//var CONTEXT_PATH='http://localhost:8085'
var skey="";
function vote(artId, value){
	cockieRec=getCookie(artId+"vt");	
	skey="voted";
	if(cockieRec==null){		
		setCookieDays(artId+"vt",value,30);		
		dataObject={articleId:artId,key:skey,value:value};
		evalServerCall('/do/statistics/save',dataObject);		
	}
	else{
		alert("Tu voto ya fu? contabilizado para el art?culo. Gracias por participar!");
		dataObject={articleId:artId};
		evalServerCall('/do/statistics/get',dataObject);
	}
	
	for(i=2;i<=value;i++){
		document.getElementById("starR"+i).src="/images/aniversario/99/starOn.gif";
	}
	
	for(j=value;j<=5;j++){
		document.getElementById("starR"+i).src="/images/aniversario/99/starOff.gif";
	}
}


function countVisit(artId){
	cockieRec=getCookie(artId+"v");	
	if(cockieRec==null){		
		setCookieSession(artId+"v",1);
		skey="visited";
		dataObject={articleId:artId,key:skey,value:1};
		evalServerCall('/do/statistics/save',dataObject);		
	}
}

function showErrorStatistics(msg){
	alert(msg);
}

function showStatistics(articleStatistics){
	if (articleStatistics.voted>0){		
		votos = articleStatistics.voted==1?" voto":" votos";
		document.getElementById("divASVotado").innerHTML= articleStatistics.voted + votos;
		var resultados = articleStatistics.votedValue/articleStatistics.voted
		document.getElementById("divASValVotado").innerHTML= "("+Decimales(resultados, 2)+")";
	}
	if(skey=='voted'){
		document.getElementById("starVote").style.display="none";
		document.getElementById("starResult").style.display='';
		document.getElementById("starResult2").style.display='';
	}
}

function Decimales(Numero, Decimales) { 
pot = Math.pow(10,Decimales); 
return parseInt(Numero * pot) / pot; 
} 

 
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
