dibujarCargador();var objPeticion;function peticion(url,envio,tipo,parametros,manejador,depurar,activarCargador){ objPeticion=null; objPeticion=new peticion_ajax(url,envio,tipo,parametros,manejador,depurar,activarCargador); if( depurar ) objPeticion.depurarOn(); objPeticion.validarDatos(); if( typeof activarCargador== '\x62\x6f\x6f\x6c\x65\x61\x6e' ) objPeticion.setActivarCargador(activarCargador); objPeticion.ejecutar();}; function peticion_ajax(url,envio,tipo,parametros,manejador,depurar){	this.xmlhttp=_instancio_xmlhttp();	this.envio =envio; this.tipo =tipo; this.metodo =true;	this.url =url;	this.parametros=devolver_parametros(parametros); this.arrayParametros=parametros;	this.manejador=manejador;	this.msg ='';	this.retorno=true;	this.arguments=arguments.length;	this.estados=new Array("UNINITIALIZED - The object has been created, but not initialized open method has not been called.\n","LOADING - The object has been created, but the send method has not been called.\n","LOADED - The send method has been called and the status and headers are available, but the response is not yet available.\n","INTERACTIVE - Some data has been received. You can call responseBody and responseText to get the current partial results.\n","COMPLETED - All the data has been received, and the complete data is available in responseBody and responseText.\n");	this.depurar_bandera=false;	this.datos_enviar=null;	this.activarCargador=true;	this.depurarOn   =_depurarOn;	this.depurarOff   =_depurarOff;	this.validarDatos=_validarDatos;	this.ejecutar   =_realizarPeticion;	this.mostrarDatosInternos=_mostrarDatosInternos;	this.manejarAsync  =_manejarAsync;	this.armarUrl   =_armarUrl;	this.setActivarCargador=_setActivarCargador; this.armarUrl();}; function _realizarPeticion(){	var peticion_respuesta='';	toogleCargador(true,this.activarCargador);	try{if( this.metodo ){ this.xmlhttp.open(this.envio,this.url,true); objXmlhttp=this.xmlhttp; this.xmlhttp.setRequestHeader('\x41\x63\x63\x65\x70\x74','\x6d\x65\x73\x73\x61\x67\x65/\x78-\x66\x6f\x72\x6d\x72\x65\x73\x75\x6c\x74'); this.xmlhttp.setRequestHeader('\x43\x6f\x6e\x74\x65\x6e\x74-\x54\x79\x70\x65','\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e/\x78-\x77\x77\x77-\x66\x6f\x72\x6d-\x75\x72\x6c\x65\x6e\x63\x6f\x64\x65\x64'); this.xmlhttp.send(this.datos_enviar); this.xmlhttp.onreadystatechange=this.manejarAsync;}else{ this.xmlhttp.open(this.envio,this.url,false); this.xmlhttp.setRequestHeader('\x41\x63\x63\x65\x70\x74','\x6d\x65\x73\x73\x61\x67\x65/\x78-\x66\x6f\x72\x6d\x72\x65\x73\x75\x6c\x74'); this.xmlhttp.setRequestHeader('\x43\x6f\x6e\x74\x65\x6e\x74-\x54\x79\x70\x65','\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e/\x78-\x77\x77\x77-\x66\x6f\x72\x6d-\x75\x72\x6c\x65\x6e\x63\x6f\x64\x65\x64'); this.xmlhttp.send(this.datos_enviar); if(this.xmlhttp.status !== 200 && this.xmlhttp.status !== 204 ){ if(this.xmlhttp.status== 12007 || this.xmlhttp.status== 12029){ 	this.msg+= 'La conexión se ha interrumpido.\nPor favor inicie sesión nuevamente.'; 	peticion_respuesta=this.xmlhttp.responseText;  }else{ 	this.msg+= '\x50\x72\x6f\x62\x6c\x65\x6d\x61\x20\x63\x6f\x6e\x20\x6c\x61\x20\x70\x65\x74\x69\x63\x69ó\x6e:\x20'+this.xmlhttp.statusText; 	peticion_respuesta=this.xmlhttp.responseText; 	if(this.depurar_bandera){  this.mostrarDatosInternos();  abrirPopup(peticion_respuesta); }} this.retorno=false;}else{ peticion_respuesta=this.xmlhttp.responseText; this.manejador(peticion_respuesta,this.arrayParametros); this.retorno=true; if(this.depurar_bandera) this.mostrarDatosInternos();} toogleCargador(false,this.activarCargador);}}catch(e){  this.msg+= e; this.retorno=false;  toogleCargador(false,this.activarCargador);}	if( !this.retorno ){  alert(this.msg);} return this.retorno;}; function _manejarAsync(){ if( objXmlhttp.readyState== 4 ){ if( objXmlhttp.status !== 200 && objXmlhttp.status !== 204 ){ toogleCargador(false,objPeticion.activarCargador); if(objXmlhttp.status== 12007 || objXmlhttp.status== 12029){  	objPeticion.msg+= '\x53\x65\x20\x68\x61\x20\x70\x65\x72\x64\x69\x64\x6f\x20\x6c\x61\x20\x63\x6f\x6e\x65\x78\x69ó\x6e.\x20\x50\x6f\x72\x20\x66\x61\x76\x6f\x72\x20\x69\x6e\x69\x63\x69\x65\x20\x73\x65\x73\x69ó\x6e\x20\x6e\x75\x65\x76\x61\x6d\x65\x6e\x74\x65.'; 	peticion_respuesta=objXmlhttp.responseText; }else{ 	objPeticion.msg+= '\x50\x72\x6f\x62\x6c\x65\x6d\x61\x20\x63\x6f\x6e\x20\x6c\x61\x20\x72\x65\x73\x70\x75\x65\x73\x74\x61\x20\x68\x74\x74\x70:\x20'+objXmlhttp.statusText; 	peticion_respuesta=objXmlhttp.responseText;   if(objPeticion.depurar_bandera){  objPeticion.mostrarDatosInternos();  abrirPopup(peticion_respuesta); }} objPeticion.retorno=false; 	alert(objPeticion.msg);}else{ toogleCargador(false,objPeticion.activarCargador); peticion_respuesta=objXmlhttp.responseText; objPeticion.manejador(peticion_respuesta,objPeticion.arrayParametros); objPeticion.retorno=true; if(objPeticion.depurar_bandera) objPeticion.mostrarDatosInternos();}}else{}}; function _mostrarDatosInternos(){	var out='\x53\x61\x6c\x69\x64\x61\x20\x70\x61\x72\x61\x20\x6c\x61\x20\x64\x65\x70\x75\x72\x61\x63\x69ó\x6e:\x20';	out+= '\n'+'\x6d\x73\x67:\x20' +this.msg;	out+= '\n'+'\x73\x74\x61\x74\x75\x73\x54\x65\x78\x74:\x20'+this.xmlhttp.statusText;	out+= '\n'+'\x72\x65\x61\x64\x79\x53\x74\x61\x74\x65:\x20'+this.xmlhttp.readyState;	out+= '\n'+'\x75\x72\x6c:\x20' +this.url;	out+= '\n'+'\x72\x65\x74\x6f\x72\x6e\x6f:\x20'+this.retorno;	out+= '\n'+'\x61\x53\x79\x6e\x63:\x20' +this.metodo;	out+= '\n'+'\x6dé\x74\x6f\x64\x6f\x20\x65\x6e\x76í\x6f:\x20'+this.envio;	out+= '\n'+'\x6d\x61\x6e\x65\x6a\x61\x64\x6f\x72:\x20'+typeof(this.manejador)+'\x20'+this.manejador.name;	out+= '\n'+'\x70\x61\x72\x61\x6d\x65\x74\x72\x6f\x73\x20\x72\x65\x63\x69\x62\x69\x64\x6f\x73:\x20'+this.parametros; 	alert ( out );}; function _depurarOff(){	this.depurar_bandera=false;}; function _depurarOn(){	this.depurar_bandera=true;}; function _validarDatos(){ if(this.arguments.length < 5){ this.msg+= '\x4c\x61\x20\x63\x61\x6e\x74\x69\x64\x61\x64\x20\x64\x65\x20\x61\x72\x67\x75\x6d\x65\x6e\x74\x6f\x73\x20\x71\x75\x65\x20\x72\x65\x63\x69\x62\x69ó\x20\x6c\x61\x20\x66\x75\x6e\x63\x69ó\x6e\x20\x65\x73\x20\x69\x6e\x63\x6f\x72\x72\x65\x63\x74\x61'; this.retorno=false; alert(this.msg); for(i in this.arguments){ this.msg+= '\n'+'\x41\x72\x67\x75\x6d\x65\x6e\x74\x6f:\x20'+i+'.\x20\x54\x61\x6c\x6f\x72:\x20'+this.arguments[i];}return false;}	if( this.tipo== '\x61' || this.tipo== '\x41' ){ this.metodo=true;}else if( this.tipo== '\x73' || this.tipo== '\x53' ){ this.metodo=false;}else{this.msg+= "El tipo de llamada no está correctamente definido a/A: asincrónico - s/S: sincrónico"; this.retorno=false; alert(this.msg); return false;} if( typeof(this.manejador) != '\x66\x75\x6e\x63\x74\x69\x6f\x6e' && this.manejador != '' ){ msg+= '\x45\x6c\x20\x6d\x61\x6e\x65\x6a\x61\x64\x6f\x72\x20\x64\x65\x20\x72\x65\x73\x75\x6c\x74\x61\x64\x6f\x20\x6e\x6f\x20\x65\x73\x74á\x20\x64\x65\x66\x69\x6e\x69\x64\x6f.'; this.retorno=false; alert(this.msg); return false;}else if(this.manejador==''){ this.manejador='\x73\x69\x6e\x4d\x61\x6e\x65\x6a\x61\x64\x6f\x72';}	if( this.url.length== 0 ){ this.msg+= '\x50\x61\x72á\x6d\x65\x74\x72\x6f\x20\x75\x72\x6c\x20\x76\x61\x63í\x6f.'; this.retorno=false; alert(this.msg); return false;} if( this.envio== '\x67' || this.envio== '\x47' ){ this.envio='\x47\x45\x54';}else if( this.envio== '\x70' || this.envio== '\x50'){ this.envio='\x50\x4f\x53\x54';}else{this.msg+= "El tipo de envío no está correctamente definido g/G: GET - p/P: POST"; this.retorno=false; alert(this.msg); return false;} }; function _instancio_xmlhttp (){	var xmlhttp=null; /*@cc_on @*/ /*@if(@_jscript_version >= 5)  try{ xmlhttp=new ActiveXObject('\x4d\x73\x78\x6d\x6c2.\x58\x4d\x4c\x48\x54\x54\x50');}catch (e){ try{xmlhttp=new ActiveXObject('\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74.\x58\x4d\x4c\x48\x54\x54\x50');}catch (E){ xmlhttp=false;}}@else xmlhttp=false;	@end @*/ if(!xmlhttp && typeof XMLHttpRequest!='\x75\x6e\x64\x65\x66\x69\x6e\x65\x64'){ try{ xmlhttp=new XMLHttpRequest();}catch (e){ xmlhttp=false;}}return xmlhttp;}; function devolver_parametros(parametros){	if(typeof(parametros)=='\x6f\x62\x6a\x65\x63\x74'){ var str=''; for(i in parametros){ if(typeof(parametros[i]) != '\x66\x75\x6e\x63\x74\x69\x6f\x6e') 	str+= '&'+i+'='+parametros[i];}if(str != ''){ return str.substr(1,str.length);}else{ return '';}}else{ return '';}}; function abrirPopup (datos){	var ventana=window.open('', '\x70\x6f\x70\x75\x70', '\x77\x69\x64\x74\x68=500,\x68\x65\x69\x67\x68\x74=350,\x73\x74\x61\x74\x75\x73=\x6e\x6f,\x72\x65\x73\x69\x7a\x61\x62\x6c\x65=\x79\x65\x73,\x74\x6f\x6f\x6c\x62\x61\x72=\x6e\x6f,\x6d\x65\x6e\x75\x62\x61\x72=\x6e\x6f,\x74\x69\x74\x6c\x65\x62\x61\x72=\x6e\x6f,\x20\x73\x63\x72\x6f\x6c\x6c\x62\x61\x72\x73=\x79\x65\x73');	ventana.document.write(datos);	ventana.focus();}; function dibujarCargador(){	document.write('<\x64\x69\x76\x20\x69\x64="\x63\x61\x72\x67\x61\x64\x6f\x72\x4c\x69\x73\x74\x61\x64\x6f"\x20\x73\x74\x79\x6c\x65="\x77\x69\x64\x74\x68:154\x70\x78;\x68\x65\x69\x67\x68\x74:68\x70\x78;\x70\x6f\x73\x69\x74\x69\x6f\x6e:\x61\x62\x73\x6f\x6c\x75\x74\x65;\x6c\x65\x66\x74:38%;\x74\x6f\x70:40%;\x7a-\x69\x6e\x64\x65\x78:99;\x76\x69\x73\x69\x62\x69\x6c\x69\x74\x79:\x68\x69\x64\x64\x65\x6e;"><\x74\x61\x62\x6c\x65\x20\x77\x69\x64\x74\x68="154"\x20\x68\x65\x69\x67\x68\x74="68"\x20\x62\x6f\x72\x64\x65\x72="0"\x20\x61\x6c\x69\x67\x6e="\x63\x65\x6e\x74\x65\x72"\x20\x63\x65\x6c\x6c\x70\x61\x64\x64\x69\x6e\x67="0"\x20\x63\x65\x6c\x6c\x73\x70\x61\x63\x69\x6e\x67="0"><\x74\x72><\x74\x64\x20\x61\x6c\x69\x67\x6e="\x63\x65\x6e\x74\x65\x72"\x20\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64="/\x69\x6d\x61\x67\x65\x6e\x65\x73/\x66\x6f\x6e\x64\x6f_\x63\x61\x72\x67\x61.\x67\x69\x66"><\x74\x61\x62\x6c\x65\x20\x77\x69\x64\x74\x68="85%"\x20\x68\x65\x69\x67\x68\x74="64"\x20\x62\x6f\x72\x64\x65\x72="0"\x20\x63\x65\x6c\x6c\x70\x61\x64\x64\x69\x6e\x67="0"\x20\x63\x65\x6c\x6c\x73\x70\x61\x63\x69\x6e\x67="0"><\x74\x72><\x74\x64\x20\x68\x65\x69\x67\x68\x74="20"\x20\x61\x6c\x69\x67\x6e="\x6c\x65\x66\x74"\x20\x73\x74\x79\x6c\x65="\x66\x6f\x6e\x74-\x66\x61\x6d\x69\x6c\x79:\x20\x54\x61\x68\x6f\x6d\x61;\x66\x6f\x6e\x74-\x73\x69\x7a\x65:\x207\x70\x74;\x66\x6f\x6e\x74-\x77\x65\x69\x67\x68\x74:\x20\x62\x6f\x6c\x64;\x63\x6f\x6c\x6f\x72:\x20#333333;">\x43\x61\x72\x67\x61\x6e\x64\x6f...</\x74\x64></\x74\x72><\x74\x72><\x74\x64\x20\x68\x65\x69\x67\x68\x74="42"\x20\x61\x6c\x69\x67\x6e="\x63\x65\x6e\x74\x65\x72"><\x69\x6d\x67\x20\x73\x72\x63="/\x69\x6d\x61\x67\x65\x6e\x65\x73/\x69\x6e\x64\x69\x63\x61\x74\x6f\x72.\x67\x69\x66"\x20\x77\x69\x64\x74\x68="16"\x20\x68\x65\x69\x67\x68\x74="16"\x20/></\x74\x64></\x74\x72></\x74\x61\x62\x6c\x65></\x74\x64></\x74\x72></\x74\x61\x62\x6c\x65></\x64\x69\x76>');}; function _setActivarCargador(bool){	this.activarCargador=bool}; function toogleCargador(accion, activarCargador){	if( !activarCargador ) return;	var mostrar='';	if( accion== true ){ mostrar='\x76\x69\x73\x69\x62\x6c\x65';}else if( accion== false ){ mostrar='\x68\x69\x64\x64\x65\x6e';}else if( document.getElementById('\x63\x61\x72\x67\x61\x64\x6f\x72\x4c\x69\x73\x74\x61\x64\x6f').style.visibility== '\x68\x69\x64\x64\x65\x6e' ){ mostrar='\x76\x69\x73\x69\x62\x6c\x65';}else{ mostrar="hidden";}document.getElementById('\x63\x61\x72\x67\x61\x64\x6f\x72\x4c\x69\x73\x74\x61\x64\x6f').style.visibility=mostrar;}; function _armarUrl(){	if(this.envio== '\x47'){ if(this.parametros != '') this.url+= "?"+this.parametros;}else{ this.datos_enviar=this.parametros;}}; function sinManejador(){	return false;}; 

