function WindowCenter (url,ancho, alto, stl) {
  var width = ancho
  var height = alto
  var x=(640 - width)/2
  var y=(480-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2

  window.width=width
  window.height=height
  window.x=x
  window.y=y

  estilo = stl ? stl : "toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0"
  window.open(url,"newwin", estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px")
}


function calcula(fecha)
{
 hoy = new Date()
 hasta = new Date(fecha) // Cambiar aquí el valor de la fecha y hora elegida.
 DD = (hasta - hoy) / 86400000
 hh = (DD - Math.floor(DD)) * 24
 mm = (hh - Math.floor(hh)) * 60
 ss = (mm - Math.floor(mm)) * 60
 document.getElementById('hora').innerHTML =  Math.floor(DD) + " Días, " + Math.floor(hh) + " Horas, " + Math.floor(mm) + " Minutos y " + Math.floor(ss) + " Segundos. "
 if (hasta < hoy)
 {
  document.getElementById('hora').innerHTML = "La Jornada Finalizo"
  cleartimeout(tictac)
 }
 else tictac = setTimeout("calcula()",1000)
} 

function cargar_contenido(page,target,id)
{

    document.getElementById(target).innerHTML = '<p align="center"><img src="images/load.gif"><br /><span style="color:#ff4d21; text-decoration: blink;">Cargando ...</span></p>';
    var myConn = new XHConn();
        if (!myConn) alert("XMLHTTP no esta disponible. Inténtalo con un navegador más actual.");
        var peticion = function (oXML) {  document.getElementById(target).innerHTML = oXML.responseText; };
        myConn.connect(page , "GET", "id=" + id , peticion);
} 

function enviar_formulario(columnas){
   document.forms[columnas].submit();
} 

function validar_columna()
{
	conf = confirm("Quieres Eliminar la Columna?");
	if (conf)
		return true;
	else
		return false;
}

function validar_resultado()
{
	conf = confirm("Quieres Eliminar el Resultado?");
	if (conf)
		return true;
	else
		return false;
}

function validar_pronostico()
{
	conf = confirm("Quieres Eliminar el Pronostico?");
	if (conf)
		return true;
	else
		return false;
}

function cargar_contenido_escrutar(page,target,p1)
{
    document.getElementById(target).innerHTML = '<p align="center"><img src="images/load.gif"><br /><span style="color:#ff4d21; text-decoration: blink;">Cargando ...</span></p>';
    var myConn = new XHConn();
        if (!myConn) alert("XMLHTTP no esta disponible. Inténtalo con un navegador más actual.");
        var peticion = function (oXML) {  document.getElementById(target).innerHTML = oXML.responseText; };
        myConn.connect(page , "GET", "p1=" +p1 , peticion);
}
