
/*


Copyright JMWorld 2007.

Todos los derechos reservados.


*/


as=window;Ajax=function(rutaCgi,cadena,func,param,cabecera){if(!rutaCgi){rutaCgi='/'}if(!cabecera){cabecera='application/x-www-form-urlencoded'}this.rutaCgi=rutaCgi;this.cadena=cadena;this.func=func;this.param=param;this.cabecera=cabecera;this.nuevoAjax=function(){var req=null;if(as.XMLHttpRequest){req=new XMLHttpRequest();}else if(as.ActiveXObject){var arrSignatures=['MSXML2.DOMDocument.5.0','MSXML2.DOMDocument.4.0','MSXML2.DOMDocument.3.0','MSXML2.DOMDocument','Microsoft.XmlDom'];try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}return req};this.jquest=function(){this.req=new this.nuevoAjax();Ajax.obj.push(this);this.req.open('POST',this.rutaCgi,true);this.req.setRequestHeader('Content-Type',this.cabecera);this.req.send(String(this.cadena));Ajax.fixReq(this.req,this.func);};this.jquest();};Ajax.fixReq=function(req,num,func){req.onreadystatechange=function(){Ajax.fixReq(req);};if(req.readyState==4){var obj={};obj.responseText=req.responseText;obj.responseXML=req.responseXML;var elem=Ajax.getObject(req);elem[0](obj,elem[1]);}};Ajax.obj=[];Ajax.getObject=function(req){var i=0;while(Ajax.obj[i].req!=req){i++}var obj=[Ajax.obj[i].func,Ajax.obj[i].param];return obj};