// JavaScript Document
function nuevoAjax()
{ 
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
	lo que se puede copiar tal como esta aqui */
	var xmlhttp=false;
	try
	{
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			// Creacion del objet AJAX para IE
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E)
		{
			if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
		}
	}
	return xmlhttp; 
}
function validar()
{
	var identificacion=document.getElementById("identifi");
	var codigo=document.getElementById("codalum");
	var imprime=document.getElementById("resultados_notas");
	var i="si"; var c="si";
	if (identificacion.value=="")
	{
		identificacion.style.backgroundColor="#F5D75C";
		i="no";
		identificacion.focus(); 
	}
	if (codigo.value=="")
	{
		codigo.style.backgroundColor="#F5D75C";
		c="no";
		identificacion.focus(); 
	}
	if(c=="si" & i=="si")
	{
		identificacion.style.backgroundColor="#FFF";
		codigo.style.backgroundColor="#FFF";
		imprime.style.visibility="visible";
		var ajax=nuevoAjax();
		ajax.open("GET", "resultados.php?id_est="+identificacion.value+"&co_est="+codigo.value, true);
		ajax.onreadystatechange=function() 
		{
			if(ajax.readyState==1)
				imprime.innerHTML='Buscando datos, espere...';
			if (ajax.readyState==4)
			{
				imprime.innerHTML= ajax.responseText;
			}
		}
		ajax.send(null);
	}
	else
	{
		imprime.style.visibility="hidden";
		alert("Compruebe campos");
	}
}
function nuevaconsulta()
{
	var identificacion=document.getElementById("identifi");
	var codigo=document.getElementById("codalum");
	var imprime=document.getElementById("resultados_notas");
	identificacion.value="";
	identificacion.style.backgroundColor="#FFF";
	codigo.value="";
	codigo.style.backgroundColor="#FFF";
	imprime.style.visibility="hidden";
	identificacion.focus(); 
	}
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=300,left = 565,top = 422');");
	}


