function $(id){ return document.getElementById(id);}
function Ajax(_1,f,_3){
var _4=0;
var _5;
var _6=0;
var _7;
this.xmlDoc=null;
this.url=_1?_1:null;
this.f=f?f:null;
this.loading=_3?_3:null;
this.loaderror=null;
this.running=false;
this.post=null;
this.id=Math.random();
this.nocache=false;
this.init=function(){
if(window.XMLHttpRequest){
this.xmlDoc=new XMLHttpRequest();
this.xmlDoc.onreadystatechange=check;
}else{
if(window.ActiveXObject){
this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
if(this.xmlDoc){
this.xmlDoc.onreadystatechange=check;
}
}else{
alert("Tu navegador no puede soportar el script");
}
}
};
this.run=function(_8,_9,_a){
this.url=_8?_8:this.url;
this.f=_9?_9:this.f;
this.loading=_a?_a:this.loading;
try{
this.init();
}
catch(e){
this.showModal("<h3 style=\"color: red\">Aviso importante</h3>Hemos detectado que tu navegador tiene desactivado el uso de controles ActiveX en la configuraci&oacute;n de seguridad, lo que te impedir&aacute; navegar con normalidad por este sitio. Para activarlo, debes seguir los siguiente pasos:<br><br><div style=\"text-align:left\">1- Accede al men&uacute; <strong>Herramientas -> Opciones de Internet</strong>.<br>2- Haz click en la pesta&ntilde;a <strong>Seguridad</strong>.<br>3- Haz click en el bot&oacute;n <strong>Nivel personalizado...</strong><br>4- Dentro del men&uacute; <strong>Controles y complementos de ActiveX</strong>, en la primera opci\xf3n <strong>Activar la secuencia de comandos de los controles de ActiveX marcados como seguros</strong>, seleccionar la opci&oacute;n <strong>Activar</strong>.<br>5- Pincha en <strong>Aceptar</strong> en las dos ventanas.<br>6- Cuando hayas terminado, haz click en el bot&oacute;n <strong>Actualizar</strong> para volver a cargar la p&aacute;gina.</div><br><br><input type=\"button\" value=\"Actualizar\" onclick=\"location.reload();\">");
return false;
}
this.running=true;
if(this.loading!=null&&this.loading!=null){
if(typeof (_5.loading)=="function"){
_5.loading();
}else{
eval(_5.loading);
}
}
document.body.style.cursor="wait";
if(this.nocache){
if(this.url.indexOf("?")>0){
this.url+="&ajax-random="+Math.random();
}else{
this.url+="?ajax-random="+Math.random();
}
}
this.xmlDoc.open((this.post==null?"GET":"POST"),this.url+"&rd="+Math.random());
if(this.post!=null){
this.xmlDoc.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
this.xmlDoc.send(this.post);
this.post=null;
};
function check(){
if(_5.xmlDoc.readyState==4){
if(_5.xmlDoc.status==200){
_5.running=false;
if(typeof (_5.f)=="function"){
_5.f();
}else{
eval(_5.f);
}
_4=0;
document.body.style.cursor="auto";
}else{
if(_5.xmlDoc.status==666){
location.href="/?pagina=inicio";
}else{
checkerror();
}
}
}
}
function checkerror(){
_5.running=false;
if(_5.loaderror!=null){
if(typeof (_5.loaderror)=="function"){
_5.loaderror();
}else{
eval(_5.loaderror);
}
}else{
if(_4<3){
if(confirm("Ha ocurrido un error de comunicaci\xf3n con el servidor. \xbfDesea reintentar?")){
_4++;
_5.run();
}else{
_4=0;
_5.errorLabel("ERROR: No se ha podido establecer comunicaci\xf3n con el servidor.");
}
}else{
_4=0;
_5.errorLabel("Error de comunicaci\xf3n con el servidor.\nPor favor, vuelva a intentarlo pasados unos minutos.");
}
}
document.body.style.cursor="auto";
return;
}
_5=this;
}


