 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];}
 }

MM_preloadImages('http://cdn.peru.com/deportes/images/iconos/ico_act_subacuaticas_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_aerodeportiva_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_ajedrez_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_andinismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_atletismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_automovilismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_badminton_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_balonmano_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_basquetbol_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_beisbol_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_billar_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_bowling_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_boxeo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_canotaje_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_ciclismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_dep_ecuestres_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_dep_extremos_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_esgrima_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_esqui_acuatico_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_bochas_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_ajedrez_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_andinismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_atletismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_esqui_nordico_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_fisicoculturismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_futbol_americano_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_futbol_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_golf_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_halterofilia_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_gimnasia_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_hipica_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_hockey_hierba_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_judo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_karate_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_kung_fu_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_lucha_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_motociclismo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_natacion_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_polo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_remo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_rugby_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_squash_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tabla_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tae_kwon_do_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tenis_mesa_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tenis_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tiro_arco_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_tiro_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_triatlon_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_vale_todo_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_vela_on.gif',
				 'http://cdn.peru.com/deportes/images/iconos/ico_voleibol_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_notasrelacionadas.gif',
				 'http://cdn.peru.com/deportes/images/bot_titulares_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_vistos_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_perucom_on.gif',
                 'http://cdn.peru.com/deportes/images/bot_mas_fotos_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_mas_videos_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_ver_mas_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_votar_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_mas_titulares_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_mas_deportes_on.gif',
				 'http://cdn.peru.com/deportes/images/bot_mas_not_perucom_on.gif');

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","#FFEFE5");
 }


 //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('divNoticia');
   var p = oDivnoticia.getElementsByTagName('div');
   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('divNoticia');
   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, 'Deportes/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","/deportes/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 
 }

function initcoockie(){
    var v1 = GetCookie("userkey",document.cookie);
    if(v1!=''){
        var o = eval("(" + v1 + ")"); 
        if(o){
        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, 'Deportes/Votaciones');
        oXmlHttp = zXmlHttp.createRequest();
        oXmlHttp.open("post","/deportes/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 = "http://cdn.peru.com/deportes/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 = 'http://cdn.peru.com/deportes/images/votaciones_estrellaamarilla.gif';
			    }
			    else if(i == insert_half)
			    {
				   document.images['rating_' + i].src = 'http://cdn.peru.com/deportes/images/rating_half.gif';
			    }
			    else
			    {
				    document.images['rating_' + i].src = 'http://cdn.peru.com/deportes/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, 'Deportes/Encuesta');
    oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("post","/deportes/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 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;
	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;
	}
}




function printform(idn,uri)
{
	window.open('/deportes/detalle/imprimir_detalle.aspx?idn=' + idn + '&uri=' + uri + '','xx','height=800,width=470,scrollbars=yes');
}

function printformfoto(idn,uri)
{
	window.open('/deportes/detalle/imprimir_detalle_foto.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";
    	    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 verAdManual(valor, id, ancho, alto){
	if (AC_FL_RunContent == 0 ) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '942',
			'height', '234',
			'src', valor,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', id,
			'bgcolor', '#ffffff',
			'name', id,
			'menu', 'true',
			'allowFullScreen', 'false',
			'wmode', 'transparent',
			'allowScriptAccess','sameDomain',
			'movie', valor,
			'salign', ''
			); //end AC code
		}
	}
function ocultaAnim(){
AdLayer.style.visibility="hidden"
}