var DU=-1;function OD(uZ,Yk,QG,CX){this.uZ=uZ;this.SK=Yk;this.SK['md5']=DU;this.QG=QG;this.Yk=OO(this.SK);this.Yk=kq(this.Yk);var qT='';if(uZ.length>0){qT='api_function='+uZ+'&';}this.Xa=qT+"params="+this.Yk;this.CX=CX?CX.splice(0,CX.length):null;};function xN(){var iQ="function : '"+this.uZ+"'\n";for(x in this.SK){iQ+="param : '"+x+"'="+this.SK[x]+";\n";}iQ+="asynchronous : "+this.QG;return iQ;};OD.prototype.toString=xN;function Communication(mU,kf,bI,G3){this.mU=mU;this.respText='';this.respDOMObject=null;this.SD=false;this.zb=false;this._T=false;this.CX=new Array();this.VG=null;this.xB=null;this.kf=kf;this.bI=bI;this.cz=0;this.Hn=null;this.A5=null;this.o0=null;this.yw=-1;var sb=new Object();sb.Z7=null;sb.pq=this;Communication.E4.push(sb);this.nD=Communication.E4.length-1;sb.Da=new Function('Da'+"("+this.nD+");");sb.PC=new Function('PC'+"("+this.nD+");");if(G3){this.cd=new Array();}this.sR=false;};Communication.E4=new Array();Communication.QK;Communication.um;Communication.mP;Communication.Wm;Communication.JU;Communication.Zf;Communication.fh;Communication.f4;Communication.pg;Communication.Pw;Communication.Z6;Communication.Z6;Communication.gm;Communication.fN;Communication.mQ;function ZS(text,wE){if(!this.bI){Communication.Zf(text,wE,undefined,this.sR);}};Communication.prototype.Zf=ZS;function qs(url,Yk,an){var sb=Communication.E4[this.nD];if(window.XMLHttpRequest){sb.Z7=new window.XMLHttpRequest();sb.Z7.onreadystatechange=sb.Da;if(!an){sb.Z7.onload=sb.PC;}sb.Z7.open("POST",url,an);sb.Z7.setRequestHeader("Content-Type","application/x-www-form-urlencoded");sb.Z7.send(Yk);}else if(window.ActiveXObject){sb.Z7=new ActiveXObject("Microsoft.XMLHTTP");if(sb.Z7){sb.Z7.onreadystatechange=sb.Da;sb.Z7.open("POST",url,an);sb.Z7.setRequestHeader("Content-Type","application/x-www-form-urlencoded");sb.Z7.send(Yk);};}};Communication.prototype.loadXML=qs;function lw(caller){if(this.cd){this.cd=new Array();}if(this.SD){Communication.E4[this.nD].Z7.abort();}if(this.Hn&&this.Hn.length>0){caller=(caller==undefined)?this:caller;for(var LS=0;LS<this.Hn.length;LS++){var bL=this.Hn[LS];if(bL!=caller){bL.kv(caller);};};}if(this.zb){this.zb=false;}};Communication.prototype.kv=lw;function oo(caller){var a9=false;if(this.A5&&this.A5.length>0){caller=(caller==undefined)?this:caller;for(var LS=0;LS<this.A5.length;LS++){var KG=this.A5[LS];if(KG!=caller&&(KG.SD||KG.lK(caller))){a9=true;break;};};}return a9;};Communication.prototype.lK=oo;function Pi(){if(this.SD){if(!this.cd){window.setTimeout('hQ'+'('+this.nD+');',200);}return;}if(this.lK()){this.zb=true;return;}if(this.cd){this.xB=this.cd.shift();this.VG=this.xB.CX;}else{this.VG=this.CX.splice(0,this.CX.length);}if(!this.kf&&Communication.mP){Communication.mP();}this.SD=true;this.cz=0;this.FP();};Communication.prototype.a4=Pi;function VR(){this.respText='';this.respDOMObject=null;dF=this.xB;if(Communication.fh)Communication.fh(dF.toString(),1);if(Communication.QK&&Communication.QK.vM){this.yw=Communication.QK.vM('api',dF.uZ,dF.SK);}this.loadXML(this.mU,dF.Xa,dF.QG);};Communication.prototype.FP=VR;function LP(){if(++this.cz<=Communication.um){this.FP();return true;}return false;};Communication.prototype.CP=LP;function YW(uZ,Yk,QG){this._T=true;if(this.cd){var dF=new OD(uZ,Yk,QG,this.CX);this.cd.push(dF);}else{var dF=new OD(uZ,Yk,QG);this.xB=dF;this.kv();}this.a4();};Communication.prototype.callFunction=YW;function fo(){if(this._T){while(this.CX.length>0){this.CX.pop();}this._T=false;}};Communication.prototype.prepareCallbackStack=fo;function nS(N6,Gg){mW=new Object();mW.N6=N6;mW.Gg=Gg;this.CX.push(mW);};Communication.prototype.addToCallbackStack=nS;function ae(sV){this.sV=sV;while(this.VG.length>0){var mW=this.VG.pop();if(this.sV||mW.Gg){var sl;if(Communication.QK&&Communication.QK.vM){var p_=Communication.QK.vM('callback',this.xB.uZ,DT(mW.N6));}try{sl=eval(mW.N6);}catch(m7){var message='Exception when evaluating \''+mW.N6+'\'\n';message+='Exception: '+m7+'\n';for(x in m7){message+=x+': '+m7[x]+'\n';}this.Zf(Communication.pg,message);sl=0;}if(Communication.QK&&Communication.QK.SJ){Communication.QK.SJ(p_,sl,-10,DT(message));}switch(sl){case 0:this.sV=false;break;case-1:this._T=false;this.SD=false;return;default:break;};};}this.SD=false;if(this.cd&&this.cd.length>0){this.a4();}else{if(this.o0){for(var LS=0;LS<this.o0.length;LS++){var zT=this.o0[LS];if(zT.zb){zT.zb=false;zT.a4();};};};}};Communication.prototype.mT=ae;function ov(sb){if(this.Hn==null){this.Hn=new Array();}this.Hn.push(sb);};Communication.prototype.tI=ov;function YN(sb){if(this.A5==null){this.A5=new Array();}this.A5.push(sb);if(sb.o0==null){sb.o0=new Array();}sb.o0.push(this);};Communication.prototype.vj=YN;function hQ(index){Communication.E4[index].pq.a4();};function PC(index){var sb=Communication.E4[index];var ni=sb.pq;var Z7=sb.Z7;var pr=1;var a5=Communication.fN;;var message='';var status;try{if(Z7&&Z7.status!=undefined){status=Z7.status;}}catch(m7){message='Request aborted';if(Communication.fh)Communication.fh('aborted');pr=0;a5=Communication.gm;}if(pr){try{if(status==200){var responseText=Z7.responseText;var responseXML=Z7.responseXML;if(Communication.fh)Communication.fh(responseText,1);if(responseXML&&responseXML.parseError){var LT=responseXML.parseError;if(LT&&(LT.errorCode!=0)){var nE=Z7.responseXML.parseError.errorCode;var PX=Z7.responseXML.parseError.line;var nL=Z7.responseXML.parseError.linepos;var uv=Z7.responseXML.parseError.reason;message="Bład parsowania XML'a :\n"+"eCode       = "+nE+"\neLine       = "+PX+"\neLinePos    = "+nL+"\neReason     = "+uv;ni.Zf(Communication.Pw,message);pr=0;};}if(pr&&Communication.JU){var sl=Communication.JU(responseText,responseXML);pr=parseInt(sl[0]);a5=parseInt(sl[1]);message=sl[2];switch(pr){case-1:return;case 0:ni.Zf(Communication.Pw,message);default:break;};}ni.respDOMObject=responseXML;ni.respText=responseText;}else{pr=0;a5=Communication.gm;if(status==0){message='Request aborted';Communication.fh('aborted');}else{if(ni.CP()){Communication.fh('Status:'+status+'. Reconnecting!');return;}message="Error loading document:\n"+"xmlHttpReq.status : "+Z7.status+"\nresponseText = "+Z7.statusText;ni.Zf(Communication.Z6,message);};}}catch(m7){a5=Communication.mQ;message='Exception '+m7;Communication.fh('Exception: '+m7);ni.Zf(Communication.Pw,message);pr=0;};}if(Communication.QK&&Communication.QK.SJ){Communication.QK.SJ(ni.yw,pr,a5,message);}ni.mT(pr);};function Da(index){var sb=Communication.E4[index];switch(sb.Z7.readyState){case 0:{break;}case 1:{break;}case 2:{break;}case 3:{break;}case 4:{if(!this.kf&&Communication.Wm){Communication.Wm();}PC(index);}};};
