if(!window.zw){window.zw={}}zw.Ajax=function(a,b){this.url=a;this.target=null;this.method="POST";this.tag=null;this.parameters="";this.info=null;this.req=null;this.call=zw.ajaxCall;this.cancel=zw.ajaxCancel;this.callBack=zw.ajaxCallBack;this.process=b;this.postProcess=false;this.sending=zw.jslng.loading;this.working=false;this.cancelling=false};zw.Ahah=function(c,b){var a=new zw.Ajax(c,null);a.target=b;return a};zw.ajaxCancel=function(){if(this.working){this.cancelling=true}};zw.ajaxCall=function(){var b,c;if(this.info){this.info.innerHTML=this.sending;this.info.style.display="block"}if(window.XMLHttpRequest){this.req=new XMLHttpRequest()}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP")}}if(this.req){b=this.req;c=this.callBack;b.obj=this;b.onreadystatechange=function(){c.call(b)};b.open(this.method,this.url,true);this.working=true;this.cancelling=false;if(this.method.toLowerCase()=="post"){b.send(this.parameters)}else{b.send("")}}else{if(this.info){this.info.innerHTML=azw.jslng.reqerr}}};zw.ajaxCallBack=function(a){var c,b;if(!a){a=this}switch(a.readyState){case 1:break;case 2:break;case 3:break;case 4:c=a.obj;if(!c.cancelling){if(a.status==200){c.working=false;c.cancelling=false;c.req=null;if(c.info){c.info.innerHTML="";if(c.info!=c.target){c.info.style.display="none"}}if(c.process){c.process.call(c,a)}if(c.target){b=document.createElement("DIV");b.innerHTML=(a.responseText==undefined?"":a.responseText);c.target.innerHTML="";c.target.appendChild(b)}if(c.postProcess){c.postProcess.call(c,a)}}else{if(c.info){c.info.innerHTML=zw.jslng.errtext+": "+a.statusText}}}else{if(a.status==200){c.working=false;c.cancelling=false}}break}};zw.ajaxXMLToArray=function(b){var a=new Array();if(b){for(i=0;i<b.childNodes.length;i++){if(b.childNodes[i].nodeType==1){a[i]=(b.childNodes[i].text?b.childNodes[i].text:b.childNodes[i].textContent)}}}return a};if(document.implementation.hasFeature("XPath","3.0")){if(typeof XMLDocument=="undefined"){XMLDocument=Document}XMLDocument.prototype.selectNodes=function(d,e){if(!e){e=this}var b=this.createNSResolver(this.documentElement);var a=this.evaluate(d,e,b,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=[];for(var c=0;c<a.snapshotLength;c++){f[c]=a.snapshotItem(c)}return f};XMLDocument.prototype.selectSingleNode=function(b,c){if(!c){c=this}var a=this.selectNodes(b,c);if(a.length>0){return a[0]}else{return null}};Element.prototype.selectNodes=function(a){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(a,this)}else{throw"For XML Elements Only"}};Element.prototype.selectSingleNode=function(a){if(this.ownerDocument.selectSingleNode){return this.ownerDocument.selectSingleNode(a,this)}else{throw"For XML Elements Only"}}};
