aAjaxA = new Array(); function Ajax3() { this.id = Math.random(); this.aUserData = new Array(); function getXmlHttpRequest() { var httpRequest = null; this.ajax_requestType = 'txt'; var httpRequestA = new Array(); try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { httpRequest = null; } } if (!httpRequest && typeof XMLHttpRequest != "undefined") { httpRequest = new XMLHttpRequest(); } aAjaxA[aAjaxA.length] = this; return httpRequest; } function getUrlSync(url) { return getUrl(url, false, null); } function getUrlAsync(url, handleStateChange) { return getUrl(url, true, handleStateChange); } // call a url function getUrl(url, async, handleStateChange) { var xmlHttpReq = getXmlHttpRequest(); if (!xmlHttpReq) return; if (handleStateChange) { xmlHttpReq.onreadystatechange = function() { handleStateChange(xmlHttpReq); }; } else { xmlHttpReq.onreadystatechange = function() {;} } xmlHttpReq.open("GET", url, false); xmlHttpReq.send(null); } function postUrl(url, data, async, stateChangeCallback) { var xmlHttpReq = this.getXmlHttpRequest(); this.xmlHttpReq = xmlHttpReq; var this2 = aAjaxA[aAjaxA.length-1]; if (!xmlHttpReq) return; xmlHttpReq.open("POST", url, async); if(async) { xmlHttpReq.onreadystatechange = function() {execOnSuccess(this2)}; } // xmlHttpReq.setRequestHeader('referer', 'fcuk'); xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.send(data+'&time1='+Math.random()); //alert ('url: ' + url + '\ndata: ' + data); if(!async) { this.execOnSuccess(this2); } } function urlEncodeDict(dict) { var result = ""; for (var i=0; i0) { return node[0].firstChild.nodeValue; } else { return null; } } function getRootNode(xmlHttpReq) { return xmlHttpReq.responseXML.getElementsByTagName('root')[0]; } function getUrlXMLResponse(url, successCallback) { this.successCallback = successCallback; this.urlResponseCallback = getUrlXMLResponseCallback; getUrl(url, true, execOnSuccess(this.urlResponseCallback)) } function postUrlXMLResponse(url, data, async ,successCallback) { this.successCallback = successCallback; this.postUrl(url, data, async, this.execOnSuccess); //(this.urlResponseCallback) } function postFormXMLResponse(formName, successCallback) { this.successCallback = successCallback; postForm(formName, false, execOnSuccess(getUrlXMLResponseCallback)) } this.postUrlXMLResponse = postUrlXMLResponse; this.postUrl = postUrl; this.execOnSuccess = execOnSuccess; this.getUrlXMLResponseCallback = getUrlXMLResponseCallback; this.getXmlHttpRequest = getXmlHttpRequest; }