var ajax=new Array();
function objetus(file) {
    xmlhttp=false;
    this.AjaxFailedAlert='Su navegador no soporta las funciónalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada.Por favor habilite javascript en su navegador para verlo normalmente.\n';
    this.requestFile = file;
    this.encodeURIString = true;
    this.execute = false;
    if (window.XMLHttpRequest) { 
        this.xmlhttp = new XMLHttpRequest();
        if (this.xmlhttp.overrideMimeType) {
            this.xmlhttp.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) { // IE
        try {
            this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try {
                this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                this.xmlhttp = null;
            }
        }
        if (!this.xmlhttp && typeof XMLHttpRequest!='undefined') {
            this.xmlhttp = new XMLHttpRequest();
            if (!this.xmlhttp){
                this.failed = true; 
            }
        } 
    }
    return this.xmlhttp ;
}
function recibeid(_pagina,valorget,valorpost,capa){
   ajax=objetus(_pagina);
    if(valorpost!=""){
       ajax.open("POST", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
    } else {
       ajax.open("GET", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
    }
   ajax.onreadystatechange=function() {
        if (ajax.readyState==1){
            document.getElementById(capa).innerHTML = "<center><img src='imagenes/loading.gif' align='center'> Cargando...</center>";
        }
        if (ajax.readyState==4) {
            if(ajax.status==200)
            {document.getElementById(capa).innerHTML =ajax.responseText;}
            else if(ajax.status==404)
            {
                capa.innerHTML = "La direccion no existe";
            }
            else
            {
                capa.innerHTML = "Error: ".ajax.status;
            }
        }
    }
    if(valorpost!=""){
       ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
       ajax.send(valorpost);
    } else {
       ajax.send(null);
    }
}
function cargaCalendario(pPagina,pArchivo,pAcc,pCapa)
{	recibeid("archivos_asig.php","acc="+pAcc+"&item="+pContenido+"&itemA="+pArchivo,"",pCapa);
}
function cargarContenidos(pEntrada,pContenido,pPagina,pAcc,pCapa)
{	if(pContenido!="")
	{	recibeid(pPagina,"acc="+pAcc+"&item="+pEntrada+"&itemC="+pContenido,"",pCapa);	}
	else
	{	recibeid(pPagina,"acc="+pAcc+"&item="+pEntrada,"",pCapa);	}
}
function cambiar_mes(mes,ano) {
	recibeid("calendario.php","sel_mes="+mes+"&sel_ano="+ano,"","miCalendario");
}
function cargarEventoCal(dia,mes,ano)
{	recibeid("calendario.php","sel_fecha="+dia+"/"+mes+"/"+ano,"","misEventos");
}
function valUss()
{	if(document.login_us.uss.value=="")
	{	alert("Ingrese su nombre de usuario");return;	}
	if(document.login_us.pss.value=="")
	{	alert("Ingrese su password de acceso");return;	}
	document.login_us.submit();
}
function valRecuperar()
{	if((document.login_us.txtemail.value=="")||(document.login_us.txtemail.value=="email"))
	{	alert("Ingrese su email");return;	}
	recibeid('index.php','c=Usuarios&a=recuperarClave','val=1&url1='+document.login_us.url1.value+"&email="+document.login_us.txtemail.value,'pie_der');
}

//document.getElementById('formu_top3').innerHTML="Ingrese su consulta con las palabras exactas";
