AjaxFactory.nR = ["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];var mT = {ActiveX: (typeof ActiveXObject !== "undefined"),Nativo: (typeof XMLHttpRequest !== "undefined")};function AjaxFactory() {}AjaxFactory.Re = function () {return mT.ActiveX || mT.Nativo;};AjaxFactory.crearConexion = function () {if (mT.Nativo) {return new XMLHttpRequest();} else if (mT.ActiveX) {if (!AjaxFactory.ee) {for (var Oj=0; Oj < AjaxFactory.nR.length; Oj++) {try {AjaxFactory.ee = new ActiveXObject(AjaxFactory.nR[Oj]);break;}catch (e) {}}}if (AjaxFactory.ee) {return AjaxFactory.ee;} else {throw new Error("Imposible crear objeto XML HTTP Request.");}} else {throw new Error("El browser no soporta XML HTTP Request.");}}; function PiletaAjax(Fc) {this.vV = Fc;this.vd = [Fc];for(var vh=0; vh <= Fc-1; vh++ ) {this.vd[vh] = AjaxFactory.crearConexion();}}; PiletaAjax.prototype.getObjetoRequestDePool = function () {if (this.vd.length > 0) {if (this.vd[0].readyState === 4 || this.vd[0].readyState === 0) {var fk = this.vd[0];this.vd.splice(0, 1);return fk;}} return false;}; PiletaAjax.prototype.liberar = function (fk) {this.vd.push(fk);};function Ajax(vf, lc) {this.VO = new PiletaAjax(lc);this.hQ = [];this.cU = vf;};Ajax.prototype.hacerPedidoAjax = function (Wi, Bd, wK) {var lZ = this.VO.getObjetoRequestDePool();if (!lZ) {this.hQ.unshift([Bd, Wi, wK]);return;}try {lZ.open("POST", Wi, true);lZ.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");lZ.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");var RD = this;lZ.onreadystatechange = function () {if (lZ.readyState === 4) {if (lZ.status === 200) {RD.VO.liberar(lZ);wK(lZ);}}};lZ.send(Bd);}catch(e) {alert(e);}};Ajax.prototype.encolarPedido = function (nj, Wi, wK ) {this.hQ.push([nj, Wi, wK]);};Ajax.prototype.procesarProximoPedido = function () {if (this.hQ.length > 0) {var PK = this.hQ.shift();this.hacerPedidoAjax(PK[1], PK[0], PK[2]);}this.UD();};Ajax.prototype.UD = function () {var RD = this;setTimeout(function () { RD.procesarProximoPedido(); }, this.cU);};Ajax.prototype.comenzar = function () {this.UD();};