tray/src/messenger/webim/js/common.js
2008-10-01 22:56:46 +00:00

1 line
8.0 KiB
JavaScript

var mn={nn:function(){return function(){this.qn.rn(this,arguments);} ;} ,sn:function(tn,parent,body){Object.un(Object.un(tn.prototype,parent.prototype),body);} } ;Object.un=function(hn,jn){for(kn in jn){hn[kn]=jn[kn];} return hn;} ;Object.prototype.un=function(ln){return Object.un.rn(this,[this,ln]);} ;Function.prototype.on=function(ln){var pn=this;return function(){return pn.rn(ln,arguments);} } ;Function.prototype.dn=function(ln){var pn=this;return function(event){pn.call(ln,event||window.event);} } ;Number.prototype.en=function(){var fn=this.toString((11+5));if(this<(13+3))return'\060'+fn;return fn;} ;var gn={an:function(){var returnValue;for(var i=0;i<arguments.length;i++){var bn=arguments[i];try{returnValue=bn();break;} catch(e){} } return returnValue;} } ;var cn=mn.nn();cn.prototype={qn:function(vn,frequency){this.vn=vn;this.frequency=frequency;this.wn=false;this.xn();} ,xn:function(){setInterval(this.yn.on(this),this.frequency*(888+112));} ,yn:function(){if(!this.wn){try{this.wn=true;this.vn();} finally{this.wn=false;} } } } ;function zn(id){var x;if(!(x=document[id])&&document.all)x=document.all[id];if(!x&&document.getElementById)x=document.getElementById(id);if(!x&&!document.all&&document.getElementsByName){x=document.getElementsByName(id);if(x.length==0)return null;if(x.length==1)return x[0];} return x;} if(!Array.prototype.$n){Array.prototype.$n=function(){var _n=this.length;for(var i=0;i<arguments.length;i++)this[_n+i]=arguments[i];return this.length;} ;} function $(){var mq=new Array();for(var i=0;i<arguments.length;i++){var nq=arguments[i];if(typeof nq=='st\u0072\151\u006eg')nq=zn(nq);if(arguments.length==1)return nq;mq.$n(nq);} return mq;} if(!Function.prototype.rn){Function.prototype.rn=function(obj,params){var qq=new Array();if(!obj)obj=window;if(!params)params=new Array();for(var i=0;i<params.length;i++)qq[i]='p\141\162a\u006ds['+i+'\135';obj.$apply$=this;var rq=eval('\157b\152.\u0024app\u006c\171\044('+qq.join('\054 ')+'\u0029');obj.$apply$=null;return rq;} ;} var sq={tq:function(){return gn.an(function(){return new ActiveXObject('\115\u0073xm\154\u0032\u002eX\115\114\u0048T\u0054\120')} ,function(){return new ActiveXObject('\u004di\u0063ros\u006f\146t\u002e\130ML\110\u0054T\120')} ,function(){return new XMLHttpRequest()} )||false;} ,uq:function(hq){if(hq&&hq.status>=0310&&hq.status<0454){var iq=hq.responseXML;if(iq&&iq.documentElement)return iq.documentElement;} return null;} ,jq:function(hq){return hq.statusText||"\u0063o\156n\145\143\u0074\u0069\u006fn\040\145rr\u006f\u0072\u0020N"+hq.status;} ,kq:function(){} } ;sq.lq=function(){} ;sq.lq.prototype={oq:function(pq){this.pq={dq:'po\u0073t',eq:true,fq:''} .un(pq||{} );} ,gq:function(){try{return this.aq.status||0;} catch(e){return 0} } ,bq:function(){var status=this.gq();return!status||(status>=0310&&status<(282+18));} ,cq:function(){return!this.bq();} } ;sq.vq=mn.nn();sq.vq.wq=['\u0055\156\u0069\156\151\164\u0069\u0061\u006c\151\172\145\u0064','Load\151\156\147','\u004co\u0061\144\u0065d','Int\145\u0072a\143\164iv\145','\103\157\155p\u006c\145t\u0065'];mn.sn(sq.vq,sq.lq,{qn:function(url,pq){this.aq=sq.tq();this.oq(pq);this.xq={} ;this.yq=false;this.zq(url);} ,zq:function(url){var fq=this.pq.fq||'';if(fq.length>0)fq+='&\u005f\075';try{if(this.pq.dq=='\u0067\145\164'&&fq.length>0)url+='\u003f'+fq;this.aq.open(this.pq.dq.toUpperCase(),url,this.pq.eq);if(this.pq.eq){this.aq.onreadystatechange=this.$q.on(this);if(this.pq.timeout){this.xq=setTimeout(this._q.on(this),this.pq.timeout);} } this.mr();var nr=this.pq.qr?this.pq.qr:fq;this.aq.send(this.pq.dq=='po\163\164'?nr:null);} catch(e){this.rr(e);} } ,mr:function(){var sr=['X\u002d\122\u0065\u0071\165\u0065\163\u0074\u0065\144\055\u0057\151\u0074\150','\u0058\u004dL\u0048\164t\160Requ\u0065s\164'];if(this.pq.dq=='\u0070o\163\u0074'){sr.$n('C\157n\164\145nt\u002dt\u0079p\u0065','\u0061p\u0070\154\151\143\141ti\u006f\156\u002f\u0078\u002d\167ww\u002d\146\157r\u006d\u002d\u0075\162\154\u0065\u006e\u0063\157de\u0064');if(this.aq.overrideMimeType&&(navigator.userAgent.match("/\u0047\u0065cko\/\u0028\d\u007b4\175 )/")||[0,0x7d5])[1]<03725)sr.$n('\u0043\u006f\156nect\u0069\u006f\u006e','\143\154o\u0073e');} if(this.pq.sr)sr.$n.rn(sr,this.pq.sr);for(var i=0;i<sr.length;i+=2)this.aq.setRequestHeader(sr[i],sr[i+1]);} ,$q:function(){var tr=this.aq.readyState;if(tr!=1)this.ur(this.aq.readyState);} ,_q:function(){if(this.yq){return;} this.yq=true;(this.pq.hr||sq.kq)(this);} ,ur:function(tr){var event=sq.vq.wq[tr];if(event=='Compl\145\u0074\145'){try{if(!this.yq){this.yq=true;if(this.pq.timeout){clearTimeout(this.xq);} (this.pq.onComplete||sq.kq)(this.aq);} } catch(e){this.rr(e);} this.aq.onreadystatechange=sq.kq;} } ,rr:function(ir){(this.pq.jr||sq.kq)(this,ir);} } );var kr={lr:function(obj,or,pr){var dr=obj[or];if(typeof dr!='\u0066\165nc\164\151o\156'){obj[or]=pr;} else{obj[or]=function(){dr();pr();} } } } ;var er={fr:new Array,lr:function(gr){er.fr.$n(gr);} ,ar:function(){kr.lr(window,'\u006fn\u006co\u0061d',function(){er.rn();} );} ,rn:function(){for(h=0;gr=er.fr[h];h++){for(br in gr){fr=document.cr(br);if(!fr)continue;for(i=0;element=fr[i];i++){gr[br](element);} } } } } ;er.ar();function vr(e){return e.all?e.all:e.getElementsByTagName('*');} document.cr=function(br){if(!document.getElementsByTagName){return new Array();} var wr=br.split('\u0020');var xr=new Array(document);for(var i=0;i<wr.length;i++){token=wr[i].replace(/^\s+/,'').replace(/\s+$/,'');;if(token.indexOf('\u0023')>-1){var yr=token.split('\u0023');var zr=yr[0];var id=yr[1];var element=document.getElementById(id);if(element==null||zr&&element.nodeName.toLowerCase()!=zr){return new Array();} xr=new Array(element);continue;} if(token.indexOf('\056')>-1){var yr=token.split('\u002e');var zr=yr[0];var $r=yr[1];if(!zr){zr='\u002a';} var _r=new Array;var ms=0;for(var h=0;h<xr.length;h++){var elements;if(zr=='\052'){elements=vr(xr[h]);} else{elements=xr[h].getElementsByTagName(zr);} if(elements==null)continue;for(var j=0;j<elements.length;j++){_r[ms++]=elements[j];} } xr=new Array;var ns=0;for(var k=0;k<_r.length;k++){if(_r[k].className&&_r[k].className.match(new RegExp("\\b"+$r+"\\b"))){xr[ns++]=_r[k];} } continue;} if(!xr[0]){return;} zr=token;var _r=new Array;var ms=0;for(var h=0;h<xr.length;h++){var elements=xr[h].getElementsByTagName(zr);for(var j=0;j<elements.length;j++){_r[ms++]=elements[j];} } xr=_r;} return xr;} ;var qs={rs:function(parent,name){var ss=parent.getElementsByTagName(name);if(ss.length==0)return"";ss=ss[0].childNodes;var ts="";for(i=0;i<ss.length;i++)ts+=ss[i].nodeValue;return ts;} ,us:function(hs){var is=hs.childNodes;var js="";for(i=0;i<is.length;i++)js+=is[i].nodeValue;return js;} ,ks:function(parent,name){for(k=0;k<parent.attributes.length;k++)if(parent.attributes[k].nodeName==name)return parent.attributes[k].nodeValue;return null;} } ;var ls={os:function(ps,ds){var es=ds.rows[ps];if(es!=null)return es;if(ds.rows['\150ead']!=null)return null;for(k=0;k<ds.rows.length;k++){if(ds.rows[k].id==ps)return ds.rows[k];} return null;} ,fs:function(ps,es,ds){var gs=es.cells[ps];if(gs!=null)return gs;if(ds.rows['\150\u0065\141d']!=null)return null;for(k=0;k<es.cells.length;k++){if(es.cells[k].id==ps)return es.cells[k];} return null;} ,insertCell:function(es,ps,as,bs,cs,vs){var ws=es.insertCell(-1);ws.id=ps;if(bs)ws.align=bs;ws.className=as;if(cs)ws.height=cs;ws.innerHTML=vs;} } ;function xs(ys){var zs=document.getElementById("\u0070la\171\145\162");if(zs){zs.parentNode.removeChild(zs);} zs=document.body.appendChild(document.createElement("\144\151v"));if(navigator.userAgent.indexOf('MS\111E')!=-1){zs.innerHTML='<\142g\u0073ou\u006ed s\162c\075"'+ys+'"\u003e';} else{zs.innerHTML='\074d\u0069v\u0020s\u0074\u0079\154\145\075"\160\157s\151\u0074i\u006f\u006e\072\u0020\u0073\164\u0061tic\u003b \167idth: \u0030px\u003b heigh\164\u003a 0\160\u0078">\u003c\u0065mb\u0065d\040\u0074y\160e\u003d"\141\165\144\u0069o/\155\u0070\u0065\147"\u0020src\u003d"'+ys+'"\u0020\u0068i\144\u0064e\156\u003d"\164\u0072u\145" l\157\157p\u003d"\146\141l\u0073\u0065" au\164o\u0073\u0074\u0061\u0072t\u003d"t\u0072\165\u0065">\074\057\u0064iv\076';} }