
var oAjaxRequestAsyncro=true;var oAjaxRequestSyncro=false;var oAjaxRequestType=oAjaxRequestAsyncro;var oAjax=new ajaxClass();function ajaxClass(){this.requestAsyncro=function(){oAjaxRequestType=oAjaxRequestAsyncro;};this.requestSyncro=function(){oAjaxRequestType=oAjaxRequestSyncro;};this.timer={time:0,now:function(){return(new Date()).getTime();},start:function(){this.time=this.now();return this.time;},since:function(){return this.now()-this.time;}}
this.useAjax=function(url,element,msg){useAjax(url,element,msg);};}
function getXMLHTTPRequest(){var oXMLHttpRequest=false;try{oXMLHttpRequest=new XMLHttpRequest();}catch(e){try{oXMLHttpRequest=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{oXMLHttpRequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){alert("getXMLHTTPRequest()\nEl objeto no se ha creado");oXMLHttpRequest=false;}}}
return oXMLHttpRequest;}
function useAjax(url,element,msg){var oXMLHttpRequest=getXMLHTTPRequest();var objINNER=document.getElementById(element);if(objINNER!=null){if(msg!=""){if(msg=="anim=1"){objINNER.innerHTML="";$(objINNER).effects().start({'opacity':[0,1]});}else{objINNER.innerHTML=msg;}}}
url=url+"&rand="+parseInt(Math.random()*999999999999999);oXMLHttpRequest.open("GET",url,oAjaxRequestType);oXMLHttpRequest.onreadystatechange=function(){ajaxResponse(oXMLHttpRequest,element,url,msg)};oXMLHttpRequest.send(null);delete oXMLHttpRequest;delete objINNER;}
function ajaxResponse(oXMLHttpRequest,element,url,msg){var objINNER=document.getElementById(element);var res="";switch(oXMLHttpRequest.readyState){case 0:break;case 1:break;case 2:break;case 3:break;case 4:switch(oXMLHttpRequest.status){case 200:res=unescape(oXMLHttpRequest.responseText);if(objINNER!=null){objINNER.innerHTML=res;if(msg=="anim=1"){$(objINNER).effects().start({'opacity':[0,1]});}}
break;case 404:if(objINNER!=null){res=res+"<div style='background-image: url(/image/warning-bg.jpg);background-repeat: repeat-x;background-position: top left;background-attachment: fixed; width:100%; height:100%; background-color:#ffffff;'>"
res=res+"  <table width='100%' cellpadding='0' cellspacing='0'>";res=res+"    <tr>";res=res+"      <td style='border-right:dotted 1px #ffffff;'><img src='/image/warning-icon.jpg'></td>";res=res+"      <td style='font:9pt Verdana;color:#ffffff;padding-left:10px;' width='100%'><b>Error 404:</b> No se ha encontrado la página<br><b>"+url+"</b><br><br></td>";res=res+"    </tr>";res=res+"  </table>";res=res+"</div>";objINNER.innerHTML=res;if(msg=="anim=1"){$(objINNER).effects().start({'opacity':[0,1]});}}
break;case 500:if(objINNER!=null){res=res+"<div style='background-image: url(/image/error-bg.jpg);background-repeat: repeat-x;background-position: top left;background-attachment: fixed; width:100%; height:100%; background-color:#ffffff;'>"
res=res+"  <table width='100%' cellpadding='0' cellspacing='0'>";res=res+"    <tr>";res=res+"      <td style='border-right:dotted 1px #ffffff;'><img src='/image/error-icon.jpg'></td>";res=res+"      <td style='font:9pt Verdana;color:#ffffff;padding-left:10px;' width='100%'><b>Error 500:</b> Error interno del servidor<br><b>"+url+"</b><br><br></td>";res=res+"    </tr>";res=res+"    <tr>";res=res+"      <td colspan='2' align='center'>";res=res+"        <input style='font:9pt Verdana;' type='button' value='  Ver  ' onClick='window.open("+String.fromCharCode(34)+url+String.fromCharCode(34)+");'>";res=res+"      </td>";res=res+"    </tr>";res=res+"  </table>";res=res+"</div>";objINNER.innerHTML=res;if(msg=="anim=1"){$(objINNER).effects().start({'opacity':[0,1]});}}
break;default:alert(oXMLHttpRequest.status+" - "+oXMLHttpRequest.statusText);break;}
break;default:break;}}
