tray/src/messenger/webim/js/chat.js
2008-12-09 23:15:26 +00:00

1 line
10 KiB
JavaScript

var nt={qt:function(rt){if(rt.contentDocument){return rt.contentDocument;} else if(rt.contentWindow){return rt.contentWindow.document;} else if(rt.document){return rt.document;} else{return null;} } ,st:function(rt){var tt=this.qt(rt);tt.open();tt.write("<h\164\155l\076\u003c\150\145\141d\u003e");tt.write("\074l\151\u006e\u006b re\u006c\u003d\"\u0073ty\154\u0065\u0073\u0068e\u0065\164\"\040t\171\u0070\145\u003d\"\164e\170\164\057c\u0073\u0073\" m\u0065\u0064\u0069a\075\"\141\u006c\154\"\040\150\162ef\075\""+ut.ht+"/\143\u0068at.cs\u0073\"\040\u002f\u003e");tt.write("<\u002fhe\141d\076<\142\157\144y\u0020bgc\u006flor='\043\106F\106F\u0046F'\u0020text\075'#\u00300000\060' \u006ci\156\153\075'#\u004328\064\u0030\060' \u0076lin\153='#C2840\u0030' al\u0069\156k\075'#\u0043\062840\u0030'\040m\u0061\u0072g\151\156\u0077\u0069\u0064\164\150\u003d'0'\040ma\162\147inh\u0065ig\u0068t='0'\040lef\u0074ma\u0072\u0067\u0069\u006e='0' \u0072ig\150tma\162\u0067in='\060'\040\164o\160m\141\u0072gi\156='0' bot\u0074\u006f\155\155argi\156\u003d'\u0030'>");tt.write("\u003c\u0074\u0061\142l\145\040wi\144th\075'1\u00300\045'\040\u0063el\u006csp\u0061\u0063ing='\060' ce\u006c\154p\u0061\144\144\u0069ng='0'\040b\u006fr\144\145\162\075'\u0030'>\u003ct\162\076\u003ctd\u0020\166al\u0069\u0067\156\u003d'to\u0070'\040cl\141\163s='mes\163ag\u0065'\040\151\u0064\075'\u0063\u006f\156\u0074e\156t'\u003e\u003c\u002f\u0074d></\164r\u003e\u003c/\u0074\141\u0062\u006ce><\u0061\040\151\u0064\u003d'\u0062o\u0074t\u006f\u006d'/\076");tt.write("</\u0062ody\u003e\u003c\057\150\u0074\155\154\076");tt.close();rt.onload=function(){if(rt.it){nt.qt(rt).getElementById('conte\u006e\164').innerHTML+=rt.it;nt.jt(rt);} } ;} ,kt:function(rt,lt){var ot=this.qt(rt).getElementById('\u0063\157\u006e\u0074\u0065n\164');if(ot==null){if(!rt.it)rt.it="";rt.it+=lt;} else{ot.innerHTML+=lt;} } ,jt:function(rt){var pt=this.qt(rt).getElementById('\142\157\164\164\157m');if(myAgent=='\157p\145r\141'){rt.contentWindow.scrollTo(0,this.qt(rt).getElementById('\143on\u0074\u0065\156t').clientHeight);} else if(pt)pt.scrollIntoView(false);} } ;sq.dt=mn.nn();mn.sn(sq.dt,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.et.on(this);this.pq.jr=this.ft.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=011610;this.gt={} ;this.frequency=(this.pq.frequency||2);this.at=0;this.bt=true;this.ct=true;this.vt=true;this.wt=this.pq.xt!=null;nt.st(this.pq.yt);if(this.pq.xt){this.pq.xt.onkeydown=this.zt.on(this);this.pq.xt.onfocus=(function(){this.vt=true;} ).on(this);this.pq.xt.onblur=(function(){this.vt=false;} ).on(this)} this.$t();} ,ft:function(_t,mu){this.nu("\157\146\146\154i\u006ee,\u0020r\145\u0063o\156\156\145\u0063t\u0069\156\u0067");this.qu();this.ru=setTimeout(this.$t.on(this),(783+217));} ,_q:function(_t){this.nu("\u0074i\u006d\u0065\u006fut,\040\u0072ec\u006f\156\u006e\145cting");this.qu();this.ru=setTimeout(this.$t.on(this),(617+383));} ,su:function(tu){this.pq.fq='a\143\u0074\u003d'+tu+'\u0026\u0074\u0068\u0072\u0065a\u0064='+(this.pq.threadid||0)+'\046to\u006be\156='+(this.pq.token||0)+'\u0026l\141\u0073\164i\u0064='+(this.pq.uu||0);if(this.pq.user)this.pq.fq+="&u\u0073er=t\162ue";if(tu=='r\145\146\162es\u0068'&&this.pq.xt&&this.pq.xt.value!='')this.pq.fq+="&typ\u0065d\u003d1";} ,hu:function(iu){if(this.pq.xt)this.pq.xt.disabled=!iu;} ,qu:function(){this.hu(true);if(this.gt.pq)this.gt.pq.onComplete=undefined;clearTimeout(this.ru);} ,$t:function(){this.su("\162efr\u0065s\u0068");this.gt=new sq.vq(this.pq.servl,this.pq);} ,et:function(hq){try{this.hu(true);this.bt=true;var ju=sq.uq(hq);if(ju&&ju.tagName=='\u0074\u0068\162ead'){this.ku(ju);} else{this.lu(hq,ju,'\162\145\u0066r\145\163\u0068 \u006dess\141\u0067e\163\040\146ailed');} } catch(e){} this.ct=false;this.ru=setTimeout(this.$t.on(this),this.frequency*0x3e8);} ,ou:function(pu){if(pu==""||!this.bt){return;} this.bt=false;this.qu();this.ct=true;this.su("po\163\u0074");var du={} .un(this.pq);du.fq+="\046m\u0065s\163\u0061\147\u0065="+encodeURIComponent(pu);du.onComplete=(function(eu){this.et(eu);if(this.pq.xt){this.pq.xt.value='';this.pq.xt.focus();} } ).on(this);if(myRealAgent!='o\160\145\u0072\141')this.hu(false);this.gt=new sq.vq(this.pq.servl,du);} ,fu:function(gu){this.ct=true;new sq.vq(this.pq.servl,{fq:'\u0061\143\164=re\u006e\141\u006de\046t\u0068r\u0065\141\144\u003d'+(this.pq.threadid||0)+'&\164oke\156='+(this.pq.token||0)+'\u0026na\155\145='+encodeURIComponent(gu)} );} ,au:function(hq){var ju=sq.uq(hq);if(ju&&ju.tagName=='cl\157s\145\u0064'){setTimeout('w\151ndo\u0077\056c\154\157s\u0065\u0028\u0029',0x7d0);} else{this.lu(hq,ju,'\u0063\u0061\156\u006eot\u0020\u0063lo\163\145');} } ,bu:function(){var cu='\u0061\143\164\075\143los\u0065&\164hr\u0065\141d\075'+(this.pq.threadid||0)+'\046\164o\u006b\u0065n\075'+(this.pq.token||0);if(this.pq.user)cu+="&\165s\u0065r\075\u0074\162\u0075e";new sq.vq(this.pq.servl,{fq:cu,onComplete:this.au.on(this)} );} ,vu:function(wu,xt){var xu=qs.us(xt);nt.kt(wu,xu);} ,yu:function(zu){if($("\u0074\171\u0070\151\u006egdiv")){$("ty\u0070\151\u006e\147d\151v").style.display=zu?'\151\156\u006ci\u006ee':'\u006eo\u006ee';} } ,$u:function(_u){var mh=qs.us(_u);if(this.pq._u&&this.pq.user){this.pq._u.innerHTML=mh!=""?"\074\151\155\u0067\u0020\u0073rc=\""+ut.ht+"\057\151\155\141ge\163/\146\u0072ee.g\u0069f\" \u0077i\144th=\"\067\"\040\150\145\151g\150\164\075\"\u0031\"\u0020b\u006f\162\u0064er\075\"0\"\040\u0061\u006c\164\075\"\"\u0020\057><img\u0020s\162c\075\""+mh+"\" b\157\u0072d\u0065r\075\"\060\"\u0020\141\154t\075\"\"/>":"";} } ,ku:function(ju){var nh=false;var qh=this.pq.yt;var rh=qs.ks(ju,"l\141\u0073\164\151\u0064");if(rh){this.pq.uu=rh;} var sh=qs.ks(ju,"\164\u0079\160\u0069\156g");if(sh){this.yu(sh=='\061');} var th=qs.ks(ju,"c\141n\u0070o\163t");if(th){if(th=='\061'&&!this.wt||this.wt&&th!='\061'){window.location.href=window.location.href;} } for(var i=0;i<ju.childNodes.length;i++){var uh=ju.childNodes[i];if(uh.tagName=='\155ess\u0061\147\u0065'){nh=true;this.vu(qh,uh);} else if(uh.tagName=='a\u0076\141t\u0061r'){this.$u(uh);} } if(window.location.search.indexOf('\u0074r\u0061\u0063\145=\157\156')>=0){var iu="\u0075\u0070\u0064ate\u0064";if(this.at>0){var hh=((new Date()).getTime()-this.at)/01750;iu=iu+"\054\u0020"+hh+"\u0020\163\u0065\u0063\u0073";if(hh>012){alert(iu);} } this.at=(new Date()).getTime();this.nu(iu);} else{this.ih();} if(nh){nt.jt(this.pq.yt);if(!this.ct){$s(ut.ht+'/so\165\u006e\144\163/ne\u0077_m\145ssa\u0067\u0065.\u0077\141\u0076');} if(!this.vt){window.focus();} } } ,zt:function(k){if(k){jh=k.ctrlKey;k=k.which;} else{k=event.keyCode;jh=event.ctrlKey;} if(this.pq.xt&&((k==015&&(jh||myRealAgent=='\157p\145ra'))||(k==012))){var kh=this.pq.xt.value;if(myRealAgent=='o\u0070er\u0061'){kh=kh.replace(/[\r\n]+$/,'');} this.ou(kh);return false;} return true;} ,lu:function(hq,ju,lh){if(ju&&ju.tagName=='\145rr\157\u0072'){this.nu(qs.rs(ju,"\u0064esc\162"));} else{this.nu("\u0072ec\u006f\156ne\u0063ti\156g");} } ,oh:function(k){if($("\145\156gi\u006e\145\151nf\157")){$("\u0065n\u0067\u0069\u006ee\u0069n\146\157").style.display='\151nl\u0069\u006e\145';$("\145\u006eg\151\156ei\156f\157").innerHTML=k;} } ,nu:function(k){if(this.ph)clearTimeout(this.ph);this.oh(k);this.ph=setTimeout(this.ih.on(this),0xfa0);} ,ih:function(){$("engin\u0065\u0069\156fo").style.display='\u006eo\u006e\u0065';} } );dh=mn.nn();dh.prototype={qn:function(pq){this.pq=pq;this.eh=0;if(this.pq.fh&&this.pq.gh&&this.pq.ah){this.pq.ah.onmousedown=this.bh.on(this);this.pq.ah.onmouseup=this.ch.on(this);this.pq.ah.onmousemove=this.vh.on(this);} } ,bh:function(e){var or=e||event;if(this.pq.ah.setCapture)this.pq.ah.setCapture();this.wh=this.pq.fh.style.pixelHeight||this.pq.fh.clientHeight;this.xh=or.screenY;this.pq.yh=this.pq.fh.style.pixelHeight+this.pq.gh.clientHeight-this.pq.zh;this.eh=1;} ,ch:function(){if(this.eh){if(this.pq.ah.releaseCapture)this.pq.ah.releaseCapture();this.eh=0;} } ,vh:function(e){var or=e||event;if(this.eh){var $h=this.wh-(or.screenY-this.xh);if($h>this.pq.yh)$h=this.pq.yh;else if($h<this.pq._h)$h=this.pq._h;if(myAgent=='mo\172')this.pq.fh.style.height=$h+'px';else this.pq.fh.style.pixelHeight=$h;} } } ;var ut={mi:{} ,ni:{} ,qi:function(){ut.mi.fu($('\u0075n\141\u006de').value);$('cha\u006e\u0067en\141\u006de\061').style.display='\u006e\157\156\145';$('\u0063h\141n\u0067en\u0061\155\145\u0032').style.display='i\u006e\u006cin\145';$('\165\u006eam\145\u006ci\156k').innerHTML=$('\165\u006e\u0061\u006d\145').value;} ,ri:function(){$('\u0063\u0068a\u006e\u0067e\156am\145\u0031').style.display='\151n\u006ci\156\u0065';$('\143\150\u0061\u006e\147e\156a\155\145\u0032').style.display='\u006eo\u006ee';} } ;er.lr({'#p\u006fst\155\145s\163a\147\u0065\040a':function(si){si.onclick=function(){var xt=$('\u006d\163\147w\u006ed');if(xt)ut.mi.ou(xt.value);} ;} ,'a\u0023\163n\u0064\155\145\163s\141\u0067\u0065\154\156k':function(si){if(myRealAgent=='op\145r\u0061'){si.innerHTML=si.innerHTML.replace('\u0043t\162l-','');} } ,'\u0073\u0065\154ec\u0074#\160r\u0065\u0064\145\146ined':function(si){si.onchange=function(){var xt=$('\155\u0073\u0067\167\u006e\u0064');if(this.selectedIndex!=0){xt.value=this.options[this.selectedIndex].innerText||this.options[this.selectedIndex].innerHTML;} this.selectedIndex=0;xt.focus();} ;} ,'d\u0069v\043\143h\u0061\u006eg\145\u006ea\u006de2 \u0061':function(si){si.onclick=function(){ut.ri();return false;} ;} ,'\144\u0069v#\u0063ha\u006e\147\145\156\u0061me\061\u0020a':function(si){si.onclick=function(){ut.qi();return false;} ;} ,'d\u0069\166\u0023cha\156\u0067\u0065name\u0031 i\156\u0070\u0075t#\165\u006ea\u006d\145':function(si){si.onkeydown=function(e){var or=e||event;if(or.keyCode==015){ut.qi();} } ;} ,'\141#\u0072e\u0066\162\145sh':function(si){si.onclick=function(){ut.mi.qu();ut.mi.$t();} ;} ,'\141\u002e\143\154\157\u0073\u0065\u0074\u0068\162ea\144':function(si){si.onclick=function(){ut.mi.bu();} ;} } );kr.lr(window,'\u006f\u006e\154\u006fa\u0064',function(){ut.ht=threadParams.wroot;ut.ni=new dh({ah:$("spl\u0031"),fh:$("\u006dsgwn\144\u0074\u0064"),gh:$("c\u0068at\u0077\156\u0064td"),_h:(18+12),zh:(20+10)} );ut.mi=new sq.dt(({yt:myRealAgent=='\u0073afar\151'?self.frames[0]:$("c\150\141t\167n\u0064"),_u:$("av\u0061\u0074\u0061r\167n\144"),xt:$("\u006d\u0073\u0067w\u006e\144")} ).un(threadParams||{} ));} );