 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('/entretenimiento2008/images/bot_titulares_on.gif',
				 '/entretenimiento2008/images/bot_vistos_on.gif',
				 '/entretenimiento2008/images/bot_perucom_on.gif');

var originalColorDivListado;

function asignarImagenDiv(imagen, objetoDiv)
{
	//alert(imagen)
	//alert(objetoDiv)
	var oimg = document.getElementById(objetoDiv);
	oimg.src = imagen;
	//alert(imagen)
}

function asignarEstiloSeccion(estilo, objetoDiv,indice1, indice2)
{		
	//alert(objetoDiv+'_'+indice1)
	//alert(objetoDiv+'_'+indice2)
	var oDiv1 = document.getElementById(objetoDiv+'_'+indice1);	
	var oDiv2 = document.getElementById(objetoDiv+'_'+indice2);
	
	oDiv1.className=estilo+'1';
	oDiv2.className=estilo+'2';


}



function menuRoll(rollIni,rollFin){
	document.getElementById(rollIni).style.display="inline";
	document.getElementById(rollFin).style.display="none";
}

function fncChangeColor(objetodiv)
 {
  if(document.all){ 
     originalColorDivListado=objetodiv.currentStyle.backgroundColor;
	 objetodiv.style.backgroundColor='#EADEEB';
	 objetodiv.style.Color='Black';
   }
  else{
     originalColorDivListado=objetodiv.style.backgroundColor;
	 objetodiv.style.backgroundColor='#EADEEB';
	 objetodiv.style.Color='Black';
   }
 }

function fncChangeColorOrig(objetodiv)
 {
  if(document.all){ 
   objetodiv.style.backgroundColor=originalColorDivListado;
   }
  else
   objetodiv.style.backgroundColor=originalColorDivListado; 
 }

 //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 "";
   }


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);
 }
//--------------------MODIFCACIONES DE ROBERTO---------------
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
//-----------------------------------------------------------
 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;
   }
   
}

PANEL_1_DIV_CURRENT_ACTIVO = 0; //este panel corresponde a {Relacionados,Titulares,Vistas,PeruCom
PANEL_1_DIV_NEXT_HIDEN = 0;

function showDIV(panel){
    switch(panel){
    case 0:{
    
        break;
    }
    case 1:{
        switch(PANEL_1_DIV_CURRENT_ACTIVO){
            case 0:{
                break;
            }
            case 1:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoTitulares",PANEL_1_DIV_NEXT_HIDEN,false);
                break;
            }
            case 2:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoVistos",PANEL_1_DIV_NEXT_HIDEN,false);
                break;
            }
            case 3:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoPerucom",PANEL_1_DIV_NEXT_HIDEN,false);
                break;
            }
        }
    break;
    }
    case 2:{
    break;
    }
    }
}

function hidenDIV(panel){
    switch(panel){
    case 0:{
        
        break;
    }
    case 1:{
        switch(PANEL_1_DIV_CURRENT_ACTIVO){
            case 0:{
                break;
            }
            case 1:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoTitulares",PANEL_1_DIV_NEXT_HIDEN,true);
                break;
            }
            case 2:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoVistos",PANEL_1_DIV_NEXT_HIDEN,true);
                break;
            }
            case 3:{
                PANEL_1_DIV_NEXT_HIDEN = onShowHidenDIV("ColCentral_ListadoPerucom",PANEL_1_DIV_NEXT_HIDEN,true);
                break;
            }
        }
    break;
    }
    case 2:{
    
    break;
    }
    }

}
 function onShowHidenDIV(contenedor,indexdivHiden,accion)
 {
    if(indexdivHiden != -1){
        var oDIVchildren = document.getElementById(contenedor).childNodes;
        if(accion){
            if(indexdivHiden < oDIVchildren.length ){
                oDIVchildren[indexdivHiden].style.display='none';
                indexdivHiden = indexdivHiden + 1;
            }
        }else{
            if(indexdivHiden > 0){
               indexdivHiden = indexdivHiden - 1;
               oDIVchildren[indexdivHiden].style.display='';
            }
        }
        return indexdivHiden;
   }else{
        document.getElementById(contenedor).style.display = (document.getElementById(contenedor).style.display == 'none')?'':'none';
   }
 }
 //Construye la cadena de los div's
 function strPrintDivCentral(titulo,url)
  {
	 return('<div class="dv_listadonoticias" onMouseOut="fncChangeColorOrig(this);" onMouseOver="fncChangeColor(this);">\
           <div  class="dv_flecharoja">&raquo;</div><div class="textitularescentral">'+ 
           '<a href="'+url+'">'+titulo+'</a><br/>'+'</div></div>');
	}	 
	 
 function capturaresultado()
  {
    if (oXmlHttp.readyState == 4 && oXmlHttp.status == 200) 
		 {
              document.getElementById("msgLoadingCentral").style.display='none';
		      var selecc=oXmlHttp.responseXML.getElementsByTagName('seleccion')[0].getAttribute('value');
			  if(selecc==1)
			  {
			     PANEL_1_DIV_CURRENT_ACTIVO = 1; //TITULARES
				 document.getElementById("ColCentral_ListadoVistos").style.display='none';
				 document.getElementById("ColCentral_ListadoPerucom").style.display='none';
				 document.getElementById("ColCentral_ListadoRelacionadas").style.display='none';

			   var strHTML='';
			   var nodo = oXmlHttp.responseXML.getElementsByTagName('nota');
			   for (var i = 0; i < nodo.length; i++) 
			    {
			     strHTML+=strPrintDivCentral(nodo[i].childNodes[0].text,nodo[i].childNodes[1].text);
			    }
				 document.getElementById("ColCentral_ListadoTitulares").innerHTML=strHTML;	
                 document.getElementById("ColCentral_ListadoTitulares").style.display='';
			  }			 
  		      else if(selecc==2)
			  {
			     PANEL_1_DIV_CURRENT_ACTIVO = 2; //VISTOS
				 document.getElementById("ColCentral_ListadoTitulares").style.display='none';
				 document.getElementById("ColCentral_ListadoPerucom").style.display='none';
				 document.getElementById("ColCentral_ListadoRelacionadas").style.display='none';

				 var strHTML='';
			   var nodo = oXmlHttp.responseXML.getElementsByTagName('nota');
			   for (var i = 0; i < nodo.length; i++) 
			    {
			     strHTML+=strPrintDivCentral(nodo[i].childNodes[0].text,nodo[i].childNodes[1].text);
			    }
				 document.getElementById("ColCentral_ListadoVistos").innerHTML=strHTML;	
                 document.getElementById("ColCentral_ListadoVistos").style.display='';
			 }	
			 else if(selecc==3){
			 
			     PANEL_1_DIV_CURRENT_ACTIVO = 3; //PERUCOM
				 document.getElementById("ColCentral_ListadoVistos").style.display='none';
				 document.getElementById("ColCentral_ListadoTitulares").style.display='none';
				 document.getElementById("ColCentral_ListadoRelacionadas").style.display='none';

				 var strHTML='';
			     var nodo = oXmlHttp.responseXML.getElementsByTagName('nota');
			     for (var i = 0; i < nodo.length; i++) 
			     {
			      strHTML+=strPrintDivCentral(nodo[i].childNodes[0].text,nodo[i].childNodes[1].text);
			     }
				 document.getElementById("ColCentral_ListadoPerucom").innerHTML=strHTML;	
                 document.getElementById("ColCentral_ListadoPerucom").style.display='';
			 }
	   }  
  }
		 
 function Solicitud(index,parm)
  {
	  if(index==0)
		 {
			//Ha seleccionado las noticias relacionadas
			document.getElementById("ColCentral_ListadoVistos").style.display='none';
			document.getElementById("ColCentral_ListadoPerucom").style.display='none';
      document.getElementById("ColCentral_ListadoTitulares").style.display='none';
			document.getElementById("ColCentral_ListadoRelacionadas").style.display='';
		 }
		else
		 {  
	    document.getElementById("msgLoadingCentral").style.display='inline';
      oXmlHttp = zXmlHttp.createRequest();
      oXmlHttp.open("post","/entretenimiento2008/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);
		 }	
  }
  

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){
        
        oXmlHttp = zXmlHttp.createRequest();
        oXmlHttp.open("post","/entretenimiento2008/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)
{
    param = 'us:\''+ user + '\'';
    param = param+','+'pw:\''+ pass + '\'';
    param = param+','+'idcom:\''+document.getElementById('idcom').value + '\'';
    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,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);
    }
    else
    {
        var curleft = curtop = 0;
        if (e.offsetParent)
        {
            do
            {
                curleft += e.offsetLeft;
			    curtop += e.offsetTop;
		     }
		     while (e = e.offsetParent);
	    }
	    else
	    {
	        curtop=350;
	        curleft=200;
	    }
        curtop=curtop - 70;
        curleft=curleft + 50;
        document.getElementById('logalert').style.top= curtop + 'px';
        document.getElementById('logalert').style.left= curleft + 'px';
	    document.getElementById('logalert').style.display='';
    }
    
}

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 = "/entretenimiento2008/images/votaciones_estrellagris.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 = '/entretenimiento2008/images/rating_on.gif';
			    }
			    else if(i == insert_half)
			    {
				   document.images['rating_' + i].src = '/entretenimiento2008/images/rating_half.gif';
			    }
			    else
			    {
				    document.images['rating_' + i].src = '/entretenimiento2008/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)
{
    oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("post","/homepage/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");
            var strTabla = ''
            strTabla = strTabla + arr;
            div.innerHTML = strTabla;
			//alert(strTabla)
        }
        else
        {
            saveResult("An error occurred: " + oXmlHttp.statusText);
        }
    }   
}

function loginEmail(){
	document.getElementById('txtemail').value = document.getElementById('fUser').value;
	document.getElementById('txtpass').value = document.getElementById('fPass').value;
	document.mailLogin.submit();
}

function sendGourmet(){
	
	document.getElementById('bnombre').value = document.getElementById('txtGourmet').value;
	document.getElementById('distrito').value = document.getElementById('lstDistritos').value;
	document.formGourmet.submit();
	
}

function saveResult(mensaje)
{
    alert(mensaje);
}

function buscapelicula(c) 
{
	var v = c.options[c.selectedIndex].value
	if (v != "") document.location.href = "http://cine.peru.com/pelicula.asp?idc=1&id="+v
}
function buscateatro(c) 
{
var v = c.options[c.selectedIndex].value
if (v != "") document.location.href = "http://cine.peru.com/teatro.asp?idc=1&id="+v
}
										 
var currMonth="";

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 saveResult(mensaje)
{
    alert(mensaje);
}
function fncSubmitComentario(hdParam)
{
    var objparm = document.getElementById(hdParam);
     objparm.value = 1;
    document.formComs.submit();
}
var idblog=1;
function setValorBlog(valor){	
	ocultaBlogs()
	idblog=valor
	verBlogs()
}


function nextBlog(){	
	if (idblog <= 7) {
		ocultaBlogs()
		idblog=idblog+2
		verBlogs()
	}
}

function prevBlog(){
	if (idblog >= 3) {
		ocultaBlogs()
		idblog=idblog-2
		verBlogs()
	}
}

function verBlogs(){	
	blog2=idblog+1	
	document.getElementById('itemBlog_' + idblog).style.display='inline'
	document.getElementById('itemBlog_' + blog2).style.display='inline'
}
function ocultaBlogs(){	
	blog2=idblog+1	
	document.getElementById('itemBlog_' + idblog).style.display='none'
	document.getElementById('itemBlog_' + blog2).style.display='none'
}

var idVideo=1;
var idMedia=1;
tipoMedia="Video"
function setValorVideo(valor){	
	ocultaVideos()
	idVideo=valor
	verVideos()
}

function switchMedia(tipo)
{		
	ocultaMedia()
	cerrarVideo()
	idMedia=1;
	document.getElementById('cajaMedia').className="fondo" + tipo;	
	document.getElementById('puntoMedia1').className="punto" + tipo + "On";
	document.getElementById('puntoMedia2').className="punto" + tipo + "Off";
	document.getElementById('puntoMedia3').className="punto" + tipo + "Off";	
	document.getElementById('contenidoFotos').style.display="none";
	document.getElementById('contenidoVideos').style.display="none";
	document.getElementById('contenido' + tipo).style.display="inline";
	
	if (tipo=="Videos") tipoMedia="Video"
	if (tipo=="Fotos") tipoMedia="Foto"
	
	setValorMedia(1)


}
function switchMedia2(tipo)
{		
	ocultaMedia()
	cerrarVideo()
	idMedia=1;
	document.getElementById('cajaMedia').className="fondo" + tipo;
//	document.getElementById('puntoMedia1').className="punto" + tipo + "On";
//	document.getElementById('puntoMedia2').className="punto" + tipo + "Off";
//	document.getElementById('puntoMedia3').className="punto" + tipo + "Off";	
	document.getElementById('contenidoFotos').style.display="none";
	document.getElementById('contenidoVideos').style.display="none";
	document.getElementById('botFotos').style.display="none";
	document.getElementById('botVideos').style.display="none";
	document.getElementById('contenido' + tipo).style.display="inline";
	document.getElementById('bot' + tipo).style.display="inline";
	
	if (tipo=="Videos") tipoMedia="Video"
	if (tipo=="Fotos") tipoMedia="Foto"
	
	setValorMedia(1)


}
function setValorMedia(valor){	
	ocultaMedia()
	idMedia=valor
	verMedia()
}
function nextMedia(){
	if (idMedia <= 7) {
		ocultaMedia()
		idMedia=idMedia+2
		verMedia()
	}
}

function prevMedia(){	
	if (idMedia >= 3) {
		ocultaMedia()
		idMedia=idMedia-2
		verMedia()
	}
}

function verMedia(){
	document.getElementById('item'+tipoMedia+'_' + idMedia).style.display='inline'
	idTemp=idMedia+1
	document.getElementById('item'+tipoMedia+'_' + idTemp).style.display='inline'
}
function ocultaMedia(){	
	document.getElementById('item'+tipoMedia+'_' + idMedia).style.display='none'
	idTemp=idMedia+1
	document.getElementById('item'+tipoMedia+'_' + idTemp).style.display='none'
}

function nextVideo(){
	if (idVideo <= 7) {
		ocultaVideos()
		idVideo=idVideo+2
		verVideos()
	}
}

function prevVideo(){	
	if (idVideo >= 3) {
		ocultaVideos()
		idVideo=idVideo-2
		verVideos()
	}
}

function verVideos(){	
	video2=idVideo+1	
	document.getElementById('itemVideo_' + idVideo).style.display='inline'
	document.getElementById('itemVideo_' + video2).style.display='inline'
}
function ocultaVideos(){	
	video2=idVideo+1	
	document.getElementById('itemVideo_' + idVideo).style.display='none'
	document.getElementById('itemVideo_' + video2).style.display='none'
}

 var displayDown=false;
  function setVideo(videoURL){
  	
	if (displayDown==false){
		toggleSlide('displayVideo');
		displayDown=true;
	}
	var params = { allowScriptAccess: "always" };
    var atts = { id: "myytplayer" };
	document.getElementById('testdiv').innerHTML=""
	document.getElementById('testdiv').innerHTML="<div id='ytapiplayer'></div>"
    swfobject.embedSWF(videoURL+"&autoplay=1&enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "290", "225", "8", null, null, params, atts);
	document.getElementById('margenEntrete').style.height='230px'
	callCertificaClick(vcertifica_sitio, 'portada/videos')
	//alert(230)
	}
	
	function setAd(){

	if (displayDown==false){
		toggleSlide('displayAd');
	}
	document.getElementById('displayAdIni').style.display="none"
   
	
	}
	
	function cerrarVideo(){
		slideup('displayVideo')
		document.getElementById('testdiv').innerHTML=""
		document.getElementById('margenEntrete').style.height='8px'
	}
	
	function cerrarAd(){
		 cerrarAd2();
	}
	
	function cerrarAd2(){
		slideup('displayAd')
		document.getElementById('displayAdIni').style.display="inline"
		//document.getElementById('testdivAd').innerHTML=""
	}
	
	
	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 buscarAmarillas(){
		textoBusca=document.getElementById("txtAmarillas").value
		if (textoBusca != ""){
			window.open('http://app06.interlatin.com/PaginasAmarillas/resultados.asp?x=1&empresa=' + textoBusca.replace(/ /g,'+'))
		}
	}
	
	var newsActualidad=2;
	var newsDeportes=2;
	var newsEconomia=2;
	var newsEspect=2;
	function addNews(tipo){
		switch (tipo){
			case "Actualidad": 
				if (newsActualidad<8) {
					newsActualidad++;
					document.getElementById('item_93_'+newsActualidad).style.display='inline'					
				}
			break;
			case "Deportes": 
				if (newsDeportes<8) {
					newsDeportes++;
					document.getElementById('item_164_'+newsDeportes).style.display='inline'
				}
			break;
			case "Economia": 
				if (newsEconomia<8) {
					newsEconomia++;
					document.getElementById('item_95_'+newsEconomia).style.display='inline'
				}
			break;
			case "Espect": 
				if (newsEspect<8) {
					newsEspect++;
					document.getElementById('item_96_'+newsEspect).style.display='inline'
				}
			break;
		}
		
	}
	function removeNews(tipo){
		
		switch (tipo){
			case "Actualidad": 
				if (newsActualidad>2) {
					document.getElementById('item_93_'+newsActualidad).style.display='none'
					newsActualidad--;					
				}
			break;
			case "Deportes": 
				if (newsDeportes>2) {
					document.getElementById('item_164_'+newsDeportes).style.display='none'
					newsDeportes--;
				}
			break;
			case "Economia": 
				if (newsEconomia>2) {
					document.getElementById('item_95_'+newsEconomia).style.display='none'
					newsEconomia--;
				}
			break;
			case "Espect": 
				if (newsEspect>2) {
					document.getElementById('item_96_'+newsEspect).style.display='none'
					newsEspect--;
				}
			break;
		}
		

	}
	
	var idNotaPrincipal
	idNotaPrincipal=1
	function verNoticia(valor){		
		document.getElementById('noticiaPrincipal_'+idNotaPrincipal).style.display='none'		
		document.getElementById('noticiaPrincipal_'+valor).style.display='inline'
		document.getElementById('link_'+ valor +'_'+valor).className='linkBotonNoticiaOn'
		idNotaPrincipal=valor
		//cert_registerHit(vcertifica_sitio, 'http://www.peru.com/portada/NotaPrincipal_'+ valor, 'certifPivot')
		//cert_getURL2(vcertifica_sitio, 'http://www.peru.com/portada/NotaPrincipal_'+ valor) 
		callCertificaClick(vcertifica_sitio, 'portada/NotaPrincipal_'+ valor)
	}
	
function fnAdHidden(nombreContenedor){
		//jlaines270209
		document.getElementById(nombreContenedor).style.overflow = 'hidden';
	//	alert(99)//var myAdDiv = document.getElementById(nombreContenedor);
		//if (myAdDiv) {
		//	myAdDiv.style.overflow = 'hidden';
		//};
	}		
	function fnAdShow(nombreContenedor){
		//jlaines270209
		document.getElementById(nombreContenedor).style.overflow = 'visible';
		document.getElementById('divDonofrio').style.position= 'absolute';
	//alert('d')
		//var myAdDiv = document.getElementById(nombreContenedor);
		//if (myAdDiv) {
		//	myAdDiv.style.overflow = 'visible';
		//};
	}
	function move_box() {   
    var offset = 0; // set offset (likely equal to your css top)    
    var element = document.getElementById('fixed_div'); 
    element.style.top = (document.documentElement.scrollTop + offset) + 'px';
  }
  function move_box2() {   
   var offset = 0; // set offset (likely equal to your css top)    
   var element = document.getElementById('fixed_div');  
   var element2 = document.getElementById('fixTop');   
   element.style.top = (document.documentElement.scrollTop + 1) + 'px';
   element.style.left = (element2.style.left + 0) + 'px';
  }

 function move_box3() 
  {   
   var offset = 0; // set offset (likely equal to your css top)    
   var element = document.getElementById('fixed_div');  
   var element2 = document.getElementById('fixTop');   
   element.style.top = (document.documentElement.scrollTop + 10) + 'px';
   element.style.left = (element2.style.left + 970) + 'px';
  }
 
 function ocultaAnim(){ AdLayer.style.visibility="hidden"}
 
 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', ancho,
			'height', alto,
			'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', 'White',
			'name', id,
			'menu', 'true',
			'allowFullScreen', 'false',
			'wmode', 'transparent',
			'allowScriptAccess','sameDomain',
			'movie', valor,
			'salign', ''
			); //end AC code
		}
	}
