function XmlHttpCommunicatorDef(a){this.OnGetReply=null;this.OnComplete=null;this.OnTimeout=null;this._xmlHttp=null;this._url=a;this._responseHeaders=null;this._innerOnReply=null;this.TimeOut=10000;this.CustomParameters=null;this.IsOpened=function(){try{return this._xmlHttp.readyState==1}catch(b){return false}};this.IsSent=function(){try{return this._xmlHttp.readyState==2}catch(b){return false}};this.IsRecieving=function(){try{return this._xmlHttp.readyState==3}catch(b){return false}};this.IsLoaded=function(){try{return this._xmlHttp.readyState==4}catch(b){return false}};this.Abort=function(){return this._xmlHttp.Abort()};this._onTimeOut=function(){if(this.OnTimeout!=null){this.OnTimeout()}};this.Dispose=function(){if(this._xmlHttp!=null){try{this._xmlHttp.onreadystatechange=null;this._xmlHttp=null}catch(b){}}};this._encode=function(b){if(b==null){return b}return encodeURIComponent(b)};this._handleException=function(b,c){if((c==null)||(c.number==-2147467259)){return}if((c.message==null)&&(c.name==null)&&(c.number==null)){alert(b+c)}else{alert(b+"\r\n"+c.name+":"+c.message+"("+c.number+")")}};this._onReadyStateChange=function(){switch(this._xmlHttp.readyState){case 0:break;case 1:break;case 2:break;case 3:try{this._responseHeaders=this._xmlHttp.getAllResponseHeaders()}catch(c){this._handleException("Recieving error occured! Error: ",c)}break;case 4:var b;try{b=this._xmlHttp.status}catch(c){b=null}if(this._innerOnReply!=null){this._innerOnReply(b,this._xmlHttp.responseXML,this._xmlHttp.responseText,this._xmlHttp.responseBody)}if(this.OnGetReply!=null){this.OnGetReply(b,this._xmlHttp.responseXML,this._xmlHttp.responseText,this._xmlHttp.responseBody,this.CustomParameters)}if(this.OnComplete!=null){this.OnComplete({Status:b,Xml:this._xmlHttp.responseXML,Text:this._xmlHttp.responseText,Body:this._xmlHttp.responseBody},this.CustomParameters)}break}};this.ReCreate=function(){this._xmlHttp=null;try{this._xmlHttp=new XMLHttpRequest()}catch(f){var b=new Array("Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");for(var c=0;c<b.length;++c){try{this._xmlHttp=new ActiveXObject(b[c]);if(this._xmlHttp!=null){break}}catch(f){}}}if(this._xmlHttp==null){alert("Cannot create XmlHttp object!")}var d=this;this._xmlHttp.onreadystatechange=function(){d._onReadyStateChange()};if(this._xmlHttp.ontimeout!=null){this._xmlHttp.ontimeout=this._onTimeOut}};this.CallSimpleMethod=function(j,c,g,b,f){var e,d=(c!=null)?c.length:0;var h={};for(e=0;e<d;e++){h[c[e].Name]=this._encode(c[e].Value)}return this.CallSimpleMethod2(j,h,g,b,f)};this.CallSimpleMethod2=function(g,k,h,b,f){var e=new Array({Method:g});var j="";var d,c=(k!=null)?k.length:0;for(ParamName in k){j+=this._encode(ParamName)+"="+this._encode(k[ParamName])+"&"}if(j.length>0){j=j.substring(0,j.length-1)}j="MethodName="+this._encode(g)+"&Arguments="+this._encode(j)+"&IsCallback=1";var l=new Array({Name:"Content-Type",Value:"application/x-www-form-urlencoded"},{Name:"Accept-Charset",Value:"utf-8"});return this.Post(l,j,h,b,f)};this.CallSoapMethod=function(f,c,e,b,d){};this.Get=function(e,d,b,c){return this._sendRequest("GET",this._url,e,null,d,b,c)};this.Post=function(f,d,e,b,c){return this._sendRequest("POST",this._url,f,d,e,b,c)};this.IsProcessing=function(){return this.IsOpened()||this.IsSent()||this.IsRecieving()};this._sendRequest=function(b,c,l,q,o,f,n){if(o==null){o=true}if(l==null){l=Array()}this._responseHeaders=null;if(this.IsRecieving()){throw new Error("Recieving reply");return null}if(this.IsSent()){throw new Error("Waiting for reply");return null}if(this.IsOpened()){throw new Error("Already opened");return null}this.ReCreate();try{if(f!=null){if(n!=null){this._xmlHttp.open(b,c,o,f,n)}else{this._xmlHttp.open(b,c,o,f)}}else{this._xmlHttp.open(b,c,o)}}catch(m){this._handleException("XmlHTTPRequest.Open error: ",m);return null}if(!this.IsOpened()){throw new Error("INVALID_STATE_ERR")}var j,g=l.length;for(j=0;j<g;j++){this._xmlHttp.setRequestHeader(l[j].Name,l[j].Value)}try{if(!o){var k;var d;var p;var h;var r=false;this._innerOnReply=function(i,s,t,e){k=i;d=s;p=t;h=e;r=true};this._xmlHttp.send(q);if(!r){alert("Couldn't get reply!");return{Status:"",Xml:null,Text:"",Body:""}}return{Status:k,Xml:d,Text:p,Body:h}}else{this._xmlHttp.send(q)}}catch(m){this._handleException("XmlHTTPRequest.Send error: ",m)}};this.ReCreate()};