 var TimerScrollMnu;
 
function ScrollLeft()
 {
    TimerScrollMnu = setInterval("document.getElementById('menuDeportesTop').scrollLeft -= 2", 15);
 }

function ScrollRight()
 {
    TimerScrollMnu = setInterval("document.getElementById('menuDeportesTop').scrollLeft += 2", 15);
 }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
 }

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];}}
 }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
 }

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
 }


function fncChangeColor(objetodiv,colorfore,colorback)
 {
  if(document.all){ 
	 objetodiv.style.backgroundColor=colorback;
	 var aa=objetodiv.getElementsByTagName("a");
	 aa[0].style.color=colorfore;
   }
  else{
	 objetodiv.style.backgroundColor=colorback;
	 var aa=objetodiv.getElementsByTagName("a");
	 aa[0].style.color=colorfore;
   }
 }

//-- Color para los titulares verticales
function fncChangeColorOrigTitulares(objetodiv)
 {
  fncChangeColor(objetodiv,"#858585","#FFFFFF");
 }

//-- Color para los titulares verticales
function fncChangeColorTitulares(objetodiv)
 {
  fncChangeColor(objetodiv,"#000000","#dbeff9");
 }


 //Cookies asociadas al documento actual
 InCookie = document.cookie;
 //buscamos el coockie
 cadena = GetCookie("tokey",InCookie);
 var acoockie = cadena.split(',');
 var oXmlHttp;
 function GetCookie (name, InCookie) 
  {
    var prop = name + "="; // propiedad buscada
    var plen = prop.length;
    var clen = InCookie.length;
    var i=0;
    if (clen>0)
     { // Cookie no vacío
		   i = InCookie.indexOf(prop,0); // aparición de la propiedad
		   if (i!=-1) 
		    { 
		      // propiedad encontrada
			    // Buscamos el valor correspondiente
			    j = InCookie.indexOf(";",i+plen);
			    if(j!=-1) // valor encontrado
				    return unescape(InCookie.substring(i+plen,j));
			    else //el último no lleva ";"
				    return unescape(InCookie.substring(i+plen,clen));
		   }
		  else
		   return "";
	   }
	  else
		  return "";
   }

//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
 var pxmin=5;        // --minimo de pixeles a disminuir;
 var pxMax = 5;      // --Max pixeles a crecer
 var minsize = 8;    // --tamaño minimo que puede tener un contenido de letra
 var countpxdecrecientes = 0;
 var countpxcrecientes = 0;


function incrementaElemento(p)
 {
   for(i=0;i<p.length;i++) 
    {
      
      var ostyle;
      if(p[i].style.fontSize == '')
      {
        if(document.all){
            ostyle = p[i].currentStyle;
        }else{
            ostyle = window.getComputedStyle(p[i],null);
        }
      }else{
        ostyle = p[i].style;
      }
      
      if(ostyle.fontSize) 
	  {
         var s = parseInt(ostyle.fontSize.replace("px",""));
      } 
	  else 
	  {
         var s = 12;
      }
     if(countpxdecrecientes > 0 || countpxcrecientes < pxMax ) 
	   {
         s += 1;
         p[i].style.fontSize = s+"px"
       }
     
   }
 }

function IncrementaFontSize()
  {
   
   var oDivnoticia = document.getElementById('zonaInfoJuegos');
   var p = oDivnoticia.getElementsByTagName('div');
   alert(4)
   incrementaElemento(p);
  // p = oDivnoticia.getElementsByTagName('p');
   //incrementaElemento(p);   
   
   if(countpxdecrecientes > 0){
      countpxdecrecientes = countpxdecrecientes - 1;
   }else if(countpxcrecientes < pxMax){
      countpxcrecientes = countpxcrecientes + 1; 
   }
      
}

function decrementaElemento(p)
 {
   for(i=0;i<p.length;i++) 
   {
      var ostyle;
      if(p[i].style.fontSize == ''){
        if(document.all){
        ostyle = p[i].currentStyle;
        }else{
        ostyle = window.getComputedStyle(p[i],null);
        }
      }else{
        ostyle = p[i].style;
      }
      if(ostyle.fontSize) 
	  {
         var s = parseInt(ostyle.fontSize.replace("px",""));
      }
	  else
	  {
         var s = 12;
      }
      if((countpxdecrecientes < pxmin || countpxcrecientes > 0 )&& s > minsize ) 
	  {
         s -= 1;
         p[i].style.fontSize = s+"px"
      }
     
   }   
 }
 
function DecrementaFontSize() 
{
   var oDivnoticia = document.getElementById('zonaInfoJuegos');
   var p = oDivnoticia.getElementsByTagName('div');
   decrementaElemento(p);
  // p = oDivnoticia.getElementsByTagName('p');
   //decrementaElemento(p);
   
   if(countpxcrecientes > 0 ){
      countpxcrecientes = countpxcrecientes - 1;
   }else if(countpxdecrecientes<pxmin){
      countpxdecrecientes = countpxdecrecientes + 1;
   }
   
}

//-- Metodo gral para los Font Size
function IncrementaFontSizeGral()
  {
   var p = document.getElementsByTagName('div');
   incrementaElemento(p);
   p = document.getElementsByTagName('p');
   incrementaElemento(p);   
}

//-- Metodo gral para los Font Size
function DecrementaFontSizeGral() 
  {
   var p = document.getElementsByTagName('div');
   decrementaElemento(p);
   p = document.getElementsByTagName('p');
   decrementaElemento(p);
 }

LstTabsOpciones_DIV_CURRENT_ACTIVO = 0; //este panel corresponde a {Relacionados,Titulares,Vistas,PeruCom
LstTabsOpciones_DIVchildren_NEXT_HIDEN = 0;
var LstTabsOpciones;

function LstTabsOpciones_ShowDIVchildren()
{
   LstTabsOpciones_DIVchildren_NEXT_HIDEN = onShowHidenDIV(LstTabsOpciones[LstTabsOpciones_DIV_CURRENT_ACTIVO],LstTabsOpciones_DIVchildren_NEXT_HIDEN,false);
}

function LstTabsOpciones_HidenDIVchildren()
{
   LstTabsOpciones_DIVchildren_NEXT_HIDEN = onShowHidenDIV(LstTabsOpciones[LstTabsOpciones_DIV_CURRENT_ACTIVO],LstTabsOpciones_DIVchildren_NEXT_HIDEN,true);
}

function onShowHidenDIV(contenedor,indexdivHiden,accion)
{
	if(indexdivHiden != -1)
	{	
		var oDIVchildren = document.getElementById(contenedor).childNodes;
		if(accion)
		{
			
			if(indexdivHiden < oDIVchildren.length )
			{
				if(document.all)
				{
	 				oDIVchildren[indexdivHiden].style.display='none';
					indexdivHiden = indexdivHiden + 1;
				}
				else
				{
					if(oDIVchildren[indexdivHiden].nodeType==1)
					{oDIVchildren[indexdivHiden].style.display='none';
				indexdivHiden +=2;
						
					}
				}
			}
		}
		else
		{
				if(document.all)
				{
					if(indexdivHiden > 0)
					{
						indexdivHiden = indexdivHiden - 1;
						oDIVchildren[indexdivHiden].style.display='';
					}
				}
				else
				{
					if(indexdivHiden > 0)
					{
						indexdivHiden-=2;
						oDIVchildren[indexdivHiden].style.display='';
						if(indexdivHiden<0)
						{
							indexdivHiden=0;
						}
					}
				}
		}
		return indexdivHiden;
	}
	else
	{
		document.getElementById(contenedor).style.display = (document.getElementById(contenedor).style.display == 'none')?'':'none';
	}
}	 
 function capturaresultado()
  {
    if (oXmlHttp.readyState == 4 && oXmlHttp.status == 200) 
	 {
	   var strHTML='';
       var selecc=LstTabsOpciones_DIV_CURRENT_ACTIVO;
       document.getElementById("msgLoadingCentral").style.display='none';
	   LstTabsOpciones_DIVchildren_NEXT_HIDEN = 0;
	   strHTML=oXmlHttp.responseText;
	   
	   for(var i=0;i<LstTabsOpciones.length;i++)
	    {
          if(selecc!=i)
		      document.getElementById(LstTabsOpciones[i]).style.display='none';
          else
	  	   {
			 document.getElementById(LstTabsOpciones[i]).innerHTML=strHTML;	
             document.getElementById(LstTabsOpciones[i]).style.display='';
		   }
	    }			 
	 }  
  }

 // Ejecuta la llamada remota, solo si no es local, index>0
 function Solicitud(index,parm,seccionTabs)
  {
	callCertificaClick(vcertifica_sitio, 'extramania/Tabs');
	LstTabsOpciones_DIVchildren_NEXT_HIDEN = 0;
	LstTabsOpciones_DIV_CURRENT_ACTIVO=seccionTabs;
    if(index==0)
     {
      for(var i=0; i<LstTabsOpciones.length; i++) 
	   { 
        if(index!=i)
	     document.getElementById(LstTabsOpciones[i]).style.display='none';
	    else
		 document.getElementById(LstTabsOpciones[i]).style.display='';
	   }
     }
    else
	 {		
        document.getElementById("msgLoadingCentral").style.display='inline';
        oXmlHttp = zXmlHttp.createRequest();
        oXmlHttp.open("post","/proxy/proxy.aspx",true);
        oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        oXmlHttp.onreadystatechange = capturaresultado;
        var vPost="tokey=" + acoockie[0] + "&idFunc=" + index + "&parm=" + parm;
        oXmlHttp.send(vPost);
	 }
 }

// Toma como argumentos los nombres de los DIV's
function initSolicitudTab()
 {
   LstTabsOpciones = arguments 
 }
 var cajaCyber=false
var cyberLogged=false
function initcoockie(){
    var v1 = GetCookie("userkey",document.cookie);
    if(v1!=''){
		
        var o = eval("(" + v1 + ")"); 
        if(o){
		if (cajaCyber==true) {
			
			document.getElementById('loggedCyber').style.display = '';
			document.getElementById('formLogin').style.display = 'none';
		}
        setvalidatecoockie(true,o.user,o.pass);
        }
    }
}
function setvalidatecoockie(crip,us,ps){
  //  document.getElementById('Useridentificator').style.display = (crip)?"none":"";
    document.getElementById('hcripus').value = us;
    document.getElementById('hcripps').value = ps;
}
function setCookie(sName,sValue) {
     document.cookie = sName + "=" + sValue; 
}
function SolicitudVotaciones(index,parm){
        callCertificaClick(vcertifica_sitio, 'extramania/votaciones');
        oXmlHttp = zXmlHttp.createRequest();
        oXmlHttp.open("post","/proxy/proxy.aspx",true);
		
        oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        if(index!=4){
			
        oXmlHttp.onreadystatechange = capturaresultadoVotaciones;
        }else{
			
        oXmlHttp.onreadystatechange = capturaresultadoAlerta;
        }
		
        var vPost="tokey=" + acoockie[0] + "&idFunc=" + index + "&parm=" + parm;
		
        oXmlHttp.send(vPost);
		
    
 }
 function capturaresultadoVotaciones()
 {	 	
        if (oXmlHttp.readyState == 4)
        {			
            if (oXmlHttp.status == 200)
            {				
                var arr = eval("(" + oXmlHttp.responseText + ")");
                eval('(' + arr + ')');
            }
            else
            {
                saveResult("An error occurred: " + oXmlHttp.statusText);
            }
        }         
 }
 function capturaresultadoAlerta()
 {
        if (oXmlHttp.readyState == 4)
        {
            if (oXmlHttp.status == 200)
            {
                var streval = oXmlHttp.responseText;
                var obj = eval("(" + streval + ")");
                if (obj.coockie != ""){
                    setCookie("userkey",obj.coockie)
                }
                obj.getfunction();
            }
            else
            {
                saveResult("An error occurred: " + oXmlHttp.statusText);
            }
        }         
}
function rate_alertas(func,param)
{
    param = 'us:\''+document.getElementById('txt1').value + '\'';
    param = param+','+'pw:\''+document.getElementById('txt2').value + '\'';
    param = param+','+'idcom:\''+document.getElementById('idcom').value + '\'';
    param = param+','+'crip:0';
    param='{'+param+'}';
    document.getElementById('txt1').value='';
    document.getElementById('txt2').value='';
    document.getElementById('idcom').value='';
    if(!is_being_rated) {
	    is_being_rated = true;
	    document.getElementById('logalert').style.display='none';
	    SolicitudVotaciones(func,param)
	    
	} else {		
	    alert(ratings_text_wait);
	}
}
function rate_alertas_coockie(func,user,pass,urlcyber,usuariobad,fecha,idusuariobad)
{
    param = 'us:\''+ user + '\'';
    param = param+','+'pw:\''+ pass + '\'';
    param = param+','+'idcom:\''+document.getElementById('idcom').value + '\'';
	param = param+','+'urlcyber:\''+ urlcyber + '\'';
	param = param+','+'usuariobad:\''+ usuariobad + '\'';
	param = param+','+'fecha:\''+ fecha + '\'';
	param = param+','+'idusuariobad:\''+ idusuariobad + '\'';
    param = param+','+'crip:1';
    document.getElementById('idcom').value='';
    param='{'+param+'}';
    if(!is_being_rated) {
	    is_being_rated = true;
	    SolicitudVotaciones(func,param)
	    
	} else {		
	    alert(ratings_text_wait);
	}
}
function show_login(e,urlcyber,usuariobad,fecha,idusuariobad,idcomentario)
{
    //buscamos el coockie
    var streval = GetCookie("userkey",document.cookie);
    document.getElementById('idcom').value=idcomentario;
      
    if(streval != ""){
        var objUser = eval("(" + streval + ")");
        rate_alertas_coockie(4,objUser.user,objUser.pass,urlcyber,usuariobad,fecha,idusuariobad);
    }else{
        var curleft = curtop = 0;
        if (e.offsetParent){
            do{
            curleft += e.offsetLeft;
			  curtop += e.offsetTop;
		      }while (e = e.offsetParent);
	    }
	    else
	    {
	        curtop=350;
	        curleft=200;
	    }
	    document.getElementById('logalert').style.display='';
        document.getElementById('logalert').style.top= curtop - 70;
        document.getElementById('logalert').style.left= curleft + 50;
    }
    
}

var ratings_text_wait = "Sólo un voto a la vez.";
var ratings_image = "stars";
var rate_fadeout_opacity = 100;
var is_ie = (document.all && document.getElementById);
var is_moz = (!document.all && document.getElementById);
var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
var is_being_rated = false;
var ratings_max = "5";
var ratings_mouseover_image = new Image();
ratings_mouseover_image.src = "/images/votaciones_estrellarojo.gif";

function rade_fadein_rating(promedio,cantidad)
{
    document.getElementById('votos').innerHTML="";
    document.getElementById('votos').innerHTML=cantidad;
    ratings_off(promedio,0);
    rade_fadein_text();
    
}

    function current_rating(rating) {
	    if(!is_being_rated) {
		    post_rating = rating;
		    for(i = 1; i <= rating; i++) {
			    document.images['rating_' + i].src = eval("ratings_mouseover_image.src");
		    }
	    }
    }


    function ratings_off(rating_score, insert_half)
    {
	    //if(!is_being_rated)
	    //{
		    for(i = 1; i <= ratings_max; i++)
		    {
			    if(i <= rating_score)
			    {
				    document.images['rating_' + i].src = '/images/votaciones_estrellaamarilla.gif';
			    }
			    else if(i == insert_half)
			    {
				   document.images['rating_' + i].src = '/images/rating_half.gif';
			    }
			    else
			    {
				    document.images['rating_' + i].src = '/images/votaciones_estrellagris.gif';
			    }
		    }
	   // }
    }


    function rate_post(func, param)
    {	
	    if(!is_being_rated) {
		    is_being_rated = true;
		    rate_process(func,param);		
	    } else {		
		    alert(ratings_text_wait);
	    }
    }

    function rate_comms(func, param)
    {	
	    if(!is_being_rated) {
		    is_being_rated = true;
		    SolicitudVotaciones(func,param)
	    } else {		
		    alert(ratings_text_wait);
	    }
    }
    

    
    function rate_process(func,param)
    {
	    if(rate_fadeout_opacity > 0) {
		    rate_fadeout_opacity -= 10;
		    if(is_opera) {
			    rate_fadein_opacity = 0;
		    } else if(is_ie) {
			    document.getElementById('ratings').style.filters='alpha(opacity='+rate_fadeout_opacity+')';
		    } else if(is_moz) {
			    document.getElementById('ratings').style.MozOpacity = (rate_fadeout_opacity/100);
		    }
		    setTimeout("rate_process(" + func + ",'" + param + "')", 100);
		    
	    } else {
		    rate_fadein_opacity = 0;
		    rate_fadeout_opacity = 100;
            SolicitudVotaciones(func,param)
	    }
    }

function rade_fadein_text() {
	if(rate_fadein_opacity < 100) {
		rate_fadein_opacity += 10;
		if(is_opera)  {
			rate_fadein_opacity = 100;
		} else	 if(is_ie) {
			document.getElementById('ratings').style.filters='alpha(opacity='+rate_fadein_opacity+')';
		} else	 if(is_moz) {
			document.getElementById('ratings').style.MozOpacity = (rate_fadein_opacity/100);
		}
		setTimeout("rade_fadein_text()", 100); 
	} else {
		rate_fadein_opacity = 100;
		//rate_unloading_text();
		is_being_rated = false;
	}
}


function getInnerText(elt) {
	var _innerText = elt.innerText;
	if (_innerText == undefined) {
  		_innerText = elt.innerHTML.replace(/<[^>]+>/g,"");
	}
	return _innerText;
}


function UpdateComms(pos,neg,idDoc)
{
    document.getElementById('resok'+idDoc).innerHTML="";
    document.getElementById('resok'+idDoc).innerHTML=pos;
    document.getElementById('resko'+idDoc).innerHTML="";
    document.getElementById('resko'+idDoc).innerHTML=neg;
    is_being_rated = false;
}

function UpdateAlertas(cantidad,idcom)
{
    document.getElementById('resalert' + idcom).innerHTML="";
    document.getElementById('resalert' + idcom).innerHTML=cantidad;
    is_being_rated = false;
}

function SolicitudEncuesta(index,parm)
{
	callCertificaClick(vcertifica_sitio, 'extramania/encuestas');
	
    oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("post","/proxy/proxy.aspx",true);
    oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    oXmlHttp.onreadystatechange = capturaresultadoEncuesta;
    var vPost="tokey=" + acoockie[0] + "&idFunc=" + index + "&parm=" + parm;
	
    oXmlHttp.send(vPost);
    
}

function Intermedia(idencuesta)
{
    var objSelect = document.getElementById('opcion');
    if(objSelect.selectedIndex != -1)
    {
        var idpregunta = objSelect.options[objSelect.selectedIndex].value;
        if( idpregunta == "0"){
            alert("seleccione una pregunta");
        }else{
			SolicitudEncuesta('1', '{idpregunta:' +  idpregunta +', idencuesta:' + idencuesta + '}' );
        }
    }
} 

function capturaresultadoEncuesta()
{
    if (oXmlHttp.readyState == 4)
    {
        if (oXmlHttp.status == 200)
        {
			
            var arr = oXmlHttp.responseText;
            var div = document.getElementById("ContenidoBarra");
            div.innerHTML = arr;
        }
        else
        {
            saveResult("An error occurred: " + oXmlHttp.statusText);
        }
    }   
}
function saveResult(mensaje)
{
    alert(mensaje);
}

function fncSubmitComentario(hdParam)
{
	var objparm = document.getElementById(hdParam);
    objparm.value = 1;
    document.formComs.submit();
}

//-- Muestra o oculta el menu adicional de la cabecera de Noticias
function fncmasmnu()
 {
  var divmenuprincipal=document.getElementById("menuadicionalcabecera");
  if(divmenuprincipal.style.display=='')
    divmenuprincipal.style.display='none';
  else
	 divmenuprincipal.style.display=''; 
 }
 
 //-- Muestra los elementos de Ultimo minuto y el desplazamiento
 //-- variable global
 var ultnot_actual;
 var ultnot_pivot;
 function mostrar_ultmin(dir)
{
	//--- 0=muestra la ultima noticia(primera carga de la página)
	//--- 1=muesta la noticia anterior, si esta al inicio, muestra la ultima
	//--- 2=muesta la noticia siguiente, si esta al final, muestra la primera
	
	//--- Recorre todos los nodos para mostar el anterior o siguiente 
	var elem_vis=document.getElementById('divultimominuto').childNodes.length;
	var array_nodos=document.getElementById('divultimominuto').childNodes;
	var existe=0;
	if((document.all && elem_vis>0) || elem_vis>1)
	{
		switch(dir)
		{
			case 0: 
					if(document.all)
					{
						ultnot_pivot=0;
						array_nodos[ultnot_pivot].style.display='';
						
					}
					else
					{
						ultnot_pivot=1;
						array_nodos[ultnot_pivot].style.display='';
					}
					ultnot_actual=0;
					break;
					
			case 1:
					array_nodos[ultnot_pivot].style.display='none';
					for(i=ultnot_pivot-1;i>=0;i--)
					{
						if(document.all)
						{
							array_nodos[i].style.display='';
							ultnot_pivot=i;
							existe=1;
							i=0;
						}
						else
						{
							
							if(array_nodos[i].nodeType==1 && i>=1)
							{
								
								array_nodos[i].style.display='';
								ultnot_pivot=i;
								existe=1;
								i=0;
							}
						}
					}
					if(existe==0)
					{
						if(document.all)
						{
							ultnot_pivot=elem_vis-1;
						}
						else
						{
							ultnot_pivot=elem_vis-2;
						}
						array_nodos[ultnot_pivot].style.display='';
					}
					
					break;
			case 2: 
					array_nodos[ultnot_pivot].style.display='none';
					for(i=ultnot_pivot+1;i<elem_vis;i++)
					{
						if(document.all)
						{
							array_nodos[i].style.display='';
							ultnot_pivot=i;
							existe=1;
							i=elem_vis;
						}
						else
						{
							//alert(i);
							if(array_nodos[i].nodeType==1 && i<elem_vis-2)
							{
								
								array_nodos[i].style.display='';
								ultnot_pivot=i;
								existe=1;
								i=elem_vis;
							}
						}
					}
					if(existe==0)
					{
						if(document.all)
						{
							ultnot_pivot=0;
						}
						else
						{
							ultnot_pivot=1;
						}
						
						array_nodos[ultnot_pivot].style.display='';
					}
					break;
		}
	}
}

//-- Muestra los elementos de Cyberperiodista y el desplazamiento
 //-- variable global
 var ultnot_actual_cyber;
 var ultnot_pivot_cyber;
 
 function mostrar_ultmin_cyber(dir)
{
	//--- 0=muestra la ultima noticia(primera carga de la página)
	//--- 1=muesta la noticia anterior, si esta al inicio, muestra la ultima
	//--- 2=muesta la noticia siguiente, si esta al final, muestra la primera
	
	//--- Recorre todos los nodos para mostar el anterior o siguiente 
	var elem_vis=document.getElementById('divciberperiodista').childNodes.length;
	var array_nodos=document.getElementById('divciberperiodista').childNodes;
	var existe=0;
	switch(dir)
	{
		case 0: 
				if(document.all)
				{
					ultnot_pivot_cyber=0;
					array_nodos[ultnot_pivot_cyber].style.display='';
					
				}
				else
				{
					ultnot_pivot_cyber=1;
					array_nodos[ultnot_pivot_cyber].style.display='';
				}
				ultnot_actual_cyber=0;
				break;
				
		case 1:
				array_nodos[ultnot_pivot_cyber].style.display='none';
				for(i=ultnot_pivot_cyber-1;i>=0;i--)
				{
					if(document.all)
					{
						array_nodos[i].style.display='';
						ultnot_pivot_cyber=i;
						existe=1;
						i=0;
					}
					else
					{
						
						if(array_nodos[i].nodeType==1 && i>=1)
						{
							
							array_nodos[i].style.display='';
							ultnot_pivot_cyber=i;
							existe=1;
							i=0;
						}
					}
				}
				if(existe==0)
				{
					if(document.all)
					{
						ultnot_pivot_cyber=elem_vis-1;
					}
					else
					{
						ultnot_pivot_cyber=elem_vis-2;
					}
					array_nodos[ultnot_pivot_cyber].style.display='';
				}
				
				break;
		case 2: 
				array_nodos[ultnot_pivot_cyber].style.display='none';
				for(i=ultnot_pivot_cyber+1;i<elem_vis;i++)
				{
					if(document.all)
					{
						array_nodos[i].style.display='';
						ultnot_pivot_cyber=i;
						existe=1;
						i=elem_vis;
					}
					else
					{
						//alert(i);
						if(array_nodos[i].nodeType==1 && i<elem_vis-2)
						{
							

							array_nodos[i].style.display='';
							ultnot_pivot_cyber=i;
							existe=1;
							i=elem_vis;
						}
					}
				}
				if(existe==0)
				{
					if(document.all)
					{
						ultnot_pivot_cyber=0;
					}
					else
					{
						ultnot_pivot_cyber=1;
					}
					
					array_nodos[ultnot_pivot_cyber].style.display='';
				}
				break;
	}
}


/*
// Captura el tipo de cambio
function capturaresultadotcambio()
 {
    if (oXmlHttp.readyState == 4 && oXmlHttp.status == 200) 
	 {
	  var selecc=oXmlHttp.responseXML.getElementsByTagName('valor')[0].getAttribute('value');
	  document.getElementById("celdatipocambio").innerHTML=selecc;	
	 }
}

// Solicitud remota al tipo de cambio
function SolicitudTCambio(index,parm)
 {
    oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("post","/proxy/proxy.aspx",true);
    oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    oXmlHttp.onreadystatechange = capturaresultadotcambio;
    var vPost="tokey=" + acoockie[0] + "&idFunc=" + index + "&parm=" + parm;
    oXmlHttp.send(vPost);
 }
*/

function printform(idn,uri)
{
	window.open('/detalle/imprimir_detalle.aspx?idn=' + idn + '&uri=' + uri + '','xx','height=800,width=470,scrollbars=yes');
}

function printformfoto(idn,uri)
{
	window.open('/detalle/imprimir_detalle_foto.aspx?idn=' + idn + '&uri=' + uri + '','xx','height=520,width=610,scrollbars=yes');
}

function printformcaricatura(idn,uri)
{
	window.open('/detalle/imprimir_detalle_caricatura.aspx?idn=' + idn + '&uri=' + uri + '','xx','height=520,width=610,scrollbars=yes');
}

function ventanaenviar(URL){ 
    window.open(URL,"ventana1","width=500, height=200, scrollbars=no, menubar=no, location=no, resizable=no") 
}
 
function fncCorreoValidar(){
	var correo= document.getElementById("correo");
    var error = "";
	var continuar = 0;
    

	if(correo.value == ""){
	        error = "Ingrese el correo electrónico de la persona a enviar la noticia";
    	    continuar = 1;
	}

  
    	if(continuar == 1)
		{
			alert(error);
			return false;
		}
		else{
        	return true;
		}
}

function fncCorreoSubmit(){
		if(fncCorreoValidar()){
			document.form1.submit();
		}
}
// Solicitud remota al XML comentario
function SolicitudXmlPag(nombreelemento,url)
 {
  XmlEnlace = zXmlHttp.createRequest();
  XmlEnlace.open("GET", url, true);
  XmlEnlace.onreadystatechange = function() {
     if (XmlEnlace.readyState == 4 && XmlEnlace.status == 200) 
	 {
	    var selecc=XmlEnlace.responseXML.getElementsByTagName('numcomentarios')[0].text;
	    document.getElementById(nombreelemento).innerHTML=selecc;	
	 }
    }
  XmlEnlace.send(null);
 }
 
 function cargaInicial(){
	 MM_preloadImages('/images/bot_votar_on.gif','/images/bot_vermas_on.gif','/images/bot_entrar_on.gif','/images/bot_mas_galerias_on.gif','/images/bot_pc_on.jpg')
 }
 
 var listaConsolas = [];
 listaConsolas[0] = [];
 listaConsolas[1] = [];
 listaConsolas[2] = [];
 listaConsolas[3] = [];
 listaConsolas[4] = [];
 listaConsolas[5] = [];
 listaConsolas[6] = [];
 listaConsolas[7] = [];
 listaConsolas[8] = [];
listaConsolas[0][0] = 138;  
listaConsolas[0][1] = "PS2"; 
listaConsolas[0][2] = "/ps2/"; 
listaConsolas[1][0] = 139;  
listaConsolas[1][1] = "PS3"; 
listaConsolas[1][2] = "/ps3/"; 
listaConsolas[2][0] = 143;  
listaConsolas[2][1] = "XBOX 360"; 
listaConsolas[2][2] = "/xbox360/"; 
listaConsolas[3][0] = 141;  
listaConsolas[3][1] = "Wii"; 
listaConsolas[3][2] = "/wii/"; 
listaConsolas[4][0] = 135;  
listaConsolas[4][1] = "Gamecube"; 
listaConsolas[4][2] = "/gamecube/";
listaConsolas[5][0] = 136;  
listaConsolas[5][1] = "DS"; 
listaConsolas[5][2] = "/ds/";
listaConsolas[6][0] = 137;  
listaConsolas[6][1] = "PC"; 
listaConsolas[6][2] = "/pc/";
listaConsolas[7][0] = 140;  
listaConsolas[7][1] = "PSP"; 
listaConsolas[7][2] = "/psp/";
listaConsolas[8][0] = 142;  
listaConsolas[8][1] = "XBOX"; 
listaConsolas[8][2] = "/xbox/";

 function getLinkConsola(idConsola, params){
	 i=0;
	 
	 while(idConsola != listaConsolas[i][0]) i++;
	 document.write('<a href="'+listaConsolas[i][2]+'" '+params+'>' + listaConsolas[i][1] + '</a>')
 }
 
  function getNombreConsola(idConsola){
	 i=0;
	 consola=""
	 for (i=0; i<9; i++){
		 if (idConsola == listaConsolas[i][0]){
		 	consola=listaConsolas[i][1];
			break
		 }
	 }
	 if (consola != "") document.write(" (" + consola + ")")
 }
 
 function getPuntaje(valor){
	 descPuntos="Bueno"
	 if (valor < 3){
		 descPuntos="Muy Malo"
	 }else{
		 if (valor < 5){
		 descPuntos="Malo"
	 	}else{
		 	if (valor < 7){
		 	descPuntos="Regular"
	 		}else{
		 		if (valor < 9){
		 		descPuntos="Bueno"
	 			}else{
					if (valor < 11){
					descPuntos="Excelente"
					}	
				}
	 		}	
	 	}	
	 }
	 document.getElementById("boxNivel").innerHTML=descPuntos
 }
 
 function getSeccion(seccion, linkSeccion){
	
 		if (linkSeccion!= "")document.getElementById("mapaLink2").href=linkSeccion
		document.getElementById("mapaLink2").innerHTML=seccion

	 
 }
 
 subCat=0;
  function getSeccionInt(subCat){	
  		cabecera="/images/cabecera.jpg";
		linkSeccion="";
		seccion="";
		switch (subCat){
			case 0: 
				linkSeccion=""
				seccion="";
				cabecera="/images/cabecera.jpg";
				linkRSS="/rss/rssPortada.aspx";
			break;
			case 135: 
				linkSeccion="/gamecube/"
				seccion="Gamecube";
				cabecera="/images/cab_gamecube.jpg";
				linkRSS="/rss/rssGamecube.aspx";
			break;
			case 136: 
				linkSeccion="/ds/"
				seccion="Nintendo DS";	
				cabecera="/images/cab_ds.jpg";
				linkRSS="/rss/rssDs.aspx";	
			break;
			case 137: 
				linkSeccion="/PC/"
				seccion="PC";
				cabecera="/images/cab_pc.jpg";
				linkRSS="/rss/rssPc.aspx";
			break;
			case 138: 
				linkSeccion="/PS2/"
				seccion="PS2";	
				cabecera="/images/cab_ps2.jpg";
				linkRSS="/rss/rssPs2.aspx";
			break;
			case 139: 
				linkSeccion="/PS3/"
				seccion="PS3";	
				cabecera="/images/cab_ps3.jpg";
				linkRSS="/rss/rssPs3.aspx";
			break;
			case 140: 
				linkSeccion="/PSP/"
				seccion="PSP";
				cabecera="/images/cab_psp.jpg";
				linkRSS="/rss/rssPsp.aspx";
			break;
			case 141: 
				linkSeccion="/Wii/"
				seccion="Wii";	
				cabecera="/images/cab_wii.jpg";
				linkRSS="/rss/rssWii.aspx";
			break;
			case 142: 
				linkSeccion="/XBOX/"
				seccion="XBOX";	
				cabecera="/images/cab_xbox.jpg";
				linkRSS="/rss/rssXbox.aspx";
			break;
			case 143: 
				linkSeccion="/XBOX360/"
				seccion="XBOX360";
				cabecera="/images/cab_xbox360.jpg";
				linkRSS="/rss/rssXbox360.aspx";
			break;
			case 144: 
				linkSeccion="/Fotos/"
				seccion="Fotos";
				linkRSS="/rss/rssFotos.aspx";
  				cabecera="/images/cabecera.jpg";
			break;
			case 145: 
				linkSeccion="/Videos/"
				seccion="Videos";
				linkRSS="/rss/rssVideos.aspx";
			break;
			case 146: 
				linkSeccion="/Noticias/"
				seccion="Noticias";	
				linkRSS="/rss/rssNoticias.aspx";
			break;
			case 147: 
				linkSeccion="/Anime/"
				seccion="Anime";
				cabecera="/images/cab_anime.jpg";
				linkRSS="/rss/rssAnime.aspx";
			break;
			case 148: 
				linkSeccion="/Moviles/"
				seccion="M&oacute;viles";	
				cabecera="/images/cab_moviles.jpg";
				linkRSS="/rss/rssMoviles.aspx";
			break;
			case 152: 
				seccion="Juegos Flash";	
				linkSeccion="/flash/"
				linkRSS="/rss/rssFlash.aspx";
			break;
			case 153: 
				seccion="Lanzamientos";	
				linkSeccion="/lanzamientos/"
				linkRSS="/rss/rssPortada.aspx";
			break;
			case 154: 
				seccion="Archivo de Noticias";	
				linkSeccion="/archivonoticias/"
				linkRSS="";
			break;
			case 444: 
				seccion="Buscador";	
				linkSeccion="/buscador/"
				linkRSS="/";
			break;
		}
		
 		if (linkSeccion!= "") document.getElementById("mapaLink2").href=linkSeccion
		if (seccion!= "") document.getElementById("mapaLink2").innerHTML=seccion
		if (linkRSS!= "") document.getElementById("linkRSS").href=linkRSS
		document.getElementById("zonaCabecera").style.backgroundImage="url("+cabecera+")"

	 
 }
 
function displayHora() {
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "am";
if (hours > 11) amOrPm = "pm";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
dispTime = hours + ":" + minutes + " " + amOrPm;
document.write(dispTime);

}

function displayDate(){
	var months = new Array(11);
	
	var today = new Date();
	var month = today.getMonth();
	var date = today.getDate();
	var year = today.getYear();
	if (year <= 1000){
		year = year + 1900;
	}
	today = null;
		
	
	months[0] = "Enero";
	months[1] = "Febrero";
	months[2] = "Marzo";
	months[3] = "Abril";
	months[4] = "Mayo";
	months[5] = "Junio";
	months[6] = "Julio";
	months[7] = "Agosto";
	months[8] = "Septiembre";
	months[9] = "Octubre";
	months[10] = "Noviembre";
	months[11] = "Diciembre";

	currMonth=months[month]
	document.write( " " + date + " de " + currMonth + " de " + year);
}
 
 function getInfoJuego(){
	 if (document.getElementById("infoOculta")) document.getElementById("infoJuego").innerHTML=document.getElementById("infoOculta").innerHTML;
	 if (document.getElementById("puntajeOculto")) {
		document.getElementById("boxPuntos").innerHTML=document.getElementById("puntajeOculto").innerHTML;
	 	getPuntaje(document.getElementById("boxPuntos").innerHTML)
	 }
 }
 
 function setPuntosRevision(){
	 document.getElementById("textRank").innerHTML=document.getElementById("puntajeOculto").innerHTML
 }

 //SCRIPT ANIMACION: Google Galleria y Jquery


	

	
	function setIndiceAnim(valor){
		indiceAnim=valor;
		document.getElementById("linkAnima").innerHTML=linksAnim[indiceAnim][1];
		document.getElementById("resumenAnima").innerHTML=linksAnim[indiceAnim][2];
		document.getElementById("thumbAnim1").style.borderColor="white"
		document.getElementById("thumbAnim2").style.borderColor="white"
		document.getElementById("thumbAnim3").style.borderColor="white"
		document.getElementById("thumbAnim4").style.borderColor="white"
		document.getElementById("thumbAnim" + valor).style.borderColor="yellow"
		
	}
	
	function goEnlaceAnim(){
		document.location=linksAnim[indiceAnim][0];
	}
	
	function captionGaleria(caption){
		document.getElementById("captionGaleria").innerHTML=caption;
	}
	
	function verVideoGaleria(indice, limite){	
		for (i=1; i<=limite; i++){
			document.getElementById("video_" + i).style.display="none";			
		}
		document.getElementById("video_" + indice).style.display="";
		
	}
	
	var wall1;
	var wall2;
	var wall3;
	
	function setWall(ind1, ind2, ind3){
		wall1=imagenesWall[ind1];
		wall2=imagenesWall[ind2];
		wall3=imagenesWall[ind3];
		document.getElementById("wallImage").setAttribute("src",imagenesWall[ind1]);
	}
	
	function getWall(size, path){
		document.location="/images/download.aspx?size=" + size + "&path=" + path
	}
	var indiceJuegoNuevo=1;
	
	function verNuevoJuego(valor){
		document.getElementById("juego_1").style.display='none';
		document.getElementById("juego_2").style.display='none';
		document.getElementById("juego_3").style.display='none';
		document.getElementById("indNav1").style.color='#1A3655';
		document.getElementById("indNav2").style.color='#1A3655';
		document.getElementById("indNav3").style.color='#1A3655';
		document.getElementById("indNav1").style.backgroundColor='#a2e3ff';
		document.getElementById("indNav2").style.backgroundColor='#a2e3ff';
		document.getElementById("indNav3").style.backgroundColor='#a2e3ff';
		
		
		document.getElementById("indNav" + valor).style.color='#ffffff';
		document.getElementById("indNav" + valor).style.backgroundColor='#1A3655';
		document.getElementById("juego_" + valor).style.display='inline';
		
	}
	
	function setIndiceNuevoJuego(inc){
		indiceJuegoNuevo=indiceJuegoNuevo + inc;
		if (indiceJuegoNuevo == 4) indiceJuegoNuevo=1;
		if (indiceJuegoNuevo == 0) indiceJuegoNuevo=3;
		if (indiceJuegoNuevo > 0 && indiceJuegoNuevo < 4) verNuevoJuego(indiceJuegoNuevo);		
	}
	
	function setJuegoDesc(){
		document.getElementById("descFlash").innerHTML=document.getElementById("descHidden").innerHTML
	}
	
	//$(document).ready(function(){
//   $("#titFotos").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 30% when the page loads
//   $("#titFotos").hover(function(){
//   $(this).fadeTo("slow", 0.0); // This should set the opacity to 100% on hover
//   document.getElementById("titFotos").style.display="none"
//   },function(){
//   $(this).fadeTo("slow", 0.6); // This should set the opacity back to 30% on mouseout
//		});
//   });
 //////////////////
 
 function  ocultaMenu(){
	 document.getElementById("menuSecciones").style.display='none';
	 document.getElementById("menuFanaticos").style.display='none';
	 document.getElementById("buscador").style.display='';
 }
 
 function verMenu(valor){
	 ocultaMenu();
	 document.getElementById("buscador").style.display='none';
	 document.getElementById(valor).style.display='';
 }
 
function ventanaSecundaria (URL){ 
    window.open(URL,"ventana1","width=500, height=200, scrollbars=no, menubar=no, location=no, resizable=no") 
 } 

var tipoBusca=1
	
	function setTipoBusqueda(valor){
		tipoBusca=valor
	}
	function buscarTexto(){
		textoBusca=document.getElementById("txtBuscador").value
		
		if (tipoBusca != 0 && textoBusca != ""){
			document.getElementById("txtNOTICIA").value=textoBusca;
			document.getElementById("radioopcion").value=tipoBusca;
			document.buscadorPeru.submit();
		}
		
	}
	
	function buscarJuego(){
		textoBusca=document.getElementById("txtKey").value
		
		if (textoBusca != ""){
			document.getElementById("keyFlash").value=textoBusca;
			document.buscadorFlash.submit();
		}
		
	}