function fileCacheCheck_IMONDEMAND(){} try{fileCacheCheck_IMONDEMAND();}catch(e){handleCorruptCacheError();} function imFunctionNamespace(){var J="http://mail.yimg.com/us.yimg.com/i/mesg/emoticons7/";var K=6;var L=6;var G=32;table_smileys={":)":"1",":-)":"1",":(":"2",":-(":"2",";)":"3",";-)":"3",":d":"4",":-d":"4",";;)":"5",";;-)":"5",">:d<":"6",":-/":"7",":-\\":"7",":x":"8",":-x":"8",':">':"9",":p":"10",":-p":"10",":-*":"11",":*":"11","=*":"11","=((":"12",":o":"13",":-o":"13","x-(":"14","x(":"14",":>":"15",":->":"15","b-)":"16",":-s":"17","#:-s":"18",">:)":"19",":((":"20",":-((":"20",":))":"21",":-))":"21",":|":"22",":-|":"22","/:)":"23","/:-)":"23","=))":"24","o:)":"25","0:)":"25","o:-)":"25",":b":"26",":-b":"26","=;":"27","i-)":"28","|-)":"28","8-|":"29","l-)":"30",":-&":"31",":-$":"32","[-(":"33",":o)":"34",":0)":"34","8-}":"35","<:-p":"36","(:|":"37","=p~":"38",":-?":"39","#-o":"40","=d>":"41",":-ss":"42","@-)":"43",":^o":"44",":-w":"45",":-<":"46",">:p":"47","<):)":"48",":@)":"49","3:-o":"50","3:-0":"50",":(|)":"51","~:>":"52","@};-":"53","%%-":"54","**==":"55","(~~)":"56","~o)":"57","*-:)":"58","8-x":"59","=:)":"60","=:-)":"60",">-)":"61",":-l":"62","[-o<":"63","$-)":"64",':-"':"65","b-(":"66",":)>-":"67","[-x":"68","\\:d/":"69",">:/":"70",";))":"71","o->":"72","o=>":"73","o-+":"74","(%)":"75",":-@":"76","^:)^":"77",":-j":"78","(*)":"79",":)]":"100",":-c":"101","~x(":"102",":-h":"103",":-t":"104","8->":"105",":-??":"106","%-(":"107",":o3":"108",">:o":"81","%-}":"91","<^>":"92","(|)":"93","/\\/*":"94",">:#":"95",":)~*":"96",":~)":"97","->xo":"98","|:d|":"99",A:"109",":!!":"110","\\m/":"111",":-q":"112",":-bd":"113","^#(^":"114",":bz":"115"}; table_colors={black:RB.jF,red:"#ff0000",green:"#008200",yellow:"#848200",blue:"#0000ff",purple:"#840084",cyan:"#008284",orange:"#ff8000",pink:"#ff0084",gray:"#848284"};function H(A){A=A.replace(/&/g,"&");A=A.replace(//g,">");A=A.replace(/'/g,"x27;");A=A.replace(/"/g,""");return A;}function I(){var A=this.s=[];for(var B=0;B0){A.length--;}return this;};this.toString=function(){if(A.length>1){A=[A.join("")]; }return A[0];};}HTMLize=function(F,d,g,f){var m=K;function i(O){var M=new I;if(O.length<2){return M.$(p(O));}for(var P=0;P=2);Q--){if(O.substring(P,P+Q).toLowerCase()!="eval"){R=table_smileys[O.substring(P,P+Q).toLowerCase()];}}if(R){M.$('');P+=Q;m--;}else{M.$(p(H(O.charAt(P))));}}return M.toString();}function D(O){var Q=new I;if(O.toLowerCase().indexOf("www.")==0){Q.$(RB.Sg);}for(var R=0;R"z"))&&((M<"0")||(M>"9"))&&(";/?:@&=+$,-_.!~*'()#%".indexOf(M)==-1)){Q.$(escape(P)); }else{Q.$(P);}}return Q;}function p(M){if(d){M=M.replace(/\r\n/g,"
");M=M.replace(/\r/g,"
");M=M.replace(/\n/g,"
");}if(g){M=M.replace(/\s/g,RB.WL);}return M;}function l(M){var O=M.match(/(http:\/\/|https:\/\/|www\.|ftp:\/\/|mailto:\/\/)\S+/i);if(O){var P="";if(O.index>0){P+=l(M.substring(0,O.index));}P+=''+H(O[0])+"";if((O.index+O[0].length)-1){Q.push(M.substring(0,P));M=M.substring(P,100000);P=M.indexOf(O,O.length); }Q.push(M);return Q;}function n(M){var S=E(M,"[");if(S.length==1){return l(M);}else{var T=new I;for(var P=0;P",U);if(X==-1){O=R.length;U=-1;}else{if(!T){var P=new B(R.substring(U,X+1));if(P.notatag){P=null; O=R.indexOf("<",O+1);if(O==-1){O=X+1;}else{X=O-1;}}else{O=U;if(M";case"1":return"";case"2":return"";case"30":return"";case"31":return"";case"32":return"";case"33":return"";case"34":return"";case"35":return""; case"36":return"";case"37":return"";case"38":return"";case"39":return"";case"4":return"";case"l":return"";case"x1":return"";case"x2":return"";case"x4":return"";case"xc":return"";case"xl":return"";default:return"<"+M+">";}}function r(M,O,Q){if(typeof O==RB.Qt){if(M.charAt(0)=="#"){M=M.substring(1);}var P=parseInt(M,16);this.red=(P&16711680)>>16;this.green=(P&65280)>>8;this.blue=(P&255);}else{this.red=M;this.green=O;this.blue=Q;}this.toString=function(){function R(S){var T="00"+S.toString(16);return T.substring(T.length-2);}return"#"+R(this.red)+R(this.green)+R(this.blue); };}var e=L;var o=G;function B(S){S=S.replace(/\s+/g," ");var O=S.match(/<(.*)>/);if(O==null){this.notatag=true;this.A="";this.toString=function(){return this.A;};this.length=this.A.length;return ;}var Q=O[1].indexOf(" ");if(Q!=-1){O[2]=O[1].substring(Q+1,10000);O[1]=O[1].substring(0,Q);}else{O[2]="";}this.tagName=this.tag=O[1].toLowerCase();this.extra=O[2];this.endTag=false;if(this.tagName.charAt(0)=="/"){this.endTag=true;this.tagName=this.tagName.substring(1);}this.special=false;this.notatag=false;var P="";switch(this.tagName){case"alt":case"fade":if(this.endTag){this.special=true;}else{this.colors=this.extra.split(","); var T=this.colors.length;for(var Q=0;Q1){this.special=true;}else{if(this.colors.length==1){P=N('',this.colors[0]);}}}break;case"font":if(this.endTag){P="";}else{var R="";var M="";O=this.extra.match(/size="([^"]*)"/);if(O!=null){var P;if(O[1].match(/[^0-9]/)){P=H(O[1]);}else{P=O[1]-0;if(Po){P=o;}P=H(P+"")+"pt";}R=' style="font-size:'+P+'"';}O=this.extra.match(/face="([^"]*)"/);if(O!=null){M=' face="'+H(O[1])+'"';}if(R+M){P="";}else{P="";}}break;case"b":case"u":case"i":P="<"+this.tag+">"; break;case"url":break;case"black":case"blue":case"cyan":case"gray":case"green":case"pink":case"purple":case"orange":case"red":case"yellow":if(this.endTag){P="";}else{P='';}break;default:if(this.tagName.indexOf("url=")==0){P=l(this.tagName.substring(4));}else{if(this.tagName.charAt(0)=="#"){P='';}else{this.notatag=true;P="";}}}this.A=P;this.toString=function(){return this.A;};this.length=this.A.length;}var k=64;var q=[];var h=[];function C(c,AD,AF){if((c.length<2)||(AF<2)){return c[0];}if(c!=q){q=c;var X=0;var W=c[0]; var b=c[1];var S=W.red;var M=W.green;var AG=W.blue;var AB=b.red;var P=b.green;var Z=b.blue;var a=(c.length-1)/k;for(var Y=0;YQ){AD=Q;}var T=Math.floor(AD*(k-1)/Q);return h[T];}function s(M,P){P=P.toString();var S=0,V=0;for(;S",S);}else{if(P.charAt(S)=="&"){S=P.indexOf(";",S);V++;}else{V++;}}}var Q=V;var U=new I(); for(S=0,V=0;S",S);U.$(P.substring(S,O+1));S=O;}else{var R;if(P.charAt(S)=="&"){var O=P.indexOf(";",S);R=P.substring(S,O+1);S=O;}else{R=P.charAt(S);}var T;if(M.tagName=="fade"){T=C(M.colors,V,Q);}else{T=M.colors[V%M.colors.length];}U.$('').$(R).$("");V++;}}return U;}return(A(F,d,g,f)).toString();};}imFunctionNamespace();Dn.F=null;function Dn(E){var F=BV();this.B=Vt("div",E);this.B.style.position=CQ;this.B.style.left="-5000";this.B.style.top="-5000";this.B.className="imoContainer";this.B.id="imOfflineMsgs";var D=Rh.A(); this.jo=XT(D.C(i9),true);this.I="hilite";this.G={};this.D=[];this.A=[];this.B.innerHTML=Dn.ja;this.C=Dom.firstChildByClass(this.B,"imoSummary");this.K=Dom.firstChildByClass(this.B,"imoHeader");if(window.IMObject){IMObject.registerBCListener(this);}jA();If.A();return true;}Dn.prototype.P=function(K,I,J,G,L){var H=Gu(K+"_"+I+"~"+Wv(J,G,L));if(H){return H;}return null;};Dn.prototype.J=function(F,G,E,H){return this.P("imoMessageRow",F,G,E,H);};Dn.prototype.Y=function(E,F,D){return this.P("imoInviteRow",E,F,D);};Dn.prototype.a=function(I,L,M,P,Q,O){var J=this.P(I,L,M,P,O);if(J){if(J.parentNode){J.parentNode.removeChild(J); }if(!Q){this.O();}If.A();}var K=Wv(M,P,O);if(this.D[K]&&this.D[K][L]==1){this.D[K][L]=null;}};Dn.prototype.Q=function(I,J,G,K,L){this.a("imoMessageRow",I,J,G,K,L);var H;if(L=="sms"){H=IMObject.getSMSSession(J,I);}else{H=IMObject.getSession(J,G,I);}if(H&&H.getIMView()==this){H.setIMView(null);}if(K&&this.C&&this.C.childNodes.length==0){this.E.T();}};Dn.prototype.O=function(){if(!this.K){return ;}if(this.C.childNodes.length==0){this.K.innerHTML=RB.sG;}else{this.K.innerHTML=RB.o2;}};Dn.prototype.Z=function(E,F,D){this.a("imoInviteRow",E,F,D);};Dn.prototype.jb=function(K,L,M,H){var J=Wv(L,M,H);var I=Dn.f.replace("",Dn.jc).replace("",L).replace("__AVATAR__",IMObject.getAvtUrl(L,M)); I=I.replace('"DISMISSCLICK"',("dk")+'("dismiss",null,null,"'+J+":"+K+'")');I=I.replace('"EMAILCLICK"',("dk")+'("email",null,null,"'+J+":"+K+'","offline")');I=I.replace('"CHATCLICK"',("dk")+'("chat",null,null,"'+J+":"+K+'")');if(kPartner.sms.enabled){I=I.replace("",""+RB.uB+" | ");I=I.replace('"TEXTCLICK"',("dk")+'("sms", null,null,"'+J+":"+K+'")');}var O=(H=="sms")?"smspresenceicon":this.L(L,M);I=I.replace("__OPICLASS__",O);this.C.insertAdjacentHTML(RB.Ty,I);row=this.C.lastChild;row.id="imoMessageRow_"+K+"~"+J; if(!this.D[J]){this.D[J]=[];}this.D[J][K]=1;return row;};Dn.prototype.L=function(E,F){var D=getBuddyIcon(E,F,"presenceicon",true,"question");if(F==HG&&!IMObject.isBuddy(E,F,true)){IMObject.subscribe([E],true,false);}return D;};Dn.prototype.q=function(L,M,P,I,Q){var K=Wv(M,P);var J=Dn.g.replace("",Dn.jn).replace("%NAME%",M).replace();J=J.replace('"ACCEPTCLICK"',("dk")+'("accept",null,null,"'+K+":"+L+":"+I+":"+Q+'")');J=J.replace('"DECLINECLICK"',("dk")+'("decline",null,null,"'+K+":"+L+'")');var O=this.L(M,P);J=J.replace("__OPICLASS__",O);this.C.insertAdjacentHTML(RB.Ty,J);row=this.C.lastChild; row.id="imoInviteRow_"+L+"~"+K;if(!this.D[K]){this.D[K]=[];}this.D[K][L]=1;return row;};Dn.prototype.W=function(G,J){if(G==null||G==""){return ;}var F=Wv(G,J);if(this.D[F]){var I;for(I in this.D[F]){if(this.D[F][I]==1){var H=this.J(I,G,J);if(H){this.c(H,G,J);}H=this.Y(I,G,J);if(H){this.c(H,G,J);}}}}};Dn.prototype.c=function(G,J,L){var K=this.L(J,L);var H=Dom.firstChildByClass(G,"impresence");if(H){H.className=H.className.replace(/[\w]+presenceicon/,K);}var I=Dom.firstChildByClass(G,"imAvatar");if(I){I.src=IMObject.getAvtUrl(J,L);}};Dn.prototype.isOfflineView=function(){return true;};Dn.prototype.onReceiveIM=function(K){K.time=K.time-"0"; var Q=(K.command=="746")?"sms":"chat";var P=K.sender;var R=K.cloud_id||HG;var O=K.target_user;var S=this.J(O,P,R,Q);if(S==null){S=this.jb(O,P,R,Q);}var L=Dom.firstChildByClass(S,"imoMessageList");var J=Dn.S.replace("",K.msg).replace(//,Bu(new Date(1000*K.time),RB.mp));this.O();if(L.childNodes.length==0){L.innerHTML=J;FW(L.firstChild,"imoMessageItemTop");}else{L.insertAdjacentHTML(RB.Ty,J);}var M=O+"~"+Wv(P,R,Q);if(this.G[M]==null){this.G[M]=[];}this.G[M][this.G[M].length]=K;this.R();this.E.v(true);};Dn.prototype.onBuddyAuthorize=function(G){var F=G.cloud_id||HG;var I=this.Y(G.sender,G.target_user,F); if(I==null){I=this.q(G.sender,G.target_user,F);}var H=Dom.firstChildByClass(I,"imoMessageList");var J=Dn.S.replace("",G.msg).replace(//,Bu(new Date(),RB.mp));this.O();if(H.childNodes.length==0){H.innerHTML=J;FW(H.firstChild,"imoMessageItemTop");}else{H.insertAdjacentHTML(RB.Ty,J);}this.R();};Dn.prototype.onReceiveTypingNotification=function(B){return ;};Dn.prototype.onEvent=function(E,F){if(!window.IMObject||!IMObject.CONST||!F){return ;}switch(E){case IMObject.CONST.YES_BUDDY_INFO:if(F.buddy_info_list&&F.buddy_info_list.records){var H=F.buddy_info_list.records;for(var G=0; G0){this.M(w,y);}else{KU(j,"email",g,this,this.v,h);}}return true;case"dismiss":this.Q(m,g,h,true,j);return true;case"accept":if(!i.IMEnabled.isIMLoggedIn()){var n;if(r){n=Xc(r);}var s=EY(this,this.H,k,v,n,y,AA);Fj.push(s);i.Lb();return true;}if(i.IMObject){i.IMObject.sendBuddyAuthorize(m,g,h,true);KX.A("imbrAccept");var q;if(getIMSenderFromContacts(g,h)){q=new VM(RB.lX.toMessage(RB.Hj+g),RB.kp,null,null,EY(this,this.T));}else{var t={};t[0]=g;t[1]=h;t[2]=c;t[3]=b;q=new cQ("addaccept",t,EY(this,this.T),null,"imacConversation");}NS.A(q);}return true; case"decline":if(!i.IMEnabled.isIMLoggedIn()){var n;if(r){n=Xc(r);}var s=EY(this,this.H,k,v,n,y,AA);Fj.push(s);i.Lb();return true;}if(i.IMObject){var d=i.IMObject.getSession(g,h,m);var u;var l=getIMSenderFromContacts(g,h);if(l){var e=(RB.B==WH)?eP.G:eP.I;u=M2(getContactDisplayName(l,e));}if(u==null||u==""){u=g;}var q=new GF(g,h,u,EY(this,this.jh),null,d,m);NS.A(q);}return true;case"dummyoffline":Dn.dummyMessages();break;default:break;}return false;};Dn.prototype.V=function(Q,Z,O,Y){var V=BV();var S=this.A.imid;var W=this.A.cloud;if(!Q){Q=this.A.profile;}var U=this.A.type;this.A=[];if(IMEnabled.isIMLoggedIn()){var P; if(Y=="sms"){P=V.IMObject.getSMSSession(Z,Q);}else{P=V.IMObject.getSession(Z,O,Q);}if(P){sessionView=P.getIMView();if(sessionView==this){P.setIMView(null);sessionView=null;}}if(sessionView==null){sessionView=Wy.create(P,"offline",true,Y);var X=Q+"~"+Wv(S,W,U);var T=this.G[X];var a=T.length;for(var R=0;R0)){var L=K.split(":");var M=L[0];var Q=L[1];O.V(null,Q,P,M);}};Dn.prototype.v=function(F,I,G){G=(G&&G.value)?G.value:""; if(I&&G&&G.length>0){var H=G.split(":");var J=H[0];var G=H[1];I.M(G,"offline");}};Dn.prototype.M=function(k,g){var T=BV();if(!Component.A(Ox.A)){var h=EY(this,this.M,k,g);Component.call(Ox.A,h);return ;}var U=this.A.imid;var Y=this.A.cloud;var Z=this.A.profile;var c=this.A.type;this.A=[];var b=(c=="sms")?getSMSSenderFromContacts(U,true):getIMSenderFromContacts(U,Y);if(b){var e=(RB.B==WH)?eP.G:eP.I;var V=M2(getContactDisplayName(b,e));}if(V==null||V==""){V=U;}var W=T.Wj.B.lS();var a=W.ownerDocument.createElement(T.Wj.S);W.appendChild(a);T.Wj.C.lL(T.Wj.jv,V,k,a);var f=Z+"~"+Wv(U,Y);var X=this.G[f]; var j=X[X.length-1]["time"];var i=Bu(new Date(1000*j),RB.jm);var d=RB.mO+" "+i;T.Wj.B.lT(W,d);T.Wj.jw.lL(W,this.jl(X,V,d),T.Wj.I);T.Qc("edit",W,false,null,true,null,g);this.Q(Z,U,Y,true,c);};Dn.prototype.jl=function(S,U,K){var O=BV();var L="";var M=O.cC.G();var Q=O.cC.H();if(!M){M=O.cl();}else{M+="pt";}if(!Q){Q=O.CK();}L+="
----- "+K+" -----

";var T=S.length;for(var P=0;P/,U).replace(//,Bu(new Date(1000*R.time),RB.z));L+=Dn.z.replace(//,R.msg); }L+=RB.Ll;if(Cq.A){return"


"+L;}return"
"+L;};Dn.prototype.T=function(E){var G=this.A.imid;var H=this.A.cloud;var F=this.A.profile;this.A=[];if(E=="dlgBtnSave"){this.Z(F,G,H);}};Dn.prototype.jh=function(E){var G=this.A.imid;var H=this.A.cloud;var F=this.A.profile;this.A=[];if(E){this.Z(F,G,H);}};Dn.prototype.jm=function(){return"offlineMsgs";};Dn.prototype.ji=function(){if(this.C==null){return"";}return RB.A30.toMessage("count="+this.C.childNodes.length);};Dn.prototype.jk=function(){return RB.Bw1;};Dn.prototype.jd=function(){this.I="";return ; };Dn.prototype.jf=function(){return ;};Dn.prototype.jg=function(){var B=LB.A(true);if(B==this.E){this.I="";}return this.I;};Dn.prototype.X=function(J){var H=this.B.firstChild;if(H==null||H.rows==null){return ;}var I=J.B;var F=-1;for(var G=0;G
"+RB.o2+"
"; Dn.f=["","","",RB.Lg].join("");Dn.jc=["
","
","","","",RB.Lg].join(""); Dn.g=["
",""+RB.Bk1+" | ","",""+RB.vh+" | ",""+RB.BS2+RB.Wa,"
","","",RB.Lg].join("");Dn.jn=["
","
","","","",RB.Lg].join(""); Dn.S=["
%NAME% has requested to add you to their contacts
"," 
","","",RB.Lg].join("");Dn.jj=" (): ";Dn.z="
";Wy.sizeMap=["8","10","12","14","18","24","36"];Wy._blankIMConversation=null;var_blankSMSConversation=null;Wy.NEW_CT=1; Wy.AD_BDY=2;Wy.BL_WARN=3;Wy.NEW_MSN_CT=4;Wy.INVALID_NUM=5;funTypingNotifications=["%username% should really learn to type with more than two fingers...","The muse has just struck %username%...","1000 monkeys just landed on %username%'s keyboard...","%username% is hammering out a wicked comeback...","Bate your breath, for %username% is typing...","+STAND BY FOR MESSAGE FROM %username%...","%username% is about to drop knowledge...","The word of %username% is about to be delivered...","+%username% IS TYPING! %username% IS TYPING!","%username% is typing AND chewing gum...","%username% is typing something utterly brilliant...","I hope you're sitting down, because %username% is typing...","Brace yourself for another ingenious dispatch from %username%...","%username% is in the zone, prepare for an AHA moment..."]; Wy._minHeight=48;Wy._initFontSizePt="";Wy._initFontSize=-1;Wy._initFontName="";function Wy(U,R,T){var M=BV();if(Cq.B){Wy._minHeight=50;}this._messageWaiting=false;this._isContact=false;this._isDirty=false;this._session=U;this._viewed=false;this._switchSource=null;this._switchEvent=null;this._initTime=(new Date()).getTime();this._buddyID="";this._cloudId="";this._buddyDispName="";this._profileId="";this._carryOverText="";this._smsValidated=false;this.element=Vt("div",R);this.element.style.position=CQ;this.element.style.left="-5000";this.element.style.top="-5000";this.element.className="imcSession"; this.element.id="imcSession_"+this.getUniqueEltSuffix();this._type=T?T:"chat";var P=Rh.A();this._dispMode=P.C(di)||"bubble";this._showTimestamps=XT(P.C(fI),true);this._showAvatars=XT(P.C(i9),true);this._viewState="hilite";if(this._type=="sms"){this._iconClass="sms";}else{this._iconClass="newIM";}this._boldStyle=false;this._italicStyle=false;this._underStyle=false;this._foreColor=RB.jF;if(this._type=="sms"){html=Wy._uiTemplate.replace(//,Wy._smsConvTemplate).replace(//,this.getAvtUrl(true)).replace(//,"0").replace(//,Wy._sendTemplate);}else{html=Wy._uiTemplate.replace(//,Wy._convTemplate).replace(//,this.getAvtUrl(true)).replace(//,"0").replace(//,Wy._sendTemplate); }if(U==null){if(this._type=="sms"){html=html.replace(//,Wy._smsToRow);}else{html=html.replace(//,Wy._imToRow);}}this.element.innerHTML=html;this._conversation=Dom.firstChildByClass(this.element,"imcConversation");var Q=Dom.firstChildByClass(this.element,"imAvatar");Q.onclick=this._launchAvatarUrl;Q.id="imtab_ownavatar_"+this.getBuddyName();Q.onmouseover=this._avatarEventHandler;Q.onmouseout=this._avatarEventHandler;this._typingElt=Dom.firstChildByClass(this.element,"imTyping");this._prevTypeIndex=14;if(this._type=="sms"){this._smsInput=Gu("_smsInput_");this._smsInput.onkeydown=Wy._smsInputKeydown; if(Cq.B){this._smsInput.addEventListener("input",Wy._smsInputPaste,true);}else{this._smsInput.onpaste=Wy._smsInputPaste;}this._smsInputCharCount=Gu("_smsCountChars_");this._smsMaxChars=parseInt(RB.ja)-this.getProfileId().length-2;this._smsInputCharCount.innerText=RB.Y.toMessage("num="+this._smsMaxChars);this._smsInputImg=Gu("_smsCountImg_");this._smsInput.id="_smsInput_"+this.getUniqueEltSuffix();this._smsInputCharCount.id="_smsCountChars_"+this.getUniqueEltSuffix();this._smsInputImg.id="_smsCountImg_"+this.getUniqueEltSuffix();this._input=null;}else{this._input=Dom.firstChildByClass(this.element,"imcBody"); this._smsInput=null;this._smsInputCharCount=null;}if(this._type=="chat"){this._rtetoolbar=Dom.firstChildByClass(this.element,"imcFormatting");var L=eE.B(imrtetoolbar.documentElement,this._rtetoolbar,"imrte_"+(new Date().getTime()),10,5);L.className="imToolbar";}this._toptoolbar=Dom.firstChildByClass(this.element,"imcToolbar");var W=(this._type=="sms")?smstoptoolbar.documentElement:imtoptoolbar.documentElement;L=eE.B(W,this._toptoolbar,this._type+"top_"+(new Date().getTime()),3,5);L.style.position=d4;var S=Dom.firstChildByClass(this.element,"imcSendBtn");if(S){S.onmouseover=EY(this,this._sendBtnEventHandler); S.onmousedown=EY(this,this._sendBtnEventHandler);S.onmouseup=EY(this,this._sendBtnEventHandler);S.onmouseout=EY(this,this._sendBtnEventHandler);S.id="imtab_sendBtn_"+this.getBuddyName();}if(Wy._initFontName==""){Wy._initFontName=M.cC.H();}if(Wy._initFontSize==-1){Wy._initFontSizePt=M.cC.G();for(var O=0;O/,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName()); }else{J=Wy._imTipTemplate.replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName());}L.insertAdjacentHTML("afterEnd",J);L.parentNode.removeChild(L);}return true;};Wy.prototype.setBuddy=function(R,X,a,T,V){var d=BV();if(!R){T=this.getProfileId();X=this.getCloudId();R=this.getBuddyName();var S=true;}if(R==""){return false;}if(!R){return false;}if(!IMEnabled.isIMLoggedIn()){var b=EY(this,this.setBuddy,R,X,a,T);Fj.push(b);Lb();return ;}var Y;if(this._type=="sms"){if(!V){R=EP(R,Mz);}Y=IMObject.getSMSSession(R,T);}else{Y=IMObject.getSession(R,X,T);}if(Y==null){return false; }var W=Y.getIMView();if(this._type=="sms"){this._contact=getSMSSenderFromContacts(R,true);}else{this._contact=getIMSenderFromContacts(R,X);}this._isContact=this._contact!=null;this._iconClass=(this._type=="sms")?"sms":getBuddyIcon(R,X,"",true,"newIM");if(W==null&&S){Y.setIMView(this);this._session=Y;IMObject.registerAppListener(this);If.A();this.handleNotification("reCd");this.initPresenceNotification();return false;}if(W!=null){if(!!a){W.show();}if(W!=this){this._tab.T();}return false;}this._session=Y;Y.setIMView(this);this._profileId=T;this._buddyID=R;this._cloudId=X;this._smsMaxChars=parseInt(RB.ja)-T.length-2; var Z;Z=(this._type=="sms")?((RB.B==WH)?eP.G:eP.I):RB.Jt;this._buddyDispName=this._isContact?getContactDisplayName(this._contact,Z):R;this.element.id="imcSession_"+this.getUniqueEltSuffix();if(this._typingElt){this._typingElt.innerText=RB.lT.toMessage(RB.Hj+this._buddyDispName);}var c=Wy._textAvatarTemplate.replace(//,jE).replace(//,this.getAvtUrl()).replace(//,"1");this._conversation.insertAdjacentHTML("beforeBegin",c);if(this._type=="sms"){this._conversation.innerHTML=Wy._smsTipTemplate.replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName()); }else{this._conversation.innerHTML=Wy._imTipTemplate.replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName());}if(this._type=="sms"){this._smsInput.id="_smsInput_"+this.getUniqueEltSuffix();this._smsInputCharCount.id="_smsCountChars_"+this.getUniqueEltSuffix();this._smsInputCharCount.innerText=RB.Y.toMessage("num="+this._smsMaxChars);this._smsInputImg.id="_smsCountImg_"+this.getUniqueEltSuffix();}else{this._input.contentWindow.document.yMsgrSessionID=this.getUniqueEltSuffix();}if(this._toField){hz(this._toField);this._toField=null;var e=Dom.firstChildByClass(this.element,"imcToRow"); if(e){e.parentNode.removeChild(e);}}if((this._type=="chat")&&(Wy._blankIMConversation==this)){Wy._blankIMConversation=null;}else{if((this._type=="sms")&&(Wy._blankSMSConversation==this)){Wy._blankSMSConversation=null;}}if(IMObject&&IMObject.isBlockedUser(R,X)){var U=YAHOO.util.Dom.getElementsByClassName("labelCell","td",this._toptoolbar);if(U&&U.length>0){U[0].innerText=RB.nJ;}var Q=YAHOO.util.Dom.getElementsByClassName(RB.Rg,"table",this._toptoolbar);if(Q&&Q.length>0){Q[0].setAttribute(RB.SG,RB.n5);Q[0].setAttribute("cmd","unblock_sender");}this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.BL_WARN); }else{if(X==Ux&&!IMObject.isBuddy(R,X)){this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.NEW_MSN_CT);}else{if(!this._isContact){this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.NEW_CT);}}}if(this._type!="sms"){IMObject.registerAppListener(this);this.initPresenceNotification();}jA();If.A();a7();return true;};Wy.prototype.createNotify=function(o,x,AC,i,y){this.deleteNotify(true);var r="";var p;var k;var g;var u;var AG;var e;var t="imcGenericNotify";var AB="";var n="";if(x==Wy.AD_BDY){if(AC){r+=AC+" ";}if(i){r+=i;}if(r.length>0){r+=" ";}r+=RB.y4.toMessage("user="+this.getBuddyName()); p=RB.p5;g="imtab_acceptadd_"+this.getBuddyName();k=RB.l2;u="imtab_declineadd_"+this.getBuddyName();AG=EY(this,this.acceptAdd,y,AC,i);e=EY(this,this.denyAdd,y);}else{if(x==Wy.NEW_CT){r=RB.C52.toMessage("user="+this.getBuddyDisplayName());p=RB.rg;g="imtab_addcontact_"+this.getBuddyName();if(this._type!="sms"){k=RB.yj;u="imtab_reportspam_"+this.getBuddyName();e=EY(this,this.confirmReportAsSpam,EY(this,iJ.k0,"Spam",this));}AG=EY(this,this.tryAddToAB);}else{if(x==Wy.INVALID_NUM){r=RB.CL1;t="imcSpamNotify";n="hazardIcon";}else{if(x==Wy.NEW_MSN_CT){var f=getIMSenderFromContacts(this.getBuddyName(),this.getCloudId()); r=RB.ll;p=RB.k2;g="imtab_addmsn_"+this.getBuddyName();k=RB.F;u="imtab_cancel_"+this.getBuddyName();AG=f?EY(this,this.addBuddy):EY(this,this.tryAddToAB);e=EY(this,this.closeTab);t="imcSpamNotify";n="hazardIcon";}else{r=RB.st.toMessage(RB.Hj+this.getBuddyDisplayName());p=RB.nJ;g="imtab_unblockuser_"+this.getBuddyName();k="";AG=EY(this,this.unblockBuddy);e=null;t="imcSpamNotify";n="hazardIcon";}}}}var z=document.createElement("tr");z.style.height=1;var h=Vt("td",z);Rc.V(o,z,o.firstChild);var AF=Vt('
',h);var l=Vt("tbody",AF);var AD=Vt("tr",l); if(n){var AE=Vt(')");if(g==d){if(b){V=Wy._toAppendMsgFull;}else{V=Wy._fromAppendMsgFull;}V=V.replace(//,d).replace(//,c).replace(//,j).replace(//,T).replace(//,a.innerHTML);if(h=i.match(Y)){i=i.replace(Y,V+h[1]);}}else{var k;if(b){V=Wy._toMsgTemplate;f=Wy._toBubbleTemplate;k="0";}else{V=Wy._fromMsgTemplate;f=Wy._fromBubbleTemplate; k="1";}i=i.replace(Y,"");V=V.replace(//,d).replace(//,c).replace(//,j).replace(//,T).replace(//,a.innerHTML);i+=f.replace(//,this.getUniqueEltSuffix()).replace(//,this.getAvtUrl(b)).replace(//,k).replace(//,V);g=d;}}}}return i;};Wy.prototype.getInputHtml=function(){if(this._type=="sms"){return this._smsInput.value;}else{return this._input.contentWindow.document.body.innerHTML;}};Wy.prototype._getInputWindowBody=function(){if(this._input){return this._input.contentWindow.document.body; }return null;};Wy.prototype.setInput=function(B){if(!B){return ;}this._isDirty=true;if(this._type=="sms"){this._smsInput.value=B;if(this._smsInputCharCount&&this._smsInput){Wy.updateSMSCharCount(this,this._smsInput);}return ;}if(Cq.B){this._input.contentWindow.document.execCommand("inserthtml",false,B);}else{this._input.contentWindow.document.body.innerHTML=B;}this._checkInputHeight();};Wy.prototype._checkInputHeight=function(E){if(!this._input||!this._input.contentWindow||!this._input.contentWindow.document.body){return ;}var D=parseInt(Cq.C?this._input.contentWindow.document.documentElement.clientHeight:this._input.contentWindow.document.body.clientHeight); var F=parseInt(this._input.contentWindow.document.body.scrollHeight);this.moveSplitter("grow",F-D,E);};Wy.prototype._getFontSize=function(){if(!Wy.sizeMap||!this._fontSize){return 12;}return Wy.sizeMap[this._fontSize-1]-"0";};Wy.prototype.moveSplitter=function(M,O,I){var H=(this._type=="sms")?this._smsInput:this._input;var K=Qh.C();var L=(H.offsetHeight+this._conversation.offsetHeight)/2;var J=H.style.height;switch(M){case"max":H.style.height=L;break;case"min":H.style.height=Wy._minHeight;break;case"grow":if(O>0){H.style.height=Math.min(L,H.offsetHeight+O);}else{if(O<0){H.style.height=Math.max(Wy._minHeight,H.offsetHeight+O); }}break;}if(I||(H.style.height!=J)){this.resize(K);}};Wy.focusInput=function(G,L){var H=G;var K=LB.A(true);if(H==null||K!=H._tab){return ;}if(H._toField!=null&&!H._isDirty){H._toField.focus();if(H._type=="chat"){H.restoreStyles(H._input.contentWindow,true);}return ;}if(H._type=="sms"){if(H._smsInput){H._smsInput.focus();}return ;}var I=H._input.contentWindow;if(!I.document.body){if(L==null){L=0;}if(L>30){return ;}setTimeout(EY(this,Wy.focusInput,G,L+1),100);return ;}H.restoreStyles(H._input.contentWindow,true);if(Cq.B||Cq.C){try{I.focus();if(Cq.C){I.document.execCommand("SelectAll");}}catch(J){}}else{Et(I,"end",true); }};Wy.prototype.activate=function(){if(this._conversation){this._conversation.style.visibility=U5;}this._checkInputHeight(true);if(Cq.A&&this._dispMode=="simple"){this.scrollWindow(true);}if(this._rtetoolbar){this._rtetoolbar.id=RB.Dm;}if(this._input){this._input.id=RB.LP;}this._viewState="";var B=La.A();B.C();setTimeout(EY(this,Wy.focusInput,this),0);};Wy.prototype.deactivate=function(){if(this._rtetoolbar){this._rtetoolbar.id=null;}if(this._input){this._input.id=null;}a7();};Wy.prototype._addInvisibleBreaks=function(L){var J=L.split("");var K=new Array();var P;var M=0;var Q=false;var I=false; var O="";for(P=0;P")){Q=false;}else{if(I&&(O==";")){I=false;}}}}K.push(O);if(Q||I){continue;}else{if(O.match(/[?#%-_=]/)){K.push("");M=0;}else{if(M==15){K.push("");M=0;}else{if(O==" "){M=0;}else{M++;}}}}}return K.join("");};Wy.prototype._appendMessageRow=function(S,V,Y){var W;var P;if(V){W=Wy._toAppendMsgTemplate;P=Wy._toAppendTSTemplate;}else{W=Wy._fromAppendMsgTemplate;P=Wy._fromAppendTSTemplate;}var Q="0px";var a="";if(this._showTimestamps){Q=Wy._tsDefaultWidth;a=Y;}P=P.replace(//,Q).replace(//,Y); var R=Gu("lastMarker_"+this.getUniqueEltSuffix());if(!R){return ;}var Z=R.parentNode;var T=document.createElement("TR");T.className="imcBubbleEntry";T.setAttribute("yid",V?this.getProfileId():this.getBuddyName());Z.insertBefore(T,R);var U=Vt(W,T);var O=Vt(P,T);U.insertAdjacentHTML(RB.Ty,S);O.insertAdjacentHTML(RB.Ty,a);var X=document.createElement("TR");Z.insertBefore(X,T);Vt("";Wy._smsToRow="";Wy._blankTemplate=""; Wy._imInputTemplate="";Wy._smsInputTemplate="";Wy._imFormattingBar="
";Wy._convTemplate=""; Wy._smsCharCount="
"+RB.Y.toMessage("num="+RB.ja)+RB.Wa;Wy._smsConvTemplate=""; Wy._sendTemplate="
',AD);var v=Vt("
",AE);}var AA=Vt('
',AD);var q=Vt('
',AA);q.innerText=r;if(AB){var j=Vt("
",AD);j.innerHTML=AB;}if(p){var w=Vt('',AA);var s=Vt('',w);s.onclick=AG;}if(k&&(k.length>0)){Vt('',w);s=Vt('',w);s.onclick=e;}if(x==Wy.BL_WARN){AA=Vt('',AD); var m=Vt('",AA);m.innerText=RB.kB;}else{AA=Vt('',AD);s=Vt('',s);}jA();return z;};Wy._toFocus=function(D){if(D==null){D=window.event;}var C=D.target||D.srcElement;if(C==null){return ;}if(window.aq){aq(C);UC=AC_showIM=AC_showSMS=false;if(this._type=="sms"){AC_showSMS=true;}else{AC_showIM=true;}AC_showOfflineYids=true;AC_HandleInsert=Wy._toHandleInsert; AC_HandleKeyDown=Wy._toKeyDown;AC_HandleEnter=Wy._toHandleEnter;}GT();};Wy._toKeyDown=function(C){if(C==null){C=window.event;}var B=C.target||C.srcElement;if(B==null){return ;}var A=Wy.getSessionView(B);if(A==null){return ;}A._isDirty=true;GT();return ;};Wy.prototype._smsValidate=function(D,C){if(!D){return ;}D=D.strip();D=EP(D);this._toField.disabled=true;if(Cq.E){this._toField.blur();}Dom.setDisplay(this._smsVerifyBusyIcon,true);this._funcAfterSmsVerify=C?C:null;IMObject.smsValidate(D,this);};Wy._extractPhone=function(D){D=D.strip();var C=D.match(/^.*[\(<\s]*([0-9-]*)[\)>\s]*[,;\s]*$/);if(C&&C[1]&&C[1]!=""){return C[1].replace(/ \-/g,""); }return null;};Wy._toHandleEnter=function(I){if(!IMEnabled.isIMLoggedIn()){var C=Xc(I);var B=EY(window,Wy._toHandleEnter,C);Fj.push(B);Lb();return true;}if(I==null){I=window.event;}var G=I.target||I.srcElement;if(G==null){return ;}var F=G.value;var E=BV();var H=Wy.getSessionView(G);if(F==RB.xe){G.value=="";YE(G,"imcToFieldClue");}if(Is()){return ;}var F;var A;if(H._type=="sms"){F=G.value;if(!F||Wy._stringHasAlphabets(F)){alert(RB.mF);return true;}if(!H._smsValidated){H._smsValidate(F);return true;}}else{A=HG;F=iH(G.value);if(F==null){A=Ux;F=IE(G.value);}if(F==null){alert(RB.kO);return true;}}a7(); var D=EY(this,Wy.focusInput,H);H.continueOnToSetBuddy(F,A,D,100,true);return true;};Wy._stringHasEnoughDigits=function(D){if(!D){return false;}var C=D.match(/^(\D*\d){10,}/);if(C){return true;}return false;};Wy._stringHasAlphabets=function(E){var F="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";if(!E){return false;}for(var D=0;D0){C[0].innerText=RB.oO;}var D=YAHOO.util.Dom.getElementsByClassName(RB.Rg,"table",this._toptoolbar);if(D&&D.length>0){D[0].setAttribute(RB.SG,RB.oO);D[0].setAttribute("cmd","block_sender");D[0].cmd="block_sender"; }NS.C(RB.rU.toMessage("yid="+this.getBuddyName()),RB.n5);}};Wy.prototype.addBuddy=function(){if(IMObject){this.deleteNotify();IMObject.addBuddy(this.getProfileId(),this.getBuddyName(),this.getCloudId());}};Wy.prototype.confirmReportAsSpam=function(F){var I=new ML(RB.nt);var H=new S3();var J;J=function(A){if(A==jW.C){F();}};var G=new VM(RB.rM.toMessage(RB.Hj+this.getBuddyName())+"
"+RB.sB,RB.sE,[I,H],null,J);NS.A(G);};Wy.prototype.tryAddToAB=function(){if(0){var B=new VM(RB.AF2.toMessage("yid="+this.getBuddyName()),RB.Bh1);NS.A(B);return ;}var B;if(this._type=="sms"){B=new cQ("addmobile",this.getBuddyName(),null,null,"smsacConversation"); }else{B=new cQ("addyid",[this.getBuddyName(),this.getCloudId()],null,null,"imacConversation");}NS.A(B);};Wy.prototype.reportSpam=function(){if(IMObject){IMObject.reportSpam(this.getProfileId(),this.getBuddyName(),this.getCloudId());KX.A("imBlockAsSpam");}};Wy.prototype._sendBtnEventHandler=function(H){if(!Evt.C()){return false;}if(!H){H=event;}var K=Evt.A(H).parentNode;var I="";var L="";var J=K.getAttribute("btnState");switch(H.type){case RB.Vl:L="_over";I="_down";K.setAttribute("btnState",RB.Jl);break;case RB.YC:I="_over";K.setAttribute("btnState",RB.FC);break;case RB.Gd:if(J==RB.Jl){L="_down"; }else{L="_over";}K.setAttribute("btnState","");break;case RB.Dp:I="_over";L="_down";K.setAttribute("btnState",RB.FC);break;default:break;}for(var G=0;G0){A7(K.childNodes[G],I);}if(L.length>0){j3(K.childNodes[G],L);}}H.cancelBubble=true;};Wy.prototype._avatarEventHandler=function(D){if(!Evt.C()){return false;}if(RB.o7.length>0){if(!D){D=event;}var C=Evt.A(D);switch(D.type){case RB.YC:A7(C,"_over");break;case RB.Gd:j3(C,"_over");break;default:break;}}D.cancelBubble=true;};Wy.prototype.isContact=function(){return this._isContact;};Wy.prototype._blockBuddy=function(C){if(IMObject){IMObject.blockUser(this.getBuddyName(),this.getCloudId()); var D;switch(C){case"unknownSender":D="imBlockUnknown";break;default:D="imBlockSender";break;}KX.A(D);}};Wy.create=function(K,L,Q,O){var P=document.body;var I=null;var M="im";if(O=="sms"){M="sms";}var J="imStart";switch(L){case"radiobar:fromEmail":case"radiobar":J=M+"stComposeToolbar";break;case RB.Lb:J=M+"stComposeMenu";break;case"menu":J=M+"stComposeMenu";break;case"autocomplete":J=M+"stAutocomplete";break;case"switchdlg":J="imstSwitchDlg";break;case"toastcompose":J="imstToastCompose";break;case"toastother":J="imstToastOther";break;case"dropdown":J="imstContactsOnline";break;case"contactlist":J="imstContactsList"; break;case"contactdetail":J=M+"stContactsDetail";break;case"mailheader":J="imstFromReadEmail";break;case"offline":J=M+"stFromOffline";break;case"receiveim":J="imReceive";break;case"receivesms":J="smsReceive";break;}if(K==null){if((O=="chat")&&(Wy._blankIMConversation!=null)){if(Q){Wy._blankIMConversation.show();}return Wy._blankIMConversation;}else{if((O=="sms")&&(Wy._blankSMSConversation!=null)){if(Q){Wy._blankSMSConversation.show();}return Wy._blankSMSConversation;}}GT();}var I=new Wy(K,P,O);I._viewed=Q;if(K==null){if((O=="chat")&&(Wy._blankIMConversation==null)){Wy._blankIMConversation=I;}else{if((O=="sms")&&(Wy._blankSMSConversation==null)){Wy._blankSMSConversation=I; }}}I._tab=new Ta(I,J);LB.L(I._tab,Q);return I;};Wy.prototype.restoreStyles=function(J,I,H,G){if(!J.document.body){if(H==null){H=0;}if(H>30){return ;}setTimeout(EY(this,this.restoreStyles,J,I,H+1),100);return ;}var F=J.document.body.style;if(!this._fontName){this._fontName=Wy._initFontName;}F.fontFamily=this._fontName;if(!this._fontSize){this._fontSize=Wy._initFontSize;}F.fontSize=this._getFontSize()+"pt";if(I){return ;}J.focus();if(this._boldStyle){J.document.execCommand("bold",false,null);}if(this._italicStyle){J.document.execCommand("italic",false,null);}if(this._underStyle){J.document.execCommand("underline",false,null); }J.document.execCommand("ForeColor",false,this._foreColor);J.focus();if(G&&Cq.C){J.document.execCommand("SelectAll");}};Wy.prototype.handleCommand=function(y,AD,AB,AE,k){var o=BV();if(y.match(/^im\:([\w\W]+)/)||y.match(/^im_ondemand\:([\w\W]+)/)){y=RegExp.$1;}switch(y){case"bold":case"italic":case"underline":if(this.getCloudId()==Ux){var AC=new VM("

"+Wy._msnTipText.toMessage(RB.Hj+this.getBuddyDisplayName())+RB.Ll);NS.A(AC);return true;}if(y=="bold"){this._boldStyle=!this._boldStyle;}else{if(y=="italic"){this._italicStyle=!this._italicStyle;}else{if(y=="underline"){this._underStyle=!this._underStyle; }}}this._input.contentWindow.focus();this._input.contentWindow.document.execCommand(y,false,null);this._input.contentWindow.focus();return true;case"fontname":case"fontsize":if(this.getCloudId()==Ux){var AC=new VM("

"+Wy._msnTipText.toMessage(RB.Hj+this.getBuddyDisplayName())+RB.Ll);NS.A(AC);return true;}if(y=="fontname"){this._fontName=AD;Wy._initFontName=AD;}else{if(y=="fontsize"){this._fontSize=AD;Wy._initFontSize=AD;Wy._initFontSizePt=Wy.sizeMap[AD-1];}}this._input.contentWindow.focus();this._input.contentWindow.document.execCommand(y,false,AD);this._input.contentWindow.focus();return true; case"ForeColor":if(this.getCloudId()==Ux){var AC=new VM("

"+Wy._msnTipText.toMessage(RB.Hj+this.getBuddyDisplayName())+RB.Ll);NS.A(AC);return true;}this._foreColor=AD;this._input.contentWindow.focus();this._input.contentWindow.document.execCommand(y,false,AD);this._input.contentWindow.focus();return true;case"insert_emoticon":this._input.contentWindow.focus();ff(this._input.contentWindow,emoticonID2Text[AD]);this._input.contentWindow.focus();return true;case"switch_send_mode_to_sms":case"switch_send_mode_to_chat":if(Component.A(Ox.A)){GL(null,null);Nd();}var x;if(y=="switch_send_mode_to_sms"){x="sms"; }else{x="chat";}if(x=="sms"&&!hj()){var n=EY(this,this.handleCommand,y,AD,AB,AE,k);cx(n);return true;}var s=false;if(AE=="radiobar"){s=true;}if(AE=="radiobar"){AE=AD?AE+":"+AD:AE;this._switchSource=AE;}if(s){var r=A5(this.getInputHtml());if((x=="chat"&&(r.length>Qy))||(x=="sms"&&(r.length>this._smsMaxChars))){alert(RB.As0);return true;}}if(s){var d;var j;if(this._type=="sms"){d=getSMSSenderFromContacts(this.getBuddyName(),true);j=d?Va(d)["id"]:"";}else{d=getIMSenderFromContacts(this.getBuddyName());j=d?eq(d,eP.H):"";}this._switchSource=AE;if((j&&(j.length>0))||(this.getBuddyName()=="")){if(this._type=="sms"){this.completeSMSToIMSwitch(j); }else{this.completeIMToSMSSwitch(j);}this.deleteNotify();this._smsValidated=false;}else{var AC;var i=(this._type=="sms")?this.verifySMSToIMSwitch:this.verifyIMToSMSSwitch;var q=(this._type=="sms")?null:this.getCloudId();KU(this._type,x,this.getBuddyName(),this,i,q);}}return true;case"switch_send_mode_to_email":if(Component.A(Ox.A)){GL(null,null);Nd();}if(AE=="radiobar"){AE=AD?AE+":"+AD:AE;}if(this.isBlankIM()){if(this._isDirty){aX=this;dk(RB.IC,AB,window,null,AE);}else{dk(RB.IC,AB,window,null,AE);this.closeTab();}return true;}var s=false;if(AE=="statustip"||AE=="radiobar:fromChat"||AE=="radiobar:fromsms"){s=true; }if(s){var d=this._contact;if(!d){d=(this._type=="sms")?getSMSSenderFromContacts(this.getBuddyName(),true):getIMSenderFromContacts(this.getBuddyName(),this.getCloudId());}var g=dc.A(d);if(g.length==0&&this.getCloudId()==Ux){g=this.getBuddyName();}this._switchSource=AE;this.completeIMToEmailSwitch(g);}return true;case"send_im":if(IMEnabled&&!IMEnabled.isIMLoggedIn()){Lb();}else{if(this._toField||this._session!=null){this._sendInput();}else{if(!this._toField&&this._session==null){Lb();}}}return true;case"toggle_display_mode":var p=AB.srcElement;if(p.tagName=="LI"){var u=p.childNodes[0];if(u){p=u; }}p.innerText=(this._dispMode=="bubble")?RB.oj:RB.nM;this._switchDisplayMode();return true;case"toggle_view_timestamps":var h=AB.srcElement;if(h){if(h.tagName=="LI"){var u=h.childNodes[0];if(u){h=u;}}h.innerText=this._showTimestamps?RB.mW:RB.nh;this._showTimestamps=!this._showTimestamps;var l=Rh.A();l.B(fI,this._showTimestamps,true);l.D();N7("timestamps");}var t;var e;if(this._dispMode=="simple"){var v=this._showTimestamps?"":Mx;t=YAHOO.util.Dom.getElementsByClassName("imTimestamp","span",this._conversation);for(e=0;e0)){var J=G.split(":");var K=J[0];var L=J[1];I.completeIMToEmailSwitch(L);}};Wy.prototype.completeIMToEmailSwitch=function(B){du=B;aX=this;dk("compose:imcontact",null,window,null,this._switchSource);};Wy.prototype.verifyIMToSMSSwitch=function(I,J,M){var L;var H=(M&&M.value)?M.value:"";if((I=="Continue")&&J&&H&&(H.length>0)){var K=H.split(":");var L=K[0];var O=K[1];J.completeIMToSMSSwitch(O);}};Wy.prototype.verifySMSToIMSwitch=function(J,K,O){var M; var I=(O&&O.value)?O.value:"";var Q=(O&&O.cloud)?O.cloud:HG;if((J=="Continue")&&K&&I&&(I.length>0)){var L=I.split(":");var M=L[0];var P=L[1];K.completeSMSToIMSwitch(P,Q);}};Wy.prototype.fixIdAndAdjustMarker=function(G){var F=Gu("lastMarker_"+this.getUniqueEltSuffix());var E=Gu("imConversationTip_"+this.getUniqueEltSuffix());this._buddyID=G;if(F){F.id="lastMarker_"+this.getUniqueEltSuffix();}if(E){var H;if(this._type=="sms"){H=Wy._smsTipTemplate.replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName());}else{H=Wy._imTipTemplate.replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName()); }E.insertAdjacentHTML("afterEnd",H);E.parentNode.removeChild(E);}};Wy.prototype.completeSMSToIMSwitch=function(U,L){if((this==Wy._blankSMSConversation)&&(Wy._blankIMConversation)){dk(RB.Js,null,null,null,"radiobar:fromsms");return ;}var M=IMObject.getIMSessionIfExists(U,L,this.getProfileId());var P=M?M.getIMView():null;if(P&&(M.getIMView()!=this)){var Q=Wv(escape(U),L);dk(RB.Gk,null,null,Q,"radiobar:fromsms");return ;}this._carryOverText=A5(this.getInputHtml());this._type="chat";this._cloudId=L;var K;this.deleteNotify();if(this._toptoolbar){this._toptoolbar.innerHTML="";S=eE.B(imtoptoolbar.documentElement,this._toptoolbar,this._type+"top_"+(new Date().getTime()),3,5); S.style.position=d4;}var O=this._smsInput.parentNode;O.innerHTML="";O.innerHTML=Wy._imInputTemplate;K=this._smsInputCharCount.parentNode;K.removeChild(this._smsInputCharCount);K.innerHTML=Wy._imFormattingBar;this._input=Dom.firstChildByClass(this.element,"imcBody");this._smsInput=null;this._smsInputCharCount=null;this._smsInputImg=null;this._rtetoolbar=Dom.firstChildByClass(this.element,"imcFormatting");var S=eE.B(imrtetoolbar.documentElement,this._rtetoolbar,"imrte_"+(new Date().getTime()),10,5);S.className="imToolbar";if(this._session){IMObject.endSMSSession(this._session);this._session=null; var R=IMObject.getSession(U,this.getCloudId(),this.getProfileId());R.setIMView(this);this._session=R;}var T=this.updateBuddyContact(U,this.getCloudId(),true);if(!T){this._buddyDispName=U;this._iconClass=U?(getBuddyIcon(this.getBuddyName(),this.getCloudId(),"",true,"newIM")):"newIM";if(U){this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.NEW_CT);}If.A();}this.fixIdAndAdjustMarker(U);this.element.id="imcSession_"+this.getUniqueEltSuffix();this.moveSplitter("min");IMObject.registerAppListener(this);if(this._typingElt){this._typingElt.innerText=RB.lT.toMessage(RB.Hj+this._buddyDispName); }this._input.contentWindow.document.yMsgrSessionID=this.getUniqueEltSuffix();setTimeout(EY(this,Wy.focusInput,this),0);if(this==Wy._blankSMSConversation){Wy._blankSMSConversation=null;Wy._blankIMConversation=this;this._toField._type=this._type;this._toLabel.innerText=RB.H;}else{this.handleNotification("switchNotify");}KX.A("imstSMSToolbar");return true;};Wy.prototype.completeIMToSMSSwitch=function(O){if((this==Wy._blankIMConversation)&&(Wy._blankSMSConversation)){dk(RB.Sd,null,null,null,"radiobar:fromChat");return ;}if(O){O=EP(O);}var P=IMObject.getSMSSessionIfExists(O,this.getProfileId());var I=P?P.getIMView():null; if(I&&(P.getIMView()!=this)){dk("im:open_im_text_session",null,null,O,"radiobar:fromChat");return ;}var M=A5(this.getInputHtml());this._type="sms";this._iconClass="sms";var Q;if(this._toptoolbar){this._toptoolbar.innerHTML="";bar=eE.B(smstoptoolbar.documentElement,this._toptoolbar,this._type+"top_"+(new Date().getTime()),3,5);bar.style.position=d4;}var K=this._input.parentNode;K.innerHTML="";K.innerHTML=Wy._smsInputTemplate;Q=this._rtetoolbar.parentNode;Q.removeChild(this._rtetoolbar);Q.innerHTML=Wy._smsCharCount;this._input=null;this._smsInput=Gu("_smsInput_");this._smsInput.onkeydown=Wy._smsInputKeydown; if(Cq.B){this._smsInput.addEventListener("input",Wy._smsInputPaste,true);}else{this._smsInput.onpaste=Wy._smsInputPaste;}this._smsMaxChars=parseInt(RB.ja)-this.getProfileId().length-2;this._smsInputCharCount=Gu("_smsCountChars_");this._smsInputImg=Gu("_smsCountImg_");if(this._session){IMObject.unregisterForAllEvents(this);IMObject.endSession(this._session,true);this._session=null;var L=IMObject.getSMSSession(O,this.getProfileId());L.setIMView(this);this._session=L;}var J=this.updateBuddyContact(O,this.getCloudId(),true);if(!J){this._buddyDispName=O;this._iconClass="sms";if(O){this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.NEW_CT); }If.A();}this.fixIdAndAdjustMarker(O);this._smsInput.id="_smsInput_"+this.getUniqueEltSuffix();this._smsInputCharCount.id="_smsCountChars_"+this.getUniqueEltSuffix();this._smsInputCharCount.innerText=RB.Y.toMessage("num="+this._smsMaxChars);this._smsInputImg.id="_smsCountImg_"+this.getUniqueEltSuffix();this.element.id="imcSession_"+this.getUniqueEltSuffix();this.setInput(M);this.moveSplitter("min");setTimeout(EY(this,Wy.focusInput,this),0);if(this==Wy._blankIMConversation){Wy._blankIMConversation=null;Wy._blankSMSConversation=this;this._toField._type=this._type;this._toLabel.innerText=RB.ma+":"; }else{this.handleNotification("switchNotify");}KX.A("smsstComposeToolbar");return true;};Wy.prototype.onSMSVerify=function(C){if(Wy._blankSMSConversation!=this){return ;}Dom.setDisplay(this._smsVerifyBusyIcon,false);if(C.status!=RB.HG){var D=EY(this,Wy.focusInput,this);this._smsValidated=true;this.deleteNotify();this.continueOnToSetBuddy(C.phone,null,D,100,true);if(this._funcAfterSmsVerify){this._funcAfterSmsVerify();this._funcAfterSmsVerify=null;}}else{this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.INVALID_NUM);this._toField.disabled=false;this._toField.focus();this._toField.select(); }};Wy.prototype.onEvent=function(F,H){if(!IMObject||!IMObject.CONST){return ;}var G="";var E;switch(F){case IMObject.CONST.YES_USER_LOGOFF_ERR:case IMObject.CONST.YES_CONNECTION_FAILED:case -1:this.onReceiveTypingNotification(false);this._session=null;IMObject.unregisterForAllEvents(this);this.handleNotification("disCd");break;case -2:this.onReceiveTypingNotification(false);this._session=null;IMObject.unregisterForAllEvents(this);break;default:break;}};Wy.prototype.onBuddyStatusChange=function(C){var D=getBuddyInfoStatus(C);this.handleNotification(D.icon,D.msg);};Wy.prototype.initPresenceNotification=function(){if(IMObject&&IMObject.isBuddy(this.getBuddyName(),this.getCloudId(),true)){var D=Hv(this.getBuddyName(),this.getCloudId()); if(!D){return ;}var C=D.msg;switch(D.icon){case"online":break;case"offline":case"busy":case"idle":this.handleNotification(D.icon,C);break;default:break;}}};Wy.prototype.handleNotification=function(U,P,S){if(this._toField){return ;}var Q="";var L=null;var R;var O=(this._dispMode=="simple");if(P&&P.length>0){P=" - "+M2(P);}else{P="";}switch(U){case"online":R=O?Wy._simpleOnlineString:Wy._onlineString;Q=R.toMessage(RB.Hj+this.getBuddyDisplayName()).replace(//,P);this._iconClass="online";break;case"offline":R=O?Wy._simpleOfflineString:Wy._offlineString;var V=("dk")+'( "im_ondemand:switch_send_mode_to_email", null, null, "'+Wv(this.getBuddyName(),this.getCloudId())+'", "statustip" ); return false;'; Q=R.toMessage(RB.Hj+this.getBuddyDisplayName(),"buddy="+this.getBuddyDisplayName()).toMessage("clickaction="+V);L=O?"imSimpleOfflineStatus":"imOfflineStatus";this._iconClass="offline";break;case"busy":R=O?Wy._simpleBusyString:Wy._busyString;Q=R.toMessage(RB.Hj+this.getBuddyDisplayName()).replace(//,P);this._iconClass="busy";break;case"idle":R=O?Wy._simpleIdleString:Wy._idleString;Q=R.toMessage(RB.Hj+this.getBuddyDisplayName()).replace(//,P);this._iconClass="idle";break;case"reCd":R=O?Wy._simpleReconnectString:Wy._reconnectString;Q=R.toMessage(RB.Hj+this.getBuddyDisplayName()); L=O?"imSimpleReconnectedStatus":"imReconnectedStatus";break;case"disCd":var M=true;if(this._type=="sms"){var W=this._contact?dc.A(this._contact):"";if(!W){M=false;}}if(!M){R=O?Wy._simpleSMSDiscString:Wy._smsDiscString;Q=R;}else{R=O?Wy._simpleDiscString:Wy._discString;var T=("dk")+'( "im_ondemand:switch_send_mode_to_email", null, null, "'+Wv(this.getBuddyName(),this.getCloudId(),this._type)+'", "statustip" ); return false;';Q=R.toMessage(RB.Hj+this.getBuddyDisplayName()).toMessage("sendemail="+T,"closechat="+("Wy.closeTab")+"()","buddy="+this.getBuddyDisplayName());}L=O?"imSimpleDisconnectedStatus":"imDisconnectedStatus"; this._iconClass="disCd";break;case"smsError":R=O?Wy._simpleSMSErrorString:Wy._smsErrorString;R=R.replace(//,S);Q=R.toMessage(RB.Hj+this.getBuddyDisplayName());L=O?"imSimpleDisconnectedStatus":"imDisconnectedStatus";this._iconClass="sms";break;case"switchNotify":R=(this._type=="sms")?(O?Wy._simpleSwitchToSMSString:Wy._switchToSMSString):(O?Wy._simpleSwitchToIMString:Wy._switchToIMString);Q=R.toMessage(RB.Hj+this.getBuddyDisplayName());L=O?"imSimpleReconnectedStatus":"imReconnectedStatus";break;default:break;}if(Q.length>0){this._addNotification(Q,L);}If.A();};Wy.prototype.onBuddyAuthorize=function(B){this._notifyRow=this.createNotify(this.element.firstChild.firstChild,Wy.AD_BDY,B.firstname,B.lastname,B.target_user); };Wy.prototype.onSMSError=function(B){if(!B.error_code){return ;}switch(B.error_code){case"22":this.handleNotification("smsError",null,RB.tF);break;case"16":this.handleNotification("smsError",null,RB.yD);break;case"19":this.handleNotification("smsError",null,RB.AK1);break;case"15":default:this.handleNotification("smsError",null,RB.A92);break;}};Wy.prototype.onReceiveIM=function(O,L){if(!L){if(this._type=="chat"){this.onReceiveTypingNotification(false);}if(this._type=="sms"&&O&&O.msg){O.msg=M2(O.msg);}var I=La.A();I.F(this.getBuddyDisplayName(),true,null,true);var J=LB.A();var K=this._tab;if(J!=K){this._viewState="hilite"; K.v(true);}if(YAHOO.mail.soundControl&&Bq&&(I.D==false||J!=K)){YAHOO.mail.soundControl.play(Tw);}if(J!=K){If.A();}}this._addMessage(O,L);if(this._type=="chat"&&!L){var M=Math.floor(Math.random()*140);var H;if((M>=14&&this._prevTypeIndex>=14)||(M==this._prevTypeIndex)){return ;}this._prevTypeIndex=M;if(kPartner.hasFunTyping&&M<14){H=funTypingNotifications[M].toMessage(RB.Hj+this.getBuddyDisplayName());if(H.charAt(0)=="+"){H=H.substr(1).toUpperCase();}}else{H=RB.lT.toMessage(RB.Hj+this.getBuddyDisplayName());}if(this._typingElt){this._typingElt.innerText=H;}}};Wy.prototype.onReceiveTypingNotification=function(C){if(!this._typingElt){return ; }var D=this._typingElt;if((!this._typing||(this._typing=="stopped"))&&C){D.style.visibility=U5;}else{if(!C){D.style.visibility=jE;}}this._typing=C?"typing":"stopped";};Wy.prototype.getAvtUrl=function(I){var J=BV();if(!IMObject||!this._showAvatars){return J.getSilhouetteUrl();}I=!!I;var G=I?this.getProfileId():this.getBuddyName();var F=I?HG:this.getCloudId();if(this._type=="sms"&&this._isContact){var H=Va(this._contact);G=H.id;F=H.cloud;}return IMObject.getAvtUrl(G,F,I);};Wy.prototype.getLastDateStamp=function(){if(!this._session){return new Date();}else{return this._session.getLastDateStamp();}}; Wy.prototype.getMyDisplayName=function(){if(cC.B){return cC.B.split(" ")[0];}else{return this._profileId;}};Wy.prototype.getProfileId=function(){var B=BV();return this._profileId?this._profileId:B.getProfileId();};Wy.prototype.getCloudId=function(){return this._cloudId;};Wy.prototype.getBuddyName=function(){return this._buddyID;};Wy.prototype.getBuddyDisplayName=function(){if(this._buddyDispName!=""){return this._buddyDispName;}return this.getBuddyName();};Wy.prototype.getIcon=function(){return this._iconClass;};Wy.prototype.getViewTooltip=function(){var D=this.getBuddyName();if(D==""){if(this._type=="sms"){D=RB.wL; }else{D=RB.Bx0;}}var C=this.getBuddyDisplayName();if(C==""){return D;}return C+" ("+D+")";};Wy.prototype.getViewTitle=function(){var B=this.getBuddyDisplayName();if(B==""){if(this._type=="sms"){B=RB.A00;}else{B=RB.A52;}}return B;};Wy.prototype.getViewState=function(){var B=LB.A(true);if(B.C==this.element){this._viewState="";}return this._viewState;};Wy.prototype.resize=function(K){var L=this.element.firstChild;if(L==null||L.rows==null){return ;}var Q=K.B;var J=-1;for(var O=0;O0){this._typingElt.style.top=L.rows[J].offsetTop+Q-this._typingElt.offsetHeight-1;}this.scrollWindow(I);}if(Cq.A){My(L,K);L.style.width="100%";}else{VO(L,K);}if(this._toLabel&&this._toField){this._toField.style.width=K.A-this._toLabel.offsetWidth-27;}};Wy.prototype.close=function(){a7();var B=this._tab;B.C.parentNode.removeChild(B.C);this._tab=null; if(this._session){IMObject.unregisterForAllEvents(this);if(this._type=="sms"){IMObject.endSMSSession(this._session);}else{this._session.sendTypingIndicator(false);IMObject.endSession(this._session);}}if(this==Wy._blankIMConversation){Wy._blankIMConversation=null;}else{if(this==Wy._blankSMSConversation){Wy._blankSMSConversation=null;}}};Wy.prototype.closeTab=function(){this._tab.v(false);this._tab.T();};Wy.prototype.show=function(){this._tab.lT();};Wy.prototype._switchDisplayMode=function(){var H;var J=Gu("imConversationTip_"+this.getUniqueEltSuffix());var I=this._dispMode=="simple";var G=(this._conversation.scrollHeight-this._conversation.scrollTop)<=this._conversation.clientHeight; H=this._getHeaderText(I);this._conversation.innerHTML=[H,this.getConversation(I)].join("");var K=Dom.firstChildByClass(this.element,"imTextAvatar");if(K){if(Cq.B){K.style.top=(this._conversation.parentNode.parentNode.offsetTop+10)+Sn;}if(!I){K.style.visibility=U5;}else{K.style.visibility=jE;}}if(Cq.C||(Cq.B&&Cq.D>=1.9)){this._addConversationPadding();}if(Cq.A&&!I){setTimeout(EY(this,this.scrollWindow,true),100);}else{this.scrollWindow(G);}this._dispMode=((this._dispMode=="bubble")?"simple":"bubble");var L=Rh.A();L.B(di,this._dispMode,true);L.D();N7("dispmode");};Wy.prototype._getHeaderText=function(C){var D="imBubbleHeader myimTimestampColor"; if(!C){D+=" imSimpleHeader";}return Wy._headerTemplate.replace(//,D).replace(//,Bu(new Date(),RB.Bp2));};Wy.prototype.getConversation=function(W){var i="";var X;var b;var U;var a;var e;var V;var d;if(this._dispMode=="simple"&&!W){U=YAHOO.util.Dom.getElementsByClassName("imcSimpleEntry","div",this._conversation);for(X=0;X/,d).replace(//,this._showTimestamps?"":RB.Pg).replace(//,e.getAttribute("ts")).replace(//,b?this.getMyDisplayName():this.getBuddyDisplayName()).replace(//,a.innerHTML);}}else{var f;var g="";U=YAHOO.util.Dom.getElementsByClassName("imcSimpleEntry","div",this._conversation);for(X=0;X

",X);};Wy.prototype._addMessage=function(k,i){if(this._session==null){return ;}var n=cC.V();if(cC.B!=null&&cC.B.length>0){n=cC.B.split(" ")[0];}var b=i?this.getMyDisplayName():this.getBuddyDisplayName(); var f=i?this.getProfileId():this.getBuddyName();var a="";if(k.time&&k.time!=0){a=Bu(new Date(1000*k.time),RB.z);}else{a=Bu(this.getLastDateStamp()?this.getLastDateStamp():new Date(),RB.z);}var h;k.msg=this._addInvisibleBreaks(k.msg);var o;var g;var V=(this._conversation.scrollHeight-this._conversation.scrollTop)<=this._conversation.clientHeight;var c=Gu("imConversationTip_"+this.getUniqueEltSuffix());if(c){if(this.getCloudId()==Ux){c.insertAdjacentHTML("afterEnd",Wy._msnTipTemplate.replace(/__CLASS__/,(this._dispMode=="simple"?"class='msnTipSimple'":"")).replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName())); }c.insertAdjacentHTML("afterEnd",this._getHeaderText(this._dispMode=="bubble"));c.parentNode.removeChild(c);if(this._dispMode=="simple"){var j=Dom.firstChildByClass(this.element,"imTextAvatar");j.style.visibility=U5;}}if(this._dispMode=="simple"){var Y;var Z=(this._type=="sms")?Wy._smsFromTemplate:Wy._imFromTemplate;o=i?Wy._toTemplate:Z;this._insertConversationHTML(o.replace(//,f).replace(//,this._showTimestamps?"":RB.Pg).replace(//,a).replace(//,b).replace(//,k.msg));}else{if(this._lastSender==f){this._appendMessageRow(k.msg,i,a); }else{var d=Gu("lastMarker_"+this.getUniqueEltSuffix());var m;if(d){d.parentNode.removeChild(d);}if(i){o=Wy._toMsgTemplate;g=Wy._toBubbleTemplate;m="0";}else{o=Wy._fromMsgTemplate;g=Wy._fromBubbleTemplate;m="1";}var e="0px";var W="";if(this._showTimestamps){e=Wy._tsDefaultWidth;W=a;}h=o.replace(//,f).replace(//,e).replace(//,a).replace(//,W).replace(//,k.msg);var X=b+"( "+f+" )";var l=i?RB.vd:b;this._insertConversationHTML(g.replace(//,this.getUniqueEltSuffix()).replace(//,this.getAvtUrl(i)).replace(//,m).replace(//,h).replace(//,l).replace(//,X)); }}this.scrollWindow(V);this._lastSender=f;this._messageWaiting=true;};Wy.prototype.scrollWindow=function(B){if(B&&this._conversation){this._conversation.scrollTop=this._conversation.scrollHeight-this._conversation.clientHeight;}};Wy.prototype._insertConversationHTML=function(B){if(Cq.C||(Cq.B&&Cq.D>=1.9)){if(!this._conversationPadding){this._addConversationPadding();}this._conversationPadding.insertAdjacentHTML("beforeBegin",B);}else{this._conversation.insertAdjacentHTML(RB.Ty,B);}};Wy.prototype._addConversationPadding=function(){this._conversationPadding=document.createElement("DIV");this._conversationPadding.className="imcConversationPadding"; this._conversationPadding.setAttribute("style","height:20px;");this._conversation.insertAdjacentElement(RB.Ty,this._conversationPadding);};Wy.prototype._addNotification=function(T,K){var O=Bu(new Date(),RB.z);var S="";if(K&&K.indexOf&&(K.indexOf("connectedStatus")>=0)){S="CS_";}var U=Gu("imNotifyElt_"+S+this.getUniqueEltSuffix());if(U){if(this._lastSender==null){U.parentNode.removeChild(U);}else{U.id="imNotifyEltSticky";}}var P=(this._conversation.scrollHeight-this._conversation.scrollTop)<=this._conversation.clientHeight;var Q=(this._dispMode=="simple")?Wy._simpleNotificationTemplate:Wy._notificationTemplate; Q=Q.replace(//,S).replace(//,this.getUniqueEltSuffix());if(!K){K="";}var M="0px";var L="";if(this._showTimestamps){M=Wy._tsDefaultWidth;L="("+O+")";}var R=Gu("imConversationTip_"+this.getUniqueEltSuffix());if(R){if(this.getCloudId()==Ux){R.insertAdjacentHTML("afterEnd",Wy._msnTipTemplate.replace(/__CLASS__/,(this._dispMode=="simple"?"class='msnTipSimple'":"")).replace(//,this.getUniqueEltSuffix()).toMessage(RB.Hj+this.getBuddyDisplayName()));}R.insertAdjacentHTML("afterEnd",this._getHeaderText(this._dispMode=="bubble"));R.parentNode.removeChild(R);}this._insertConversationHTML(Q.replace(//,T).replace(//g,K).replace(//,M).replace(//,O).replace(//,L)); this.scrollWindow(P);this._lastSender=null;};Wy.prototype.continueOnToSetBuddy=function(H,K,I,J,G){var L=BV();if(this.setBuddy(H,K,null,L.getProfileId(),G)){this._viewState="";setTimeout(I,J);return true;}return ;};Wy.prototype._sendInput=function(){if(this._type=="sms"&&!hj()){var V=EY(this,this._sendInput);cx(V);return false;}if(this._session==null){var S;if(this._type!="sms"){var M=HG;S=iH(this._toField.value);if(S==null){M=Ux;S=IE(this._toField.value);}if(S==null){alert(RB.kO);return ;}}else{S=this._toField.value;if(!S||Wy._stringHasAlphabets(S)||!Wy._stringHasEnoughDigits(S)){alert(RB.mF); return ;}if(!this._smsValidated){var Q=EY(this,this._sendInput);this._smsValidate(S,Q);return ;}}var Q=EY(this,this._sendInput);var P=this.continueOnToSetBuddy(S,M,Q,50,true);return P;}if(this._type!="sms"){var T=this.getCloudId();if(T==Ux&&!IMObject.isBuddy(this.getBuddyName(),T)){var U=new VM(RB.ll);NS.A(U);return ;}}var R=this._getMessageToBeSent();if(R==""){return ;}var W;if(W=R.match(/^\/sound (.*?)$/)){switch(W[1]){case"on":Bq=true;break;case"off":Bq=false;break;case"mac":Tw="immac";break;case"win":Tw="imwin";break;}var O=Rh.A();if((W[1]=="on")||(W[1]=="off")){O.B(MW,Bq?"yes":"no",true);}else{O.B(Gz,Tw,true); }O.D();return ;}if(this._type=="sms"){this._session.sendSMS(R);this.onReceiveIM({msg:R},true);this._smsInput.value="";this._smsInputCharCount.innerText=RB.Y.toMessage("num="+this._smsMaxChars);this._smsInputImg.className="";this._smsInput.focus();KX.A("smsSend");}else{var L=this._getInputWindowBody();this._session.sendTypingIndicator(false);this._session.sendIM(L,true,L.style);if(Cq.E){L.innerHTML="
";}else{L.innerHTML="";}this.moveSplitter("min");this.restoreStyles(this._input.contentWindow,null,null,Cq.C);KX.A("imSend");}setTimeout("throbberHack()",100); };Wy.prototype._getMessageToBeSent=function(){var B;if(this._type=="sms"){B=this._smsInput;return M2(B.value);}else{B=this._input.contentWindow.document.body;return B.innerHTML.stripTags();}};Wy.prototype.getUniqueEltSuffix=function(){return this.getBuddyName()+"_"+this._initTime;};Wy.prototype.getFontSelection=function(B){if(this._rtetoolbar){return this._rtetoolbar.getElementsByTagName(RB.bE)[B];}};Wy.prototype.getID=function(){return"imtab_tabopi_"+this.getBuddyName();};Wy.getSessionElement=function(C){var D=C;while(D&&!he(D,"imcSession")){D=D.parentNode;}return D;};Wy.getSessionUID=function(E){var F=Wy.getSessionElement(E); if(F==null){return null;}var G=F.id;var H=G.indexOf("imcSession_");if(H==0){return G.substring("imcSession_".length);}return null;};Wy.getSessionView=function(D){var E=Wy.getSessionElement(D);var F=LB.I(E);return F.D;};Wy._inputLoad=function(J){var I=null;if(J&&J.currentTarget){I=J.currentTarget;}else{if(J&&J.srcElement){I=J.srcElement;}}var K=Wy.getSessionUID(I);var L=Wy._getView(K);if(L==null){if(J){J=Xc(J);}setTimeout(EY(Wy,Wy._inputLoad,J),100);return ;}var H=I.contentWindow.document;if(H.designMode.toLowerCase()=="on"){if(Cq.A){H.yMsgrSessionID=K;H.onkeydown=Wy._inputKeydown;H.onkeypress=Wy._inputKeypress; H.ondeactivate=Wy.handleDeactivate;H.onactivate=Wy.handleActivate;H.onbeforedeactivate=Wy.handleBeforeDeactivate;H.onbeforeactivate=Wy.handleBeforeActivate;}}else{if(Cq.B){H.yMsgrSessionID=K;H.addEventListener("keydown",Wy._inputKeydown,true);H.addEventListener("keypress",Wy._inputKeypress,true);H.addEventListener(RB.Pl,Nf,true);H.addEventListener("blur",Tu,true);}H.designMode="on";if(Cq.B){H.execCommand("styleWithCSS",false,false);}}var G=H.body;if(Cq.B){H.addEventListener("keyup",Wy._updateGUIforSelectionIM,true);H.addEventListener(RB.Dp,Wy._updateGUIforSelectionIM,true);H.addEventListener(RB.bE,Wy._updateGUIforSelectionIM,true); }else{if(G){G.onselect=G.onmouseup=G.onkeyup=Wy._updateGUIforSelectionIM;}}if(G){if(Cq.C){G.innerHTML="";}if(L&&L._carryOverText){if(Cq.B){G.textContent+=L._carryOverText;}else{G.innerText+=L._carryOverText;}L._carryOverText="";}}setTimeout(EY(this,Wy.focusInput,I),100);};Wy.handleDeactivate=function(){var C=Wy._getView(this.yMsgrSessionID);var D=C._input.contentWindow.event;Console.log("Deactivate");};Wy.handleBeforeDeactivate=function(){var C=Wy._getView(this.yMsgrSessionID);var D=C._input.contentWindow.event;Console.log("Before Deactivate");};Wy.handleActivate=function(){var C=Wy._getView(this.yMsgrSessionID); var D=C._input.contentWindow.event;Console.log("Activate");};Wy.handleBeforeActivate=function(){var C=Wy._getView(this.yMsgrSessionID);var D=C._input.contentWindow.event;Console.log("Before Activate");};Wy._updateSelectElemIM=function(O,L,I){var J;var H=Wy._getView(I);if(!H){return ;}var K=H._input.contentWindow.document;J=K.queryCommandValue(L);if(!J){J="null";}else{if(L=="FontName"){J=K5(J);}else{if(L=="FontSize"){J="size"+J;}}}var M=NH(O,J);if(M&&Lang.isArray(M)){M=M[0];}if((M)&&(!M.selected)){M.selected=true;}};Wy._updateGUIforSelectionIM=function(){var E=LB.A();var F=Cq.A?this.document.yMsgrSessionID:this.yMsgrSessionID; var H=E.l4(0);if(H){Wy._updateSelectElemIM(H,"FontName",F);}var G=E.l4(1);if(G){Wy._updateSelectElemIM(G,"FontSize",F);}};Wy._getView=function(D){var F=Gu("imcSession_"+D);var E=LB.I(F);if(E==null){return null;}return E.D;};Wy.allowedKeysAfterMaxChars=function(B){return Zd.B(B)||Zd.F(B)||Zd.E(B);};Wy.updateSMSCharCount=function(H,G,E){var F=H._smsMaxChars-G.value.length;H._smsInputCharCount.innerText=RB.Y.toMessage("num="+F);if(F<=0){H._smsInputImg.className="cantTypeIcon";if(F<0){H._smsInputCharCount.innerText=RB.Y.toMessage("num=0");G.value=G.value.substring(0,H._smsMaxChars);}}else{H._smsInputImg.className="typingTypeIcon"; }};Wy._smsInputPaste=function(M){if(M==null){M=window.event;}var Q=Evt.A(M);var L=Q.id;var J=L.indexOf("_smsInput_")==0?L.substring("_smsInput_".length):null;if(J==null){return ;}var P=Wy._getView(J);var K;if(Cq.A){K=window.clipboardData.getData("Text");var S=P.getInputHtml();var O=S?S.length:0;if(K&&((O+K.length)>P._smsMaxChars)){var R=P._smsMaxChars-O;K=K.substr(0,R);window.clipboardData.setData("Text",K);}}else{K=P.getInputHtml();if(K&&(K.length>P._smsMaxChars)){K=K.substr(0,P._smsMaxChars);P.setInput(K);}}return true;};Wy._smsInputKeydown=function(K){if(K==null){K=window.event;}var O=Evt.A(K); var I=O.id;var M=I.indexOf("_smsInput_")==0?I.substring("_smsInput_".length):null;if(M==null){return ;}var H=Wy._getView(M);if(H){H._isDirty=true;var J=H._session;}switch(K.keyCode){case KeyCodes.Enter:if(H._toField||J!=null){H._sendInput();}else{if(!H._toField&&J==null){Lb();}}Evt.B(K);return false;default:var L=H._smsMaxChars-O.value.length;setTimeout(EY(Wy,Wy.updateSMSCharCount,H,O,K.keyCode),0);if((L<=0)&&!Wy.allowedKeysAfterMaxChars(K)){return false;}break;}};Wy._inputKeydown=function(F){var D=Wy._getView(this.yMsgrSessionID);var E;if(D){D._isDirty=true;E=D._session;}if(F==null){F=D._input.contentWindow.event; }switch(F.keyCode){case KeyCodes.Enter:if(D._toField||E!=null){D._sendInput();}else{if(!D._toField&&E==null){Lb();}}Evt.B(F);return false;default:VY(F);setTimeout(EY(D,D._checkInputHeight),0);if(E!=null){E.sendTypingIndicator(true);}break;}};Wy._inputKeypress=function(D){var C=Wy._getView(this.yMsgrSessionID);if(D==null){D=C._input.contentWindow.event;}switch(D.keyCode){case KeyCodes.Enter:Evt.B(D);return false;default:break;}};Wy._tsDefaultWidth="60px";Wy._uiTemplate="
"; Wy._imToRow="
"+RB.H+"
"+RB.ma+" :
"+RB.H+"
"+Wy._imFormattingBar+"
"+Wy._imInputTemplate+"
","
"+Wy._smsCharCount+"
"+Wy._smsInputTemplate+"
","
"+RB.qy+"
";Wy._toMsgTemplate="";Wy._toAppendMsgFull=""; Wy._toAppendMsgTemplate="";Wy._toAppendTSTemplate="";Wy._fromMsgTemplate="";Wy._fromAppendMsgFull=""; Wy._fromAppendMsgTemplate="";Wy._fromAppendTSTemplate="";Wy._avatarStylePrefix="background-image: ";Wy._imFromTemplate="
():
";Wy._smsFromTemplate="
():
"; Wy._toTemplate="
():
";Wy._toBubbleTemplate=["","","
","","","
","","
","
","
","
"].join(""); Wy._fromBubbleTemplate=["","","
","","","
","","
","
","
"].join(""); Wy._notificationTemplate=["","","
"].join("");Wy._simpleNotificationTemplate="
"; Wy._discString="
"+RB.k9+"
"+RB.mI+"
";Wy._smsErrorString="
";Wy._smsDiscString="
"+RB.k9+"
"; Wy._idleString="
"+RB.nT+"
";Wy._reconnectString="
"+RB.n8+"
";Wy._onlineString="
"+RB.nd+"
";Wy._busyString="
"+RB.nO+"
"; Wy._offlineString="
"+RB.nB+"
"+RB.o3+"
";Wy._switchToSMSString="
"+RB.mi+"
";Wy._switchToIMString="
"+RB.mu+"
";Wy._simpleDiscString=""+RB.k9+" "+RB.mI+RB.Wa; Wy._simpleSMSDiscString=""+RB.k9+" ";Wy._simpleSMSErrorString=" ";Wy._simpleReconnectString=""+RB.n8+" "; Wy._simpleIdleString=""+RB.nT+" ";Wy._simpleOnlineString=""+RB.nd+" ";Wy._simpleBusyString=""+RB.nO+" "; Wy._simpleOfflineString=""+RB.nB+" "+RB.o3+RB.Wa;Wy._simpleSwitchToSMSString=""+RB.mi+" ";Wy._simpleSwitchToIMString=""+RB.mu+" ";Wy._msnTipText="
"+RB.Bx1+" "+RB.Aq2+"
"; Wy._msnTipTemplate="
"+Wy._msnTipText+"
";Wy._imTipTemplate="
"+RB.lk+"
"+RB.tQ+"
";Wy._smsTipTemplate="
"+RB.lk+"
"+RB.pZ+"
"; Wy._tipTemplateBlank="
"+RB.AA0+"
"+RB.ry+"
";Wy._headerTemplate="
";Wy._textAvatarTemplate="";Component.B(Ox.Y,"cmd",("j1"));function j1(J,K,L,H,I){var G=BV(); var F=cT(window);var M;var C=true;switch(J){case"im_ondemand:create_view":var E=createIMView(H.imsession,H.source,H.showNow,H.type);if(H.ondone){H.ondone.call(H.scope,E,H.params);}break;case"im_ondemand:new_im":if(IMEnabled.isIMLoggedIn()){createIMView(null,I,true,"chat");}else{fnClosure=EY(window,j1,J,K,L,H,I);Fj.push(fnClosure);Lb();}break;case"im_ondemand:new_text_msg":if(IMEnabled.isIMLoggedIn()){if(!hj()){fnClosure=EY(window,j1,J,K,L,H,I);cx(fnClosure);break;}createIMView(null,I,true,"sms");}else{var O=EY(window,j1,J,K,L,H,I);Fj.push(O);Lb();}break;case"im_ondemand:open_im_text_session":if(IMEnabled.isIMLoggedIn()){if(!hj()){O=EY(window,j1,J,K,L,H,I); cx(O);break;}H=EP(H);IMObject.getSMSSessionWithView(H,I,true);}else{var O=EY(window,j1,J,K,L,H,I);Fj.push(O);Lb();}break;case"im_ondemand:open_im_session":H=H.toLowerCase();var B=bD(H);if(B.length<=1){B[1]=HG;}if(IMEnabled.isIMLoggedIn()){IMObject.getSessionWithView(B[0],B[1],I,true);}else{var O=EY(window,j1,J,K,L,H,I);Fj.push(O);Lb();}break;case"im_ondemand:switch_send_mode_to_chat":M=LB.A();if(M&&M.A()==RB.aM){return M.handleCommand(J,H,K,I,L);}XR(J,K,L,H,I,"chat");break;case"im_ondemand:switch_send_mode_to_sms":M=LB.A();if(M&&M.A()==RB.aM){return M.handleCommand(J,H,K,I,L);}XR(J,K,L,H,I,"sms"); break;case"im_ondemand:im_new_status":var A=new KP(RB.sA,null,EY(Ac,Ac.E));NS.A(A);A.ju();break;case"im_ondemand:show_msn_add_dialog":if(NS.B){NS.B.cancelDialog();}var D=dY();if(D==null){var A=new VM(RB.qX,RB.AR1,null,null,EY(Tq,Tq.F,2));NS.A(A);}else{var A=new hq(dY());NS.A(A);}KX.A("imScanMSNContacts");break;default:C=false;}return C;}function cx(A){if(!Mz){var B=new Ma(Rq,A);NS.A(B);}}function KU(B,E,D,A,I,F){var G=Ox.B;if(!Component.A(G)){var C=TJ[G]?TJ[G]:G;var J=EY(window,KU,B,E,D,A,I,F);Component.C(C,J);return ;}var H;H=new D2(B,E,D,A,I,F);NS.A(H);H.ju();}iJ.z="

"+RB.tg+"
.

"+RB.x7+"

"+RB.qU+"

"; function iJ(O,P,M,A){var J=new jW("Spam",RB.nt,null,true);var K=new jW("Block",RB.zp,null,true);var L=new jW("Show",RB.w3,null,false);L.A=M;L.B=true;K.B=false;J.B=false;var Q=iJ.z;Q=Q.replace(//,O).replace(//,P);this.B(Q,"",[L,K,J],null,iJ.k0,A);}MA(iJ,VM);iJ.prototype.B=VM;iJ.k0=function(H,G){var F;var I;if(H=="Spam"){G.reportSpam();F=RB.tJ;I=RB.qx;}else{if(H=="Block"){if(cX(G.getBuddyName(),G.getCloudId())){return ;}G._blockBuddy("unknownSender");F=RB.o0;I=RB.mP;}else{return ;}}F=F.toMessage("yid="+G.getBuddyName());G.closeTab();var J=new VM(F,I);NS.A(J);};ij.z="

"; ij.kk;ij.kh;ij.lL;ij.kI;function ij(A,C,S,O,K,Q,U){var R=new jW("Continue",RB.k7,null,false);R.A=_setIMText;var P=new S3(RB.rs);P.B=true;A=A+ij.z;var T;if(Q){T=function(D,E,B){Q(D=="Continue",E,B);};}ij.lL=S;ij.kh=O;ij.kk=K;ij.kI=null;this.$$$_SimpleInputDialog(A,C,[R,P],null,T,U);}MA(ij,Xm);ij.prototype.$$$_SimpleInputDialog=Xm;ij.ju=function(E,G){if(!E.document.body){if(G==null){G=0;}if(G>100){return ;}setTimeout(EY(this,ij.ju,E,G+1),100);return ;}ij.kI=E;E.document.body.style.fontSize=ij.kh;E.document.body.style.fontFamily=ij.kk;E.document.body.innerHTML=ij.lL;var F=Gu("Continue",E.parent);if(F){F.disabled=true; }if(Cq.B){try{E.focus();}catch(H){}}else{Et(E,"start",true);E.document.body.scrollTop=0;}};ij.prototype.n4=function(E){var D=null;if(E&&E.currentTarget){D=E.currentTarget;}else{if(E&&E.srcElement){D=E.srcElement;}}D.style.overflow=RB.AC;var F=D.contentWindow.document;if(F.designMode.toLowerCase()=="on"){if(Cq.A){F.onkeydown=ij._handleKeydown;}}else{if(Cq.B){F.addEventListener("keydown",ij._handleKeydown,true);}F.designMode="on";if(Cq.B){F.execCommand("styleWithCSS",false,true);}}setTimeout(EY(this,ij.ju,D.contentWindow),100);};ij.prototype._handleKeydown=function(D){var E=ij.kI;if(!E){return ;}var F=Gu("Continue",E.parent); if(E.document.body.innerHTML.length<2000){F.disabled=false;}else{F.disabled=true;}};ij.prototype._setIMText=function(){var B=Gu("imText");if(B){B=B.contentWindow;}if(B&&B.document.body){this.jc=B.document.body.innerHTML;}};Ma.z="

"+GH(RB.pV)+RB.Ll+RB.C31+": ";function Ma(I,G){this.jc=G;var H=new jW(jW.C,RB.C,this._setHomeCountry,true);var A=new S3();var J=Ma.z;this.B(J,RB.qb,[H,A],null,I); }MA(Ma,VM);Ma.prototype.B=VM;Ma.prototype._setHomeCountry=function(){var D=Gu("home_country_sel");if(D){var E=D.value;if(!E){return true;}Mz=E;var F=Rh.A();F.B(Dx,E,true);F.D();}};KP.z="

"+RB.BC0+":
"+RB.yo+"
"; function KP(A,I,K){var J=new jW(jW.C,RB.C,this.kW,true);var C=new S3();J.B=true;J.A=this.kW;C.B=false;var L=KP.z;this.B(L,A,[J,C],null,K,I);}MA(KP,VM);KP.prototype.B=VM;KP.prototype.kW=function(){var B=Gu("newStatus");if(B.value==""){alert(RB.An1);return true;}Xo(Gu("bz").checked,Gu("newStatus").value.substr(0,255));return false;};KP.prototype.d=function(C){this.B.prototype.d.call(this,C);if(C.keyCode==KeyCodes.Enter){var D=this.kW();if(!D){NS.B.cancelDialog();}}return true;};KP.prototype.ju=function(){var D=Gu("newStatus");var F=Gu("newStatusDiv");var E=Gu("customStatusColumn");F.style.width=D.offsetWidth+5; F.style.height=D.offsetHeight+5;F.style.overflow=RB.AC;D.style.overflow=RB.AC;E.style.overflow="";setTimeout(this.m5,20);};KP.prototype.m5=function(){var B=Gu("customStatusColumn");B.style.overflow=RB.AC;};hq.z="

"+RB.Bq1+"

"+RB.Ab0;hq.m1="

"; function hq(J){this.jz=[];this.f=J.length;this.la=J;this.ku=false;var M=new jW("dlgBtnAdd",RB.k2,null,true);var C=new S3();M.B=true;M.A=this.lV;C.B=false;var K=this.lW();var A=RB.xJ.toMessage("num="+this.f);var O=hq.z;O=O.replace(//,K);O=O.replace(/\%num\%/,this.f);var L=function(){if(this.ku){var B=this.f;var D=new VM(RB.xR.toMessage("num="+B),RB.BQ1.toMessage("num="+B));NS.A(D);}};this.B(O,A,[M,C],null,L,this.f);}MA(hq,VM);hq.prototype.B=VM;hq.md=function(F){var D=Gu("msn_ct_"+F);var E=Gu("msn_select_all");if(D&&!D.checked&&E.checked){E.checked=false;}};hq.mn=function(){var J=Gu("msn_ct_list"); var I=Gu("msn_select_all");var H=J.childNodes;var G;if(I.checked){this.f=H.length;G=true;}else{G=false;this.f=0;}for(var F=0;F/,L).replace(//,J);}return K;};GF.m7="

"+GH(RB.oT)+"

"; GF.lX="

"+GH(RB.oT)+"

";function GF(c,b,K,U,a,W,V){this.G=a||"decline";var C;var A=GF.lX;var X;if(a==RB.bH){A=A.replace(//,RB.qs.toMessage("yid="+K)).replace(//g,K);C=RB.sy;X=RB.CN2;}else{if(typeof IMObject!=RB.Qt&&IMObject&&!IMObject.isBuddy(c,b)){A=GF.m7;}A=A.replace(//,RB.CI0).replace(//g,K); C=RB.Ba2;X=RB.l2;}var Z=function(D,E,B){GF.lT(D==jW.C,E,B);if(U){U(D==jW.C,B);}};var S=new jW(jW.C,X,this.k0,true);var T=new S3();T.B=false;var Y={};Y.imid=c;Y.cloud=b;Y.dispName=K;Y.session=W;Y.profile=V;this.B(A,C,[S,T],null,Z,Y);}MA(GF,VM);GF.prototype.B=VM;GF.prototype.k0=function(){var F=this.G;var E=Gu("imblock");var D=Gu("imspam");if(E&&E.checked){F+=RB.bH;}if(D&&D.checked){F+=RB.dd;}this.jc=F;};GF.lT=function(Z,R,V){if(!Z){return ;}var O=R.imid;var S=R.cloud;var U=R.profile;var P=R.dispName;var a=R.session;var T=V.match(/decline/);var X=V.match(/block/);var Y=V.match(/spam/);var Q=null; if(T){if(IMObject){IMObject.sendBuddyAuthorize(U,O,S,false);}text=RB.BX0.toMessage("yid="+P);KX.A("imbrDeny");}if(X){if(cX(O,S)){return ;}if(IMEnabled.isIMLoggedIn()){IMObject.blockUser(O,S);Q="imBlockSender";}if(T){text=RB.vq.toMessage("yid="+P);}else{text=RB.o0.toMessage("yid="+P);}}if(Y){if(IMObject){IMObject.reportSpam(U,O,S);Q="imBlockAsSpam";}text+=RB.WL+RB.B11.toMessage("yid="+P);}if(Q){KX.A(Q);}var W=new VM(text,T?RB.AQ1:RB.mP);NS.A(W);};D2.Z="
";D2._emailRowTemplate=""+RB.ls+" "; D2._imRowTemplate=""+RB.ny+" ";D2._smsRowTemplate=""+RB.BD2+" ";D2._editSMSTemplate="";function D2(U,M,a,X,V,A){var c;var C;this.O=M;this.jd=U;this.G=U+"2"+M;this.D=a;this.ky=A;var Z=new jW("Continue",RB.k7,null,false);Z.B=true;var S=new S3();S.B=false;var Y=cQ.lG.replace(//,cQ.o);var T=cQ.l5.replace(//,cQ.o);var W=D2._editSMSTemplate;switch(this.G){case"chat2sms":C=RB.pE; c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.kc);c+=D2.Z.replace(//,D2._smsRowTemplate).replace(//,D2._imRowTemplate);T=this.D;c=c.replace(//,T).replace(//,W);this.ji="qc_smsid";break;case"sms2chat":C=RB.lq;c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.kt);c+=D2.Z.replace(//,D2._imRowTemplate).replace(//,D2._smsRowTemplate);W=this.D;T=T.replace(//,"0").replace(//,RB.m1).replace(//,"1").replace(//,cQ.u); T=T.replace(//,"").replace(//,RB.FI);c=c.replace(//,W).replace(//,T);this.ji="qc_imid";break;case"chat2email":C=RB.nn;c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.lN);c+=D2.Z.replace(//,D2._emailRowTemplate).replace(//,D2._imRowTemplate);T=this.D;Y=Y.replace(//,"0").replace(//,RB.my).replace(//,"1").replace(//,cQ.u);c=c.replace(//,Y).replace(//,T);this.ji="qc_email";break;case"sms2email":C=RB.nn;c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.lN); c+=D2.Z.replace(//,D2._emailRowTemplate).replace(//,D2._smsRowTemplate);W=this.D;Y=Y.replace(//,"0").replace(//,RB.my).replace(//,"1").replace(//,cQ.u);c=c.replace(//,Y).replace(//,W);this.ji="qc_email";break;case"email2chat":C=RB.lq;c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.kt);c+=D2.Z.replace(//,D2._imRowTemplate).replace(//,D2._emailRowTemplate);Y=this.D;T=T.replace(//,"0").replace(//,RB.m1).replace(//,"1").replace(//,cQ.u); T=T.replace(//,"").replace(//,RB.FI);c=c.replace(//,Y).replace(//,T);this.ji="qc_imid";break;case"email2sms":C=RB.pE;c=cQ.X.replace(//,"quickContactAlertIcon").replace(//,RB.kc);c+=D2.Z.replace(//,D2._smsRowTemplate).replace(//,D2._emailRowTemplate);Y=this.D;c=c.replace(//,Y).replace(//,W);this.ji="qc_smsid";break;}Z.A=this.kG;var b=[Z,S];this.$$$_SimpleInputDialog(c,C,b,null,V,X);}MA(D2,Xm);D2.prototype.$$$_SimpleInputDialog=Xm;D2.prototype.d=function(B){this.$$$_SimpleInputDialog.prototype.d.call(this,B); if(B.keyCode==KeyCodes.Enter){this.lY(B,"Continue");}return true;};D2.prototype.ju=function(){var B=Gu(this.ji);if(B){B.focus();B.blur();B.focus();}return ;};D2.prototype.kG=function(){var U=Gu("qc_email");var m=Gu("qc_imid");var c=Gu("qc_smsid");var Y=Gu("qc_imtype");var i;var g;var h;var f;var k;switch(this.G){case"chat2email":i=(U.getAttribute("changed")==1)?U.value.strip():"";g=this.D;k=this.ky;break;case"sms2email":i=(U.getAttribute("changed")==1)?U.value.strip():"";h=this.D;break;case"chat2sms":h=c.value.strip();g=this.D;k=this.ky;break;case"email2sms":h=c.value.strip();i=this.D;break;case"email2chat":g=(m.getAttribute("changed")==1)?m.value.strip():""; i=this.D;k=Y.options[Y.selectedIndex].value;break;case"sms2chat":g=(m.getAttribute("changed")==1)?m.value.strip():"";h=this.D;k=Y.options[Y.selectedIndex].value;break;}if(g){g=M2(g);}if(i){i=M2(i);}if(h){h=M2(h);}if((this.O=="email")&&((i.length==0)||(!(/^[A-Z0-9._%-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/gi).test(i)))){alert(RB.lN);return true;}else{if(this.O=="chat"){if(!g){alert(RB.kt);return true;}else{if((k=="2")&&!IMObject.isBuddy(g,k)){alert(RB.Bb0);return true;}}}else{if((this.O=="sms")&&((h.length==0)||Wy._stringHasAlphabets(h))){alert(RB.kc);return true;}}}var f;f=getContactFromIMID(g,k);if(!f){f=getSMSSenderFromContacts(h); }if(!f){f=EO(i);}if(!f){var j=contacts.XMLDocument;var Z=j.createElement(eP.B);if((this.jd=="email")||(this.O=="email")){UX(Z,eP.A,i);}if((this.jd=="chat")||(this.O=="chat")){UX(Z,eP.E,g);}if((this.jd=="sms")||(this.O=="sms")){UX(Z,eP.H,h);}Ut(Z);}else{var W={};var X=false;var e;var b;var a;var V;var d;e=dc.A(f);b=Va(f);a=b.id;existingIMCloudId=b.cloud;d=eq(f,eP.H);if(!e&&((this.jd=="email")||(this.O=="email"))){W[eP.A]=i;X=true;}if(((this.jd=="chat")||(this.O=="chat"))&&(!a||(a&&(existingIMCloudId!=k)))){if(k==HG){W[eP.E]=g;}else{if(k==Ux){W[eP.P]=g;}}X=true;}if(!d&&((this.jd=="sms")||(this.O=="sms"))){W[eP.H]=h; X=true;}if(X===true){W.id=S2(f,eP.D);if(typeof MF!=RB.Qt){MF(W);}}}var l={};if(this.O=="chat"){l.value=g;l.cloud=k;}else{if(this.O=="email"){l.value=i;l.cloud=null;}else{if(this.O=="sms"){l.value=h;l.cloud=null;}}}l.value=this.O+":"+l.value;this.jc=l;return false;};D2.prototype.L=function(B){B.innerHTML="
"+this.F+RB.bb;};function XR(S,B,A,J,G,H){var I=BV();var P=false;if(!I.IMEnabled.isIMEnabled()||!I.IMEnabled.isIMLoggedIn()){var Q=EY(window,XR,S,B,A,J,G,H);I.Fj.push(Q);I.Lb();return ;}if(H=="sms"&&!hj()){var Q=EY(window,XR,S,B,A,J,G,H);cx(Q);return ;}var T=(H=="sms")?"im:open_im_text_session":RB.Gk; var R=(H=="sms")?RB.Sd:RB.Js;if(G=="radiobar"){P=true;G=G+":"+J;}else{var M=I.LB.A();var O=M.C.contentWindow;if(O&&(A!=O)){O.dk(S,null,O,J,G,H);return ;}var C=M.kd(H);if((G=="autocomplete")||(C==J)){P=true;}else{dk(T,null,null,J,G);return ;}}if(P){var F=TabInfoHelper.A(true);var E=RB.xb;var K=fi(G);var L=TabInfoHelper.C(false);if(G=="radiobar:fromEmail"){if(K==null){Nk(H,RB.BI1,R);}else{if(K.length==0){var M=I.LB.A();if(!M.z()){var D=I.LB.G.C;dk(R,null,null,null,G);Wk("discard",D);}else{iC(G,H,K);}}else{if(L&&L.G()){Nk(H,RB.AS1,R);}else{iC(G,H,K);}}}}else{if(K==null||(L&&L.G())){dk(T,null,null,J,G); }else{if(G=="autocomplete"||H=="sms"){I.LB.O(J,H);}iC(G,H);}}}}function TF(C,F,E){var G;var D=(E&&E.value)?E.value:"";var B=(E&&E.cloud)?E.cloud:HG;if(D){var H=D.split(":");G=H[0];D=H[1];}if((C=="Continue")&&F&&D&&(D.length>0)){var D=(G=="sms")?D:Wv(D.toLowerCase(),B);LB.O(D,G);var A=F.view;A.gu(F.shortText,F.source,F.type);}}function iC(D,G,E){var C=BV();var I=TabInfoHelper.A(true);var B=window;var F=I?(Cq.A?I.document.body.innerText:I.document.body.textContent):"";var A;var H;if(G=="sms"){A=Wf;H=RB.Sd;}else{if(G=="chat"){A=Qy;H=RB.Js;}}if(F.length>A){if(window.parent==C){B=C;}B.Nk(G,RB.BE2,H); }else{if(G=="chat"){F=M2(F);}gu(F,D,G,E);}}function gu(E,O,J,D){var K=BV();var H=K.LB.Y(J);if(H==""&&D){var I={};I.shortText=E;I.source=O;I.type=J;I.view=this;K.KU("email",J,D,I,TF);return ;}var C=HG;if(J=="chat"){var B=bD(H);H=B[0];C=B[1];}if(K.IMObject){var L=TabInfoHelper.A(true);var A=L&&L.document.body;var G=LB.G.C;if(H.length>0){var M;if(J=="sms"){var F=EP(H);M=K.IMObject.getSMSSessionWithView(F,O,true);}else{M=K.IMObject.getSessionWithView(H,C,O,true);}}else{M=Wy.create(null,O,true,J);}setTimeout(EY(this,Fu,G,M,E,A?L.document.body.style.fontFamily:null,A?L.document.body.style.fontSize:null),100); return ;}}function Fu(B,A,F,C,E,D){A.setInput(F);Wk("discard",B);}function Ta(C,D){this.W=false;this.D=C;if(D){this.k1=D;}Lang.callSuper(this,[C.element]);}MA(Ta,V5);Ta.kE=function(C,D){if(C&&D){D.v(false);D.T();}};Ta.prototype.handleCommand=function(J,K,I,G,L){var H=false;if(this.D&&this.D.handleCommand){H=this.D.handleCommand(J,K,I,G,L);}if(!H){V5.prototype.handleCommand.apply(this,arguments);}return H;};Ta.prototype.kC=function(){return this.W==true;};Ta.prototype.v=function(B){this.W=B;};Ta.prototype.V=function(){return this.D?this.D.getViewTitle():"";};Ta.prototype.jk=function(){return this.D?this.D.getBuddyName():""; };Ta.prototype.k0=function(){return this.D.getViewState();};Ta.prototype.g=function(){return this.D.getIcon();};Ta.prototype.A=function(){return RB.aM;};Ta.prototype.R=function(){if(this.k1){var B=this.k1;this.k1=null;return B;}if(this.D&&this.D._type=="sms"){return"smsConversation";}return"imConversation";};Ta.prototype.o=function(){V5.prototype.I.call(this);if(this.C){this.ji();}};Ta.prototype.ji=function(){if(this.U){this.U.E();}};Ta.prototype.jr=function(){if(this.U){this.U.D();}};Ta.prototype.l5=function(){};Ta.prototype.S=function(B){V5.prototype.S.call(this,B);if(this.D){this.D.resize(B); }};Ta.prototype.T=function(){if(this.W){NS.L(RR(0,1),RB.lJ,Ta.kE,true,this);return ;}if(this.D){this.D.close();}V5.prototype.T.call(this);};Ta.prototype.M=function(){if(this.D){this.D.activate();this.jr();}V5.prototype.M.call(this);this.li="";if(!this.D.keepFocusOnTab){SU("");}};Ta.prototype.I=function(){if(this.D){this.D.deactivate();}if(Component.A(Ox.A)){GL(null,null);}V5.prototype.I.call(this);};Ta.prototype.jw=function(B){return(this.D)?this.D.getCompArea(B):null;};Ta.prototype.l4=function(B){return(this.D)?this.D.getFontSelection(B):null;};Ta.prototype.kh=function(){return(this.D)?this.D.getID():null; };function jL(B){this.O=B;this.W=false;Lang.callSuper(this,[B.B]);}MA(jL,V5);jL.prototype.kC=function(){return this.W==true;};jL.prototype.v=function(B){this.W=B;};jL.prototype.handleCommand=function(J,K,I,G,L){var H=false;if(this.O&&this.O.H){H=this.O.H(J,K,I,G,L);}if(!H){V5.prototype.handleCommand.apply(this,arguments);}return H;};jL.prototype.V=function(){return this.O?this.O.ji():"";};jL.prototype.jk=function(){return this.O?this.O.jk():"";};jL.prototype.g=function(){return this.O?this.O.jm():"";};jL.prototype.A=function(){return RB.ew;};jL.prototype.R=function(){return"imOfflineMessages";}; jL.prototype.k0=function(){return this.O.jg();};jL.prototype.S=function(B){V5.prototype.S.call(this,B);if(this.O&&this.O.X){this.O.X(B);}};jL.prototype.T=function(){if(this.W){NS.L(RR(0,1),RB.lJ,Ta.kE,true,this);return ;}if(this.O){this.O.u();}V5.prototype.T.call(this);};jL.prototype.M=function(){if(t
1