// INSTANCIA XMLhttpRequest ////////////////////////
function getXMLHttpRequest(){try {req = new XMLHttpRequest();} catch (err1) {try { req = new ActiveXObject("Msxml2.XMLHTTP");} catch (err2) {try {req = new ActiveXObject("Microsoft.XMLHTTP");	} catch (err3){	req = false;}}} return req;	}

var obtenerRespaldo=getXMLHttpRequest();
var cargando = "<img src='imagenes/cargando.gif'>";

petPDF = getXMLHttpRequest();

function cClase(div,classe) { document.getElementById(div).className = classe; }
function mostrar(div) { document.getElementById(div).style.display = ''; }
function ocultar(div) { document.getElementById(div).style.display = 'none'; }
function MostrarFecha()
   {
   var nombres_dias = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado")
   var nombres_meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre")

   var fecha_actual = new Date()

   dia_mes = fecha_actual.getDate()		//dia del mes
   dia_semana = fecha_actual.getDay()		//dia de la semana
   mes = fecha_actual.getMonth() + 1
   anio = fecha_actual.getYear()

   if (anio < 100)					//pasa el aï¿½o a 4 digitos
      anio = '19' + anio
   else if ( ( anio > 100 ) && ( anio < 999 ) ) {	//efecto 2000
      var cadena_anio = new String(anio)
      anio = '20' + cadena_anio.substring(1,3)
   }
 
   //escribe en pagina
   document.write(nombres_dias[dia_semana] + ", " + dia_mes + " de " + nombres_meses[mes - 1] + " de " + anio)
}
function Abrir_VentanaPDF(el_url) { 
	var especificaciones="top=100, left=150, location=no, toolbars=no, status=no, scrollbars=yes, menubar=no, resizable=yes, width=450,height=500" 
	var titulo="Titulo"
	window.open(el_url,titulo,especificaciones); 
}
function abrirVisorPDF(){
	document.getElementById("capaFondo1").style.visibility="visible";
    document.getElementById("capaVentana").style.visibility="visible";
    document.formulario.bAceptar.focus();
}
    
function cerrarVisorPDF(){
	document.getElementById("capaFondo1").style.visibility="hidden";
	document.getElementById("capaVentana").style.visibility="hidden";
	document.formulario.bAceptar.blur();
}



function PDF(url)
{
ventana=window.open(url,'','top=100,left=150,locationp=no,toolbars=no,status=no,scrollbars=yes,menubar=yes, resizable=yes, width=420,height=440')
}

function PDF_R()
{
	if (petPDF.readyState==4)
	{
		if (petPDF.status==200)
		{
			document.getElementById('visorPDF').innerHTML = petPDF.responseText;
		}
	}
	else
	{
		document.getElementById('visorPDF').innerHTML = 'Por favor espere..';
	}
}
function Abrir_Video(url)
{
ventana=window.open(url,'','top=100,left=150,locationp=no,toolbars=no,status=no,scrollbars=no,menubar=no, resizable=no, width=400,height=420')
}

function crearRespaldo()
    {
	
	var ale = Math.round(Math.random()*1000000); //aleatorio es para que no guarde cache
	var parametros="ale="+ale; //se guarda los datos enla variable para su envio
	obtenerRespaldo.open("POST","respaldoPagina/prueba2.php",true); //abre la conexion
	obtenerRespaldo.onreadystatechange = crearRespaldo_R; //cuando cambia el status de la peticion manda a llamar la funcion de respuesta
	obtenerRespaldo.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1'); //juego de caracteres que va a mandar la peticion
	obtenerRespaldo.send(parametros);//envia los datos
	//alert ("Congreso del Estado");
	}
	
function crearRespaldo_R()
{
	if(obtenerRespaldo.readyState==4)//inicia el status de la variable igual a 4que significa que termino de enviar la peticion
			{
			if(obtenerRespaldo.status==200)//pone el status de la varible igual a 200 que significa que ya respondio
			  {

			  }
			
		}
			else {

	
	      }
  }
  
