// despliega la hora
/*setInterval("tiempo()",100);
function tiempo()
{
var hora= new Date();
h=hora.getHours();
m=hora.getMinutes();
s=hora.getSeconds();
tmp= h +":" +m +":"+s ;
//document.getElementById("tmpo").innerHTML=tmp;
}*/

function imprimir(URL)
{
	
	a="../imprimir/impresion.asp?url="+URL
	window.open(a,"","width=800,height=800,scrollbars=1")
}
function ldd()
{
//alert("in")
	window.location="../lodeldia/default.asp"
}

function mandar(URL)
{
	
	a="../enviar/enviarNota.asp?url="+URL
		a="http://www.laprensagrafica.com/zinfodesa/enviarNota.asp?url="+URL
	window.open(a,"","width=500,height=600")
}

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_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 openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}


//evita que se introduzcan caracteres que no son alfanumericos

function presionar(e)
{
	
var v=window.event ? e.keyCode : e.which
var b=window.event?1:0
//alert(window.event)
var valor=String.fromCharCode(v)
reg = /\w/;
//alert (v)
if( b==0 && (v==0 || v== 8))
{
	return true
}
return reg.test(valor)
}

function validar_enc(id)
{
	 //alert(document.encuesta.elements.length)
	//alert(id)
	

 for (i=0 ;i<document.encuesta.elements.length; i++)

 	if (document.encuesta.elements[i].checked==true)
		{
			
		v=window.open('/encuesta/almacenar.asp?id='+ id +'&rad='+document.encuesta.elements[i].value,'Validar','width=566,height=425')
		v.focus()
		//document.cookie='voto=1;expires=1'
		//document.getElementById("votarEncuesta").width=0
		//document.getElementById("votarEncuesta").height=0
		//alert(document.cookie)
		//alert(document.encuesta.elements[i].checked +" " + i) 
		deshabilitar()
		return	
		}
		
alert("Debe seleccionar una respuesta")
	
}



function deshabilitar()
{
	for(i=0; i<document.encuesta.elements.length;i++)
		{
			
		document.encuesta.elements[i].checked=false
		document.encuesta.elements[i].disabled=true
		document.getElementById("Bvotar").disabled=true
		
		}

}



function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return 0;
}





function NOTA_onclick(valor)
        {
        //if (typeof(ventana_bknews) == "undefined" || ventana_bknews.closed == true)
          //{
	  	  //ElLink="../ultimahora/data_frames.htm" 
		  ElLink="/ultimahora/data.htm#" + valor
          ventana_bknews=window.open(ElLink,"BreakinNews","scrollbar=yes, toolbar=no,menubar=no,resizealbe=no, width=566, height=425,scrollbars")
         // }
       // else
         // {
          ventana_bknews.focus()
         // ventana_bknews.parent.location.reload()
          //}
        }
		
function resultados(id)
{

	//ventana=window.open('http://www.laprensagrafica.com/encuesta/resultados.asp?id=' + id ,'','width=400,height=400')	
	//ventana.focus()	
	
	//if (typeof(ventana_bknews) == "undefined" || ventana_bknews.closed == true)
          //{
	  	  // ElLink="../ultimahora/data.htm#" 
		  ElLink='http://www.laprensagrafica.com/encuesta/resultados.asp?id=' + id
          ventana=window.open(ElLink,"BreakinNews","scrollbar=yes, toolbar=no,menubar=no,resizealbe=no, width=566, height=425,scrollbars")
         // }
       // else
         // {
          ventana.focus()
         // ventana_bknews.parent.location.reload()
          //}
	 

}
		
		//*******************************para otra encuesta*******************************
function validar_enc02(id)
{
	 //alert(document.encuesta.elements.length)
	//alert(id)
	

 for (i=0 ;i<document.encuesta02.elements.length; i++)

 	if (document.encuesta02.elements[i].checked==true)
		{
			
		v=window.open('/encuesta/almacenar.asp?id='+ id +'&rad='+document.encuesta.elements[i].value,'Validar','width=400,height=400')
		v.focus()
		//document.cookie='voto=1;expires=1'
		//document.getElementById("votarEncuesta").width=0
		//document.getElementById("votarEncuesta").height=0
		//alert(document.cookie)
		//alert(document.encuesta.elements[i].checked +" " + i) 
		deshabilitar02()
		return	
		}
		
alert("Debe seleccionar una respuesta")
	
}



function deshabilitar02()
{
	for(i=0; i<document.encuesta02.elements.length;i++)
		{
			
		document.encuesta02.elements[i].checked=false
		document.encuesta02.elements[i].disabled=true
		document.getElementById("Bvotar02").disabled=true
		
		}

}


    /* MUESTRA LA INFORMACION DEL PIE DE PAGINA*/
   /* this function shows the pop-up when
     user moves the mouse over the link */
    function Show(ev)
    {
		if(!document.all)
		{
			/* get the mouse left position */
			x = ev.pageX + document.body.scrollLeft;
			/* get the mouse top position  */
			y = ev.pageYB + document.body.scrollTop + 35;
			/* display the pop-up */
			document.getElementById("Popup").style.display="block";
			/* set the pop-up's left */
			document.getElementById("Popup").style.left = x-75;
			/* set the pop-up's top */
			document.getElementById("Popup").style.top = y-250;
		}
		else
		{
			/* get the mouse left position */
			x = event.clientX + document.body.scrollLeft;
			/* get the mouse top position  */
			y = event.clientY + document.body.scrollTop + 35;
			/* display the pop-up */
			document.getElementById("Popup").style.display="block";
			/* set the pop-up's left */
			document.getElementById("Popup").style.left = x-75;
			/* set the pop-up's top */
			document.getElementById("Popup").style.top = y-250;
			
		}
    }
    /* this function hides the pop-up when
     user moves the mouse out of the link */
    function Hide()
    {
        /* hide the pop-up */
        document.getElementById("Popup").style.display="none";
    }

		
/*function hora()
{
	var fecha= new Date();
	//fecha.setHours(12,00,00)
	document.getElementById("tmpo").innerHTML="<font color=white>" + ceros(fecha.getHours(),"h") + ":" + ceros(fecha.getMinutes(),"m") + "."+cola(ceros(fecha.getHours()))+"</font>"
}*/

function ceros(valor,tipo)
{
	var resultado="";
	resultado=parseInt(valor)<10?"0"+valor:valor
	
	//alert(tipo=="h")
	if(tipo=="h")
	{
		resultado=parseInt(valor)>12?(parseInt(valor)-12):valor;
		resultado=parseInt(valor)<10?"0" + resultado:resultado;
		
	}
	
	return resultado
	
}

function cola(valor)
{

	var colita=""
	colita=parseInt(valor)<12?" a.m":" p.m."

	return colita
}

function pubSplah(nombre)
{

	document.getElementById(nombre).style.visibility= "hidden"
	
}
