var oq;if(false){oq=new aY();}var bg={q:null,H:new Object(),o:0,b:function(){if(bg.o++>5){if(oq){oq.f(0);}checkAndCloseLoadingSplash();bg.o=0;}},V:function(b,D,r){var H=m8(b);if(H){var S=bg.H[b];if(null==S||D>S){if(!r||D>0){H.innerHTML=D+"%";bg.H[b]=D;}}}else{qQ("Can't mark box with ID "+b+"; not found.",R7.D);}},D:function(b){var V=m8(b);if(V){V.innerHTML="<img alt=\"Checkmark\" width=\"15px\" height=\"15px\" src=\"img/green_check.gif\" />";}else{qQ("Can't mark box with ID "+b+"; not found.",R7.D);}},e:function(){if(null==bg.q){bg.S();}else{hz(m8("splash"));}},h:function(){LK(m8("splash"));},l:function(){Fk=0;bg.D("tickPrefs");bg.D("tickFolderList");bg.D("tickMailbox");setTimeout("TC()",250);},S:function(){try{bg.q=m8("splash");hz(bg.q);var b=wo("<DIV>",bg.q);b.id="filler";b.style.backgroundColor="#F2EDED";b.style.position="absolute";b.style.zIndex="9998";b.style.height="100%";b.style.width="100%";XH(b,65);var V=m8("loadingUserPrefs");V.innerHTML=strings.loading_user_prefs+"... ";V=m8("loadingFolderList");V.innerHTML=strings.loading_retrieving_folder_list+"... ";V=m8("loadingAccessingMailbox");V.innerHTML=strings.loading_accessing_mailbox+"... ";var D=m8("splashSurround");D.style.position="absolute";D.style.zIndex="9999";D.style.height="100%";D.style.width="100%";D.onclick=bg.b;}catch(e){bg.q=null;qQ("Couldn't locate splash element.",R7.r);}},r:function(b){var V=0;for(var D=0;D<b.length;D++){var H=b[D];var S=H.o();if(null!=S&&S.indexOf("INBOX")>0){V+=H.h();}}V=(V)?(V/b.length):0;bg.V("tickMailbox",V,true);}};function BF(){this.e=null;this.l=null;this.S=null;this.d=null;this.H=null;}function bh(b){var V=0;try{this.e=b.getAttribute("id");this.S=parseInt(b.getAttribute("percent"));this.l=b.getAttribute("currently");this.d=parseInt(b.getAttribute("time"));this.H=b.getAttribute("url");}catch(e){qQ("Unable to parse pong.",R7.r);V=1;}return V;}BF.prototype.q=bh;function Ny(){return this.l;}BF.prototype.D=Ny;function cj(){return this.d;}BF.prototype.r=cj;function ch(){return this.S;}BF.prototype.h=ch;function UP(){return this.H;}BF.prototype.o=UP;function fi(){return this.e;}BF.prototype.V=fi;function q8(){return (100<=this.S);}BF.prototype.b=q8;function lB(b,V){this.S=null;this.V=b;this.r=V;}function oZ(){var b=new X2.S(nW("ping"),true,ps(this,this.H),ps(this,this.b));b.D("ping",ax);b.b.add("no.report.faults",true);b.V.d();}lB.prototype.h=oZ;function wn(b,V){var D=new Array();var r=b.D();if(r){var S=r.getElementsByTagName("pingResponse");if(S.length){var h=S[0];var l=h.getAttribute("code");if("OK"==l){var o=r.getElementsByTagName("pong");for(var q=0;q<o.length;q++){var e=new BF();if(!e.q(o[q])){if(!e.b()){D.push(e);}}}}else{if("NOPLATFORM"==l){qQ("Can't really check status, no platform ping.",R7.V);}else{qQ("Ping - error or unknown status reported by SWA.",R7.r);if(this.r){this.r();}return ;}}}}this.S=D;if(this.V){this.V(D);}}lB.prototype.H=wn;function PZ(V,D){qQ("Ping error!",R7.r);this.S=null;if(this.r){this.r();}}lB.prototype.b=PZ;function Sk(){return this.S;}lB.prototype.D=Sk;function aY(b,V,D,r,H){this.h=0;this.o=0;this.W=0;this.a=5;this.e=300;this.t=this.e;this.V=(b)?b:1000;this.H=new lB(ps(this,this.S),ps(this,this.l));this.p=V;this.B=D;this.D=r;this.d=H;this.q=false;}function gG(b){this.W++;this.h++;if(this.W>=this.e||this.h>=this.t){qQ("Stopping pinging, threshold expired.",R7.D);this.f(1);}else{if(this.N()){qQ("Conditions satisfied, done monitoring progress.",R7.D);this.f(0);}else{if(this.D){this.D(b);}this.C();}}}aY.prototype.S=gG;function Z0(){var b=true;if(this.d){for(var V in this.d){b=this.d[V]();if(!b){break;}}}return b;}aY.prototype.N=Z0;function co(b){this.W++;this.o++;if(this.W>=this.e||this.o>=this.a){qQ("Stopping pinging, too many errors.",R7.D);this.f(2);}else{this.C();}}aY.prototype.l=co;function jP(){qQ("New ping, count: "+this.W,R7.D);return this.H.h();}aY.prototype.b=jP;function iV(b){if(b){setTimeout("cZ()",b);}else{if(!this.q&&this.p){this.p();}this.q=true;this._conditionTimer=setInterval("wS()",150);this.C();}}aY.prototype.r=iV;function vn(b){if(!this.q){qQ("Finish called on already stopped ping monitor.",R7.V);return ;}this.q=false;if(this._pingTimer){clearTimeout(this._pingTimer);}if(this._conditionTimer){clearInterval(this._conditionTimer);}if(this.B){this.B();}qQ("Done pinging with result: "+b,R7.D);}aY.prototype.f=vn;function gV(){return this.V;}aY.prototype.K=gV;function YY(b){this.V=b;}aY.prototype.Y=YY;function WL(b){if(!this.q){qQ("Loop called on stopped ping monitor.",R7.V);return ;}this._pingTimer=setTimeout("kG()",(b)?b:this.V);}aY.prototype.C=WL;function kG(){if(oq){oq.b();}}function cZ(){if(oq){oq.r();}}function wS(){if(oq){if(oq.N()){oq.f(0);}}}function TC(){bg.h();}
