var rt={st:function(tt){if(tt.contentDocument){return tt.contentDocument;} else if(tt.contentWindow){return tt.contentWindow.document;} else if(tt.document){return tt.document;} else{return null;} } ,ut:function(tt){var ht=this.st(tt);ht.open();ht.write("");ht.write("");ht.write("");ht.write("
");ht.write("");ht.close();tt.onload=function(){if(tt.jt){rt.st(tt).getElementById('content').innerHTML+=tt.jt;rt.kt(tt);} } ;} ,lt:function(tt,ot){var pt=this.st(tt).getElementById('content');if(pt==null){if(!tt.jt)tt.jt="";tt.jt+=ot;} else{pt.innerHTML+=ot;} } ,kt:function(tt){var dt=this.st(tt).getElementById('bottom');if(myAgent=='opera'){try{tt.contentWindow.scrollTo(0,this.st(tt).getElementById('content').clientHeight);} catch(e){} } if(dt){dt.scrollIntoView(false);} } } ;sq.et=mn.nn();mn.sn(sq.et,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.ft.on(this);this.pq.jr=this.gt.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=0x1388;this.at={} ;this.frequency=(this.pq.frequency||2);this.bt=0;this.ct=true;this.vt=true;this.wt=true;this.xt=this.pq.yt!=null;rt.ut(this.pq.zt);if(this.pq.yt){this.pq.yt.onkeydown=this.$t.on(this);this.pq.yt.onfocus=(function(){this.wt=true;} ).on(this);this.pq.yt.onblur=(function(){this.wt=false;} ).on(this)} this._t();} ,gt:function(mu,nu){this.qu("offline, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),01750);} ,_q:function(mu){this.qu("timeout, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),(620+380));} ,tu:function(uu){this.pq.fq='act='+uu+'&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0)+'&lastid='+(this.pq.hu||0);if(this.pq.user)this.pq.fq+="&user=true";if(uu=='refresh'&&this.pq.yt&&this.pq.yt.value!='')this.pq.fq+="&typed=1";} ,iu:function(ju){if(this.pq.yt)this.pq.yt.disabled=!ju;} ,ru:function(){this.iu(true);if(this.at.pq)this.at.pq.onComplete=undefined;clearTimeout(this.su);} ,_t:function(){this.tu("refresh");this.at=new sq.vq(this.pq.servl,this.pq);} ,ft:function(hq){try{this.iu(true);this.ct=true;var ku=sq.uq(hq);if(ku&&ku.tagName=='thread'){this.lu(ku);} else{this.ou(hq,ku,'refresh messages failed');} } catch(e){} this.vt=false;this.su=setTimeout(this._t.on(this),this.frequency*(775+225));} ,pu:function(du){if(du==""||!this.ct){return;} this.ct=false;this.ru();this.vt=true;this.tu("post");var eu={} .un(this.pq);eu.fq+="&message="+encodeURIComponent(du);eu.onComplete=(function(fu){this.ft(fu);if(this.pq.yt){this.pq.yt.value='';this.pq.yt.focus();} } ).on(this);if(myRealAgent!='opera')this.iu(false);this.at=new sq.vq(this.pq.servl,eu);} ,gu:function(au){this.vt=true;new sq.vq(this.pq.servl,{fq:'act=rename&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0)+'&name='+encodeURIComponent(au)} );} ,bu:function(hq){var ku=sq.uq(hq);if(ku&&ku.tagName=='closed'){setTimeout('window.close()',(1224+776));} else{this.ou(hq,ku,'cannot close');} } ,cu:function(){var vu='act=close&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0);if(this.pq.user)vu+="&user=true";new sq.vq(this.pq.servl,{fq:vu,onComplete:this.bu.on(this)} );} ,wu:function(xu,yt){var yu=qs.us(yt);rt.lt(xu,yu);} ,zu:function($u){if($("typingdiv")){$("typingdiv").style.display=$u?'inline':'none';} } ,_u:function(mh){var nh=qs.us(mh);if(this.pq.mh&&this.pq.user){this.pq.mh.innerHTML=nh!=""?"\"\"\"\"/":"";} } ,lu:function(ku){var rh=false;var sh=this.pq.zt;var th=qs.ks(ku,"lastid");if(th){this.pq.hu=th;} var uh=qs.ks(ku,"typing");if(uh){this.zu(uh=='1');} var hh=qs.ks(ku,"canpost");if(hh){if(hh=='1'&&!this.xt||this.xt&&hh!='1'){window.location.href=window.location.href;} } for(var i=0;i=0){var ju="updated";if(this.bt>0){var jh=((new Date()).getTime()-this.bt)/(892+108);ju=ju+", "+jh+" secs";if(jh>012){alert(ju);} } this.bt=(new Date()).getTime();this.qu(ju);} else{this.kh();} if(rh){rt.kt(this.pq.zt);if(!this.vt){var lh=$('soundimg');if(lh==null||lh.className.match(new RegExp("\\bisound\\b"))){$s(it.qh+'/sounds/new_message.wav');} } if(!this.wt){window.focus();} } } ,oh:function(ph,dh){return((dh==(12+1)&&(ph||this.pq.ignorectrl))||(dh==012));} ,$t:function(k){if(k){eh=k.ctrlKey;k=k.which;} else{k=event.keyCode;eh=event.ctrlKey;} if(this.pq.yt&&this.oh(eh,k)){var fh=this.pq.yt.value;if(this.pq.ignorectrl){fh=fh.replace(/[\r\n]+$/,'');} this.pu(fh);return false;} return true;} ,ou:function(hq,ku,gh){if(ku&&ku.tagName=='error'){this.qu(qs.rs(ku,"descr"));} else{this.qu("reconnecting");} } ,ah:function(k){if($("engineinfo")){$("engineinfo").style.display='inline';$("engineinfo").innerHTML=k;} } ,qu:function(k){if(this.bh)clearTimeout(this.bh);this.ah(k);this.bh=setTimeout(this.kh.on(this),07640);} ,kh:function(){$("engineinfo").style.display='none';} } );var it={ch:{} ,vh:function(){it.ch.gu($('uname').value);$('changename1').style.display='none';$('changename2').style.display='inline';$('unamelink').innerHTML=nt($('uname').value);} ,wh:function(){$('changename1').style.display='inline';$('changename2').style.display='none';} } ;er.lr({'#postmessage a':function(xh){xh.onclick=function(){var yt=$('msgwnd');if(yt)it.ch.pu(yt.value);} ;} ,'select#predefined':function(xh){xh.onchange=function(){var yt=$('msgwnd');if(this.selectedIndex!=0){yt.value=this.options[this.selectedIndex].innerText||this.options[this.selectedIndex].innerHTML;} this.selectedIndex=0;yt.focus();} ;} ,'div#changename2 a':function(xh){xh.onclick=function(){it.wh();return false;} ;} ,'div#changename1 a':function(xh){xh.onclick=function(){it.vh();return false;} ;} ,'div#changename1 input#uname':function(xh){xh.onkeydown=function(e){var or=e||event;if(or.keyCode==015){it.vh();} } ;} ,'a#refresh':function(xh){xh.onclick=function(){it.ch.ru();it.ch._t();} ;} ,'a#togglesound':function(xh){xh.onclick=function(){var lh=$('soundimg');if(!lh){return;} if(lh.className.match(new RegExp("\\bisound\\b"))){lh.className="tplimage inosound";} else{lh.className="tplimage isound";} var yh=$('msgwnd');if(yh)yh.focus();} ;} ,'a.closethread':function(xh){xh.onclick=function(){it.ch.cu();} ;} } );kr.lr(window,'onload',function(){it.qh=threadParams.wroot;it.cssfile=threadParams.cssfile;it.ch=new sq.et(({ignorectrl:-1,zt:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),mh:$("avatarwnd"),yt:$("msgwnd")} ).un(threadParams||{} ));} );