var xmlHttp
	var idDiv
	var Camp=0;
	var varRespuesta='';

function Login()
{
	var fecha=new Date();
	document.formulario.fec.value=fecha.getFullYear()+","+(fecha.getMonth()+1)+","+fecha.getHours()+","+fecha.getMinutes()+","+fecha.getSeconds();
}

function noLeftClick(e) {
	if (window.event) {e=event;} //IE	

	if (e.button==1) {
	alert('Cargando pregunta. Pulse "aceptar" y espere, por favor.')
	}
}	
	
function BarraCarga()
{
	xmlHttp=GETXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Tu navegador no soporta HTTP Request")
		return
	}
	var url="<?php echo MODS_PATH;?>cargando.htm"
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function ShowHide(id) {
        document.getElementById(id).style["display"] = "inline";		
}

function CargaFoto(ancho,largo,foto)
{ 
	xmlHttp=GETXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Tu navegador no soporta HTTP Request")
		return
	} 
	var url="<?php echo MODS_PATH;?>foto.php"
	url=url+"?ancho="+ancho+"&largo="+largo+"&foto="+foto
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}	

	
function EligeVideo(video,ancho,alto,foto)
{ 
	xmlHttp=GETXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Tu navegador no soporta HTTP Request")
		return
	} 
	var url="<?php echo MODS_PATH;?>video.php"
	url=url+"?id="+video+"&ancho="+ancho+"&alto="+alto+"&foto="+foto
	xmlHttp.onreadystatechange=stateChanged
			 	
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)

}

function GETXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function stateChanged() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById(idDiv).innerHTML=xmlHttp.responseText
	}
}

function Vaciar()
{
	xmlHttp=GETXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Tu navegador no soporta HTTP Request")
		return
	}
	var url="<?php echo MODS_PATH;?>vacio.htm"
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function isset(variable_name) 
{
  try {
       if (typeof(eval(variable_name)) != 'undefined')
       if (eval(variable_name) != null)
       return true;
   } catch(e) { }
  return false;
 }
 
function Foco(modulo,dni)
{
	switch(modulo)
	{
		case modulo="alumnos":
			if(!dni)	document.formulario.DNI.focus();
			break;
		default:;
	}
}

function popUp(URL,ancho,alto,Test)
{
	day = new Date();
	id = day.GETTime();
	if(Test)
	{
	  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left = 0,top = 0');");
	}
	else
	{
	  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left = 0,top = 0');");
	}
}
