FROM_ARCHIVE=1;(function(){if(typeof (MangoSpring)==="undefined"){MangoSpring={}}MangoSpring.namespace=function(){if(arguments.length==0){return }var namespace={};for(var i=0,a=arguments;i<a.length;i=i+1){var nslvl=a[i].split(".");namespace=MangoSpring;for(var j=(nslvl[0]=="MangoSpring"?1:0);j<a[i].length;j=j+1){namespace[nslvl[j]]=namespace[nslvl[j]]||{};namespace=namespace[nslvl[j]]}}return namespace};var $debug=false;MangoSpring.register=function(module,myClass,ns){var namespace=MangoSpring[ns];if(!namespace&&ns){namespace=MangoSpring.namespace(ns)}if(namespace&&!namespace[module]){namespace[module]=myClass||{}}else{if(!namespace&&!MangoSpring[module]){MangoSpring[module]=myClass}}return namespace};MangoSpring.log=function(){if(window.console&&$debug){window.console.log.apply(window.console,arguments)}};MangoSpring.warn=function(){if(window.console&&$debug){window.console.warn.apply(window.console,arguments)}};MangoSpring.error=function(){if(window.console&&$debug){window.console.error.apply(window.console,arguments)}};MangoSpring.info=function(){if(window.console&&$debug){window.console.info.apply(window.console,arguments)}};MangoSpring.setDebugOn=function(){$debug=true};MangoSpring.namespace("ui","util","config","net","model","event","plugin","lang")})();(function(){var App=MangoSpring;App.util.VersionPatcher=function(){var hostYahooVersionInfo=null;var t="";return{init:function(){this.setYahooVersion()},isYahoo:function(){return(typeof (YAHOO)!="undefined")},setYahooVersion:function(){try{if(this.isYahoo()){hostYahooVersionInfo=YAHOO.env.getVersion("yahoo");hostYahooVersionInfo=YAHOO.lang.merge({},hostYahooVersionInfo)}}catch(e){}},isAddPatch:function(){try{if(this.isYahoo()){if(hostYahooVersionInfo.version!="2.6.0"){return true}}}catch(e){}return false},addYahooPatch:function(){if(this.isAddPatch()){alert("came here yahoo version adding...");var _FOCUS=YAHOO.env.ua.ie?"focusin":"focus";var _BLUR=YAHOO.env.ua.ie?"focusout":"blur";if(!App.E){this.addYahooShortcuts()}if(!App.E.addFocusListener){App.E.addFocusListener=function(el,fn,obj,override){return this.addListener(el,_FOCUS,fn,obj,override,true)};App.E.removeFocusListener=function(el,fn){return this._removeListener(el,_FOCUS,fn,true)};App.E.addBlurListener=function(el,fn,obj,override){return this.addListener(el,_BLUR,fn,obj,override,true)};App.E.removeBlurListener=function(el,fn){return this.removeListener(el,_BLUR,fn,true)}}return true}return false},addYahooShortcuts:function(){try{App.$=YAHOO.util.Dom.get;App.D=YAHOO.util.Dom;App.U=YAHOO.util;App.E=YAHOO.util.Event;App.L=YAHOO.lang;App.S=YAHOO.util.Selector;App.J=YAHOO.lang.JSON;App.C=YAHOO.util.Cookie;App.A=YAHOO.util.Connect}catch(e){}}}}})();try{MangoSpring.util.versionPatcher=new MangoSpring.util.VersionPatcher();MangoSpring.util.versionPatcher.init()}catch(e){}if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]]}}return E};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C)}else{return false}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]}}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B)}if(E){E.VERSION=H;E.BUILD=G}else{YAHOO.log("mainClass is undefined for module "+A,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple"}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0]}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0]}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0]}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1])}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1])}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1])}return C}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break}}if(D){A.push(B)}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F},isBoolean:function(G){return typeof G==="boolean"},isFunction:function(G){return A.toString.apply(G)===C},isNull:function(G){return G===null},isNumber:function(G){return typeof G==="number"&&isFinite(G)},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false},isString:function(G){return typeof G==="string"},isUndefined:function(G){return typeof G==="undefined"},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that all dependencies are included.")}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G]}}B._IEEnumFix(J.prototype,I)}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.")}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]]}}else{for(L in J){if(H||!(L in K)){K[L]=J[L]}}B._IEEnumFix(K,J)}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.")}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H])}B.augmentObject.apply(this,G)},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+""}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G}else{if(B.isFunction(G)){return H}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O)}else{N.push(G[I])}N.push(M)}if(N.length>1){N.pop()}N.push("]")}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O)}else{N.push(G[I])}N.push(M)}}if(N.length>1){N.pop()}N.push("}")}return N.join("")},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break}K=V.indexOf(T,L);if(L+1>=K){break}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J)}S=H[R];if(O){S=O(R,S,U)}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10))}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4)}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10))}else{S=S.toString()}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I}}V=V.substring(0,L)+S+V.substring(K+1)}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g")}return V},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"")}catch(H){return G}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true)}return J},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O]}if(!I){throw new TypeError("method undefined")}if(!B.isArray(M)){M=[J]}L=function(){I.apply(H,M)};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G)}else{clearTimeout(G)}}}},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G))}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H)}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H]};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V])}}return Z};var I=function(T,U,W){var V=W||"utf-8";return J("link",{id:"yui__dyn_"+(R++),type:"text/css",charset:V,rel:"stylesheet",href:T},U)};var P=function(T,U,W){var V=W||"utf-8";return J("script",{id:"yui__dyn_"+(R++),type:"text/javascript",charset:V,src:T},U)};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId)}}};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T)}return V};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V))}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return }if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T))}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.scope||T;T.onTimeout.call(U,A(T))}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel()}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return }if(Z){U.url.shift();if(U.varName){U.varName.shift()}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.charset);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y)}else{C(V)}return }var T=U.url[0];if(!T){U.url.shift();return G(V)}if(U.timeout){U.timer=S.later(U.timeout,U,O,V)}if(U.type==="script"){W=P(T,c,U.charset)}else{W=I(T,c,U.charset)}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e)}}else{a.appendChild(W)}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T)}};var K=function(){if(E){return }E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T]}}E=false};var D=function(a){var X=M[a];if(X){var Z=X.nodes,T=Z.length,Y=X.win.document,W=Y.getElementsByTagName("head")[0];if(X.insertBefore){var V=B(X.insertBefore,a);if(V){W=V.parentNode}}for(var U=0;U<T;U=U+1){W.removeChild(Z[U])}X.nodes=[]}};var H=function(U,T,V){var X="q"+(L++);V=V||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K()}M[X]=S.merge(V,{tId:X,type:U,url:T,finished:false,aborted:false,nodes:[]});var W=M[X];W.win=W.win||window;W.scope=W.scope||W.win;W.autopurge=("autopurge" in W)?W.autopurge:(U==="script")?true:false;S.later(0,W,G,X);return{tId:X}};var F=function(c,X,W,U,Y,Z,b){var a=b||G;if(N.ie){X.onreadystatechange=function(){var d=this.readyState;if("loaded"===d||"complete"===d){X.onreadystatechange=null;a(W,U)}}}else{if(N.webkit){if(c==="script"){if(N.webkit>=420){X.addEventListener("load",function(){a(W,U)})}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;g<e;g=g+1){d=d[f[g]];if(!d){this.attempts++;if(this.attempts++>this.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h)}else{}return }}T.timer.cancel();a(W,U)},null,true)}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U])}}}}else{X.onload=function(){a(W,U)}}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T)},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true}},script:function(T,U){return H("script",T,U)},css:function(T,U){return H("css",T,U)}}}();YAHOO.register("get",YAHOO.util.Get,{version:"2.7.0",build:"1799"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{yahoo:true,get:true},info:{root:"2.7.0/build/",base:"http://yui.yahooapis.com/2.7.0/build/",comboBase:"http://yui.yahooapis.com/combo?",skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["reset","fonts","grids","base"],rollup:3},dupsAllowed:["yahoo","get"],moduleInfo:{animation:{type:"js",path:"animation/animation-min.js",requires:["dom","event"]},autocomplete:{type:"js",path:"autocomplete/autocomplete-min.js",requires:["dom","event","datasource"],optional:["connection","animation"],skinnable:true},base:{type:"css",path:"base/base-min.css",after:["reset","fonts","grids"]},button:{type:"js",path:"button/button-min.js",requires:["element"],optional:["menu"],skinnable:true},calendar:{type:"js",path:"calendar/calendar-min.js",requires:["event","dom"],skinnable:true},carousel:{type:"js",path:"carousel/carousel-min.js",requires:["element"],optional:["animation"],skinnable:true},charts:{type:"js",path:"charts/charts-min.js",requires:["element","json","datasource"]},colorpicker:{type:"js",path:"colorpicker/colorpicker-min.js",requires:["slider","element"],optional:["animation"],skinnable:true},connection:{type:"js",path:"connection/connection-min.js",requires:["event"]},container:{type:"js",path:"container/container-min.js",requires:["dom","event"],optional:["dragdrop","animation","connection"],supersedes:["containercore"],skinnable:true},containercore:{type:"js",path:"container/container_core-min.js",requires:["dom","event"],pkg:"container"},cookie:{type:"js",path:"cookie/cookie-min.js",requires:["yahoo"]},datasource:{type:"js",path:"datasource/datasource-min.js",requires:["event"],optional:["connection"]},datatable:{type:"js",path:"datatable/datatable-min.js",requires:["element","datasource"],optional:["calendar","dragdrop","paginator"],skinnable:true},dom:{type:"js",path:"dom/dom-min.js",requires:["yahoo"]},dragdrop:{type:"js",path:"dragdrop/dragdrop-min.js",requires:["dom","event"]},editor:{type:"js",path:"editor/editor-min.js",requires:["menu","element","button"],optional:["animation","dragdrop"],supersedes:["simpleeditor"],skinnable:true},element:{type:"js",path:"element/element-min.js",requires:["dom","event"]},event:{type:"js",path:"event/event-min.js",requires:["yahoo"]},fonts:{type:"css",path:"fonts/fonts-min.css"},get:{type:"js",path:"get/get-min.js",requires:["yahoo"]},grids:{type:"css",path:"grids/grids-min.css",requires:["fonts"],optional:["reset"]},history:{type:"js",path:"history/history-min.js",requires:["event"]},imagecropper:{type:"js",path:"imagecropper/imagecropper-min.js",requires:["dom","event","dragdrop","element","resize"],skinnable:true},imageloader:{type:"js",path:"imageloader/imageloader-min.js",requires:["event","dom"]},json:{type:"js",path:"json/json-min.js",requires:["yahoo"]},layout:{type:"js",path:"layout/layout-min.js",requires:["dom","event","element"],optional:["animation","dragdrop","resize","selector"],skinnable:true},logger:{type:"js",path:"logger/logger-min.js",requires:["event","dom"],optional:["dragdrop"],skinnable:true},menu:{type:"js",path:"menu/menu-min.js",requires:["containercore"],skinnable:true},paginator:{type:"js",path:"paginator/paginator-min.js",requires:["element"],skinnable:true},profiler:{type:"js",path:"profiler/profiler-min.js",requires:["yahoo"]},profilerviewer:{type:"js",path:"profilerviewer/profilerviewer-min.js",requires:["profiler","yuiloader","element"],skinnable:true},reset:{type:"css",path:"reset/reset-min.css"},"reset-fonts-grids":{type:"css",path:"reset-fonts-grids/reset-fonts-grids.css",supersedes:["reset","fonts","grids","reset-fonts"],rollup:4},"reset-fonts":{type:"css",path:"reset-fonts/reset-fonts.css",supersedes:["reset","fonts"],rollup:2},resize:{type:"js",path:"resize/resize-min.js",requires:["dom","event","dragdrop","element"],optional:["animation"],skinnable:true},selector:{type:"js",path:"selector/selector-min.js",requires:["yahoo","dom"]},simpleeditor:{type:"js",path:"editor/simpleeditor-min.js",requires:["element"],optional:["containercore","menu","button","animation","dragdrop"],skinnable:true,pkg:"editor"},slider:{type:"js",path:"slider/slider-min.js",requires:["dragdrop"],optional:["animation"],skinnable:true},stylesheet:{type:"js",path:"stylesheet/stylesheet-min.js",requires:["yahoo"]},tabview:{type:"js",path:"tabview/tabview-min.js",requires:["element"],optional:["connection"],skinnable:true},treeview:{type:"js",path:"treeview/treeview-min.js",requires:["event","dom"],optional:["json"],skinnable:true},uploader:{type:"js",path:"uploader/uploader.js",requires:["element"]},utilities:{type:"js",path:"utilities/utilities.js",supersedes:["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],rollup:8},yahoo:{type:"js",path:"yahoo/yahoo-min.js"},"yahoo-dom-event":{type:"js",path:"yahoo-dom-event/yahoo-dom-event.js",supersedes:["yahoo","event","dom"],rollup:3},yuiloader:{type:"js",path:"yuiloader/yuiloader-min.js",supersedes:["yahoo","get"]},"yuiloader-dom-event":{type:"js",path:"yuiloader-dom-event/yuiloader-dom-event.js",supersedes:["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],rollup:5},yuitest:{type:"js",path:"yuitest/yuitest-min.js",requires:["logger"],skinnable:true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;i<a.length;i=i+1){o[a[i]]=true}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i)}}return a}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2)},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i}}return -1},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true}return o},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a))}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.onTimeout=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.comboBase=YUI.info.comboBase;this.combine=false;this.root=YUI.info.root;this.timeout=0;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name)}});this.skin=lang.merge(YUI.info.skin);this._config(o)};Y.util.YUILoader.prototype={FILTERS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i])}else{this[i]=o[i]}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger")}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y}}this.filter=this.FILTERS[f]}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a)},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({name:name,type:"css",path:sinf.base+skin+"/"+sinf.path,after:sinf.after,rollup:sinf.rollup,ext:ext})}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({name:name,type:"css",after:sinf.after,path:pkg+"/"+sinf.base+skin+"/"+mod+".css",ext:ext})}}return name},getRequires:function(mod){if(!mod){return[]}if(!this.dirty&&mod.expanded){return mod.expanded}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m))}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]))}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o}if(m[ckey]){return m[ckey]}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm))}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i])}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey]},calculate:function(o){if(o||this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup()}this._reduce();this._sort();this.dirty=false}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){if(lang.hasOwnProperty(info,name)){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name)}}else{smod=this._addSkin(this.skin.defaultSkin,name)}m.requires.push(smod)}}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules)}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore)}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]]}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j))}}this.loaded=l},_explode:function(){var r=this.required,i,mod;for(i in r){if(lang.hasOwnProperty(r,i)){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req)}}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod}return s},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]}}return null},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll,info=this.moduleInfo;if(this.dirty||!this.rollups){for(i in info){if(lang.hasOwnProperty(info,i)){m=info[i];if(m&&m.rollup){rollups[i]=m}}}this.rollups=rollups}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=info[i];s=m.supersedes;roll=false;if(!m.rollup){continue}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(lang.hasOwnProperty(r,j)){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break}}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m)}}}if(!rolled){break}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i]}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(lang.hasOwnProperty(r,j)){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j]}}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]]}}}}}}},_onFailure:function(msg){YAHOO.log("Failure","info","loader");var f=this.onFailure;if(f){f.call(this.scope,{msg:"failure: "+msg,data:this.data,success:false})}},_onTimeout:function(){YAHOO.log("Timeout","info","loader");var f=this.onTimeout;if(f){f.call(this.scope,{msg:"timeout",data:this.data,success:false})}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){var mm=info[aa];if(loaded[bb]||!mm){return false}var ii,rr=mm.expanded,after=mm.after,other=info[bb],optional=mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true}}}if(mm.ext&&mm.type=="css"&&!other.ext&&other.type=="css"){return true}return false};for(var i in this.required){if(lang.hasOwnProperty(this.required,i)){s.push(i)}}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break}}if(moved){break}else{p=p+1}}if(!moved){break}}this.sorted=s},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1)},_combine:function(){this._combining=[];var self=this,s=this.sorted,len=s.length,js=this.comboBase,css=this.comboBase,target,startLen=js.length,i,m,type=this.loadType;YAHOO.log("type "+type);for(i=0;i<len;i=i+1){m=this.moduleInfo[s[i]];if(m&&!m.ext&&(!type||type===m.type)){target=this.root+m.path;target+="&";if(m.type=="js"){js+=target}else{css+=target}this._combining.push(s[i])}}if(this._combining.length){YAHOO.log("Attempting to combine: "+this._combining,"info","loader");var callback=function(o){var c=this._combining,len=c.length,i,m;for(i=0;i<len;i=i+1){this.inserted[c[i]]=true}this.loadNext(o.data)},loadScript=function(){if(js.length>startLen){YAHOO.util.Get.script(self._filter(js),{data:self._loading,onSuccess:callback,onFailure:self._onFailure,onTimeout:self._onTimeout,insertBefore:self.insertBefore,charset:self.charset,timeout:self.timeout,scope:self})}};if(css.length>startLen){YAHOO.util.Get.css(this._filter(css),{data:this._loading,onSuccess:loadScript,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,scope:self})}else{loadScript()}return }else{this.loadNext(this._loading)}},insert:function(o,type){this.calculate(o);this._loading=true;this.loadType=type;if(this.combine){return this._combine()}if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js")};this.insert(null,"css");return }this.loadNext()},sandbox:function(o,type){this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox")}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js")};this.insert(null,"css");return }if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js")},scope:this},"js");return }this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this._onFailure("undefined module "+m);for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort()}return }if(m.type!=="js"){this._loadCount++;continue}url=m.fullpath;url=(url)?this._filter(url):this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data})}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data})}else{this._onFailure.call(this.varName+" reference failure")}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data})},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData))}},loadNext:function(mname){if(!this._loading){return }if(mname){if(mname!==this._loading){return }this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data})}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue}if(s[i]===this._loading){return }m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return }if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath,self=this,c=function(o){self.loadNext(o.data)};url=(url)?this._filter(url):this._url(m.path);if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true}fn(url,{data:s[i],onSuccess:c,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,varName:m.varName,scope:self});return }}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this)}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data})}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load()}},_filter:function(str){var f=this.filter;return(f)?str.replace(new RegExp(f.searchExp,"g"),f.replaceStr):str},_url:function(path){return this._filter((this.base||"")+path)}}})();YAHOO.register("yuiloader",YAHOO.util.YUILoader,{version:"2.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{htmlFor:"for",className:g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x]}}}}return y}if(y.DOM_EVENTS){y=y.get("element")}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x])}return z}return y}return null},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y]}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y)}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y)},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y]}}return x}}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(z){try{x=G.filters("alpha").opacity}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x)}}}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x})},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1}}break;case"float":x="styleFloat";default:Y.style[x]=y}}else{}}}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat"}Y.style[x]=y}else{}}}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY)},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G))},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0}}if((AC==c)){if(G!==r){AE=parseInt(G,10)}if(x!==r){AD=parseInt(x,10)}}AG[0]-=AE;AG[1]-=AD}if((Y||z)){AG[0]+=z;AG[1]+=Y}AG[0]=AB(AG[0]);AG[1]=AB(AG[1])}else{}return AG}}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z)}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z)}if(AA||AB){z[0]-=AB;z[1]-=AA}}z[0]+=x;z[1]+=Y}else{if(D){z[0]-=x;z[1]-=Y}else{if(I||H){z[0]+=x;z[1]+=Y}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1])}else{}return z}}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0]};return E.Dom.batch(G,Y,E.Dom,true)},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1]};return E.Dom.batch(G,Y,E.Dom,true)},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y})},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA)}AC=E.Dom._getXY(G);if(!AD||AC===false){return false}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b]}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P]}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px")}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px")}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true})}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null])},setY:function(G,Y){E.Dom.setXY(G,[null,Y])},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x)}else{}return y};return E.Dom.batch(G,Y,E.Dom,true)},getClientWidth:function(){return E.Dom.getViewportWidth()},getClientHeight:function(){return E.Dom.getViewportHeight()},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[]}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y]}}if(AE){E.Dom.batch(Y,AE,x,AD)}return Y},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G)},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y)}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1}}else{}return G},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G)},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true}}else{}return G},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G)},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G)}}}else{}return Y},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G})},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false}else{if(!AB){G=E.Dom._addClass(y,x.to)}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true}}}}else{}return G},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x)}y.id=z}return z};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments)},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x)}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16)}}}else{}return G},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y)},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y)}else{}return G},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[]}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break}else{x[x.length]=G[z]}}}if(AD){E.Dom.batch(x,AD,y,AC)}return x},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true)},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA)}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA)}}else{return false}return y},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight}return G},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth}return G},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G}}return null},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null}var x=function(y){return E.Dom.hasClass(y,G)};return E.Dom.getAncestorBy(Y,x)},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase()};return E.Dom.getAncestorBy(Y,x)},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G}}return null},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null}return E.Dom.getPreviousSiblingBy(G)},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G}}return null},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null}return E.Dom.getNextSiblingBy(G)},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x)},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null}return E.Dom.getFirstChildBy(G)},getLastChildBy:function(G,x){if(!G){return null}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x)},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G)},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z}return false});return G},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G)},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft)},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop)},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null}return G[Z].insertBefore(Y,G)},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling)}else{return G[Z].appendChild(Y)}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y)},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x)},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G)},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase()}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G))},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U)}}}return G},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G))},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0}}y[0]+=G;y[1]+=Y;return y}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x)}return x}}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent"}return x}}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B)}else{return null}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B)};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}")};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B)};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0]}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A)};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U)}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z)}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z)}else{Y=a}}}}return Y},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d)}Z[H][e]=L}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b}a=Z[H][Y]}return a+I},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break}return Y+I},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X)}return Z},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J]}return(Z)?Z[X]:S},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a))}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E)}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")"}return E},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("")}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1")}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H}return H.toLowerCase()}}}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C)}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C))},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll()}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true}}return E},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0]}try{G=M.fn.call(L,B,M.obj)}catch(F){this.lastError=F;if(A){throw F}}}else{try{G=M.fn.call(L,this.type,I,M.obj)}catch(H){this.lastError=H;if(A){throw H}}}if(false===G){if(!this.silent){}break}}}return(G!==false)},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B)}this.subscribers=[];return A},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj}this.subscribers.splice(A,1)},toString:function(){return"CustomEvent: '"+this.type+"', context: "+this.scope}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj}else{return this.overrideContext}}return A};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B)}else{return(this.fn==A)}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }"};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach()};this._interval=setInterval(N,this.POLL_INTERVAL)}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P})}C=this.POLL_RETRYS;this.startInterval()},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true)},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N}else{P=O}}M.call(P,"DOMReady",[],N)},0)}else{this.DOMReadyEvent.subscribe(M,N,O)}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z}return Z}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W)});return true}}}if(!O){return false}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true}var N=O;if(W){if(W===true){N=S}else{N=W}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S)};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q)}}E[Q].push(a)}else{try{this._simpleAdd(O,M,P,b)}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false}}return true},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false)},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true)},removeFocusListener:function(N,M){return this.removeListener(N,K,M)},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true)},removeBlurListener:function(N,M){return this.removeListener(N,L,M)},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S)}}M=G[P];if(M&&M[2]){M[2](R)}return T},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1}else{return B[M]}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N))},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N)}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W)}return W}}if(!V||!V.call){return this.purgeElement(N,false,M)}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true}}return false}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V)}if(S>=0){R=I[S]}if(!N||!R){return false}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false)}catch(U){this.lastError=U;return false}}delete I[S][this.WFN];delete I[S][this.FN];I.splice(S,1);return true},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M)},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode}}catch(M){}return N},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft()}}return M},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop()}}return N},getXY:function(M){return[this.getPageX(M),this.getPageY(M)]},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement}else{if(N.type=="mouseover"){M=N.fromElement}}}return this.resolveTextNode(M)},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N}catch(M){this.lastError=M;return N}}return O.time},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M)},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation()}else{M.cancelBubble=true}},preventDefault:function(M){if(M.preventDefault){M.preventDefault()}else{M.returnValue=false}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break}P=P.caller}}return N},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M]}return M},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O}}return -1},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N}return N},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined")}catch(M){return false}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach()}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready)}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null}return }if(this.locked){return }if(this.isIE){if(!this.DOMReady){this.startInterval();return }}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0)}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj}else{U=W.overrideContext}}W.fn.call(U,W.obj)};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null}}else{T(P,Q);F[N]=null}}else{R.push(Q)}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q)}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1)}}this.startInterval()}else{if(this._interval){clearInterval(this._interval);this._interval=null}}this.locked=false},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn)}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T)}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J]}else{if(M==="unload"){N=[J]}else{N=[I]}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S})}}}}return(R.length)?R:null},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ]}else{M=O[N.ADJ_SCOPE]}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P)}}O=null}G=null;N._simpleRemove(window,"unload",N._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft]}else{if(N){return[N.scrollTop,N.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M))}}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M))}}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M)}}else{return function(){}}}}()}}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null}catch(ex){}},EU.POLL_INTERVAL)}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready()}},EU.POLL_INTERVAL)}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready)}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E)}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[]}B[A].push({fn:C,obj:F,overrideContext:E})}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G)}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G)}}return B}return false},unsubscribeAll:function(A){return this.unsubscribe(A)},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext)}}}return I[G]},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F])}return G.fire.apply(G,B)},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true}}return false}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D)}if(C.isFunction(E)){G.subscribe(E)}else{G.subscribe(E.fn,E.scope,E.correctScope)}function H(O,N){if(!I.shift){I.shift=false}if(!I.alt){I.alt=false}if(!I.ctrl){I.ctrl=false}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O)}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I)}this.enabled=true};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I)}this.enabled=false};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"")}};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38}})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1799"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(C){var B=YAHOO.util.Event.getTarget(C),A=B.nodeName.toLowerCase();if((A==="input"||A==="button")&&(B.type&&B.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(B.name)+"="+encodeURIComponent(B.value)}});return true}return false})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A)},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A}else{if(typeof A=="boolean"){this._use_default_post_header=A}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A}else{this._use_default_xhr_header=A}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A}},createXhrObject:function(F){var E,A;try{A=new XMLHttpRequest();E={conn:A,tId:F}}catch(D){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);E={conn:A,tId:F};break}catch(C){}}}finally{return E}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D)}else{C={};C.tId=D;C.isUpload=true}if(C){this._transaction_id++}}catch(B){}finally{return C}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null}else{if(E&&E.customevents){this.initCustomEvents(D,E)}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString()}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true)}}if((F.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header)}if(this._has_default_headers||this._has_http_headers){this.setHeader(D)}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState()}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B)}return D}},initCustomEvents:function(A,C){var B;for(B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B])}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true)},D.timeout)}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId]}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A)}B.handleTransactionResponse(C,D)}},this._polling_interval)},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status}else{D=13030}}catch(E){D=13030}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C)}else{G.success.apply(G.scope,[C])}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C)}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C)}else{G.failure.apply(G.scope,[C])}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C)}else{G.failure.apply(G.scope,[C])}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C)}}this.releaseObject(F);C=null},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2)}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G}return D},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B}else{E.status=F;E.statusText=G}if(D){E.argument=D}return E},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true}else{this._has_http_headers=true}},setHeader:function(A){var B;if(this._has_default_headers){for(B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B])}}}if(this._has_http_headers){for(B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B])}}delete this._http_headers;this._http_headers={};this._has_http_headers=false}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false},setForm:function(M,H,C){var L,B,K,I,P,J=false,F=[],O=0,E,G,D,N,A;this.resetFormState();if(typeof M=="string"){L=(document.getElementById(M)||document.forms[M])}else{if(typeof M=="object"){L=M}else{return }}if(H){this.createFrame(C?C:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=L;return }for(E=0,G=L.elements.length;E<G;++E){B=L.elements[E];P=B.disabled;K=B.name;if(!P&&K){K=encodeURIComponent(K)+"=";I=encodeURIComponent(B.value);switch(B.type){case"select-one":if(B.selectedIndex>-1){A=B.options[B.selectedIndex];F[O++]=K+encodeURIComponent((A.attributes.value&&A.attributes.value.specified)?A.value:A.text)}break;case"select-multiple":if(B.selectedIndex>-1){for(D=B.selectedIndex,N=B.options.length;D<N;++D){A=B.options[D];if(A.selected){F[O++]=K+encodeURIComponent((A.attributes.value&&A.attributes.value.specified)?A.value:A.text)}}}break;case"radio":case"checkbox":if(B.checked){F[O++]=K+I}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(J===false){if(this._hasSubmitListener&&this._submitElementValue){F[O++]=this._submitElementValue}J=true}break;default:F[O++]=K+I}}}this._isFormSubmit=true;this._sFormData=F.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData=""},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(YAHOO.env.ua.ie){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){C.src="javascript:false"}}else{C=document.createElement("iframe");C.id=B;C.name=B}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C)},appendPostData:function(A){var D=[],B=A.split("&"),C,E;for(C=0;C<B.length;C++){E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=decodeURIComponent(B[C].substring(0,E));D[C].value=decodeURIComponent(B[C].substring(E+1));this._formNode.appendChild(D[C])}}return D},uploadFile:function(D,N,E,C){var I="yuiIO"+D.tId,J="multipart/form-data",L=document.getElementById(I),O=this,K=(N&&N.argument)?N.argument:null,M,H,B,G;var A={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",I);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",J)}else{this._formNode.setAttribute("enctype",J)}if(C){M=this.appendPostData(C)}this._formNode.submit();this.startEvent.fire(D,K);if(D.startEvent){D.startEvent.fire(D,K)}if(N&&N.timeout){this._timeOut[D.tId]=window.setTimeout(function(){O.abort(D,N,true)},N.timeout)}if(M&&M.length>0){for(H=0;H<M.length;H++){this._formNode.removeChild(M[H])}}for(B in A){if(YAHOO.lang.hasOwnProperty(A,B)){if(A[B]){this._formNode.setAttribute(B,A[B])}else{this._formNode.removeAttribute(B)}}}this.resetFormState();var F=function(){if(N&&N.timeout){window.clearTimeout(O._timeOut[D.tId]);delete O._timeOut[D.tId]}O.completeEvent.fire(D,K);if(D.completeEvent){D.completeEvent.fire(D,K)}G={tId:D.tId,argument:N.argument};try{G.responseText=L.contentWindow.document.body?L.contentWindow.document.body.innerHTML:L.contentWindow.document.documentElement.textContent;G.responseXML=L.contentWindow.document.XMLDocument?L.contentWindow.document.XMLDocument:L.contentWindow.document}catch(P){}if(N&&N.upload){if(!N.scope){N.upload(G)}else{N.upload.apply(N.scope,[G])}}O.uploadEvent.fire(G);if(D.uploadEvent){D.uploadEvent.fire(G)}YAHOO.util.Event.removeListener(L,"load",F);setTimeout(function(){document.body.removeChild(L);O.releaseObject(D)},100)};YAHOO.util.Event.addListener(L,"load",F)},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId]}D=true}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId]}D=true}}else{D=false}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B)}this.handleTransactionResponse(E,G,true)}return D},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false}else{return false}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.7.0",build:"1799"});(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F)};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames)},setAttribute:function(C,F,E){var D=this.getEl();if(this.patterns.noNegatives.test(C)){F=(F>0)?F:0}if("style" in D){B.Dom.setStyle(D,C,F+E)}else{if(C in D){D[C]=F}}},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G)}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if("style" in E){if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)]}else{G=0}}else{if(C in E){G=E[C]}}return G},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px"}return""},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined")};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"]}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1}}else{E=I+F[D]["by"]*1}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M)};this.getEl=function(){return E};this.isAnimated=function(){return D};this.getStartTime=function(){return F};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1}B.AnimMgr.registerElement(this);return true};this.stop=function(M){if(!this.isAnimated()){return false}if(M){this.currentFrame=this.totalFrames;this._onTween.fire()}B.AnimMgr.stop(this)};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M)}D=true;H=0;F=new Date()};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame)};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit)}H+=1};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps)};D=false;H=0;this.onComplete.fire(N)};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G)}};B.Anim=A})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start()};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop()}return true};this.start=function(){if(C===null){C=setInterval(this.run,this.delay)}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0)}B=[];C=null;A=0}else{this.unRegister(H)}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G)}G._onTween.fire()}else{YAHOO.util.AnimMgr.stop(G,H)}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G}}return -1};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame)}else{K=J-(I+1)}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1)}G.currentFrame+=K}}};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]]}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1]}}return[C[0][0],C[0][1]]}};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H)};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)]}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)]}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]}return null};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I)});if(F){I=C.Dom.getStyle(F,E)}else{I=A.DEFAULT_BGCOLOR}}}else{I=D.getAttribute.call(this,E)}return I};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H])}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")"}else{I=D.doMethod.call(this,F,J,G)}return I};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I]}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G}};C.ColorAnim=A})();YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A},easeIn:function(B,A,D,C){return D*(B/=C)*B+A},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A}return -D/2*((--B)*(B-2)-1)+A},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A}return -D/2*((B-=2)*B*B*B-2)+A},elasticIn:function(C,A,G,F,B,E){if(C==0){return A}if((C/=F)==1){return A+G}if(!E){E=F*0.3}if(!B||B<Math.abs(G)){B=G;var D=E/4}else{var D=E/(2*Math.PI)*Math.asin(G/B)}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A},elasticOut:function(C,A,G,F,B,E){if(C==0){return A}if((C/=F)==1){return A+G}if(!E){E=F*0.3}if(!B||B<Math.abs(G)){B=G;var D=E/4}else{var D=E/(2*Math.PI)*Math.asin(G/B)}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A}if((C/=F/2)==2){return A+G}if(!E){E=F*(0.3*1.5)}if(!B||B<Math.abs(G)){B=G;var D=E/4}else{var D=E/(2*Math.PI)*Math.asin(G/B)}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158}return E*(B/=D)*B*((C+1)*B-C)+A},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J)}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H)}else{F.setAttribute.call(this,G,I,H)}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")]}else{H=F.getAttribute.call(this,G)}return H};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I)}else{J=F.doMethod.call(this,G,K,H)}return J};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J.points["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L]}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M]}L=K}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative")}if(D(J.points["from"])){E.Dom.setXY(H,J.points["from"])}else{E.Dom.setXY(H,E.Dom.getXY(H))}G=this.getAttribute("points");if(D(J.points["to"])){I=B.call(this,J.points["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G)}}else{if(D(J.points["by"])){I=[G[0]+J.points["by"][0],G[1]+J.points["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]]}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L)}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I}else{F.setRuntimeAttribute.call(this,P)}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G};var D=function(G){return(typeof G!=="undefined")};E.Motion=A})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H)}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)]}else{G=C.doMethod.call(this,E,H,F)}return G};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop]}else{G=C.getAttribute.call(this,E)}return G};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1]}else{C.setAttribute.call(this,E,H,G)}};B.Scroll=D})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.7.0",build:"1799"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild)}else{document.body.appendChild(C)}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true)},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0"}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim()}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5"}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block"}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue}G[E].apply(G,D)}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true)},_onResize:function(C){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init()}if(!this.ids[C]){this.ids[C]={}}this.ids[C][D.id]=D},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={}}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id]}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id]}}}delete this.handleIds[E.id]},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={}}this.handleIds[D][C]=C},isDragDrop:function(C){return(this.getDDById(C))?true:false},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue}if(!D||C.isTarget){G[G.length]=C}}}return G},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true}}return false},isTypeOfDD:function(C){return(C&&C.__ygDragDrop)},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C])},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D]}}return null},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true},this.clickTimeThresh)},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E})}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E})}this.dragThreshMet=true},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C)}this.fromTimeout=false;this.fireEvents(C,true)}else{}this.stopDrag(C);this.stopEvent(C)}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C)}if(this.preventDefault){YAHOO.util.Event.preventDefault(C)}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E})}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E})}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E})}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false}}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F)}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F})}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F})}if(C){this.fireEvents(F,false)}}this.stopEvent(F)}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return }var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue}if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d)}I[S]=true;delete this.dragOvers[S]}for(var R in a.groups){if("string"!=typeof R){continue}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G)}else{if(!I[G.id]){c.enterEvts.push(G)}else{c.overEvts.push(G)}this.dragOvers[G.id]=G}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C)}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V})}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"]}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q})}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q})}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]})}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]})}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0]}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C}}}}return G},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H}else{delete this.locationCache[G.id]}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true}}}catch(E){}return false},getLocation:function(H){if(!this.isTypeOfDD(H)){return null}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F)}catch(I){}if(!K){return null}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G)},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G}if(!G){return false}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x)}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver}else{return false}},_onUnload:function(D,C){this.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);this.ids={}},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D))}return C},getElement:function(C){return YAHOO.util.Dom.get(C)},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style},getPosX:function(C){return YAHOO.util.Dom.getX(C)},getPosY:function(C){return YAHOO.util.Dom.getY(C)},swapNode:function(E,C){if(E.swapNode){E.swapNode(C)}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C)}else{if(C==E.nextSibling){F.insertBefore(C,E)}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D)}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft}else{if(D){E=D.scrollTop;C=D.scrollLeft}else{}}return{top:E,left:C}},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D)},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight()},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth()},numericSort:function(D,C){return(D-C)},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad()}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true}else{D=D.parentNode}}}return false}}}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners()}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D)}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments)},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},unlock:function(){this.locked=false},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id)}return this._domRef},getDragEl:function(){return B.get(this.dragElId)},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event")}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E)}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig()},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E]}else{if(!F&&0!==F){this.padding=[E,C,E,C]}else{this.padding=[E,C,F,D]}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return }var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H)},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1]},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C)},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C]}this.DDM.removeDDFromGroup(this,C)},setDragElId:function(C){this.dragElId=C},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C)}this.handleElId=C;this.DDM.regHandle(this.id,C)},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C)}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return }if(this.isLocked()){return }var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J)}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J)}if((C===false)||(E===false)||(F===false)||(H===false)){return }this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J)}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)))},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX}if(C>this.maxX){C=this.maxX}}if(this.constrainY){if(F<this.minY){F=this.minY}if(F>this.maxY){F=this.maxY}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F}},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C)}this.invalidHandleIds[C]=C},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C)},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D]},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C)}delete this.invalidHandleIds[C]},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E]}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase()}catch(G){H=F.nodeName}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D])}return E},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(I,F){if(!F){return I}else{if(F[0]>=I){return F[0]}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E]}}return F[F.length-1]}}},toString:function(){return("DragDrop "+this.id)}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider)})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B)}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D)},setDelta:function(B,A){this.deltaX=B;this.deltaY=A},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B)},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y]}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px")}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth)},0)},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1]}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A)}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A)}if(M>B&&F<C){window.scrollTo(D+A,N)}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N)}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A))},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A))},toString:function(){return("DD "+this.id)}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame()}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame()},50);return }var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId)},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2))}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible")},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0}if(isNaN(I)){I=0}if(isNaN(F)){F=0}if(isNaN(D)){D=0}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px")}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C)},b4StartDrag:function(A,B){this.showFrame(A,B)},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden")},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","")},toString:function(){return("DDProxy "+this.id)}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B)}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id)}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.7.0",build:"1799"});YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true)}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name)}return A},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false}if(this.validator&&!this.validator.call(A,F)){return false}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name)}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D)}return true},configure:function(B,C){B=B||{};if(C){this._written=false}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A]}}}},resetValue:function(){return this.setValue(this._initialConfig.value)},resetConfig:function(){this.configure(this._initialConfig,true)},refresh:function(A){this.setValue(this.value,A)}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null}return B.getValue()},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false}return C.setValue(E,B)},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B}}return C},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B)}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true}return false},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C)}}},register:function(B,C){this.setAttributeConfig(B,C)},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C]}}return D},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C)}else{this._configs[B].configure(C,D)}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D)},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig()},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B)}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments)},on:function(){this.subscribe.apply(this,arguments)},addListener:function(){this.subscribe.apply(this,arguments)},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C)},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B)},createAttribute:function(B){return new YAHOO.util.Attribute(B,this)}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider)})();(function(){var B=YAHOO.util.Dom,C=YAHOO.util.AttributeProvider;var A=function(D,E){this.init.apply(this,arguments)};A.DOM_EVENTS={click:true,dblclick:true,keydown:true,keypress:true,keyup:true,mousedown:true,mousemove:true,mouseout:true,mouseover:true,mouseup:true,focus:true,blur:true,submit:true,change:true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(F,D){var E=this.get("element");if(E){E[D]=F}},DEFAULT_HTML_GETTER:function(D){var E=this.get("element"),F;if(E){F=E[D]}return F},appendChild:function(D){D=D.get?D.get("element"):D;return this.get("element").appendChild(D)},getElementsByTagName:function(D){return this.get("element").getElementsByTagName(D)},hasChildNodes:function(){return this.get("element").hasChildNodes()},insertBefore:function(D,E){D=D.get?D.get("element"):D;E=(E&&E.get)?E.get("element"):E;return this.get("element").insertBefore(D,E)},removeChild:function(D){D=D.get?D.get("element"):D;return this.get("element").removeChild(D)},replaceChild:function(D,E){D=D.get?D.get("element"):D;E=E.get?E.get("element"):E;return this.get("element").replaceChild(D,E)},initAttributes:function(D){},addListener:function(H,G,I,F){var E=this.get("element")||this.get("id");F=F||this;var D=this;if(!this._events[H]){if(E&&this.DOM_EVENTS[H]){YAHOO.util.Event.addListener(E,H,function(J){if(J.srcElement&&!J.target){J.target=J.srcElement}D.fireEvent(H,J)},I,F)}this.createEvent(H,this)}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments)},on:function(){return this.addListener.apply(this,arguments)},subscribe:function(){return this.addListener.apply(this,arguments)},removeListener:function(E,D){return this.unsubscribe.apply(this,arguments)},addClass:function(D){B.addClass(this.get("element"),D)},getElementsByClassName:function(E,D){return B.getElementsByClassName(E,D,this.get("element"))},hasClass:function(D){return B.hasClass(this.get("element"),D)},removeClass:function(D){return B.removeClass(this.get("element"),D)},replaceClass:function(E,D){return B.replaceClass(this.get("element"),E,D)},setStyle:function(E,D){return B.setStyle(this.get("element"),E,D)},getStyle:function(D){return B.getStyle(this.get("element"),D)},fireQueue:function(){var E=this._queue;for(var F=0,D=E.length;F<D;++F){this[E[F][0]].apply(this,E[F][1])}},appendTo:function(E,F){E=(E.get)?E.get("element"):B.get(E);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:E});F=(F&&F.get)?F.get("element"):B.get(F);var D=this.get("element");if(!D){return false}if(!E){return false}if(D.parent!=E){if(F){E.insertBefore(D,F)}else{E.appendChild(D)}}this.fireEvent("appendTo",{type:"appendTo",target:E});return D},get:function(D){var F=this._configs||{},E=F.element;if(E&&!F[D]&&!YAHOO.lang.isUndefined(E.value[D])){this._setHTMLAttrConfig(D)}return C.prototype.get.call(this,D)},setAttributes:function(J,G){var E={},H=this._configOrder;for(var I=0,D=H.length;I<D;++I){if(J[H[I]]!==undefined){E[H[I]]=true;this.set(H[I],J[H[I]],G)}}for(var F in J){if(J.hasOwnProperty(F)&&!E[F]){this.set(F,J[F],G)}}},set:function(E,G,D){var F=this.get("element");if(!F){this._queue[this._queue.length]=["set",arguments];if(this._configs[E]){this._configs[E].value=G}return }if(!this._configs[E]&&!YAHOO.lang.isUndefined(F[E])){this._setHTMLAttrConfig(E)}return C.prototype.set.apply(this,arguments)},setAttributeConfig:function(D,E,F){this._configOrder.push(D);C.prototype.setAttributeConfig.apply(this,arguments)},createEvent:function(E,D){this._events[E]=true;return C.prototype.createEvent.apply(this,arguments)},init:function(E,D){this._initElement(E,D)},destroy:function(){var D=this.get("element");YAHOO.util.Event.purgeElement(D,true);this.unsubscribeAll();if(D&&D.parentNode){D.parentNode.removeChild(D)}this._queue=[];this._events={};this._configs={};this._configOrder=[]},_initElement:function(F,E){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];E=E||{};E.element=E.element||F||null;var H=false;var D=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var G in D){if(D.hasOwnProperty(G)){this.DOM_EVENTS[G]=D[G]}}if(typeof E.element==="string"){this._setHTMLAttrConfig("id",{value:E.element})}if(B.get(E.element)){H=true;this._initHTMLElement(E);this._initContent(E)}YAHOO.util.Event.onAvailable(E.element,function(){if(!H){this._initHTMLElement(E)}this.fireEvent("available",{type:"available",target:B.get(E.element)})},this,true);YAHOO.util.Event.onContentReady(E.element,function(){if(!H){this._initContent(E)}this.fireEvent("contentReady",{type:"contentReady",target:B.get(E.element)})},this,true)},_initHTMLElement:function(D){this.setAttributeConfig("element",{value:B.get(D.element),readOnly:true})},_initContent:function(D){this.initAttributes(D);this.setAttributes(D,true);this.fireQueue()},_setHTMLAttrConfig:function(D,F){var E=this.get("element");F=F||{};F.name=D;F.setter=F.setter||this.DEFAULT_HTML_SETTER;F.getter=F.getter||this.DEFAULT_HTML_GETTER;F.value=F.value||E[D];this._configs[D]=new YAHOO.util.Attribute(F,this)}};YAHOO.augment(A,C);YAHOO.util.Element=A})();YAHOO.register("element",YAHOO.util.Element,{version:"2.7.0",build:"1799"});YAHOO.register("utilities",YAHOO,{version:"2.7.0",build:"1799"});(function(){var A=YAHOO.util;A.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(B,C){return B===C},"!=":function(B,C){return B!==C},"~=":function(B,D){var C=" ";return(C+B+C).indexOf((C+D+C))>-1},"|=":function(B,C){return B===C||B.slice(0,C.length+1)===C+"-"},"^=":function(B,C){return B.indexOf(C)===0},"$=":function(B,C){return B.slice(-C.length)===C},"*=":function(B,C){return B.indexOf(C)>-1},"":function(B,C){return B}},pseudos:{root:function(B){return B===B.ownerDocument.documentElement},"nth-child":function(B,C){return A.Selector._getNth(B,C)},"nth-last-child":function(B,C){return A.Selector._getNth(B,C,null,true)},"nth-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName)},"nth-last-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName,true)},"first-child":function(B){return A.Selector._getChildren(B.parentNode)[0]===B},"last-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B[B.length-1]===C},"first-of-type":function(B,C){return A.Selector._getChildren(B.parentNode,B.tagName)[0]},"last-of-type":function(C,D){var B=A.Selector._getChildren(C.parentNode,C.tagName);return B[B.length-1]},"only-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B.length===1&&B[0]===C},"only-of-type":function(B){return A.Selector._getChildren(B.parentNode,B.tagName).length===1},empty:function(B){return B.childNodes.length===0},not:function(B,C){return !A.Selector.test(B,C)},contains:function(B,D){var C=B.innerText||B.textContent||"";return C.indexOf(D)>-1},checked:function(B){return B.checked===true}},test:function(F,D){F=A.Selector.document.getElementById(F)||F;if(!F){return false}var C=D?D.split(","):[];if(C.length){for(var E=0,B=C.length;E<B;++E){if(A.Selector._test(F,C[E])){return true}}return false}return A.Selector._test(F,D)},_test:function(D,G,F,E){F=F||A.Selector._tokenize(G).pop()||{};if(!D.tagName||(F.tag!=="*"&&D.tagName!==F.tag)||(E&&D._found)){return false}if(F.attributes.length){var B,H,C=A.Selector._re.urls;if(!D.attributes||!D.attributes.length){return false}for(var I=0,K;K=F.attributes[I++];){H=(C.test(K[0]))?2:0;B=D.getAttribute(K[0],H);if(B===null||B===undefined){return false}if(A.Selector.operators[K[1]]&&!A.Selector.operators[K[1]](B,K[2])){return false}}}if(F.pseudos.length){for(var I=0,J=F.pseudos.length;I<J;++I){if(A.Selector.pseudos[F.pseudos[I][0]]&&!A.Selector.pseudos[F.pseudos[I][0]](D,F.pseudos[I][1])){return false}}}return(F.previous&&F.previous.combinator!==",")?A.Selector._combinators[F.previous.combinator](D,F):true},filter:function(E,D){E=E||[];var G,C=[],H=A.Selector._tokenize(D);if(!E.item){for(var F=0,B=E.length;F<B;++F){if(!E[F].tagName){G=A.Selector.document.getElementById(E[F]);if(G){E[F]=G}else{}}}}C=A.Selector._filter(E,A.Selector._tokenize(D)[0]);return C},_filter:function(E,G,H,D){var C=H?null:[],I=A.Selector._foundCache;for(var F=0,B=E.length;F<B;F++){if(!A.Selector._test(E[F],"",G,D)){continue}if(H){return E[F]}if(D){if(E[F]._found){continue}E[F]._found=true;I[I.length]=E[F]}C[C.length]=E[F]}return C},query:function(C,D,E){var B=A.Selector._query(C,D,E);return B},_query:function(H,M,N,F){var P=(N)?null:[],E;if(!H){return P}var D=H.split(",");if(D.length>1){var O;for(var I=0,J=D.length;I<J;++I){O=arguments.callee(D[I],M,N,true);P=N?O:P.concat(O)}A.Selector._clearFoundCache();return P}if(M&&!M.nodeName){M=A.Selector.document.getElementById(M);if(!M){return P}}M=M||A.Selector.document;if(M.nodeName!=="#document"){A.Dom.generateId(M);H=M.tagName+"#"+M.id+" "+H;E=M;M=M.ownerDocument}var L=A.Selector._tokenize(H);var K=L[A.Selector._getIdTokenIndex(L)],B=[],C,G=L.pop()||{};if(K){C=A.Selector._getId(K.attributes)}if(C){E=E||A.Selector.document.getElementById(C);if(E&&(M.nodeName==="#document"||A.Dom.isAncestor(M,E))){if(A.Selector._test(E,null,K)){if(K===G){B=[E]}else{if(K.combinator===" "||K.combinator===">"){M=E}}}}else{return P}}if(M&&!B.length){B=M.getElementsByTagName(G.tag)}if(B.length){P=A.Selector._filter(B,G,N,F)}return P},_clearFoundCache:function(){var E=A.Selector._foundCache;for(var C=0,B=E.length;C<B;++C){try{delete E[C]._found}catch(D){E[C].removeAttribute("_found")}}E=[]},_getRegExp:function(D,B){var C=A.Selector._regexCache;B=B||"";if(!C[D+B]){C[D+B]=new RegExp(D,B)}return C[D+B]},_getChildren:function(){if(document.documentElement.children){return function(C,B){return(B)?C.children.tags(B):C.children||[]}}else{return function(F,C){if(F._children){return F._children}var E=[],G=F.childNodes;for(var D=0,B=G.length;D<B;++D){if(G[D].tagName){if(!C||G[D].tagName===C){E[E.length]=G[D]}}}F._children=E;return E}}}(),_combinators:{" ":function(C,B){while((C=C.parentNode)){if(A.Selector._test(C,"",B.previous)){return true}}return false},">":function(C,B){return A.Selector._test(C.parentNode,null,B.previous)},"+":function(D,C){var B=D.previousSibling;while(B&&B.nodeType!==1){B=B.previousSibling}if(B&&A.Selector._test(B,null,C.previous)){return true}return false},"~":function(D,C){var B=D.previousSibling;while(B){if(B.nodeType===1&&A.Selector._test(B,null,C.previous)){return true}B=B.previousSibling}return false}},_getNth:function(C,L,N,G){A.Selector._re.nth.test(L);var K=parseInt(RegExp.$1,10),B=RegExp.$2,H=RegExp.$3,I=parseInt(RegExp.$4,10)||0,M=[],E;var J=A.Selector._getChildren(C.parentNode,N);if(H){K=2;E="+";B="n";I=(H==="odd")?1:0}else{if(isNaN(K)){K=(B)?1:0}}if(K===0){if(G){I=J.length-I+1}if(J[I-1]===C){return true}else{return false}}else{if(K<0){G=!!G;K=Math.abs(K)}}if(!G){for(var D=I-1,F=J.length;D<F;D+=K){if(D>=0&&J[D]===C){return true}}}else{for(var D=J.length-I,F=J.length;D>=0;D-=K){if(D<F&&J[D]===C){return true}}}return false},_getId:function(C){for(var D=0,B=C.length;D<B;++D){if(C[D][0]=="id"&&C[D][1]==="="){return C[D][2]}}},_getIdTokenIndex:function(D){for(var C=0,B=D.length;C<B;++C){if(A.Selector._getId(D[C].attributes)){return C}}return -1},_patterns:{tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/},_tokenize:function(B){var D={},H=[],I,G=false,F=A.Selector._patterns,C;B=A.Selector._replaceShorthand(B);do{G=false;for(var E in F){if(YAHOO.lang.hasOwnProperty(F,E)){if(E!="tag"&&E!="combinator"){D[E]=D[E]||[]}if((C=F[E].exec(B))){G=true;if(E!="tag"&&E!="combinator"){if(E==="attributes"&&C[1]==="id"){D.id=C[3]}D[E].push(C.slice(1))}else{D[E]=C[1]}B=B.replace(C[0],"");if(E==="combinator"||!B.length){D.attributes=A.Selector._fixAttributes(D.attributes);D.pseudos=D.pseudos||[];D.tag=D.tag?D.tag.toUpperCase():"*";H.push(D);D={previous:D}}}}}}while(G);return H},_fixAttributes:function(C){var D=A.Selector.attrAliases;C=C||[];for(var E=0,B=C.length;E<B;++E){if(D[C[E][0]]){C[E][0]=D[C[E][0]]}if(!C[E][1]){C[E][1]=""}}return C},_replaceShorthand:function(C){var D=A.Selector.shorthand;var E=C.match(A.Selector._re.attr);if(E){C=C.replace(A.Selector._re.attr,"REPLACED_ATTRIBUTE")}for(var G in D){if(YAHOO.lang.hasOwnProperty(D,G)){C=C.replace(A.Selector._getRegExp(G,"gi"),D[G])}}if(E){for(var F=0,B=E.length;F<B;++F){C=C.replace("REPLACED_ATTRIBUTE",E[F])}}return C}};if(YAHOO.env.ua.ie&&((!document.documentMode&&YAHOO.env.ua.ie<8)||document.documentMode<8)){A.Selector.attrAliases["class"]="className";A.Selector.attrAliases["for"]="htmlFor"}})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.7.0",build:"1799"});YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){var F=YAHOO.lang;var E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expires instanceof Date){E+="; expires="+A.expires.toGMTString()}if(F.isString(A.path)&&A.path!=""){E+="; path="+A.path}if(F.isString(A.domain)&&A.domain!=""){E+="; domain="+A.domain}if(A.secure===true){E+="; secure"}}return E},_createCookieHashString:function(B){var D=YAHOO.lang;if(!D.isObject(B)){throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.")}var C=new Array();for(var A in B){if(D.hasOwnProperty(B,A)&&!D.isFunction(B[A])&&!D.isUndefined(B[A])){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String(B[A])))}}return C.join("&")},_parseCookieHash:function(E){var D=E.split("&"),F=null,C=new Object();if(E.length>0){for(var B=0,A=D.length;B<A;B++){F=D[B].split("=");C[decodeURIComponent(F[0])]=decodeURIComponent(F[1])}}return C},_parseCookieString:function(J,A){var K=new Object();if(YAHOO.lang.isString(J)&&J.length>0){var B=(A===false?function(L){return L}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(J)){var H=J.split(/;\s/g),I=null,C=null,E=null;for(var D=0,F=H.length;D<F;D++){E=H[D].match(/([^=]+)=/i);if(E instanceof Array){try{I=decodeURIComponent(E[1]);C=B(H[D].substring(E[1].length+1))}catch(G){}}else{I=decodeURIComponent(H[D]);C=I}K[I]=C}}}return K},get:function(A,B){var D=YAHOO.lang;var C=this._parseCookieString(document.cookie);if(!D.isString(A)||A===""){throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.")}if(D.isUndefined(C[A])){return null}if(!D.isFunction(B)){return C[A]}else{return B(C[A])}},getSub:function(A,C,B){var E=YAHOO.lang;var D=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.")}if(E.isUndefined(D[C])){return null}if(!E.isFunction(B)){return D[C]}else{return B(D[C])}}else{return null}},getSubs:function(A){if(!YAHOO.lang.isString(A)||A===""){throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.")}var B=this._parseCookieString(document.cookie,false);if(YAHOO.lang.isString(B[A])){return this._parseCookieHash(B[A])}return null},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.")}A=A||{};A.expires=new Date(0);return this.set(B,"",A)},removeSub:function(B,D,A){if(!YAHOO.lang.isString(B)||B===""){throw new TypeError("Cookie.removeSub(): Cookie name must be a non-empty string.")}if(!YAHOO.lang.isString(D)||D===""){throw new TypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.")}var C=this.getSubs(B);if(YAHOO.lang.isObject(C)&&YAHOO.lang.hasOwnProperty(C,D)){delete C[D];return this.setSubs(B,C,A)}else{return""}},set:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.set(): Cookie name must be a string.")}if(E.isUndefined(C)){throw new TypeError("Cookie.set(): Value cannot be undefined.")}var D=this._createCookieString(B,C,true,A);document.cookie=D;return D},setSub:function(B,D,C,A){var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.")}if(!F.isString(D)||D===""){throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.")}if(F.isUndefined(C)){throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.")}var E=this.getSubs(B);if(!F.isObject(E)){E=new Object()}E[D]=C;return this.setSubs(B,E,A)},setSubs:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.setSubs(): Cookie name must be a string.")}if(!E.isObject(C)){throw new TypeError("Cookie.setSubs(): Cookie value must be an object.")}var D=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;return D}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.7.0",build:"1799"});YAHOO.lang.JSON=(function(){var l=YAHOO.lang,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_INVALID=/^[\],:{}\s]*$/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k]}else{value[k]=v}}}}return reviver.call(o,key,value)};return typeof reviver==="function"?walk({"":data},""):data}function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4)}return _CHARS[c]}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char)}function _isValid(str){return l.isString(str)&&_INVALID.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))}function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"'}function _stringify(h,key,d,w,pstack){var o=typeof w==="function"?w.call(h,key,h[key]):h[key],i,len,j,k,v,isArray,a;if(o instanceof Date){o=l.JSON.dateToString(o)}else{if(o instanceof String||o instanceof Boolean||o instanceof Number){o=o.valueOf()}}switch(typeof o){case"string":return _string(o);case"number":return isFinite(o)?String(o):"null";case"boolean":return String(o);case"object":if(o===null){return"null"}for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null"}}pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||"null"}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i<len;++i){k=w[i];v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}else{for(k in o){if(typeof k==="string"&&l.hasOwnProperty(o,k)){v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}}a.sort()}}pstack.pop();return isArray?"["+a.join(",")+"]":"{"+a.join(",")+"}"}return undefined}return{isValid:function(s){return _isValid(_prepare(s))},parse:function(s,reviver){s=_prepare(s);if(_isValid(s)){return _revive(eval("("+s+")"),reviver)}throw new SyntaxError("parseJSON")},stringify:function(o,w,d){if(o!==undefined){if(l.isArray(w)){w=(function(a){var uniq=[],map={},v,i,j,len;for(i=0,j=0,len=a.length;i<len;++i){v=a[i];if(typeof v==="string"&&map[v]===undefined){uniq[(map[v]=j++)]=v}}return uniq})(w)}d=d>=0?d:1/0;return _stringify({"":o},"",d,w,[])}return undefined},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z"},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d}return str}}})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.7.0",build:"1799"});(function(App){App.config.OFFLINE_STATE="offline";App.config.ONLINE_STATE="online";App.config.SUSPEND_STATE="suspend";App.config.OFFLINE_ID=2;App.config.ONLINE_ID=3;App.config.BUSY_ID=4;App.config.INVISIBLE_ID=5;App.config.IDLE_ID=6;App.config.USER_TAB_ID="mango-user-tab";App.config.ROOM_TAB_ID="mango-room-tab";App.config.ONLINE_TAB_ID="mango-online-list";App.config.POPOUT_TAB_ID="mango-popout-tab";App.config.MODERATOR_LIST_ID="mango-moderators-list";App.config.VISITOR_LIST_ID="mango-visitors-list";App.config.FRIEND_LIST_ID="mango-friends-list";App.config.userNameMaxLen=20;App.config.roomNameMaxLen=20;App.config.avatarMaxWidth=25;App.config.statusMsgMaxLen=40;App.config.listItemHeight=document.compatMode&&document.compatMode=="BackCompat"?30:32;App.config.listItemWidth=128;App.config.listItemCount=5;App.config.busyClass="mango-busy";App.config.onlineClass="mango-online";App.config.offlineClass="mango-offline";App.config.idleClass="mango-idle";App.config.grouplistItemHeight=20;App.config.grouplistItemCount=6;App.config.DEFAULT_LIST_FOCUS=false;App.config.GROUP_CONV_TYPE="G";App.config.CHAT_CONV_TYPE="S";App.config.TYPING=1;App.config.HAS_ENTERED=2;App.config.BLANK=0;App.config.MAX_MSG_LEN=950;App.config.YES="Y";App.config.NO="N";App.config.USER_ROLE_VISITOR="V";App.config.USER_ROLE_MODERATOR="M";App.config.EXPAND="E";App.config.COLLAPSE="C";App.config.WEBIM="webim";App.config.PULSE="pulse";App.config.WEBIM_PATH="service";App.config.SG_PATH="sg";App.config.PULSE_PATH="pulse";App.config.USER_UPLOAD_TYPE="UUP";App.config.CONV_UPLOAD_TYPE="UFO";App.config.ATTACHMENT_TYPE="IM"})(MangoSpring);function FABridge(target,bridgeName){this.target=target;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=FABridge.nextBridgeID++;this.name=bridgeName;this.nextLocalFuncID=0;FABridge.instances[this.name]=this;FABridge.idMap[this.bridgeID]=this;return this}FABridge.TYPE_ASINSTANCE=1;FABridge.TYPE_ASFUNCTION=2;FABridge.TYPE_JSFUNCTION=3;FABridge.TYPE_ANONYMOUS=4;FABridge.initCallbacks={};FABridge.argsToArray=function(args){var result=[];for(var i=0;i<args.length;i++){result[i]=args[i]}return result};function instanceFactory(objID){this.fb_instance_id=objID;return this}function FABridge__invokeJSFunction(args){var funcID=args[0];var throughArgs=args.concat();throughArgs.shift();var bridge=FABridge.extractBridgeFromID(funcID);return bridge.invokeLocalFunction(funcID,throughArgs)}FABridge.addInitializationCallback=function(bridgeName,callback){try{var inst=FABridge.instances[bridgeName];if(inst!=undefined){callback.call(inst);return }var callbackList=FABridge.initCallbacks[bridgeName];if(callbackList==null){FABridge.initCallbacks[bridgeName]=callbackList=[]}callbackList.push(callback)}catch(e){}};function FABridge__bridgeInitialized(bridgeName){var objects=document.getElementsByTagName("object");var ol=objects.length;var activeObjects=[];try{if(ol>0){for(var i=0;i<ol;i++){if(typeof objects[i].SetVariable!="undefined"){activeObjects[activeObjects.length]=objects[i]}}}}catch(e){}var embeds=document.getElementsByTagName("embed");var el=embeds.length;var activeEmbeds=[];if(el>0){for(var j=0;j<el;j++){if(typeof embeds[j].SetVariable!="undefined"){activeEmbeds[activeEmbeds.length]=embeds[j]}}}var aol=activeObjects.length;var ael=activeEmbeds.length;var searchStr="bridgeName="+bridgeName;if((aol==1&&!ael)||(aol==1&&ael==1)){FABridge.attachBridge(activeObjects[0],bridgeName)}else{if(ael==1&&!aol){FABridge.attachBridge(activeEmbeds[0],bridgeName)}else{var flash_found=false;if(aol>1){for(var k=0;k<aol;k++){var params=activeObjects[k].childNodes;for(var l=0;l<params.length;l++){var param=params[l];if(param.nodeType==1&&param.tagName.toLowerCase()=="param"&&param.name.toLowerCase()=="flashvars"&&param.value.indexOf(searchStr)>=0){FABridge.attachBridge(activeObjects[k],bridgeName);flash_found=true;break}}if(flash_found){break}}}if(!flash_found&&ael>1){for(var m=0;m<ael;m++){var flashVars=activeEmbeds[m].attributes.getNamedItem("flashVars").nodeValue;if(flashVars.indexOf(searchStr)>=0){FABridge.attachBridge(activeEmbeds[m],bridgeName);break}}}}}return true}FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;FABridge.extractBridgeFromID=function(id){var bridgeID=(id>>16);return FABridge.idMap[bridgeID]};FABridge.attachBridge=function(instance,bridgeName){var newBridgeInstance=new FABridge(instance,bridgeName);FABridge[bridgeName]=newBridgeInstance;var callbacks=FABridge.initCallbacks[bridgeName];if(callbacks==null){return }for(var i=0;i<callbacks.length;i++){callbacks[i].call(newBridgeInstance)}delete FABridge.initCallbacks[bridgeName]};FABridge.blockedMethods={toString:true,get:true,set:true,call:true};FABridge.prototype={root:function(){return this.deserialize(this.target.getRoot())},releaseASObjects:function(){return this.target.releaseASObjects()},releaseNamedASObject:function(value){if(typeof (value)!="object"){return false}else{var ret=this.target.releaseNamedASObject(value.fb_instance_id);return ret}},create:function(className){return this.deserialize(this.target.create(className))},makeID:function(token){return(this.bridgeID<<16)+token},getPropertyFromAS:function(objRef,propName){if(FABridge.refCount>0){throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.")}else{FABridge.refCount++;var retVal=this.target.getPropFromAS(objRef,propName);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},setPropertyInAS:function(objRef,propName,value){if(FABridge.refCount>0){throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.")}else{FABridge.refCount++;var retVal=this.target.setPropInAS(objRef,propName,this.serialize(value));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},callASFunction:function(funcID,args){if(FABridge.refCount>0){throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.")}else{FABridge.refCount++;var retVal=this.target.invokeASFunction(funcID,this.serialize(args));retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},callASMethod:function(objID,funcName,args){if(FABridge.refCount>0){throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.")}else{FABridge.refCount++;args=this.serialize(args);var retVal=this.target.invokeASMethod(objID,funcName,args);retVal=this.handleError(retVal);FABridge.refCount--;return retVal}},invokeLocalFunction:function(funcID,args){var result;var func=this.localFunctionCache[funcID];if(func!=undefined){result=this.serialize(func.apply(null,this.deserialize(args)))}return result},getTypeFromName:function(objTypeName){return this.remoteTypeCache[objTypeName]},createProxy:function(objID,typeName){var objType=this.getTypeFromName(typeName);instanceFactory.prototype=objType;var instance=new instanceFactory(objID);this.remoteInstanceCache[objID]=instance;return instance},getProxy:function(objID){return this.remoteInstanceCache[objID]},addTypeDataToCache:function(typeData){var newType=new ASProxy(this,typeData.name);var accessors=typeData.accessors;for(var i=0;i<accessors.length;i++){this.addPropertyToType(newType,accessors[i])}var methods=typeData.methods;for(var i=0;i<methods.length;i++){if(FABridge.blockedMethods[methods[i]]==undefined){this.addMethodToType(newType,methods[i])}}this.remoteTypeCache[newType.typeName]=newType;return newType},addPropertyToType:function(ty,propName){var c=propName.charAt(0);var setterName;var getterName;if(c>="a"&&c<="z"){getterName="get"+c.toUpperCase()+propName.substr(1);setterName="set"+c.toUpperCase()+propName.substr(1)}else{getterName="get"+propName;setterName="set"+propName}ty[setterName]=function(val){this.bridge.setPropertyInAS(this.fb_instance_id,propName,val)};ty[getterName]=function(){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName))}},addMethodToType:function(ty,methodName){ty[methodName]=function(){return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,methodName,FABridge.argsToArray(arguments)))}},getFunctionProxy:function(funcID){var bridge=this;if(this.remoteFunctionCache[funcID]==null){this.remoteFunctionCache[funcID]=function(){bridge.callASFunction(funcID,FABridge.argsToArray(arguments))}}return this.remoteFunctionCache[funcID]},getFunctionID:function(func){if(func.__bridge_id__==undefined){func.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[func.__bridge_id__]=func}return func.__bridge_id__},serialize:function(value){var result={};var t=typeof (value);if(t=="number"||t=="string"||t=="boolean"||t==null||t==undefined){result=value}else{if(value instanceof Array){result=[];for(var i=0;i<value.length;i++){result[i]=this.serialize(value[i])}}else{if(t=="function"){result.type=FABridge.TYPE_JSFUNCTION;result.value=this.getFunctionID(value)}else{if(value instanceof ASProxy){result.type=FABridge.TYPE_ASINSTANCE;result.value=value.fb_instance_id}else{result.type=FABridge.TYPE_ANONYMOUS;result.value=value}}}}return result},deserialize:function(packedValue){var result;var t=typeof (packedValue);if(t=="number"||t=="string"||t=="boolean"||packedValue==null||packedValue==undefined){result=this.handleError(packedValue)}else{if(packedValue instanceof Array){result=[];for(var i=0;i<packedValue.length;i++){result[i]=this.deserialize(packedValue[i])}}else{if(t=="object"){for(var i=0;i<packedValue.newTypes.length;i++){this.addTypeDataToCache(packedValue.newTypes[i])}for(var aRefID in packedValue.newRefs){this.createProxy(aRefID,packedValue.newRefs[aRefID])}if(packedValue.type==FABridge.TYPE_PRIMITIVE){result=packedValue.value}else{if(packedValue.type==FABridge.TYPE_ASFUNCTION){result=this.getFunctionProxy(packedValue.value)}else{if(packedValue.type==FABridge.TYPE_ASINSTANCE){result=this.getProxy(packedValue.value)}else{if(packedValue.type==FABridge.TYPE_ANONYMOUS){result=packedValue.value}}}}}}}return result},addRef:function(obj){this.target.incRef(obj.fb_instance_id)},release:function(obj){this.target.releaseRef(obj.fb_instance_id)},handleError:function(value){if(typeof (value)=="string"&&value.indexOf("__FLASHERROR")==0){var myErrorMessage=value.split("||");if(FABridge.refCount>0){FABridge.refCount--}throw new Error(myErrorMessage[1]);return value}else{return value}}};ASProxy=function(bridge,typeName){this.bridge=bridge;this.typeName=typeName;return this};ASProxy.prototype={get:function(propName){return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName))},set:function(propName,value){this.bridge.setPropertyInAS(this.fb_instance_id,propName,value)},call:function(funcName,args){this.bridge.callASMethod(this.fb_instance_id,funcName,args)},addRef:function(){this.bridge.addRef(this)},release:function(){this.bridge.release(this)}};var Janus;JanusConnector=function(session_id,felix_id,user_name,bridge,socket_port,socket_host){var session_id=session_id,bridge=bridge,felix_id=felix_id,flexRoot=null,pushController=null,has_sent_msg=false;if(FABridge[bridge]){flexRoot=FABridge[bridge].root();pushController=flexRoot.getController(socket_port,socket_host)}Janus={updateSocketProps:function(sockIP,sockPort){socket_port=sockPort;socket_host=sockIP},processCallback:function(callback,params){params=YAHOO.lang.isArray(params)?params:[params];if(callback&&YAHOO.lang.isFunction(callback.fn)){callback.fn.apply(callback.scope||this,params)}},sendMessage:function(params,callback){if(!flexRoot){return }has_sent_msg=true;pushController.sendMessageOverSocket(params.conv_id,felix_id,session_id,params.message,params.name,"","");this.processCallback(callback,params)},sendOfflineMessage:function(params,callback){if(!flexRoot){return }has_sent_msg=true;pushController.sendOfflineMessageOverSocket(params.conv_id,felix_id,session_id,params.message,params.name,"","");this.processCallback(callback,params)},ignore:function(params,callback){if(!flexRoot){return }pushController.sendIgnoreOverSocket(felix_id,session_id,params.conv_id,params.ignoredUserId,params.ignoredUserName);this.processCallback(callback,YAHOO.lang.merge(params,{has_ignored:true}))},unignore:function(params,callback){if(!flexRoot){return }pushController.sendUnignoreOverSocket(felix_id,session_id,params.conv_id,params.userIdToUnignore,params.userNameToUnignore);this.processCallback(callback,YAHOO.lang.merge(params,{has_ignored:false}))},warn:function(params,callback){if(!flexRoot){return }pushController.sendWarnOverSocket(felix_id,session_id,params.conv_id,params.userIdToWarn,params.userNameToWarn);this.processCallback(callback)},typing:function(status,params){if(!flexRoot){return }switch(status){case 1:pushController.sendComposingOverSocket(felix_id,session_id,params.conv_id,params.userName);break;case 2:pushController.sendPausedOverSocket(felix_id,session_id,params.conv_id,params.userName);break;default:pushController.sendInactiveOverSocket(felix_id,session_id,params.conv_id,params.userName)}},customPresence:function(params,callback){if(!flexRoot){return }pushController.sendCustomPresenceOverSocket(felix_id,session_id,params.presence_option_id,params.text,user_name);this.processCallback(callback,[felix_id,params])},updateParams:function(obj){if(!flexRoot){return }pushController.updateParameters(obj)},hasSentMessage:function(){return has_sent_msg},audioCallAccepted:function(params){if(!flexRoot){return }pushController.sendCVAOverSocket(felix_id,session_id,params.conv_id,user_name)},audioCallRejected:function(params){if(!flexRoot){return }pushController.sendCVROverSocket(felix_id,session_id,params.conv_id,user_name)},videoCallAccepted:function(params){if(!flexRoot){return }pushController.sendCOAOverSocket(felix_id,session_id,params.conv_id,user_name)},videoCallRejected:function(params){if(!flexRoot){return }pushController.sendCOROverSocket(felix_id,session_id,params.conv_id,user_name)},sendRCA:function(params){if(!flexRoot){return }pushController.sendRCASocket(felix_id,session_id,params.conv_id,user_name,"")},sendRFC:function(params){if(!flexRoot){return }pushController.sendRFCSocket(felix_id,session_id,params.conv_id,user_name,params.message)},sendRCR:function(params){if(!flexRoot){return }pushController.sendRCRSocket(felix_id,session_id,params.conv_id,user_name,"")},hasSeenFile:function(params){if(!flexRoot){return }pushController.sendCOFOverSocket(felix_id,session_id,params.conv_id,user_name,params.message)}}};RoR=function(bridge,host_prefix){var flexRoot=null;if(FABridge[bridge]){flexRoot=FABridge[bridge].root()}RoR={_conn:{},_debug:true,_use_default_ms_header:true,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},_trans_id:0,getTransactionObj:function(){var conn,t_id=this._trans_id;try{conn={tId:t_id};if(conn){this._trans_id++}}catch(e){return null}finally{return conn}},send:function(uri,params,callback){var conn=this.getTransactionObj();var args=(callback&&callback.argument)?callback.argument:null;if(!conn){this.log("Connection creation failed")}else{if(callback&&callback.customevents){this.initCallbackEvents(conn,callback)}conn.callback=callback;conn.method="POST";if(!/^http:\/\//.test(uri)){uri=host_prefix+uri}uri+=(uri.indexOf("?")==-1?"?t=":"&t=")+(new Date().getTime());conn.href=uri;conn.params=params||"";conn.success="RoR.handleSuccess";conn.failure="RoR.handleError";flexRoot.request(conn.href,conn.tId,conn.params,conn.method,conn.success,conn.failure,(callback&&callback.timeout?callback.timeout:30000));this._conn[conn.tId]=conn}},initCallbackEvents:function(con,callback){for(var prop in callback.customevents){if(this._customEvents[prop][0]){con[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);con[this._customEvents[prop][0]].subscribe(callback.customevents[prop])}}},handleSuccess:function(o){try{if(o.success){var conn=this._conn[o.tId];this.handleTransactionResponse(o,conn)}else{this.handleError(o)}}catch(e){}},handleError:function(o){try{var conn=this._conn[o.tId];this.handleTransactionResponse(o,conn,true)}catch(e){}},handleTransactionResponse:function(o,con,isError){var responseObject=this.createResponseObject(o,con);var callback=con.callback;if(!isError){if(callback&&callback.success){if(!callback.scope){callback.success(responseObject)}else{callback.success.apply(callback.scope,[responseObject])}}this.successEvent.fire(responseObject);if(con.successEvent){con.successEvent.fire(responseObject)}}else{if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject)}else{callback.failure.apply(callback.scope,[responseObject])}}this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject)}}delete this._conn[o.tId]},createResponseObject:function(o,con){var obj={};obj.responseText=unescape(o.responseText);obj.tId=o.tId;if(con.callback.argument){obj.argument=con.callback.argument}return obj},log:function(msg){}}};var XMLDoc=function(s){try{this.document=null;this.root=null;this.isIExplorer=YAHOO.env.ua.ie;if(this.isIExplorer){this.document=new window.ActiveXObject("Microsoft.XMLDOM");this.document.async=false;this.document.setProperty("SelectionLanguage","XPath");this.document.loadXML(s)}else{var parser=new DOMParser();this.document=parser.parseFromString(s,"text/xml");this.oSerializer=new XMLSerializer()}this.root=this.document.documentElement}catch(ex){throw new Error("Invalid XML document!")}};XMLDoc.prototype.selectNodes=function(xpath){var nodeList;if(this.isIExplorer){return this.document.selectNodes(xpath)}else{var evaluator=new XPathEvaluator();nodeList=evaluator.evaluate(xpath,this.document,null,XPathResult.ANY_TYPE,null);var nodes=[];if(nodeList!=null){var element=nodeList.iterateNext();while(element){nodes.push(element);element=nodeList.iterateNext()}}return nodes}};XMLDoc.prototype.selectSingleNode=function(xpath,nsResolver){try{nsResolver=nsResolver||null;if(this.isIExplorer){if(nsResolver){this.document.setProperty("SelectionNamespaces","xmlns:"+nsResolver.prefix+'="'+nsResolver.nsURI+'"')}return this.document.selectSingleNode(xpath)}if(nsResolver){var nsObj={normalResolver:this.document.createNSResolver(this.document.documentElement),lookupNamespaceURI:function(prefix){switch(prefix){case"ms":return nsResolver.nsURI;default:return this.normalResolver.lookupNamespaceURI(prefix)}}}}var evaluator=new XPathEvaluator();var result=evaluator.evaluate(xpath,this.document,nsObj,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(result!=null){return result.singleNodeValue}else{return null}}catch(e){return null}};XMLDoc.prototype.serialize=function(){if(this.isIExplorer){return this.document.xml}return this.oSerializer.serializeToString(this.document)};var XMPPParser=function(){};XMPPParser.parse=function(message){if(XMPPParser.startsWith("<message",message)){return new XMPP_Message(message)}else{if(XMPPParser.startsWith("<presence",message)){return new XMPP_Presence(message)}else{if(XMPPParser.startsWith("<iq",message)){return new XMPP_IQ(message)}}}};XMPPParser.startsWith=function(fragment,message){return(message.indexOf(fragment)==0)};XMPP_Packet=function(){this._tag="";this._to="";this._from="";this._type="";this._id="";this._msgCreatedAt=""};XMPP_Packet.prototype.getXML=function(){return this.doc.serialize()};XMPP_Packet.prototype.getTag=function(){return this.doc.root.tagName};XMPP_Packet.prototype.getMessageCreatedAt=function(){if(!this._msgCreatedAt){this._msgCreatedAt=this._value(this.getChild(this.doc.root.tagName+"/mstag/@msgID"))}return this._msgCreatedAt};XMPP_Packet.prototype._value=function(node){node=node||"";if(node){node=node.nodeValue}return node};XMPP_Packet.prototype.getTo=function(){return this._value(this.getChild(this.doc.root.tagName+"/@to"))};XMPP_Packet.prototype.getFrom=function(){return this._value(this.getChild(this.doc.root.tagName+"/@from"))};XMPP_Packet.prototype.getType=function(){return this._value(this.getChild(this.doc.root.tagName+"/@type"))};XMPP_Packet.prototype.getId=function(){return this._value(this.getChild(this.doc.root.tagName+"/@id"))};XMPP_Packet.prototype.isError=function(){return(this.getType()=="error")};XMPP_Packet.prototype.getChild=function(xpath,nsResolver){return this.doc.selectSingleNode(xpath,nsResolver)};XMPP_Packet.prototype.isSystem=function(){return(this.getChild(this.doc.root.tagName+"/system")!==null)};XMPP_Packet.prototype.getErrorCode=function(){return this._value(this.getChild(this.doc.root.tagName+"/error/code/text()"))};XMPP_Packet.prototype.getErrorText=function(){return this._value(this.getChild(this.doc.root.tagName+"/error/text/text()"))};XMPP_Message=function(message){this.doc=new XMLDoc(message);this.constructor.superclass.constructor.call(this);this.is_typing="";this.body="";this.nsResolver={prefix:"ms",nsURI:"http://jabber.org/protocol/chatstates"}};YAHOO.lang.extend(XMPP_Message,XMPP_Packet);XMPP_Message.prototype.getBody=function(){if(!this.body){this.body=this._value(this.getChild(this.doc.root.tagName+"/body/text()"))}return this.body};XMPP_Message.prototype.getUserName=function(){return this._value(this.getChild(this.doc.root.tagName+"/mstag/@userName"))};XMPP_Message.prototype.getPlatform=function(){return this._value(this.getChild(this.doc.root.tagName+"/mstag/@platform"))};XMPP_Message.prototype.isTypingMsg=function(){if(!this.is_typing){this.is_typing=this.getChild("//ms:composing|//ms:paused|//ms:inactive",this.nsResolver)!==null}return this.is_typing};XMPP_Message.prototype.isComposing=function(){if(!this.composing){this.composing=(this.getChild("//ms:composing",this.nsResolver)!==null)}return this.composing};XMPP_Message.prototype.isPaused=function(){if(!this.paused){this.paused=(this.getChild("//ms:paused",this.nsResolver)!==null)}return this.paused};XMPP_Message.prototype.isInactive=function(){if(!this.inactive){this.inactive=(this.getChild("//ms:inactive",this.nsResolver)!==null)}return this.inactive};var XMPP_IQ=function(message){this.doc=new XMLDoc(message);this.constructor.superclass.constructor.call(this);this.msgSubType="";this.userId="";this.userName="";this.userImage="";this.desc="";this.realUser="";this.chatType="";this.communityId=""};YAHOO.lang.extend(XMPP_IQ,XMPP_Packet);XMPP_IQ.prototype.getCommunityId=function(){if(!this.communityId){this.communityId=this._value(this.getChild(this.doc.root.tagName+"/system/@communityId"))}return this.communityId};XMPP_IQ.prototype.getDesc=function(){if(!this.desc){this.desc=this._value(this.getChild(this.doc.root.tagName+"/desc/text()"))}return this.desc};XMPP_IQ.prototype.getMessageCreatedAt=function(){if(!this._msgCreatedAt){this._msgCreatedAt=this._value(this.getChild(this.doc.root.tagName+"/system/@msgID"))}return this._msgCreatedAt};XMPP_IQ.prototype.getJanusServerIP=function(){return this._value(this.getChild(this.doc.root.tagName+"/subscribe/@server"))};XMPP_IQ.prototype.getJanusServerPort=function(){return this._value(this.getChild(this.doc.root.tagName+"/subscribe/@port"))};XMPP_IQ.prototype.getMsgSubType=function(){if(!this.msgSubType){this.msgSubType=this._value(this.getChild(this.doc.root.tagName+"/system/@msgSubType"))}return this.msgSubType};XMPP_IQ.prototype.getUserId=function(){if(!this.userId){this.userId=this._value(this.getChild(this.doc.root.tagName+"/system/@userId"))}return this.userId};XMPP_IQ.prototype.getUserName=function(){if(!this.userName){this.userName=this._value(this.getChild(this.doc.root.tagName+"/system/@userName"))}return this.userName};XMPP_IQ.prototype.getUserImage=function(){if(!this.userImage){this.userImage=this._value(this.getChild(this.doc.root.tagName+"/system/@userImage"))}return this.userImage};XMPP_IQ.prototype.getRecipientId=function(){if(!this.recipientId){this.recipientId=this._value(this.getChild(this.doc.root.tagName+"/system/@recipientUserId"))}return this.recipientId};XMPP_IQ.prototype.getRecipientName=function(){if(!this.recipientName){this.recipientName=this._value(this.getChild(this.doc.root.tagName+"/system/@recipientUserName"))}return this.recipientName};XMPP_IQ.prototype.getChatType=function(){if(!this.chatType){this.chatType=this._value(this.getChild(this.doc.root.tagName+"/system/@type"))}return this.chatType};XMPP_IQ.prototype.isRealUser=function(){if(this.realUser==""){this.realUser=Boolean(this.getChild(this.doc.root.tagName+'/system[@isRealUser="Y"]'))}return this.realUser};var XMPP_Presence=function(message){this.doc=new XMLDoc(message);this.constructor.superclass.constructor.call(this);this.realUser="";this.userImage="";this.userName="";this.status="";this.showText="";this.platform=""};YAHOO.lang.extend(XMPP_Presence,XMPP_Packet);XMPP_Presence.prototype.getShow=function(){return this._value(this.getChild(this.doc.root.tagName+"/show/text()"))};XMPP_Presence.prototype.getStatus=function(){return this._value(this.getChild(this.doc.root.tagName+"/status/text()"))};XMPP_Presence.prototype.getUserName=function(){if(!this.userName){this.userName=this._value(this.getChild(this.doc.root.tagName+"/mstag/@userName"))}return this.userName};XMPP_Presence.prototype.getPlatform=function(){if(!this.platform){return this._value(this.getChild(this.doc.root.tagName+"/mstag/@platform"))}return this.platform};XMPP_Presence.prototype.getUserImage=function(){if(!this.userImage){this.userImage=this._value(this.getChild(this.doc.root.tagName+"/system/@userImage"))}return this.userImage};XMPP_Presence.prototype.getUserImageFromMSTag=function(){if(!this.userImage){this.userImage=this._value(this.getChild(this.doc.root.tagName+"/mstag/@userImage"))}return this.userImage};XMPP_Presence.prototype.isRealUser=function(){if(this.realUser==""){this.realUser=Boolean(this.getChild(this.doc.root.tagName+'/system[@isRealUser="Y"]'))}return this.realUser};(function(){var _msDateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(value,length){value=String(value);length=parseInt(length)||2;while(value.length<length){value="0"+value}return value};return function(date,mask){if(arguments.length==1&&(typeof date=="string"||date instanceof String)&&!/\d/.test(date)){mask=date;date=undefined}date=date?new Date(date):new Date();if(isNaN(date)){throw"invalid date"}var dF=_msDateFormat;mask=String(dF.masks[mask]||mask||dF.masks["default"]);var d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),H=date.getHours(),M=date.getMinutes(),s=date.getSeconds(),L=date.getMilliseconds(),o=date.getTimezoneOffset(),flags={d:d,dd:pad(d),ddd:dF.i18n.dayNames[D],dddd:dF.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dF.i18n.monthNames[m],mmmm:dF.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4)};return mask.replace(token,function($0){return($0 in flags)?flags[$0]:$0.slice(1,$0.length-1)})}}();_msDateFormat.masks={"default":"ddd mmm d yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",shortDateTime:"mmm dd h:MM TT",isoFullDateTime:"yyyy-mm-dd'T'HH:MM:ss.lo"};_msDateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(mask){return _msDateFormat(this,mask)}})();if(typeof Ulib=="undefined"){Ulib={}}var tmpl_cache={};Ulib.template=function template(str,data){var fn=!/\W/.test(str)?tmpl_cache[str]=tmpl_cache[str]||template(document.getElementById(str).innerHTML):new Function("obj","var p=[], print=function () {p.push.apply(p, arguments);};with( obj ) { p.push('"+str.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');");return data?fn(data):fn};Ulib.removeTemplateCacheItem=function(key){if(cache[key]){delete cache[key]}};Ulib.toQuery=function(obj){var r=[];var space2plus=function(s){return s.replace(/%20/g,"+")};for(prop in obj){r[r.length]=prop+"="+space2plus(encodeURIComponent(obj[prop]===null||obj[prop]===undefined?"":obj[prop]))}return r.join("&")};Ulib.parseQuery=function(){var obj={},query=location.search.slice(1,location.search.length),items=query.split("&");var plus2space=function(s){return s.replace(/%20|\+/g," ")};var regex=new RegExp("(\\w+)=(.+)?");for(var i=0,len=items.length;i<len;++i){var match=items[i].match(regex);if(match&&match[1]&&match[2]){obj[match[1]]=decodeURIComponent(plus2space(match[2]))}}return obj};Ulib.evalJSON=function(str){return eval("("+str+")")};Ulib.inArray=function(arr,needle){if(!arr){return -1}for(var i=0,len=arr.length;i<len;++i){if(YAHOO.lang.isFunction(needle)){if(needle(arr[i])){return i}}else{if(arr[i]==needle){return i}}}return -1};Ulib.showWaitPanel=function(s){var wait_panel=document.getElementById("wait-panel");if(wait_panel){wait_panel.innerHTML=s;wait_panel.style.display="block";return }var d=document.createElement("div");with(d){id="wait-panel";className="wait-panel";innerHTML=s}document.body.appendChild(d)};Ulib.hideWaitPanel=function(){try{document.getElementById("wait-panel").style.display="none"}catch(ex){}};Ulib.getDialog=function(){if(!this.dlg){this.dlg=new YAHOO.widget.Dialog("ms-dialog-cont",{constraintviewport:true,width:"600px",xy:[0,-100],visible:false,modal:true,postmethod:"none",hideaftersubmit:false})}return this.dlg};Ulib.setHTML=function(el,content,scrollInView){content=YAHOO.lang.trim(content);with(YAHOO.util.Dom){el=get(el);if(!el){return }el.innerHTML=content;if(scrollInView){this.scrollTo(true)}}};Ulib.scrollTo=function(el,alignToBottom){with(YAHOO.util.Dom){el=get(el);el.scrollIntoView(alignToBottom?false:true)}};Ulib.toggle=function(){var a=arguments,ln=a.length,el,i;with(YAHOO.util.Dom){for(i=0;i<ln;++i){el=get(a[i]);display=Ulib._getComputedStyle(el,"display");el.style.display=display!="none"?"none":""}}};Ulib._getComputedStyle=function(elem,style){var computedStyle;if(typeof elem.currentStyle!="undefined"){computedStyle=elem.currentStyle}else{computedStyle=document.defaultView.getComputedStyle(elem,null)}return computedStyle[style]};Ulib.htmlize=function(s){return s.replace(/>|<|&|\r\n|\n|\r/g,function(m){switch(m){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"\n":case"\r":case"\r\n":return"<br />";default:return m}})};Ulib.truncate=function(str,limit){var ellipsis="...";return str.length>limit?str.slice(0,limit-ellipsis.length)+ellipsis:str};Ulib.toggleClass=function(el,className){var el=YAHOO.util.Dom.get(el);if(el){var condition=YAHOO.util.Dom.hasClass(el,className);if(condition){YAHOO.util.Dom.removeClass(el,className)}else{YAHOO.util.Dom.addClass(el,className)}}};Ulib.clone=function(obj){var o={};for(var key in obj){o[key]=obj[key]}return o};Ulib.toArray=function(){var args=Array.prototype.slice.call(arguments[0]);return args};Ulib.bind=function(fn,scope){var a=Array.prototype.slice.call(arguments);fn=a.shift();scope=a.shift();return function(){var args=a.concat(Array.prototype.slice.call(arguments));return fn.apply(scope||window,args)}};(function(){var Y=YAHOO,$get=YAHOO.util.Dom.get,Event=YAHOO.util.Event,Lang=YAHOO.lang,Dom=YAHOO.util.Dom;window.domBuilder=function(el){return new domBuilder.element.init(el)};domBuilder._nodeMap={};domBuilder._createNode=function(tag){var _node=domBuilder._nodeMap[tag];if(!_node){_node=domBuilder._nodeMap[tag]=document.createElement(tag)}return _node.cloneNode(false)};domBuilder.element=domBuilder.prototype={init:function(el){this.element=$get(el);this.rootNode=this.element.parentNode;this.currentNode=this.element;return this},_insert:function(tag,attr,position){if(Lang.isFunction(attr)){attr=attr()}var el=domBuilder._createNode(tag);for(var key in attr){switch(key){case"style":Dom.setStyle(el,"cssText",attr[key]);break;default:el.setAttribute(key,attr[key])}}position=position||"beforeEnd";switch(position){case"beforeBegin":this.currentNode=this.currentNode.parentNode.insertBefore(el,this.currentNode);break;case"afterBegin":this.currentNode=this.currentNode.insertBefore(el,this.currentNode.firstChild);break;case"beforeEnd":this.currentNode=this.currentNode.appendChild(el);break;case"afterEnd  ":if(this.currentNode.nextSibling){this.currentNode=this.currentNode.parentNode.insertBefore(el,this.currentNode.nextSibling)}else{this.currentNode=this.currentNode.parentNode.appendChild(el)}}return this},text:function(s){if(Lang.isFunction(s)){s=s()}if(!Lang.isString(s)){throw"argument to text() must be a string or a function that returns a string!"}this.currentNode.innerHTML=s;return this},addClass:function(cls){Dom.addClass(this.currentNode,cls);return this},append:function(node){if(Lang.isString(node)){node=domBuilder._createNode(node)}this.currentNode=this.currentNode.appendChild(node);return this},before:function(tag,attr){return this._insert(tag,attr,"beforeBegin")},attr:function(attribs){for(var key in attribs){switch(key){case"style":Dom.setStyle(this.currentNode,"cssText",attribs[key]);break;default:this.currentNode.setAttribute(key,attribs[key])}}},on:function(evt,fn,args,scope){Event.addListener(this.currentNode.id||this.currentNode,evt,fn,args,scope);return this},end:function(){if(this.currentNode!==this.rootNode){this.currentNode=this.currentNode.parentNode}return this}};var tagNames=["div","span","table","tr","td","tbody","thead","tfoot","caption","a","img","p","pre","code","ul","ol","li","h1","h2","h3","h4","h5","h6","input","strong","dt","dl","dd","label","form","button","textarea","select","option","optgroup","hr","blockquote","em","br","fieldset","legend"];var proto=domBuilder.element;for(var i=0,len=tagNames.length;i<len;++i){var t=tagNames[i];if(!proto[t]){with({tag:t}){proto[t]=function(attr,position){return this._insert(tag,attr,position)}}}}domBuilder.element.init.prototype=domBuilder.element})();(function(App){App.$=YAHOO.util.Dom.get;App.D=YAHOO.util.Dom;App.U=YAHOO.util;App.E=YAHOO.util.Event;App.L=YAHOO.lang;App.S=YAHOO.util.Selector;App.J=YAHOO.lang.JSON;App.C=YAHOO.util.Cookie;App.A=YAHOO.util.Connect;App.util.JSONCookie=function(){var config={path:"/",domain:location.host};return{write:function(key,obj,options){var cooki=this.get(key);options=options||{};config.expires=options.expires||this.getTenMinFutureTime();if(cooki){var obj=App.L.merge(cooki,obj)}var json_cooki=App.J.stringify(obj);App.C.set(key,json_cooki,{path:"/"})},get:function(key){var ck=App.C.get(key);if(ck){try{var data=App.J.parse(ck);return data}catch(e){return null}}return ck},remove:function(ck){return App.C.remove(ck)},getTenMinFutureTime:function(){return new Date(new Date().getTime()+(1000*60*10))}}}();App.util.MouseEvent=function(){var isChildNode=function(_paren,_child){if(_paren===_child){return false}while(_child&&_child!==_paren&&_child!==document.body){_child=_child.parentNode}return(_child===_paren)};return{on:function(el,sType,fn,obj,override){if(YAHOO.env.ua.ie){App.E.on(el,sType,fn,obj,override);return }switch(sType.toLowerCase()){case"mouseenter":App.E.on(el,"mouseover",this._bind(fn,obj,override,"mouseenter"));break;case"mouseleave":App.E.on(el,"mouseout",this._bind(fn,obj,override,"mouseleave"));break}},_bind:function(fn,obj,override,type){return function(e){var relTarg=App.E.getRelatedTarget(e);if(relTarg===this||isChildNode(this,relTarg)){return }args=Array.prototype.slice.call(arguments);args.push(type);if(override){fn.apply(obj||this,args)}else{fn.apply(this,args)}}}}}();App.helper={rand32:function(){return Math.floor(Math.random()*4294967295)},truncate:function(str,limit){if(!str){return str}if(str.length>limit){str=str.substring(0,limit-2)+"..."}return str},toQuery:function(obj){if(!App.L.isObject(obj)){throw new Error("Function Expects 'Object' as Paramter")}var r=[];for(o in obj){r[r.length]=o+"="+this._serialize(obj[o])}return r.join("&")},_serialize:function(v){if(!v){v=""}return encodeURIComponent(v)},toArray:function(){return Array.prototype.slice.apply(arguments,[0])},keys:function(obj,bfirstOnly){var ks=[];for(key in obj){ks[ks.length]=key}if(bfirstOnly&&ks.length>0){return ks[0]}return ks},activate:function(el){App.E.onAvailable(el,function(){el=App.D.get(el);if(!el.disabled){try{el.focus();el.select()}catch(ex){}}})},firstName:function(name){if(name.indexOf(" ")>-1){return name.split(" ")[0]}return name},evalJSON:function(json){return window.eval("("+json+")")},getTime:function(){return new Date().getTime()},wordwrap:function(word,brk){var fn=function(all,text,chr){return text+"<wbr/>&shy;"+chr};return word.replace(new RegExp("([A-Za-z0-9_\\.\\-]{"+brk+"})([A-Za-z0-9_\\.\\-])","g"),fn)},trim:function(str){return str.replace(/(^\s+|\s+$)/g,"")},renderDate:function(dt,mask){var now=new Date();mask=mask||"mediumDate";if(dt){now.setTime(dt.getTime())}return now.format(mask)},renderTime:function(dt,mask){var now=new Date();mask=mask||"shortTime";if(dt){now.setTime(dt.getTime())}return now.format(mask)},yellowFade:function(element){var bgcolor=App.D.getStyle(element,"backgroundColor");var myAnim=new YAHOO.util.ColorAnim(element,{backgroundColor:{from:"#ffff00",to:"#EEEEEE"}},2,YAHOO.util.Easing.easeOutStrong);myAnim.onComplete.subscribe(function(){App.D.setStyle(element,"backgroundColor",bgcolor)});myAnim.animate()},find:function(item,source){var result=-1;for(var i=0,ln=source.length;i<ln;i=i+1){if(source[i]==item){result=i;break}}return result},stripHTML:function(s){return s.replace(/<\/?[^>]+>/gi,"")},escapeHTML:function(s){return s.replace(/>|<|&|\r\n|\n|\r/g,function(m){switch(m){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"\n":case"\r":case"\r\n":return"<br />";default:return m}})},capitalize:function(str){return str.replace(/^[a-z]/,function(m){return m.toUpperCase()})},append:function(arrToAppend,arrToBeAppended){Array.prototype.push.apply(arrToAppend,arrToBeAppended)},removeEl:function(el){var el=App.D.get(el);try{if(el){return el.parentNode.removeChild(el)}}catch(e){}},formatImage:function(img,env){if(img.match(/^http:\/\//)){return img}if(env=="qa"){img="http://qa.mangospring.com"+img}else{if(env=="prod"){img="http://mangospring.com"+img}else{img="http://localhost"+img}}return img},getPresenceImage:function(p_id,env){var img="";switch(parseInt(p_id)){case 4:img="/ce/images/busy.gif";break;case 3:img="/ce/images/online.gif";break;default:img="/ce/images/offline.gif"}return this.formatImage(img,env)},getPresenceClass:function(p_id){var cls="";switch(parseInt(p_id)){case 4:cls="mango-busy";break;case 3:cls="mango-online";break;case 6:cls="mango-idle";break;default:cls="mango-offline"}return cls},formatURL:function(url){if(url.match(/^http:\/\//)){return url}return"http://"+url}};App.helper.Title=function(){var old_title=document.title,new_title="",timer=null,defaultDelay=2000;var changeTitle=function(){if(App.config.hasFocus){document.title=old_title;return timer.cancel()}if(document.title==old_title){document.title=new_title}else{document.title=old_title}};return{blink:function(message,delay){if(!message){return }delay=delay||defaultDelay;if(timer){timer.cancel()}new_title=message;if(!App.config.hasFocus){timer=YAHOO.lang.later(delay,this,changeTitle,[],true)}}}}();App.util.writeFlashBridge=function(hostPrefix,bridgeName,version){version=version||3;var div=document.createElement("div");div.innerHTML='<div id="mango-swf-bridge-cont"></div>';App.D.setStyle(div,"cssText","position:fixed;height:8px;width:8px;overflow:hidden;bottom:5px;left:1px;z-index:10000");App.D.insertBefore(div,document.body.firstChild);try{swfobject.embedSWF(hostPrefix+"/ce/FABridge_v"+version+".swf","mango-swf-bridge-cont","8","8","9.0.0",null,{bridgeName:bridgeName},{allowScriptAccess:"always",wmode:"transparent",allowNetworking:"all"},{id:"flexApp",name:"flexApp"})}catch(e){}};App.util.writeSoundBridge=function(host_prefix,bridgeName){var div=document.createElement("div");div.innerHTML='<div id="sound_notify"></div>';App.D.setStyle(div,"cssText","position:fixed;height:1px;width:1px;overflow:hidden;top:0;left:2px");App.D.insertAfter(div,document.body.firstChild);try{swfobject.embedSWF(host_prefix+"/ce/sound.swf?f_loc="+encodeURIComponent(host_prefix+"/ce/images/ding.mp3"),"sound_notify","1","1","8.5.0.0",null,{bridgeName:bridgeName},{allowScriptAccess:"always",wmode:"transparent"},{id:"soundApp",name:"soundApp"})}catch(e){}};App.util.showLoading=function(){var id="mango-chat-loader",ldr=App.$(id);if(!ldr){domBuilder(document.body).div({id:id,style:"cursor:wait; height:30px;width:171px;position: fixed; _position: absolute; bottom:-1px; right: 20px; background: transparent url("+HOST_PREF+"/ce/images/dummy-strip.png)",title:"Initializing, please wait..."}).span({style:"margin-left: 45px; padding-top: 6px; display: block; font-family: Tahoma, Verdana, Arial; vertical-align: middle; font-size: 11px;"}).img({src:HOST_PREF+"/ce/images/init-chat.gif",style:"vertical-align:middle"}).end();App.L.later(6000,App.util,App.util.hideLoading)}else{App.D.setStyle(ldr,"display","")}};App.util.hideLoading=function(){App.D.setStyle("mango-chat-loader","display","none")};App.util.ie6MsgBox=function(){var d=document.createElement("div");d.className="mango-ie6-msg-container";domBuilder(d).p().addClass("mango-ie6-desc").text("Social bar is not supported on IE 6.x versions or below. Please use any of the following browsers to launch the site and instantly connect with friends and people on this site.").end().hr({noshade:"noshade",size:"1"}).end().ul().addClass("mango-ie6-brw-option").li().addClass("mango-firefox").a({href:"http://www.getfirefox.net/download.html",title:"Get the Best and Fastest Web Browser, it's Free",target:"_new"}).on("click",function(){d.parentNode.removeChild(d)}).text("Download Firefox 3").end().end().li().addClass("mango-ie7").a({href:"http://www.microsoft.com/windows/products/winfamily/ie/worldwide.mspx",title:"Internet Explorer 7",target:"_new"}).on("click",function(){d.parentNode.removeChild(d)}).text("Download Internet Explorer 7+").end().end().end().p().addClass("mango-ie6-footer").a({href:"#"}).addClass("mango-ie6-close").on("click",function(){d.parentNode.removeChild(d);return false}).text("Close Box").end().end();document.body.appendChild(d)};YAHOO.util.Dom.remove=function(el,doPurge){var els=[];if(App.L.isArray(el)){els.push.apply(els,el)}else{els.push(el)}for(var i=0,len=els.length;i<len;++i){var element=this.get(els[i]);if(element){App.E.purgeElement(element,doPurge);if(element.parentNode){element.parentNode.removeChild(element)}}}};App.config.CommunitySettings=function(settings){App.config.Settings={get:function(key){return settings[key]?settings[key]:null},has:function(key,value){return(settings[key]&&settings[key]==value)}}};App.config.SessionSettings=function(config){App.config.SessionConfig={get:function(key){return config[key]?config[key]:null},has:function(key,value){return(config[key]&&config[key]==value)},isYou:function(id){return config.felix_id==id},set:function(obj){for(var i in obj){config[i]=obj[i]}}}};App.model.UserModel=function(data){this.data=data;this.hash={};this.length=0;this.onAdd=new App.U.CustomEvent("onAddRecord",this,true,App.U.CustomEvent.FLAT);this.onUpdate=new App.U.CustomEvent("onUpdateRecord",this,true,App.U.CustomEvent.FLAT);this.onRemove=new App.U.CustomEvent("onRemoveRecord",this,true,App.U.CustomEvent.FLAT);this._init()};App.model.UserModel.prototype={_init:function(){for(var i=0,len=this.data.length;i<len;i++){var obj=this.data[i];if(App.config.SessionConfig.isYou(obj.felix_user_id)){if(obj.presence_option_id<3||obj.presence_option_id>4){obj.presence_option_id=3;obj.custom_presence=App.helper.capitalize(App.config.ONLINE_STATE)}}this.hash[this.data[i].felix_user_id]=new App.model.User(this.data[i])}this.length=i;App.event.DataSync.roomUserModelSyncEvent.subscribe(this.keepInSync,this,true)},select:function(k){if(App.L.isString(k)||App.L.isNumber(k)){return this.hash[k]?this.hash[k]:null}if(App.L.isFunction(k)){var items=[];for(var i in this.hash){if(k(this.hash[i])){items.push(this.hash[i])}}return items}},add:function(key,rec,silent){if(!this.hash[key]){this.hash[key]=new App.model.User(rec);if(!silent){this.onAdd.fire(this.hash[key])}this.length++}return this.hash[key]},update:function(key,rec){if(this.hash[key]){delete rec.user_role;this.hash[key].update(rec);this.onUpdate.fire(this.hash[key]);App.event.DataSync.userModelSyncEvent.fire({type:"update",data:this.hash[key]})}},remove:function(key){if(this.hash[key]){this._removeRecord(key);App.event.DataSync.userModelSyncEvent.fire({type:"remove",data:rec})}},_removeRecord:function(key){delete this.hash[key];this.onRemove.fire(key);this.length--},keepInSync:function(obj){var rec=obj.data;if(obj.type=="update"&&App.L.isObject(rec)){if(this.hash[rec.getId()]){this.hash[rec.getId()].update(rec);this.onUpdate.fire(rec)}}else{if(obj.type=="remove"&&App.L.isValue(rec)){this._removeRecord(rec)}}},totalUser:function(){return this.length},getByPresence:function(bFn){var presence={online:0,offline:0,busy:0};for(var rec in this.hash){if(!App.L.isFunction(bFn)||bFn(this.records[rec])){switch(parseInt(this.hash[rec].presence_option_id)){case 4:presence.busy++;case 3:presence.online++;break;default:presence.offline++}}}return presence},destroy:function(){this.onAdd.unsubscribeAll();this.onUpdate.unsubscribeAll();this.onRemove.unsubscribeAll();this.hash=null;this.data=null},toString:function(){return"App.model.UserModel => { total users => "+this.totalUser()+" } "}};App.model.User=function(attr){this.felix_user_id="";this.member_name="";this.email_id="";this.user_image=HOST_PREF+"/images/users/default/1.gif";this.user_role=App.config.USER_ROLE_VISITOR;this.status="";this.presence_option_id=3;this.active_status_text="Active Since: ";this.active_status_time=new Date().getTime();this.custom_presence="Online";this.is_authenticated=App.config.NO;this.contact_id=null;this.is_inner_circle=App.config.NO;this.user_medium="";this.profile_url="#";App.L.augmentObject(this,attr,true)};App.model.User.prototype.update=function(obj){App.L.augmentObject(this,obj,true)};App.model.User.prototype.getId=function(){return this.felix_user_id};App.model.User.prototype.getName=function(){return this.member_name};App.model.User.prototype.getImage=function(){return this.user_image};App.model.User.prototype.getPresenceMsg=function(){if(this.isOffline()){return"Offline"}return this.custom_presence||"Online"};App.model.User.prototype.getPresenceId=function(){return this.presence_option_id};App.model.User.prototype.isBuddy=function(){return(this.is_inner_circle=="Y")};App.model.User.prototype.isSubscriber=function(){return(this.user_role=="S")};App.model.User.prototype.isVisitor=function(){return(this.user_role=="V")};App.model.User.prototype.isModerator=function(){return(this.user_role=="M"||this.user_role=="A")};App.model.User.prototype.isAdmin=function(){return(this.user_role=="A")};App.model.User.prototype.isAuthenticated=function(){return(this.is_authenticated=="Y")};App.model.User.prototype.isBot=function(){return(this.user_type=="T")};App.model.User.prototype.isOnline=function(){return(this.presence_option_id==3||this.presence_option_id==4)};App.model.User.prototype.isIdle=function(){return(this.presence_option_id==6)};App.model.User.prototype.isOffline=function(){return !this.isOnline()&&!this.isIdle()};App.model.User.prototype.hasBlocked=function(){return(this.has_blocked=="Y")};App.model.User.prototype.isContact=function(){return this.contact_id||null};App.model.User.prototype.getPageURL=function(){var url=App.L.trim(this.profile_url)||"#";if(url!="#"&&!url.match(/^http:\/\//)){url="http://"+url}return url};App.model.RoomsModel=function(data){this.data=data;this.hash={};this.length=0;this.onAdd=new App.U.CustomEvent("onAddRecord",this,true,App.U.CustomEvent.FLAT);this.onUpdate=new App.U.CustomEvent("onUpdateRecord",this,true,App.U.CustomEvent.FLAT);this.onRemove=new App.U.CustomEvent("onRemoveRecord",this,true,App.U.CustomEvent.FLAT);this._init()};App.model.RoomsModel.prototype={_init:function(){for(var i=0,len=this.data.length;i<len;i++){this.hash[this.data[i].id]=new App.model.Room(this.data[i])}this.length=i},select:function(k){if(App.L.isString(k)||App.L.isNumber(k)){return this.hash[k]?this.hash[k]:null}if(App.L.isFunction(k)){var items=[];for(var i in this.hash){if(k(this.hash[i])){items.push(this.hash[i])}}return items}},add:function(key,rec){if(!this.hash[key]){this.hash[key]=new App.model.Room(rec);this.onAdd.fire(this.hash[key]);this.length++}return this.hash[key]},update:function(key,rec){if(this.hash[key]){this.hash[key].update(rec);this.onUpdate.fire(this.hash[key])}},remove:function(key){if(this.hash[key]){delete this.hash[key];this.onRemove(key);this.length--}},keepInSync:function(rec){if(this.hash[rec.conv_id]){this.hash[rec.conv_id].update(rec);this.onUpdate.fire(rec)}},totalRooms:function(){return this.length},getMembers:function(key){return this.hash[key].members},addMembers:function(key,members){var room_obj=this.hash[key];if(!room_obj){return }room_obj.members=new App.model.RoomUserModel(members)},removeMembers:function(key){var room_obj=this.hash[key];if(!room_obj){return }var room_members=this.getMembers(key);var session_user=room_members.get(App.config.SessionConfig.get("felix_id"));if(session_user&&session_user.isVisitor()){this.decreaseCount(key)}room_obj.members.destroy();room_obj.members=null},increaseCount:function(key){var room_obj=this.hash[key];if(room_obj){room_obj.setActiveCount(room_obj.getActiveCount()+1);this.onUpdate.fire(room_obj)}},decreaseCount:function(key){var room_obj=this.hash[key];if(room_obj){room_obj.setActiveCount(room_obj.getActiveCount()-1);this.onUpdate.fire(room_obj)}},setMemberCounts:function(key,counts){var room_obj=this.hash[key];if(room_obj&&counts){if(counts.online_member_count){room_obj.setActiveCount(counts.online_member_count)}if(counts.moderator_count){room_obj.setModeratorCount(counts.moderator_count)}this.onUpdate.fire(room_obj)}},destroy:function(){this.onAdd.unsubscribeAll();this.onUpdate.unsubscribeAll();this.onRemove.unsubscribeAll();this.hash=null;this.data=null}};App.model.Room=function(attr){this.members=null;this.online_member_count=0;App.L.augmentObject(this,attr,true)};App.model.Room.prototype={update:function(){},getMemberCount:function(){return this.member_count},getActiveCount:function(){return this.online_member_count},setActiveCount:function(count){this.online_member_count=count},getModeratorCount:function(){return this.moderator_count},setModeratorCount:function(count){this.moderator_count=count},getName:function(){return this.name},getImage:function(){return this.conv_image_url},getId:function(){return this.id},getPageURL:function(){var url=App.L.trim(this.conv_url)||"#";if(url!="#"&&!url.match(/^http:\/\//)){url="http://"+url}return url}};App.model.RoomUserModel=function(data){this.constructor.superclass.constructor.call(this,data)};App.L.extend(App.model.RoomUserModel,App.model.UserModel);App.model.RoomUserModel.prototype._init=function(){for(var i=0,len=this.data.length;i<len;i++){this.hash[this.data[i].felix_user_id]=new App.model.User(this.data[i])}this.length=i;App.event.DataSync.userModelSyncEvent.subscribe(this.keepInSync,this,true);this.data=null};App.model.RoomUserModel.prototype.selectAll=function(){var users=[];for(var i in this.hash){users.push(this.hash[i])}return users};App.model.RoomUserModel.prototype.get=function(key){var user=null;if(key){user=this.hash[key]}return user};App.model.RoomUserModel.prototype.update=function(key,rec){if(this.hash[key]){this.hash[key].update(rec);this.onUpdate.fire(rec);App.event.DataSync.roomUserModelSyncEvent.fire({type:"update",data:rec})}};App.model.RoomUserModel.prototype.remove=function(key){if(this.hash[key]){delete this.hash[key];this.onRemove.fire(key);this.length--}};App.model.RoomUserModel.prototype.destroy=function(){this.onUpdate.unsubscribeAll();this.onRemove.unsubscribeAll();this.onAdd.unsubscribeAll();App.event.DataSync.userModelSyncEvent.unsubscribe(this.keepInSync,this)};App.model.RoomUserModel.prototype.toString=function(){return"App.model.RoomUserModel => { total users => "+this.totalUser()+" } "};App.config.ChatRequestObject=function(obj){if(!App.L.isObject(obj)){throw"Can't instantiate the ChatRequestObject class without an object"}this.user_name="";this.message="";this.created_at="";this.created_at_date="";this.felix_user_id="";this.user_image="";this.user_role="";this.is_auth=App.config.NO;this.presence_id="";this.type="";this.id="";App.L.augmentObject(this,obj,true)};App.config.ChatRequestObject.prototype={getCreatedAt:function(){if(this.created_at&&!this.created_at_date){this.created_at_date=new Date(this.created_at)}return this.created_at_date},isAuthenticated:function(){return this.is_auth==App.config.YES},getId:function(){return this.id},getFelixId:function(){return this.felix_user_id},getConvId:function(){return this.conv_id},getImage:function(){return this.user_image},getMessage:function(){return this.message},getName:function(){return this.user_name},getType:function(){return this.type}};App.event.DataSync=function(){return{roomUserModelSyncEvent:new App.U.CustomEvent("RoomUserDataSyncEvent",this,true,App.U.CustomEvent.FLAT),userModelSyncEvent:new App.U.CustomEvent("UserDataSyncEvent",this,true,App.U.CustomEvent.FLAT),ignoreUnignoreSyncEvent:new App.U.CustomEvent("IgnoreUnignoreSyncEvent",this,true,App.U.CustomEvent.FLAT)}}();App.event.GlobalPresence=function(){return{onSessionUserStateChange:new App.U.CustomEvent("onSessionUserStateChange",this,true,App.U.CustomEvent.FLAT),onUserPresenceChange:new App.U.CustomEvent("onUserPresenceChange",this,true,App.U.CustomEvent.FLAT)}}();App.config.PopStateCookie=function(){var popInState="PI";var popOutState="PO";var sb_window_prefs={current_state:popInState};return{check:function(){return App.C.get("sb_window_prefs")!==null},copy:function(){var o={};for(var i in sb_window_prefs){o[i]=sb_window_prefs[i]}return o},write:function(o){for(var i in o){sb_window_prefs[i]=o[i]}var cookie=App.J.stringify(sb_window_prefs);App.C.set("sb_window_prefs",cookie,{path:"/"})},get:function(){return App.C.get("sb_window_prefs",App.J.parse)}}}();App.util.SubTypeDispatcher=function(){this.handlers=[]};App.util.SubTypeDispatcher.prototype={dispatch:function(sub_type,obj){for(var i=0,handler;handler=this.handlers[i];++i){if(handler.canHandle(sub_type)){handler.handleType(obj);break}}},add:function(handler){this.handlers.push(handler)},addMultiple:function(handler_arr){Array.prototype.push.call(this.handlers,handler_arr)}};App.util.BaseTypeHandler=function(){};App.util.BaseTypeHandler.canHandle=function(type){};App.util.BaseTypeHandler.handleType=function(obj){}})(MangoSpring);var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();(function(App){App.$=YAHOO.util.Dom.get;App.D=YAHOO.util.Dom;App.U=YAHOO.util;App.E=YAHOO.util.Event;App.L=YAHOO.lang;App.S=YAHOO.util.Selector;App.J=YAHOO.lang.JSON;App.C=YAHOO.util.Cookie;App.A=YAHOO.util.Connect;App.event.AppInit=new App.U.CustomEvent("appInitEvent",this,true);App.event.BeforeAppInit=new App.U.CustomEvent("beforeAppInitEvent",this,true);App.event.AppKill=new App.U.CustomEvent("appKillEvent",this,true);App.event.windowUnload=new App.U.CustomEvent("windowUnload",this,true);var temp_hash=mango_social_bar_uri.match(/\w+$/)[0];COMMUNITY_HASH=temp_hash;HOST_DOMAIN=mango_social_bar_uri.match(/^http:\/\/(.[^\/]+)/)[1];FROM_ARCHIVE=(typeof (FROM_ARCHIVE)!="undefined")?true:false;HOST_PREF="http://"+HOST_DOMAIN;FLASH_BRIDGE="comm";SOUND_BRIDGE="soundBridge";QUIRKS_MODE=document.compatMode&&document.compatMode=="BackCompat";var PUSH_PORT="8089";var PUSH_IP="";var jsFiles=[HOST_PREF+"/ce/javascripts/lang/strings-en-US.js",HOST_PREF+"/ce/javascripts/bar_push_control.js",HOST_PREF+"/ce/javascripts/toaster.js",HOST_PREF+"/ce/javascripts/im.js",HOST_PREF+"/ce/javascripts/reconnect.js",HOST_PREF+"/ce/javascripts/editable.js",HOST_PREF+"/ce/javascripts/ads.js"];var cssFiles=[HOST_PREF+"/ce/stylesheets/"+(FROM_ARCHIVE?"archive/sitegroupsarchive_v1-min.css":"socialbar.css")];if(QUIRKS_MODE){cssFiles.push(HOST_PREF+"/ce/stylesheets/quirks.css")}App.system={_bootURIOnline:"/ce/site_chat/",_bootURIOffline:"/ce/site_chat_offline/",_bootPulseURIOnline:"/ce/pulse_chat/",_bootPulseURIOffline:"/ce/pulse_chat_offline/",startEvent:new App.U.CustomEvent("startEvent",this,true),completeEvent:new App.U.CustomEvent("completeEvent",this,true),_getQueryParams:function(){var query={};query.mango_external_uid=(typeof mango_external_uid==="undefined")?"":mango_external_uid;query.CBC=App.C.get("CBC");query.off_state=App.C.get("off_state");var user_detail=App.C.get("usr_dtl");App.L.merge(query,user_detail?App.J.parse(user_detail):{});return Ulib.toQuery(query)},_getBootURI:function(){if(App.config.product==App.config.WEBIM){if(this.isOffline()){return this._bootURIOffline+COMMUNITY_HASH}return this._bootURIOnline+COMMUNITY_HASH}else{if(this.isOffline()){return this._bootPulseURIOffline+COMMUNITY_HASH}return this._bootPulseURIOnline+COMMUNITY_HASH}},isOffline:function(){return(App.C.get("off_state")=="Y")},boot:function(dntFireStartEvent){if(YAHOO.env.ua.ie==6||(YAHOO.env.ua.ie>0&&YAHOO.env.ua.ie<=6)){App.system.completeEvent.fire();return App.event.AppInit.fire(null)}if(typeof mango_product==="undefined"||mango_product==App.config.WEBIM){App.config.product=App.config.WEBIM;App.config.productPath=App.config.WEBIM_PATH}else{App.config.product=App.config.PULSE;App.config.productPath=App.config.PULSE_PATH}App.config.product=(typeof mango_product==="undefined")?App.config.WEBIM:mango_product;var qs=this._getQueryParams();var uri=this._getBootURI();if(dntFireStartEvent!==true){this.startEvent.fire()}RoR.send(uri,qs,{success:this._success,failure:this._failure,scope:this})},_success:function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(App.L.isObject(resp)&&resp.success===true){this.completeEvent.fire();this.handleSuccess(resp)}else{this.failure(xhr)}},failure:function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp&&resp.error){this.handleError()}this.completeEvent.fire()},handleSuccess:function(resp){resp.uiState=App.system.isOffline()?App.config.OFFLINE_STATE:App.config.ONLINE_STATE;try{if(resp.room_obj.visitor_auto_login_enabled==="N"&&(!App.C.get("off_state")||App.C.get("off_state")=="Y")){App.C.set("off_state","Y",{path:"/"});resp.uiState=App.config.OFFLINE_STATE}else{var pop_cookie=App.C.get("sb_window_prefs",App.J.parse);if(pop_cookie&&pop_cookie.current_state=="PO"){resp.uiState=App.config.SUSPEND_STATE}}}catch(e){}App.event.AppInit.fire(resp)},handleError:function(obj){switch(obj.error_code){case"CE_USER_BLOCKED":alert(obj.error);break}},reboot:function(){this.shutdown();this.boot()},shutdown:function(){App.event.AppKill.fire(arguments)},initAppLoad:function(){App.event.BeforeAppInit.fire();App.util.writeFlashBridge(HOST_PREF,FLASH_BRIDGE);App.util.writeSoundBridge(HOST_PREF,SOUND_BRIDGE)},toString:function(){return"App.system instance"}};App.system.startEvent.subscribe(App.util.showLoading);App.system.completeEvent.subscribe(App.util.hideLoading);FABridge.addInitializationCallback(FLASH_BRIDGE,function(){App.log("Bridge initialization callback executed...");RoR(FLASH_BRIDGE,HOST_PREF);App.system.boot(true);App.event.windowUnload.subscribe(function(){try{FABridge[FLASH_BRIDGE].root().destroyPopInstance()}catch(ex){}try{FABridge[FLASH_BRIDGE].releaseASObjects();FABridge[SOUND_BRIDGE].releaseASObjects()}catch(ex){}swfobject.removeSWF("flexApp");swfobject.removeSWF("soundApp")})});App.E.on(window,"beforeunload",function(){App.event.windowUnload.fire()});App.E.onDOMReady(function(){App.info("dom is ready now");App.system.startEvent.fire();var callbackObj={onSuccess:App.system.initAppLoad,onFailure:function(){App.log("Is internet up ? ")},scope:App.system};var passCallback=false;if(!FROM_ARCHIVE){App.U.Get.script(jsFiles,callbackObj);passCallback=true}App.info("Passing callback object to CSS get ? "+passCallback);App.U.Get.css(cssFiles,!passCallback?callbackObj:null)})})(MangoSpring);_mango_locale_string_map={"ok-button":"Ok","save-button":"Save","login-button":"Sign In","cancel-button":"Cancel","skip-button":"Skip","saving-txt":"Saving...","login-txt":"Signing in...","creating-txt":"Creating...",create:"Create",open:"Open",yes:"Yes",no:"No","blank-input":"{name} cannot be left blank!","email-error":"Invalid Email Id","wrong-login-id":"Invalid {name}","pwd-min-err":"Password should be minimum {name} characters","pwd-max-err":"Password should be maximum {name} characters","sv-success":"Saved Successfully","sv-failed":"Unable to save at this time, try again later!","login-success":"Signed in Successfully","server-err":"Some error occured during server call, please refresh the page again!","online-txt":"You are Online","offline-txt":"You are Offline","busy-txt":"You are Busy","go-online":"Go Online","go-offline":"Go Offline","offline-msg":"{name} is offline and can't receive IM at this moment.","online-msg":"{name} is online, will receive messages over IM","fav-u-login":"You need to log in to be able to add contacts to {name}","fav-o-login":"The contact needs to be logged in for you to be able to add him/her to your {name}","no-user":"No one is online at this time","add-2-fav":'<em class="fav_info">Only "{name}" who are currently online will appear here.</em>',"del-confirm":"Are you sure you want to remove this user from {name}?","blok-confirm":"Are you sure you want to block this user?","unblok-confirm":"Are you sure you want to unblock this user?","warn-confirm":"Are you sure you want to warn this user?","ignore-confirm":"Are you sure you want to ignore this user?","unignore-confirm":"Are you sure you want to un-ignore this user?","remove-confirm":"Are you sure you want to remove this user?","vw-hist":"View Chat History",ignore:"Ignore",unignore:"Un-Ignore",block:"Block user on Chat","blocked-msg":"You've blocked {name}, you won't be able to chat, until you 'Unblock' the user from 'Actions'.","block-msg2":"User has successfully blocked",unblock:"Unblock user on Chat","unblock-success":"User has been successfully unblocked. We will close the chat window now, please reopen to continue.",warn:"Warn","cant-warn":"Sorry, you cannot warn this user.",remove:"Remove",add2fav:"Add to {name}",del2fav:"Remove from {name}","voice-call":"Call","send-mail":"Send Quick Email","vw-member":"View Members","send-file":"Upload File",upcoming:"Coming Soon!","popup-block":"Oops! You have popup blocker installed","hide-tips":"Hide Tips","show-tips":"Show Tips","mail-sent":"Mail successfully sent","session-timeout":"Session has timed out",typing:"is typing...","has-entered":"entered text","no-email":'"{name}" has not yet provided the system an authenticated Email ID. Unable to send a Quick Email at this time.',"retry-title":"Network Connection Status","retry-lbl":"Retry Now","stop-try-lbl":"Stop Retry","retry-now":"Attempting to connect now...","retry-err":"Lost network connectivity. You will not receive any new messages till the connectivity is restored. Attempting to restore the connectivity in {name}.","session-dirty":"Your session has been expired. Please refresh the page to continue.",uploading:"Uploading file...Please wait!","stop-try-msg":"Stopped connecting. No new messages will be pushed to you. Please refresh your browser if you wish to attempt establishing the connection to the server again.","ane-title":"This message was sent over email","no-lt-gt":'Input contains invalid characters. The ">" and "<" characters are not allowed.',"online-count-title":"Online/Total","no-admin-room":"No rooms have been created by Admin at this time.","no-user-room":"You do not have any favorite/created rooms at this time.","create-room-lbl":"Create","open-room-lbl":"Open","find-room-lbl":"Find","refresh-room-lbl":"Refresh","refresh-pending":"Refreshing...","refresh-tip":"Refresh this list","create-tip":"Create new group","create-team-tip":"Create new project","open-tip":"Open a group","find-tip":"Find more rooms","find-team-tip":"Find more projects","lbl-room-name":"Enter Name :","edit-prof":"Profile","edit-settings":"Settings","sign-in":"Sign In","lbl-email":"Email Id","lbl-name":"Name","lbl-login":"Login Id","lbl-pwd":"Password","trans-title":"Will be used only to send transcript","trans-text":"Want a transcript of this chat session over email?","name-tip-text":"Click to change your name","upload-title":"Click to upload your own avatar","inplace-title":"Click here to edit this text","sign-up":"Sign Up","sign-up-title":"Don't have an account?","my-mango":"My Mango","my-mango-title":"Go to ","btn-chat":"Chat","btn-email":"Email","btn-more":"More","mob-platform":"Logged in from Mobile","desk-platform":"Logged in from Desktop","vw-action":"Other Actions","hd-action":"Hide Actions","vw-member":"View Members","hd-member":"Hide Members","pop-back":"Pop-In Again","pop-mode-msg":"You're in popped-out mode.","pop-reload":"Popping you in back again...","pop-warn":"You have decided to navigate away from this page, the popped-out chat will close now!",close:"Close",send:"Send","setting-header-1":"Show notifications for :","setting-header-2":"Play sound for :","setting-lbl-1":" Presence change","setting-lbl-2":" New user messages",loading:"Loading, please wait...","audio-call":"Incoming call from <strong>{name}</strong> at {call_time}.","video-call":"Incoming video call from <strong>{name}</strong> at {call_time}.","audio-title":"Audio Call Notification","video-title":"Video Call Notification","suspended-mode":"Currently you are in popped-out state, Please pop-in back and retry.","offline-mode":"Currently you are offline, Please go online to start chat.","email-to":"Email To: ","invite-to":"Send invite to: ","room-moderator-lbl":"Moderators","room-members-lbl":"Members","room-active-user-lbl":"Active","vw-room-page":"View Room Page","vw-team-page":"View Team Page","vw-profile":"View Profile","audio-call-label":"Make a Audio Call","video-call-label":"Make a Video Call","audio-accept-label":"Accept","audio-reject-label":"Ignore","video-accept-label":"Accept","video-reject-label":"Ignore","audio-call-rejected":"Call ignored from <strong>{name}</strong> at {call_time}","video-call-rejected":"Call ignored from <strong>{name}</strong> at {call_time}","audio-call-ended":"Call ended from <strong>{name}</strong> at {call_time}","video-call-ended":"Call ended from <strong>{name}</strong> at {call_time}","av-call-canceled-ok-label":"Ok","user-offline-for-audio-call":"Sorry! The user you are trying to call is Offline. The user needs to be Online for placing an Audio call.","user-visitor-for-audio-call":"Sorry! The user you are trying to call is not signed-in. The user needs to be signed in first before you can place an Audio call.","user-blocked-for-audio-call":"Sorry! The user you are trying to call is Blocked. The user needs to be Unblocked for placing an Audio call.","user-unauthenticated-for-audio-call":"You are currently not signed-in. Please signin and then place the Audio call.","user-busy-for-in-audio-call":"Sorry! You cannot take this call as you are already on another call. Please end the current call, if you wish to take the new incoming call.","user-busy-on-another-audio-call":"Sorry! You cannot place a second call while you are on the first call.","user-platfrom-not-valid-for-audio":"Sorry! You can not place an Audio Call. The user you are trying to call is not using the full window client.","user-offline-for-video-call":"Sorry! The user you are trying to call is Offline. The user needs to be Online for placing a Video call.","user-visitor-for-video-call":"Sorry! The user you are trying to call is not signed-in. The user needs to be signed in first before you can place a Video call.","user-blocked-for-video-call":"Sorry! The user you are trying to call is Blocked. The user needs to be unblocked for placing a Video call.","user-unauthenticated-for-video-call":"You are currently not signed-in. Please signin and then place the Video call.","user-busy-for-in-video-call":"Sorry! You cannot take this Video call as you are already on another call. Please end the current Video call, if you wish to take the new incoming Video call.","user-busy-on-another-video-call":"Sorry! You cannot place a second video call while you are on the first call.","user-platfrom-not-valid-for-video":"Sorry! You can not place a Video Call. The user you are trying to call is not using the full window client.","server-forcefully-socket-close":"You have been logged out.",expand:"Expand",shrink:"Collapse","shrink-confirm":"You are having {count} conversation{suffix} right now, in collapsed view you will not be able to chat.\nSo would you like to close them as well and proceed with collapsing?",optional:"Optional","rfc-send":'The community settings will require you to send a request for private chat invite to the user first. <a href="#" class="mango-rfc">Send Request now</a>.',"invite-txt":"<strong>{name}</strong> has invited you for a private chat.","invite-u-txt":"You have invited <strong>{name}</strong> for a private chat.","reject-txt":"Sorry! The user is unable to accept your request for chat at this time. You might want to try requesting some other time.",accept:"Accept",reject:"Reject","update-tab":"Updates","no-updates":"You have no updates at this time!","new-updates":"You have new updates","invite-success":"Invitation send successfully","file-seen":"{user} has clicked to view your file ({file})."};function _i18n(key,args){var Y=YAHOO;if(Y.lang.isUndefined(_mango_locale_string_map)){return }var v=_mango_locale_string_map[key];if(v){if(Y.lang.isObject(args)){v=Y.lang.substitute(v,args)}}return v}(function(){var App=MangoSpring;App.net.SocketConnector=function(channel,felixId,sessionId,communityId,userName,userImage,pushPort,pushDomain){this.channel=channel.root();this.felixId=felixId;this.sessionId=sessionId;this.communityId=communityId;this.userName=userName;this.userImage=userImage;this.port=pushPort;this.domain=pushDomain;this.chat=new YAHOO.util.CustomEvent("Chat",this,true,YAHOO.util.CustomEvent.FLAT);this.sysMsg=new YAHOO.util.CustomEvent("SystemMessage",this,true,YAHOO.util.CustomEvent.FLAT);this.presence=new YAHOO.util.CustomEvent("Presence",this,true,YAHOO.util.CustomEvent.FLAT);this.error=new YAHOO.util.CustomEvent("Error",this,true,YAHOO.util.CustomEvent.FLAT);this.connectSuccess=new YAHOO.util.CustomEvent("connectSuccess",this,true,YAHOO.util.CustomEvent.FLAT);this.connectError=new YAHOO.util.CustomEvent("connectError",this,true,YAHOO.util.CustomEvent.FLAT);this.socketConnected=false;this.connect()};App.net.SocketConnector.ON_RETRY="RetryFail";App.net.SocketConnector.ON_CANCEL="RetryCancel";App.net.SocketConnector.CONNECTED="Connected";App.net.SocketConnector.prototype={connect:function(){if(!this.channel){throw new Error("Channel root not found!")}this.open();this.error.subscribe(this.handleSubscribeError,this,true)},route:function(xmpp){var tag=xmpp.getTag();if(xmpp.isError()){this.log("Error occured so returning....");this.disconnect();return this.error.fire(xmpp)}this.log(xmpp.getXML());switch(tag){case"message":this.chat.fire(xmpp);break;case"iq":this.sysMsg.fire(xmpp);break;case"presence":this.presence.fire(xmpp);break}},open:function(){this.log("setting PushConstraint");this.channel.setPushConstraint(this.port,this.domain,this.communityId,this.sessionId,this.felixId,this.userName,this.userImage,"MangoSpring.net.Socket.onData");var controller=this.channel.getController(this.port,this.domain);controller.addEventListener(App.net.SocketConnector.CONNECTED,this.onConnect);controller.addEventListener(App.net.SocketConnector.ON_RETRY,this.onError);controller.connect()},close:function(){try{if(!this.socketConnected){return }this.socketConnected=false;var controller=this.channel.getController(this.port,this.domain);controller.removeEventListener(App.net.SocketConnector.CONNECTED,this.onConnect);controller.removeEventListener(App.net.SocketConnector.ON_RETRY,this.onError);controller.closeConnection();this.log("Connection close by close()");this.destroy();return true}catch(e){return false}},disconnect:function(){var controller=this.channel.getController(this.port,this.domain);controller.removeEventListener(App.net.SocketConnector.CONNECTED,this.onConnect);controller.removeEventListener(App.net.SocketConnector.ON_RETRY,this.onError);controller.disconnect();this.socketConnected=false;this.destroy()},onData:function(message){this.log("App.net.Socket.onData :: "+message);var xmpp=XMPPParser.parse(message);this.route(xmpp)},onConnect:function(event){var _oSelf=App.net.Socket;_oSelf.log("Success fully connected...");_oSelf.socketConnected=true;_oSelf.connectSuccess.fire("Socket Connected Successfully")},onError:function(event){var _oSelf=App.net.Socket;_oSelf.log("Connection broken. Retrying in "+event.getInterval()+" seconds");_oSelf.socketConnected=false;_oSelf.connectError.fire(event.getInterval())},isConnected:function(){return this.socketConnected},stopRetry:function(){this.channel.getController(this.port,this.domain).stopRetry()},connectNow:function(){if(!this.socketConnected){this.channel.getController(this.port,this.domain).retryOnDemand()}},changeUserName:function(name){this.userName=name},handleSubscribeError:function(xmpp){var code=xmpp.getErrorCode();this.log("Error code :: "+code);switch(code){case"MSSUB_001":case"MSSUB_003":this.markSessionDirty();setTimeout(function(){alert(_i18n("session-dirty"))},0);break;case"FUE_001":case"FUE_002":case"FUE_003":case"SUE_001":setTimeout(function(){alert(xmpp.getErrorText())},0);break;case"ERR_001":setTimeout(function(){alert(xmpp.getErrorText())},0);break}},markSessionDirty:function(){var controller=this.channel.getController(this.port,this.domain);controller.markSessionDirty()},log:function(message){App.log(message)},destroy:function(){this.chat.unsubscribeAll();this.sysMsg.unsubscribeAll();this.presence.unsubscribeAll();this.connectSuccess.unsubscribeAll();this.connectError.unsubscribeAll()},updateSocketProps:function(sockIP,sockPort){this.port=sockPort;this.domain=sockIP;this.channel.getController(this.port,this.domain).updateSocketParams(this.domain,this.port)}}})();(function(App){App.ui.SlidingToaster=function(id,config){this.id=id;this.contentId=id+"_msg_cont";this._initConfig(config);this.visible=false;this.timer=null;this.isAnimRunning=false;this.onResponse=new YAHOO.util.CustomEvent("onresp",this);this.onResponse.subscribe(this._slideIn,this,true);this._createUI();this._initAnimation();App.E.on(this.element,"mouseover",this.onMouseOver,this,true);App.E.on(this.element,"mouseout",this.onMouseOut,this,true);App.E.on(this.element,"click",this.onClick,this,true)};App.ui.SlidingToaster.prototype.dispTime=10000;App.ui.SlidingToaster.prototype.direction="right";App.ui.SlidingToaster.prototype.closeButton=false;App.ui.SlidingToaster.prototype._initConfig=function(attr){if(!attr){return }if(attr.dir&&this._isValidDir(attr.dir)){this.direction=attr.dir}if(attr.dispTime&&App.L.isNumber(attr.dispTime)){this.dispTime=attr.dispTime}if(attr.close&&App.L.isBoolean(attr.close)){this.closeButton=attr.close}if(attr.community_name){this.community_name=attr.community_name}if(attr.klas){this.klas=attr.klas}if(attr.periodicUpdate&&App.L.isObject(attr.periodicUpdate)){this.periodicUpdate=true;this.updater=new App.util.ToasterUpdater(attr.periodicUpdate,{success:this.notify,scope:this})}};App.ui.SlidingToaster.prototype._isValidDir=function(dir){return(dir=="right"||dir=="left")};App.ui.SlidingToaster.prototype._createUI=function(){var dv=['<div class="ms-toaster-header">',this.showCloseButton(),App.helper.truncate(this.community_name,20),"</div>",'<div class="toaster_body" id="',this.contentId,'">','<div class="avatar"></div>','<div class="info">','<p class="name"></p><p class="status"></p>',"</div></div>"];domBuilder(document.body).div({id:this.id,style:"visibility:hidden"}).addClass("toast_container "+this.klas).text(dv.join(""));this.element=App.D.get(this.id);this.msgCont=App.D.get(this.contentId);if(!QUIRKS_MODE||YAHOO.env.ua.gecko){App.D.setStyle(this.element,"visibility","visible");App.D.setStyle(this.element,this.direction,this.getStartPos()+"px")}};App.ui.SlidingToaster.prototype.showCloseButton=function(){var markUp='<span class="close" title="Close">x</span>';if(!this.closeButton){markUp=""}return markUp};App.ui.SlidingToaster.prototype._initAnimation=function(){if(this.direction=="left"){this.slideInAttr={left:{to:2,from:this.getStartPos()}};this.slideOutAttr={left:{from:2,to:this.getStartPos()}}}else{this.slideInAttr={right:{to:2,from:this.getStartPos()}};this.slideOutAttr={right:{from:2,to:this.getStartPos()}}}this.slideIn=new YAHOO.util.Anim(this.element,this.slideInAttr,0.5,YAHOO.util.Easing.backIn);this.slideIn.onComplete.subscribe(this._slideInComplete,this,true);this.slideOut=new YAHOO.util.Anim(this.element,this.slideOutAttr,0.5,YAHOO.util.Easing.backOut);this.slideOut.onComplete.subscribe(this._slideOutComplete,this,true)};App.ui.SlidingToaster.prototype._slideIn=function(resp){if(this.timer){this.timer.cancel();this.slideOut.stop(true)}this.write(resp);if(QUIRKS_MODE&&YAHOO.env.ua.ie){App.L.later(this.dispTime,this,this._slideInComplete);return App.D.setStyle(this.element,"visibility","visible")}this.slideOut.attributes.from=this.getStartPos();this.slideIn.animate();this.isAnimRunning=true};App.ui.SlidingToaster.prototype.write=function(resp){var imageCont=App.S.query("div.avatar",this.msgCont,true);var nameCont=App.S.query("p.name",this.msgCont,true);var statusCont=App.S.query("p.status",this.msgCont,true);nameCont.innerHTML=App.helper.truncate(resp.userName,20);statusCont.innerHTML=App.helper.truncate(App.helper.capitalize(resp.custom_presence),22)+'&nbsp;<img src="'+HOST_PREF+'/ce/images/transparent.gif" height="14" width="14" border="0" class="toaster-mango-'+resp.status+'"/>';imageCont.innerHTML='<img src="'+resp.userImage+'" />'};App.ui.SlidingToaster.prototype._slideInComplete=function(){if(!this.slideOut){}this.timer=App.L.later(this.dispTime,this,this._slideOut);this.isAnimRunning=false};App.ui.SlidingToaster.prototype._slideOut=function(bForceExit){this.slideOut.attributes.to=this.getStartPos();if(this.mouseOver&&!bForceExit){this.timer=App.L.later(this.dispTime,this,this._slideOut)}else{if(QUIRKS_MODE&&YAHOO.env.ua.ie){return App.D.setStyle(this.element,"visibility","hidden")}this.isAnimRunning=true;if(this.timer){this.timer.cancel()}this.slideOut.animate()}};App.ui.SlidingToaster.prototype._slideOutComplete=function(){this.clear();this.isAnimRunning=false;this.visible=false};App.ui.SlidingToaster.prototype.getStartPos=function(){return -this.element.offsetWidth};App.ui.SlidingToaster.prototype.getEndPos=function(){return 1};App.ui.SlidingToaster.prototype.onMouseOver=function(e){this.mouseOver=true};App.ui.SlidingToaster.prototype.onMouseOut=function(e){var targ=App.E.getTarget(e);var region=App.D.getRegion(this.element);var xy=App.E.getXY(e);var contains=(xy[0]>=region.left&&xy[0]<=region.right)&&(xy[1]>=region.top&&xy[1]<=region.bottom);var flag=false;if(contains){flag=false}this.mouseOver=flag};App.ui.SlidingToaster.prototype.onClick=function(e){var targ=App.E.getTarget(e);if(App.D.hasClass(targ,"close")){App.E.stopEvent(e);this.slideIn.stop(true);if(this.timer){this.timer.cancel()}this._slideOut(true);this.slideOut.stop(true)}};App.ui.SlidingToaster.prototype.clear=function(){try{App.S.query("div.avatar",this.msgCont,true).innerHTML="";App.S.query("p.name",this.msgCont,true).innerHTML="";App.S.query("p.status",this.msgCont,true).innerHTML=""}catch(e){}};App.ui.SlidingToaster.prototype.notify=function(resp){if(!resp){return""}try{this._slideIn(resp)}catch(e){}};App.ui.SlidingToaster.prototype.destroy=function(){this.slideIn.stop();this.slideOut.stop();if(this.timer){this.timer.cancel()}if(this.updater){this.updater.destroy()}App.E.purgeElement(this.element);App.D.remove(this.element)};App.ui.AdToaster=function(id,config){this.constructor.superclass.constructor.call(this,id,config)};App.L.extend(App.ui.AdToaster,App.ui.SlidingToaster);App.ui.AdToaster.prototype._createUI=function(){domBuilder(document.body).div({id:this.id,style:"visibility:hidden"}).addClass("mango-ad-toaster "+this.klas).text("&nbsp;");this.element=App.D.get(this.id);if(!QUIRKS_MODE||YAHOO.env.ua.gecko){App.D.setStyle(this.element,"visibility","visible");App.D.setStyle(this.element,this.direction,this.getStartPos()+"px")}};App.ui.AdToaster.prototype.write=function(obj){this.element.innerHTML="";domBuilder(this.element).a({href:obj.link,target:"_new",title:obj.title}).img({src:obj.src}).end().end()};App.util.ToasterUpdater=function(config,callback){this.currIndex=0;this.timer=null;this._initConfig(config,callback);this.start()};App.util.ToasterUpdater.prototype._initConfig=function(cfg,callback){if(!App.L.isFunction(callback.success)){throw new Error("Don't know where to notify thus returning!")}this.callback=callback;if(!callback.scope){this.callback.scope=window}if(App.L.isString(cfg.dataSrc)){this.remoteReq=true;this.dataURI=cfg.dataSrc}if(App.L.isArray(cfg.dataSrc)){this.remoteReq=false;this.dataList=cfg.dataSrc}if(cfg.interval&&App.L.isNumber(cfg.interval)){this.interval=cfg.interval}};App.util.ToasterUpdater.prototype.start=function(){if(!this.remoteReq){App.L.later(this.interval,this,this.doFlush,null,true)}};App.util.ToasterUpdater.prototype.doFlush=function(){if(this.currIndex>=this.dataList.length){this.currIndex=0}this.callback.success.apply(this.callback.scope,[this.dataList[this.currIndex]]);this.currIndex++};App.util.ToasterUpdater.prototype.destroy=function(){this.timer.cancel();this.callback=null;this.dataList=null};App.util.AudioVideoToaster=function(name,type,callTime,convId,fromUserId){this.id="mango-audio-toaster"+(++App.util.AudioVideoToaster._count);this.name=name;this.type=type;this.callTime=callTime;this.convId=convId;this.fromUserId=fromUserId;this.timeOut=30000;this.timer=null;this._init();this.showAnim=new YAHOO.util.Anim(this.element,{right:{from:-305,to:5}},1,YAHOO.util.Easing.backIn);this.hideAnim=new YAHOO.util.Anim(this.element,{right:{from:5,to:-305}},1,YAHOO.util.Easing.backOut);this.showAnim.onComplete.subscribe(this.startTimer,this,true);this.hideAnim.onComplete.subscribe(this.destroy,this,true)};App.util.AudioVideoToaster._count=0;App.util.AudioVideoToaster.tosters={};App.util.AudioVideoToaster.onCallCanceled=function(name,type,callTime,key,fromUserId,callCancelType){try{App.util.AudioVideoToaster.stopTimer(type,key);var toasters=App.util.AudioVideoToaster.tosters;if(toasters[key+type]){var avToaster=toasters[key+type];if(avToaster&&(key+type)==avToaster.convId+avToaster.type){avToaster.body.innerHTML="";var msgType="";if(callCancelType=="CVE"||callCancelType=="COE"){msgType=_i18n(type+"-call-ended",{name:name,call_time:callTime})}else{if(callCancelType=="CVR"||callCancelType=="COR"){msgType=_i18n(type+"-call-rejected",{name:name,call_time:callTime})}}domBuilder(avToaster.body).div().text(msgType).end().div().addClass("ms-av-buttons").a({href:"#"}).addClass(type=="audio"?"mango-audio-call-canceled":"mango-video-call-canceled").text(_i18n("av-call-canceled-ok-label")).end().end();if(type=="audio"){var closeBtn=App.S.query("#"+avToaster.id+" span.mango-audio-close",null,true);if(closeBtn){App.D.replaceClass(closeBtn,"mango-audio-close","mango-audio-cancel-close")}}else{var closeBtn=App.S.query("#"+avToaster.id+" span.mango-video-close",null,true);if(closeBtn){App.D.replaceClass(closeBtn,"mango-video-close","mango-video-cancel-close")}}avToaster.timer=App.L.later(avToaster.timeOut,avToaster,avToaster.hide,null,false)}}else{var obj=new App.util.AudioVideoToaster(name,type,callTime,key,fromUserId);App.util.AudioVideoToaster.onCallCanceled(name,type,callTime,key,fromUserId,callCancelType);obj.showAnim.onComplete.unsubscribe(obj.startTimer,obj,true);obj.show()}}catch(e){MSElert(e)}};App.util.AudioVideoToaster.stopTimer=function(type,key){var toasters=App.util.AudioVideoToaster.tosters;if(toasters[key+type]){var avToaster=toasters[key+type];if(avToaster&&(key+type)==(avToaster.convId+avToaster.type)&&avToaster.timer){avToaster.timer.cancel()}}};App.util.AudioVideoToaster.hideToaster=function(type,key){var toasters=App.util.AudioVideoToaster.tosters;if(toasters[key+type]){var avToaster=toasters[key+type];if(avToaster&&(key+type)==avToaster.convId+avToaster.type){avToaster.hideAnim.animate()}}};App.util.AudioVideoToaster.prototype={_init:function(){try{var toasters=App.util.AudioVideoToaster.tosters;if(toasters[this.convId+this.type]){toasters[this.convId+this.type].destroy()}domBuilder(document.body).div({id:this.id}).addClass("ms-reconnect-box").div().addClass("ms-header").text(this.type=="audio"?_i18n("audio-title"):_i18n("video-title")).span({title:_i18n("close")}).addClass(this.type=="audio"?"mango-audio-close":"mango-video-close").text("x").end().end().div().addClass("ms-body").div().text(this.type=="audio"?_i18n("audio-call",{name:this.name,call_time:this.callTime}):_i18n("video-call",{name:this.name,call_time:this.callTime})).end().div().addClass("ms-av-buttons").a({href:"#"}).addClass(this.type=="audio"?"mango-audio-accept":"mango-video-accept").text(_i18n(this.type=="audio"?"audio-accept-label":"video-accept-label")).end().a({href:"#"}).addClass(this.type=="audio"?"mango-audio-reject":"mango-video-reject").text(_i18n(this.type=="audio"?"audio-reject-label":"video-reject-label")).end().end().end().div().addClass("ms-footer").end();this.element=App.D.get(this.id);with(App.S){this.header=query("#"+this.id+" div.ms-header",null,true);this.body=query("#"+this.id+" div.ms-body",null,true);this.footer=query("#"+this.id+" div.ms-footer",null,true)}App.E.on(this.element,"click",this.handleEvent,null,this);if(this.convId){App.util.AudioVideoToaster.tosters[this.convId+this.type]=this}}catch(e){}},startTimer:function(){if(this.timer){this.timer.cancel()}this.timer=App.L.later(this.timeOut,this,this.hide,null,false)},show:function(){this.showAnim.animate()},hide:function(){this.hideAnim.animate()},handleEvent:function(e){var target=App.E.getTarget(e);if(App.D.hasClass(target,"mango-audio-close")){this.onReject()}else{if(App.D.hasClass(target,"mango-video-close")){this.onReject()}else{if(App.D.hasClass(target,"mango-audio-accept")){this.onAccept()}else{if(App.D.hasClass(target,"mango-audio-reject")){this.onReject()}else{if(App.D.hasClass(target,"mango-video-accept")){this.onAccept()}else{if(App.D.hasClass(target,"mango-video-reject")){this.onReject()}else{if(App.D.hasClass(target,"mango-audio-call-canceled")||App.D.hasClass(target,"mango-audio-cancel-close")||App.D.hasClass(target,"mango-video-call-canceled")||App.D.hasClass(target,"mango-video-cancel-close")){this.hide()}}}}}}}},onAccept:function(){var conf=App.config.SessionConfig;var callNowData={dn:"sitegroup",env:conf.get("env"),ch:App.config.Settings.get("community_hash"),bu:HOST_DOMAIN,UID:conf.get("felix_id"),UNAME:conf.get("user_name"),OUID:this.fromUserId,CONID:this.convId,CID:App.config.Settings.get("id"),CU:this.type=="audio"?8:9,CT:"S",CHIST:"false",PCC:"false",SID:conf.get("session_id"),pushPort:conf.get("janus_port"),pushURL:conf.get("janus_url"),mango_external_uid:""};if(this.type=="audio"){App.ui.oneOOneAudio(callNowData,this.fromUserId)}else{if(this.type=="video"){App.ui.oneOOneAudio(callNowData,this.fromUserId)}}this.hide()},onReject:function(){if(this.type=="audio"){Janus.audioCallRejected({conv_id:this.convId})}else{if(this.type=="video"){Janus.videoCallRejected({conv_id:this.convId})}}this.hide()},destroy:function(){App.E.removeListener(this.element,"click",this.handleEvent);if(this.timer){this.timer.cancel()}App.helper.removeEl(this.element);if(this.convId){delete App.util.AudioVideoToaster.tosters[this.convId+this.type]}}}})(MangoSpring);(function(App){var YDom=YAHOO.util.Dom,YEvent=YAHOO.util.Event,YLang=YAHOO.lang,YSelect=YAHOO.util.Selector;App.ui.Reconnect=function(){this._init();this.currentInterval=0;this.noAction=false;this.delayTimer=null};App.ui.Reconnect.prototype={_init:function(){var cont=document.createElement("div");var id=App.ui.Reconnect.id+(++App.ui.Reconnect.count);cont.id=id;YDom.addClass(cont,App.ui.Reconnect.CSS_CLASS);cont.innerHTML='<div class="ms-header"></div><div class="ms-body"></div><div class="ms-footer"></div>';document.body.appendChild(cont);this.container=YDom.get(cont.id);this.header(_i18n("retry-title"));this.footer('<a class="ms-stop-try" href="#">'+_i18n("stop-try-lbl")+'</a>&nbsp;|&nbsp;<a class="ms-try-now" href="#">'+_i18n("retry-lbl")+"</a>");YEvent.on(this.container,"click",this.handleEvent,null,this)},footer:function(content){if(!this.footerEl){this.footerEl=YSelect.query("div.ms-footer",this.container.id,true)}this.footerEl.innerHTML=content},header:function(content){if(!this.headerEl){this.headerEl=YSelect.query("div.ms-header",this.container.id,true)}this.headerEl.innerHTML=content},update:function(content){try{if(!this.bodyEl){this.bodyEl=YSelect.query("div.ms-body",this.container.id,true)}this.bodyEl.innerHTML=content}catch(e){}},show:function(interval){if(interval){this.startCountDown(interval)}if(!this.isVisible){if(QUIRKS_MODE&&YAHOO.env.ua.ie){this.isVisible=true;return YDom.setStyle(this.container,"display","block")}else{var showAnim=new YAHOO.util.Anim(this.container,{right:{from:-305,to:5}},1,YAHOO.util.Easing.backIn);showAnim.onComplete.subscribe(function(){this.isVisible=true},null,this);showAnim.animate()}}},hide:function(){if(this.isVisible){if(QUIRKS_MODE&&YAHOO.env.ua.ie){this.isVisible=false;return YDom.setStyle(this.container,"display","none")}else{var hideAnim=new YAHOO.util.Anim(this.container,{right:{from:5,to:-305}},1,YAHOO.util.Easing.backOut);hideAnim.onComplete.subscribe(function(){this.isVisible=false},null,this);hideAnim.animate()}}this.noAction=false;this.stopTimer();if(this.delayTimer){this.delayTimer.cancel()}},dismiss:function(){if(this.isVisible){this.isVisible=false;return YDom.setStyle(this.container,"display","none")}this.noAction=false;this.stopTimer();if(this.delayTimer){this.delayTimer.cancel()}},stopTimer:function(){if(this.countDownTimer){this.countDownTimer.stop()}},handleEvent:function(e){var targ=YEvent.getTarget(e);if(this.noAction){return }if(YDom.hasClass(targ,"ms-try-now")){this.tryNow();YEvent.stopEvent(e)}else{if(YDom.hasClass(targ,"ms-stop-try")){this.stopTry();YEvent.stopEvent(e)}else{if(YDom.hasClass(targ,"mango-close-conn")){this.hide()}}}},tryNow:function(){this.update(_i18n("retry-now"));App.net.Socket.connectNow()},stopTry:function(){this.stopTimer();this.update(_i18n("stop-try-msg"));App.net.Socket.stopRetry();App.net.Socket.disconnect();this.delayTimer=YAHOO.lang.later(App.ui.Reconnect.stopRetryHideDelay,this,this.hide);this.footer('<a href="javascript://" class="mango-close-conn">'+_i18n("close")+"</a>")},startCountDown:function(v){if(!this.countDownTimer){this.countDownTimer=new App.util.Counter(Ulib.bind(this.updateCounter,this))}this.countDownTimer.set(v)},updateCounter:function(counter,str){var output="";if(counter<=1){output=_i18n("retry-now")}else{output=_i18n("retry-err",{name:str.replace(/\s?([^\s]*)/,"<strong>$1</strong>")})}this.update(output)},destroy:function(){this.stopTimer();if(this.delayTimer&&this.delayTimer.stop){this.delayTimer.stop()}YAHOO.util.Event.removeListener(this.container,"click",this.handleEvent);this.container.innerHTML="";this.container.parentNode.removeChild(this.container)}};App.ui.Reconnect.count=0;App.ui.Reconnect.id="ms-reconnect-ui";App.ui.Reconnect.CSS_CLASS="ms-reconnect-box";App.ui.Reconnect.stopRetryHideDelay=15000;App.util.Counter=function(callback){this.counter=0;this.timer=null;this.callback=callback};App.util.Counter.prototype.set=function(interval){window.clearInterval(this.timer);this.counter=parseInt(interval);this.callback(this.counter,this.calculate(this.counter));this.timer=window.setInterval(Ulib.bind(this.start,this),1000)};App.util.Counter.prototype.start=function(){this.counter--;var output="";if(this.counter==0){window.clearInterval(this.timer)}output=this.calculate(this.counter);this.callback(this.counter,output)};App.util.Counter.prototype.calculate=function(val){if(val<60){return this._seconds(val)}else{return this._minutes(val)}};App.util.Counter.prototype._minutes=function(m){if(m==60){return"1 minute"}var min=parseInt(m/60),sec=parseInt(m%60);return min+":"+(sec<10?"0"+sec:sec)+" minutes"};App.util.Counter.prototype._seconds=function(s){if(s==1){return"1 second"}return(s<10?"0"+s:s)+" seconds"};App.util.Counter.prototype.stop=function(){window.clearInterval(this.timer);this.timer=0}})(MangoSpring);(function(App){var Y=YAHOO,YDom=YAHOO.util.Dom,YEvent=YAHOO.util.Event,YLang=YAHOO.lang;App.util.Editable=function(el,cfg){this.element=YDom.get(el);if(!this.element){throw new Error("Element doesn't exist")}this._initConfig(cfg);this._initEventHandlers();this.reqObj={}};App.util.Editable.prototype={TAG_NAME:"input",ALLOWED_TAGS:{input:"text",textarea:""},maxTextLength:65,_initConfig:function(cfg){if(cfg.tag&&(cfg.tag.toLowerCase() in this.ALLOWED_TAGS)){this.tag=cfg.tag.toLowerCase()}else{this.tag=this.TAG_NAME}this.dataSrc=cfg.dataSrc;this.effects=(cfg.effects&&cfg.effects===true);if(cfg.updateURI){this.updateURI=cfg.updateURI}this.dntSaveExecuteCallback=cfg.dntSaveExecuteCallback;this.beforeSave=new Y.util.CustomEvent("beforesave",this,true);this.afterSave=new Y.util.CustomEvent("aftersave",this,true);YDom.setStyle(this.element,"cursor","pointer")},_initEventHandlers:function(){if(this.effects){YEvent.on(this.element,"mouseover",this.showEffects,this,true);YEvent.on(this.element,"mouseout",this.hideEffects,this,true)}YEvent.on(this.element,"click",this.handleMouseEvent,this,true)},addCallback:function(callback){this.callback=callback},isFORMElement:function(el,type){el=YDom.get(el);if(type&&el.type&&el.type.toLowerCase()==type){return el}else{if(el&&!type){return el}}return null},cleanText:function(str){var checkText=new String(str);var regEx=/\"/g;checkText=String(checkText.replace(regEx,""));checkText=checkText.replace(/</g,"&lt;").replace(/>/g,"&gt;");return checkText},showEffects:function(e){if(!this.inputEl&&YEvent.getTarget(e).tagName.toLowerCase()!="input"){YDom.setStyle(YEvent.getTarget(e),"backgroundColor","#FFFFB4")}},hideEffects:function(e){if(YEvent.getTarget(e).tagName.toLowerCase()!="input"){YDom.setStyle(YEvent.getTarget(e),"backgroundColor","#fff")}},handleMouseEvent:function(e){var targ=YEvent.getTarget(e);if(targ.tagName&&targ.tagName.toLowerCase()==this.tag){return false}this.contents=this.getContents();this.makeEditable()},getContents:function(){var contents="";if(YLang.isFunction(this.dataSrc)){contents=this.cleanText(YLang.trim(this.dataSrc()))}else{if(obj=this.isFORMElement(this.dataSrc,"hidden")){contents=this.cleanText(YLang.trim(obj.value))}else{contents=this.cleanText(YLang.trim(this.dataSrc.innerHTML))}}return contents},setContents:function(content){if(YLang.isFunction(this.dataSrc)){this.dataSrc(content)}else{if(obj=this.isFORMElement(this.dataSrc,"hidden")){obj.value=content}else{this.dataSrc.innerHTML=content}}},makeEditable:function(){this.inputEl=YDom.generateId();var new_el=document.createElement(this.tag);new_el.setAttribute("type",this.ALLOWED_TAGS[this.tag]);new_el.setAttribute("id",this.inputEl);new_el.value=this.contents;YDom.addClass(new_el,this.klas);this.element.innerHTML="";this.element.appendChild(new_el);new_el.select();YEvent.on(new_el,"blur",this.undoChanges,this,true);this.keyListener=new YAHOO.util.KeyListener(new_el,{keys:13},{fn:this.saveChanges,scope:this,correctScope:true});this.keyListener.enable()},saveChanges:function(){var el=YDom.get(this.inputEl);if(!this.validate(el)){return alert(_i18n("no-lt-gt"))}this.keyListener.disable();YEvent.removeListener(YAHOO.util.Selector.query("input[type=text]",this.element,true),"blur",this.undoChanges,this);if(YLang.trim(el.value).length>0){this.contents=el.value;this.element.innerHTML=App.helper.truncate(this.contents,this.maxTextLength)}else{this.element.innerHTML=this.contents}this.setContents(this.contents);this._save()},validate:function(el){var v=el.value;return v.match(/[><]/gi)===null},_save:function(){try{this.reqObj.text=this.contents;this.beforeSave.fire(this.reqObj);if(this.dntSaveExecuteCallback){if(this.callback&&this.callback.fn){this.callback.fn.apply(this.callback.scope||this,[this.reqObj])}}else{RoR.send(this.updateURI,App.helper.toQuery(this.reqObj),{customevents:{onSuccess:this._success,onFailure:this._failure},scope:this})}}catch(e){}},_success:function(type,args){var xhr=args[0];var resp=App.helper.evalJSON(xhr.responseText);if(resp&&resp.success){this.afterSave.fire(resp.result||resp)}else{this.failure(type,args)}},_failure:function(type,args){},undoChanges:function(e){if(this.element){this.element.innerHTML=this.contents}this.clearInput()},clearInput:function(){this.inputEl=null;this.contents=""},destroy:function(){YEvent.removeListener(this.element,"click",this.handleMouseEvent);this.beforeSave.unsubscribeAll();this.afterSave.unsubscribeAll();this.callback=null;this.element=null}}})(MangoSpring);(function(App){App.config.hasFocus=true;App.config.product=App.config.WEBIM;App.config.productPath=App.config.WEBIM_PATH;App.util.onWindowFocus=function(){App.config.hasFocus=true};App.util.onWindowBlur=function(){App.config.hasFocus=false};App.E.addBlurListener(YAHOO.env.ua.ie?document:window,App.util.onWindowBlur);App.E.addFocusListener(YAHOO.env.ua.ie?document:window,App.util.onWindowFocus);App.event.AppInit.subscribe(function(type,args){var resp=args[0];if(YAHOO.env.ua.ie==6||(YAHOO.env.ua.ie>0&&YAHOO.env.ua.ie<=6)){if(!App.C.get("no_ie6")){App.C.set("no_ie6","Y",{path:"/"});return App.util.ie6MsgBox()}return }if(resp.env==="qa"||resp.env==="local"){App.setDebugOn()}App.config.CommunitySettings(Ulib.clone(resp.room_obj));delete resp.room_obj;App.config.SessionSettings(Ulib.clone(resp));App.ui.socialBar=new App.ui.Taskbar("mango-taskbar",App.config.SessionConfig,App.config.Settings,resp);App.event.GlobalPresence.onSessionUserStateChange.fire(App.ui.socialBar.getState());if(resp.uiState!==App.config.OFFLINE_STATE&&!App.moduleSWFLoaded){YAHOO.lang.later(10000,this,function(){FABridge[FLASH_BRIDGE].root().loadChatModule(HOST_PREF,App.config.SessionConfig.get("env"));App.moduleSWFLoaded=true})}App.event.AppKill.subscribe(App.util.ChatMessageQueue.clearAll)},App,true);App.ui.Taskbar=function(id,config,settings,response){this.id=id;this.config=config;this.settings=settings;if(this.settings.has("domain_id","3")){App.config.productPath=App.config.SG_PATH}this._state=new App.ui.UIState(this,config.get("uiState"));this.stateChanged=new App.U.CustomEvent("UIStateChange",this,true,App.U.CustomEvent.FLAT);this.beforeOpenChat=new App.U.CustomEvent("beforeOpenChat",this,true,App.U.CustomEvent.FLAT);this.shrinkView=new App.U.CustomEvent("shrinkView",this,true,App.U.CustomEvent.FLAT);this.expandView=new App.U.CustomEvent("expandView",this,true,App.U.CustomEvent.FLAT);this.tabs={};this.lists=[];this.warnHash={};this.warnCount=0;this.caeser={tbs:{ust:"N",onl:"N",rls:"N",ono:[],grp:[]},fid:"",cid:""};this._init(response)};App.ui.Taskbar.className="";App.ui.Taskbar.prototype={_init:function(resp){try{var taskbar=domBuilder(document.body).div({id:this.id,style:"display:none"}).addClass(this.settings.get("theme")).div().addClass("mango-taskbar-tleft").end().div().addClass("mango-taskbar-tright").end().div({id:"mango-taskbar-inner"}).addClass("mango-clearfix").div({style:"float:left;"}).div({id:"mango-powered"}).addClass("mango-button-cont mango-powered-by").a({href:"http://mangospring.com/ce/mkt/communityim",target:"_blank",title:"Powered by MangoSpring"}).img({src:HOST_PREF+"/ce/images/powered_by.png"}).end().end().end().div({id:"mango-shrink"}).addClass("mango-button-cont mango-expand-collapse").a({href:"#"}).addClass("mango-collapse").text("Collapse").span().addClass("mango-tool-tip").text("Collapse").end().end().end().end().div({id:"mango-chat-buttons-bar"}).div({id:"mango-move-next",title:"View Next"}).addClass("mango-button-cont").end().div({id:"mango-chat-tab-cont"}).addClass("mango-button-cont").div({id:"mango-chat-tab-bar"}).end().end().div({id:"mango-move-prev",title:"View Previous"}).addClass("mango-button-cont").end().div({id:"mango-sound-cont",style:"width:1px;"}).addClass("mango-button-cont").end().div({id:"mango-list-buttons-cont"}).addClass("mango-buttons-wrapper").end().end().end();this.taskbarEl=taskbar.currentNode;this.listMediator=new App.ui.ListViewMediator();var listParent=App.$("mango-list-buttons-cont");var pop_cookie=App.config.PopStateCookie.get();if(this._state.getState()==App.config.ONLINE_STATE&&(!pop_cookie||pop_cookie.current_state=="PI")){App.model.users=new App.model.UserModel(resp.buddy_list.sort(function(a,b){if(a.presence_option_id==3){return -1}if(a.presence_option_id==3&&b.presence_option_id==3){return 0}if(a.presence_option_id==4&&(b.presence_option_id>4||b.presence_option_id<3)){return -1}return 1}));App.model.rooms=new App.model.RoomsModel(resp.room_list);domBuilder(document.body).div({id:"ms_flyout_container"},"afterBegin").addClass(App.config.Settings.get("theme"));App.ui.PresenceToaster=new App.ui.SlidingToaster("presence_toaster",{dir:"right",klas:"presence_toaster",dispTime:2500,close:true,community_name:"Notification"});if(this.settings.has("show_online_list","Y")){this.onlineListView=new App.ui.CompositeOnlineListView(App.config.ONLINE_TAB_ID,listParent,App.config.Settings,App.model.users,this.listMediator,this._state);this.stateChanged.subscribe(this.onlineListView.changeState,this.onlineListView,true);this.shrinkView.subscribe(this.onlineListView.vanish,this.onlineListView,true);this.expandView.subscribe(this.onlineListView.display,this.onlineListView,true)}if(this.settings.has("show_rooms_list","Y")){this.roomsListView=new App.ui.CompositeRoomsListView(App.config.ROOM_TAB_ID,listParent,App.config.Settings,App.model.rooms,this.listMediator,this._state);this.stateChanged.subscribe(this.roomsListView.changeState,this.roomsListView,true);this.shrinkView.subscribe(this.roomsListView.vanish,this.roomsListView,true);this.expandView.subscribe(this.roomsListView.display,this.roomsListView,true)}this._initPushChannel();JanusConnector(this.config.get("session_id"),this.config.get("felix_id"),this.config.get("user_name"),FLASH_BRIDGE,this.config.get("janus_url"),this.config.get("janus_port"))}this.userTabListView=new App.ui.CompositeUserSettingsListView(App.config.USER_TAB_ID,listParent,App.config.Settings,null,this.listMediator,this._state);this.stateChanged.subscribe(this.userTabListView.changeState,this.userTabListView,true);this.shrinkView.subscribe(this.userTabListView.hide,this.userTabListView,true);this.tabMgr=new App.ui.TabList(this);if(this._state.getState()==App.config.ONLINE_STATE&&(!pop_cookie||pop_cookie.current_state=="PI")){with(App.E){on(window,"beforeunload",this.writeWarnHash,null,this);on(window,"beforeunload",this.saveState,null,this)}this.buildWarnHash();this.buildState();this.updatesTab=new App.ui.CompositeUpdatesListView(App.config.UPDATES_TAB_ID,listParent,App.config.Settings,resp,this.listMediator,this._state);this.stateChanged.subscribe(this.updatesTab.changeState,this.updatesTab,true);this.shrinkView.subscribe(this.updatesTab.hide,this.updatesTab,true)}if(this._state.getState()!=App.config.SUSPEND_STATE){this.shrinkView.subscribe(this.toggleTaskbarView,this,true);this.expandView.subscribe(this.toggleTaskbarView,this,true)}if(this._state.getState()==App.config.ONLINE_STATE||this._state.getState()==App.config.SUSPEND_STATE){App.ui.popoutChat=new App.ui.PopoutTabView(App.config.POPOUT_TAB_ID,listParent,this._state,this,pop_cookie)}this.toggler=new App.ui.ExpandCollapse("mango-shrink",this,this._state.getState());App.D.setStyle(this.id,"display","");this.stateChanged.subscribe(this.goSuspendMode,this,true)}catch(e){}},_initPushChannel:function(){App.log("Connecting to Push Channel: Push Port: "+this.config.get("janus_port")+" :: IP = "+this.config.get("janus_url"));try{App.net.Socket=new App.net.SocketConnector(FABridge[FLASH_BRIDGE],this.config.get("felix_id"),this.config.get("session_id"),this.config.get("community_id"),this.config.get("user_name"),this.config.get("image_url"),this.config.get("janus_port"),this.config.get("janus_url"));App.net.Socket.chat.subscribe(this.handleResponsePacket,this,true);App.net.Socket.sysMsg.subscribe(this.handleSystemMessage,this,true);App.net.presenceMgr=new App.net.PresenceHandler(App.model.users);App.net.Socket.presence.subscribe(App.net.presenceMgr.onChange,App.net.presenceMgr,true);App.net.Reconnect=new App.ui.Reconnect();App.net.Socket.connectSuccess.subscribe(App.net.Reconnect.hide,App.net.Reconnect,true);App.net.Socket.connectError.subscribe(App.net.Reconnect.show,App.net.Reconnect,true);App.net.Socket.error.subscribe(App.net.Reconnect.dismiss,App.net.Reconnect,true)}catch(e){App.warn("Error is => %s at line %d",e.message,e.lineNumber||0)}},changeState:function(state){this._state=state;this.stateChanged.fire(state);App.event.GlobalPresence.onSessionUserStateChange.fire(state.getState())},getState:function(){return this._state.getState()},switchView:function(what){switch(what.toUpperCase()){case App.config.EXPAND:this.expandView.fire(what);break;case App.config.COLLAPSE:var count=this.tabMgr.getCount();if(count>0){if(confirm(_i18n("shrink-confirm",{count:count,suffix:(count>1?"s":"")}))){this.tabMgr.closeAll()}else{return this.toggler.undo()}}this.shrinkView.fire(what);break}},toggleTaskbarView:function(viewState){var anim=null;switch(viewState){case App.config.EXPAND:anim=new YAHOO.util.Anim(this.taskbarEl,{width:{to:100,from:10,unit:"%"}},0.2,YAHOO.util.Easing.easeOutStrong);break;case App.config.COLLAPSE:var attr={width:{to:this._state.getState()==App.config.OFFLINE_STATE?158:216}};anim=new YAHOO.util.Anim(this.taskbarEl,attr,0.2,YAHOO.util.Easing.easeOutStrong);break}if(anim){anim.animate()}},openChat:function(chatType,record,focused,bFetchHistory){var instance=this.tabMgr.get(record.getId(),chatType);this.beforeOpenChat.fire(record);if(!instance){instance=this.tabMgr.add(record.getId(),(chatType==App.config.CHAT_CONV_TYPE)?new App.ui.IM(this.tabMgr,record,chatType,focused,this.settings,this.config,bFetchHistory):new App.ui.GroupIM(this.tabMgr,record,chatType,focused,this.settings,this.config))}else{instance.toggle()}return instance},handleResponsePacket:function(packet){switch(packet.getType()){case"groupchat":var tabInstance=this.tabMgr.get(packet.getTo(),App.config.GROUP_CONV_TYPE);if(tabInstance){tabInstance.handleIMResponse(packet)}break;case"chat":var tabInstance=null;if(this.config.isYou(packet.getFrom())&&!packet.isTypingMsg()){tabInstance=this.tabMgr.findConvById(packet.getTo())}if(!tabInstance){tabInstance=this.tabMgr.get(packet.getFrom(),App.config.CHAT_CONV_TYPE)}if(tabInstance){tabInstance.handleIMResponse(packet)}else{if(packet.isTypingMsg()){return }if(this.config.isYou(packet.getFrom())){return }App.util.ChatMessageQueue.store(packet.getFrom(),{from:packet.getFrom(),type:packet.getType(),name:packet.getUserName(),text:packet.getBody(),to:this.config.get("felix_id"),time:App.helper.getTime(),msgId:App.helper.rand32()});var userObject=App.model.users.select(packet.getFrom());if(userObject){tab=this.openChat(App.config.CHAT_CONV_TYPE,userObject,true)}else{var data={member_name:packet.getUserName(),felix_user_id:packet.getFrom(),user_medium:packet.getPlatform()};var record=App.model.users.add(data.felix_user_id,data,true);if(record){tab=this.openChat(App.config.CHAT_CONV_TYPE,record,true)}}}break}},handleSystemMessage:function(xmpp){if(xmpp.isSystem()){if(xmpp.getCommunityId()&&!this.config.has("id",xmpp.getCommunityId())){return }var bPrintMsg=this.handleSubTypes(xmpp);if(bPrintMsg){var tabInstance=this.tabMgr.get(xmpp.getTo(),App.config.GROUP_CONV_TYPE);if(tabInstance){tabInstance.incomingSystemResponse(xmpp)}}}else{if(xmpp.getType()=="result"){}}},handleSubTypes:function(xmpp){var retVal=true;switch(xmpp.getMsgSubType()){case"VER":case"SEC":case"VLR":case"SLC":case"CVM":case"COM":retVal=false;break;case"CVR":var callTime=App.helper.renderTime(new Date());App.util.AudioVideoToaster.onCallCanceled(xmpp.getUserName(),"audio",callTime,xmpp.getTo(),xmpp.getUserId(),xmpp.getMsgSubType());break;case"COA":App.util.AudioVideoToaster.stopTimer("video",xmpp.getTo());App.util.AudioVideoToaster.hideToaster("video",xmpp.getTo());break;case"CVA":App.util.AudioVideoToaster.stopTimer("audio",xmpp.getTo());App.util.AudioVideoToaster.hideToaster("audio",xmpp.getTo());break;case"CVE":var callTime=App.helper.renderTime(new Date());App.util.AudioVideoToaster.onCallCanceled(xmpp.getUserName(),"audio",callTime,xmpp.getTo(),xmpp.getUserId(),xmpp.getMsgSubType());break;case"CVQ":var callTime=App.helper.renderTime(new Date());var obj=new App.util.AudioVideoToaster(xmpp.getUserName(),"audio",callTime,xmpp.getTo(),xmpp.getUserId());obj.show();break;case"COQ":var callTime=App.helper.renderTime(new Date());var obj=new App.util.AudioVideoToaster(xmpp.getUserName(),"video",callTime,xmpp.getTo(),xmpp.getUserId());obj.show();break;case"COR":var callTime=App.helper.renderTime(new Date());App.util.AudioVideoToaster.onCallCanceled(xmpp.getUserName(),"video",callTime,xmpp.getTo(),xmpp.getUserId(),xmpp.getMsgSubType());break;case"COE":var callTime=App.helper.renderTime(new Date());App.util.AudioVideoToaster.onCallCanceled(xmpp.getUserName(),"video",callTime,xmpp.getTo(),xmpp.getUserId(),xmpp.getMsgSubType());break;case"VEG":case"SJR":var room_members=App.model.rooms.getMembers(xmpp.getTo());if(room_members){var data={member_name:xmpp.getUserName(),felix_user_id:xmpp.getUserId(),is_authenticated:xmpp.isRealUser()?App.config.YES:App.config.NO,user_image:xmpp.getUserImage()};room_members.add(data.felix_user_id,data)}App.model.rooms.increaseCount(xmpp.getTo());this.notifySystemMsg(xmpp);break;case"VLG":case"SLR":var room_members=App.model.rooms.getMembers(xmpp.getTo());if(room_members){room_members.remove(xmpp.getUserId())}App.model.rooms.decreaseCount(xmpp.getTo());this.notifySystemMsg(xmpp);break;case"VDM":if(!App.model.users.select(xmpp.getUserId())){return }App.model.users.update(xmpp.getUserId(),{member_name:xmpp.getUserName()});break;case"VBR":this.handleBlockRequest();break;case"UFO":retVal=false;if(xmpp.getChatType()=="chat"){var tab=this.tabMgr.findConvById(xmpp.getTo());if(tab){tab.incomingSystemResponse(xmpp)}else{var record=this.addNewUserObject(xmpp.getUserId(),{member_name:xmpp.getUserName(),felix_user_id:xmpp.getUserId()},true);App.util.ChatMessageQueue.store(xmpp.getUserId(),{type:"S",name:xmpp.getUserName(),text:xmpp.getDesc(),to:this.config.get("felix_id"),time:App.helper.getTime(),msgId:App.helper.rand32()});this.openChat(App.config.CHAT_CONV_TYPE,record,true)}}else{if(xmpp.getChatType()=="groupchat"){var tab=this.tabMgr.get(xmpp.getTo(),App.config.GROUP_CONV_TYPE);if(tab){tab.incomingSystemResponse(xmpp)}else{}}}this.notifySystemMsg(xmpp);break;case"COF":var tab=this.tabMgr.findConvById(xmpp.getTo());if(tab){tab.incomingSystemResponse(xmpp)}retVal=false;break;case"UUP":var img_src=new RegExp('(]*href=")([^"]*)("[^>]*>)').exec(xmpp.getDesc())[2];if(this.config.isYou(xmpp.getUserId())){this.userTabListView.changeUserAvatar(img_src);this.config.set({image_url:img_src})}App.model.users.update(xmpp.getUserId(),{user_image:img_src});break;case"VWR":var recipientUserId=xmpp.getRecipientId();this.notifySystemMsg(xmpp);if(!this.config.isYou(recipientUserId)){return retVal}var warnCount=this.increaseWarnCount(xmpp.getUserId());if(warnCount>=this.settings.get("warn_count_limit")){this.handleBlockRequest()}break;case"RCM":break;case"USC":this.sessionTimedOut();break;case"RCA":var felix_id=xmpp.getUserId();var tabInstance=this.tabMgr.get(felix_id,App.config.CHAT_CONV_TYPE);if(tabInstance){var record=App.model.users.select(felix_id);tabInstance.close();this.openChat(App.config.CHAT_CONV_TYPE,record,true)}if(this.updatesTab){this.updatesTab.handleUpdates(xmpp)}break;case"RFC":if(this.updatesTab){this.updatesTab.handleUpdates(xmpp)}break;case"RCR":var tabInstance=this.tabMgr.get(xmpp.getUserId(),App.config.CHAT_CONV_TYPE);if(tabInstance){xmpp.desc=_i18n("reject-txt");tabInstance.incomingSystemResponse(xmpp)}}return retVal},notifySystemMsg:function(xmpp){var tab=null;if(xmpp.getChatType()=="chat"){tab=this.tabMgr.findConvById(xmpp.getTo())}else{if(xmpp.getChatType()=="groupchat"){tab=this.tabMgr.get(xmpp.getTo(),App.config.GROUP_CONV_TYPE)}}if(tab){tab.notifyMsgArrival(xmpp)}},addNewUserObject:function(id,obj,silent){return App.model.users.add(id,obj,silent)},increaseWarnCount:function(userIdWhoWarned){if(!this.warnHash[userIdWhoWarned]){this.warnHash[userIdWhoWarned]=1;this.warnCount++}return this.warnCount},buildWarnHash:function(){var warn_ck=App.C.get("warn");if(warn_ck){this.warnHash=App.J.parse(warn_ck);for(var key in this.warnHash){this.warnCount++}}},writeWarnHash:function(){var cookie_str=App.J.stringify(this.warnHash);App.C.set("warn",cookie_str,{path:"/"})},handleBlockRequest:function(){this.config.set({presence_id:App.config.OFFLINE_ID,custom_presence:App.config.OFFLINE_STATE});App.C.set("CBC",this.settings.get("id"),{path:"/",expires:new Date(new Date().getTime()+(3*24*60*60*1000))});this._state.goOfflineState();this.userTabListView.endSession({community_id:this.settings.get("id"),send_transcript:App.config.NO})},sessionTimedOut:function(){this.config.set({presence_id:App.config.OFFLINE_ID,custom_presence:App.config.OFFLINE_STATE});this._state.goOfflineState();this.userTabListView.endSession({community_id:this.settings.get("id"),send_transcript:App.config.NO});this.userTabListView.show()},logout:function(){this.config.set({presence_id:App.config.OFFLINE_ID,custom_presence:App.config.OFFLINE_STATE});this._state.goOfflineState();this.userTabListView.endSession({community_id:this.settings.get("id"),send_transcript:App.config.NO})},buildState:function(){var caeser=App.util.JSONCookie.get("caeser");if(App.L.isObject(caeser)&&(caeser.fid==this.config.get("felix_id")||caeser.fid==-1)&&caeser.cid==this.settings.get("community_hash")){for(var t in caeser.tbs){switch(t){case"ono":var onoList=caeser.tbs.ono;if(onoList.length>0){for(var i=0,len=onoList.length;i<len;++i){var ono=onoList[i];var key=App.helper.keys(ono)[0];var state=ono[key]||{unfocusMsgCount:0};var rec=App.model.users.select(key);if(!rec){rec=this.addNewUserObject(key,{member_name:"Opening...",felix_user_id:key},true)}App.config.currentTabCookies={unfocusMsgCount:state.unfocusMsgCount};var tabObj=this.openChat(App.config.CHAT_CONV_TYPE,rec,false);if(state.unfocusMsgCount>0){tabObj.onRecordLoaded.subscribe(tabObj.showNewMsg,tabObj,true)}delete App.config.currentTabCookies}}break;case"grp":var grpList=caeser.tbs.grp;if(grpList.length>0){for(var i=0,len=grpList.length;i<len;++i){var grp=grpList[i];var key=App.helper.keys(grp)[0];var state=grp[key]||{unfocusMsgCount:0};var rec=App.model.rooms.select(key);if(rec){App.config.currentTabCookies={unfocusMsgCount:state.unfocusMsgCount};var tabObj=this.openChat(App.config.GROUP_CONV_TYPE,rec,false);if(state.unfocusMsgCount>0){tabObj.onRecordLoaded.subscribe(tabObj.showNewMsg,tabObj,true)}delete App.config.currentTabCookies}}}break;case"ust":if(caeser.tbs[t]=="F"){}break;case"rls":if(caeser.tbs[t]=="F"){}break;case"onl":if(caeser.tbs[t]=="F"){}break}}}else{var ck=App.util.JSONCookie.get("usr_dtl")||"";if(this.config.has("is_auth","N")){this.userTabListView.show();App.helper.yellowFade(App.$("mango-name-tip"));App.D.setStyle("name_tip","display","")}}App.C.set("caeser","",{path:"/"})},saveState:function(){var key="";if(this.onlineListView&&this.onlineListView.isVisible()){key="onl"}else{if(this.roomsListView&&this.roomsListView.isVisible()){key="rls"}else{if(this.userTabListView.isVisible()){key="ust"}}}if(key){var ob={};ob[key]="F";this.extendCookieObject(ob)}var states=this.tabMgr.getTabStates();this.extendCookieObject({ono:states[0],grp:states[1]});App.util.JSONCookie.write("caeser",this.caeser)},extendCookieObject:function(obj){for(var k in obj){switch(k){case"ono":this.caeser.tbs.ono=this.caeser.tbs.ono.concat(obj[k]);break;case"grp":this.caeser.tbs.grp=this.caeser.tbs.grp.concat(obj[k]);break;default:this.caeser.tbs[k]=obj[k]}}this.caeser.fid=this.config.get("felix_id");this.caeser.cid=this.settings.get("community_hash")},goSuspendMode:function(state){if(state.getState()==App.config.SUSPEND_STATE){App.E.removeListener(window,"beforeunload",this.writeWarnHash);App.E.removeListener(window,"beforeunload",this.saveState);App.log(" channel disconnected ");App.net.Socket.disconnect()}},destroy:function(){this.stateChanged.unsubscribeAll();this.beforeOpenChat.unsubscribeAll();this.shrinkView.unsubscribeAll();this.expandView.unsubscribeAll();this.state=null;this.tabMgr=null;App.helper.removeEl(this.id);try{App.E.removeListener(window,"beforeunload",this.writeWarnHash);App.E.removeListener(window,"beforeunload",this.saveState);App.model.users.destroy();App.model.rooms.destroy();App.ui.PresenceToaster.destroy()}catch(e){}}};App.ui.PopoutTabView=function(id,parent,state,mediator,cookie){this.id=id;this.parentNode=App.$(parent);this.state=state;this.communityId=App.config.Settings.get("id");this.flexRoot=FABridge[FLASH_BRIDGE].root();this.suspendMode=false;this._init((cookie&&cookie.current_state=="PO"));mediator.stateChanged.subscribe(this.changeState,this,true);if(cookie){if(cookie.current_state=="PO"){this.suspendMode=true;this.writePOCookie();return this.initPopout(this.suspendMode)}}};App.ui.PopoutTabView.prototype={_init:function(suspendMode){domBuilder(this.parentNode).div({id:this.id}).addClass("mango-button-cont").div({id:"mango-popout-button"}).addClass("mango-tab-button").img({src:HOST_PREF+"/ce/images/transparent.gif"}).addClass("mango-popout-icon").end().end().div({id:"mango-popout-window-wrapper",style:"display:none"}).img({id:"mango-popout-preview",src:HOST_PREF+"/ce/images/popout-preview.png",style:"width:167px;height:117px"}).end().end();this.element=App.$(this.id);this.elementWrapper=App.$("mango-popout-window-wrapper");this.targetImage=App.$("mango-popout-preview");this.buttonEl=App.$("mango-popout-button");this.isInside=false;this.animShowRunning=false;this.animHideRunning=false;if(!suspendMode){App.util.MouseEvent.on(this.element,"mouseenter",this.mouseIn,this,true);App.util.MouseEvent.on(this.element,"mouseleave",this.mouseOut,this,true);this.animShow=new YAHOO.util.Anim(this.elementWrapper,{opacity:{to:1,from:0}},0.4,YAHOO.util.Easing.easeIn);this.animShow.onStart.subscribe(function(){this.animShowRunning=true},this,true);this.animShow.onTween.subscribe(function(){if(!this.isInside){this.animShow.stop();if(!YAHOO.env.ua.ie){App.D.setStyle(this.elementWrapper,"opacity","0")}}},this,true);this.animShow.onComplete.subscribe(function(){this.animShowRunning=false},this,true);App.E.on(this.element,"click",this.openPopup,null,this);var conf=App.config.SessionConfig;this.queryParams={communityHash:App.config.Settings.get("community_hash"),domainName:"sitegroup",environment:conf.get("env")=="local"?"qa":conf.get("env"),baseURL:HOST_DOMAIN,id:"",type:"",commId:App.config.Settings.get("id"),popout:App.config.YES,commName:App.config.Settings.get("name"),mango_external_uid:(typeof (mango_external_uid)!="undefined")?mango_external_uid:""}}},mouseIn:function(){this.isInside=true;App.D.setStyle(this.elementWrapper,"display","block");this._start()},mouseOut:function(){this.isInside=false;this._start()},_start:function(){if(this.isInside&&!this.animShowRunning){if(!YAHOO.env.ua.ie){this.animShow.animate()}}else{App.D.setStyle(this.elementWrapper,"display","none");if(!YAHOO.env.ua.ie){App.D.setStyle(this.elementWrapper,"opacity","0")}}},openPopup:function(){if(typeof (mango_show_po)!="undefined"&&mango_show_po==="N"){return alert(_i18n("upcoming"))}var newWin=window.open(HOST_PREF+"/ce/full_win.html?"+Ulib.toQuery(this.queryParams),"popWin","width=1000,height=600");if(!newWin){alert(_i18n("popup-block"));return }this.initPopout();newWin.focus()},initPopout:function(suspendMode){this.flexRoot.popOut(App.config.Settings.get("id"),"MangoSpring.ui.popoutChat.flashCallback",(suspendMode===true));this.state.goSuspendState();this.afterPopout();App.E.on(window,"beforeunload",this.destroyPopAction,null,this)},flashCallback:function(msg){switch(msg){case"FW_OPEN":this.writePOCookie();if(this.state.getState()!=App.config.SUSPEND_STATE){this.state.goSuspendState();this.afterPopout()}break;case"FW_SIGNOUT":this.popupClose("loggedout");break;case"CLOSE":this.popupClose();break}},writePOCookie:function(){App.config.PopStateCookie.write({current_state:"PO",communityId:this.communityId})},writePICookie:function(){App.config.PopStateCookie.write({current_state:"PI",communityId:this.communityId})},afterPopout:function(){this.elementWrapper.parentNode.removeChild(this.elementWrapper);App.E.purgeElement(this.element);this.buttonEl.innerHTML="";domBuilder(this.buttonEl).a({href:"#"}).addClass("pop-back-in").text(_i18n("pop-back")).end().append(document.createTextNode(" "+_i18n("pop-mode-msg")));App.D.addClass(this.buttonEl,"pop-in");App.D.setStyle("mango-taskbar","width",!YAHOO.env.ua.ie?"375px":"415px");App.E.on(this.element,"click",this.popBackIn,null,this)},popBackIn:function(e){var el=App.E.getTarget(e);if(el.className.match("pop-back-in")){this.flexRoot.popIn();this.popupClose()}App.E.stopEvent(e)},popupClose:function(name){this.writePICookie();if(name=="loggedout"){App.C.set("off_state","Y",{path:"/"});this.buttonEl.innerHTML="";domBuilder(this.buttonEl).text("").a({href:"#"}).addClass("pop-go-online").on("click",this.popupClose,null,this).text(_i18n("go-online")).end().append(document.createTextNode(" "+_i18n("offline-txt")));App.E.removeListener(this.element,"click",this.popBackIn);App.event.GlobalPresence.onSessionUserStateChange.fire(App.config.OFFLINE_STATE)}else{App.E.purgeElement(this.element);this.buttonEl.innerHTML=_i18n("pop-reload");this.reloadSocialBar()}App.E.removeListener(window,"beforeunload",this.destroyPopAction,null,this)},reloadSocialBar:function(){this.state.goOnlineState()},destroy:function(){App.helper.removeEl(this.element);App.E.removeListener(this.element,"click",this.popBackIn)},destroyPopAction:function(){},changeState:function(state){if(state.getState()==App.config.OFFLINE_STATE){this.destroy()}}};App.ui.ExpandCollapse=function(id,mediator,state){this.id=id;this.mediator=mediator;this.cookieName="mango-expand";this.state="";this.lastAction="";this.cookie=this._getCookie();this.mediator.stateChanged.subscribe(this.handleTaskbarState,this,true);this.mediator.beforeOpenChat.subscribe(function(){if(this.state==App.config.COLLAPSE){this.expand()}},this,true);this._init();if(state==App.config.SUSPEND_STATE){this.handleTaskbarState(mediator._state)}};App.ui.ExpandCollapse.prototype={_init:function(){this.element=App.$(this.id);this.tip=this.element.getElementsByTagName("span")[0];this.poweredBy=App.$("mango-powered");this._setState();App.E.on(this.element,"click",this.changeState,null,this)},_setState:function(){if(this.cookie===App.config.COLLAPSE){this.state=App.config.COLLAPSE;this.collapse()}else{this.state=App.config.EXPAND;this.expand()}},_getCookie:function(){return App.C.get(this.cookieName)},_setCookie:function(v){App.C.set(this.cookieName,v,{path:"/"})},handleTaskbarState:function(state){if(state.getState()==App.config.SUSPEND_STATE){App.D.setStyle(this.element,"display","none");App.D.setStyle(this.poweredBy,"display","");App.E.removeListener(this.element,"click",this.changeState)}this._setCookie("0")},changeState:function(e){if(e){App.E.stopEvent(e)}if(this.state==App.config.EXPAND){this.collapse()}else{this.expand()}},expand:function(){this._doExpand();this.lastAction=App.config.EXPAND;this.mediator.switchView(this.state)},_doExpand:function(){this.state=App.config.EXPAND;this._setCookie(this.state);this.tip.innerHTML=_i18n("shrink");App.D.replaceClass(this.tip.parentNode,"mango-collapse","mango-expand");App.D.removeClass(this.element,"mango-do-collapse");App.D.setStyle(this.poweredBy,"display","")},collapse:function(){this._doCollapse();this.lastAction=App.config.COLLAPSE;this.mediator.switchView(this.state)},_doCollapse:function(){this.state=App.config.COLLAPSE;this._setCookie(this.state);this.tip.innerHTML=_i18n("expand");App.D.replaceClass(this.tip.parentNode,"mango-expand","mango-collapse");App.D.addClass(this.element,"mango-do-collapse");App.D.setStyle("mango-powered","display","none")},undo:function(){if(this.lastAction==App.config.EXPAND){this._doCollapse()}else{if(this.lastAction==App.config.COLLAPSE){this._doExpand()}}}};App.ui.TabList=function(parent){this.tabs={};this.tabSlider=new App.ui.TabSlider(this);this.currentSelected=null;this.tabCount=0;this.parent=parent};App.ui.TabList.prototype={add:function(id,instance){var key=instance.chatType.toLowerCase()+id;if(!this.tabs[key]){this.tabs[key]=instance;instance.onBlurWindow.subscribe(this.unselectTab,this,true);instance.onFocusWindow.subscribe(this.selectTab,this,true);instance.onClose.subscribe(this.closeTab,this,true);this.parent.stateChanged.subscribe(instance.handleStateChange,instance,true);this.selectTab(instance);this.tabSlider.addToList(key);this.tabCount++}return this.tabs[key]},selectTab:function(instance){var id=instance.chatType.toLowerCase()+instance.id;this.toggleSelected(id);this.selectedTab=id},unselectTab:function(){this.selectedTab=null},closeTab:function(type,args){var id=args[0];var type=args[1];var dntFireCloseCall=args[2];this.tabSlider.close(type.toLowerCase()+id);this.remove(id,type.toLowerCase())},toggleSelected:function(id){if(this.selectedTab&&this.selectedTab!=id&&this.tabs[this.selectedTab]&&this.tabs[this.selectedTab].focused){this.tabs[this.selectedTab].toggle()}},get:function(id,type){var key=type.toLowerCase()+id;return this.tabs[key]},remove:function(id,type){var key=type.toLowerCase()+id;delete this.tabs[key];this.tabCount--},getCount:function(){return this.tabCount},getLastTab:function(){var tb=null;for(var t in this.tabs){tb=this.tabs[t]}return tb},closeAll:function(){for(var t in this.tabs){this.tabs[t].close(true)}},findConvById:function(conv_id){for(var cKey in this.tabs){if(this.tabs[cKey].conv_id==conv_id){return this.tabs[cKey]}}return null},forEachTab:function(fn,scope){if(!App.L.isFunction(fn)){return }scope=scope||this;var result=[];for(tb in this.tabs){var n=fn.apply(scope,[this.tabs[tb],tb]);if(n){result.push(n)}}return result},getTabStates:function(){var ono=[];var grp=[];var r={};var temp={};for(var t in this.tabs){var isGroupChat=this.tabs[t].isGroupChat();var unfocusMsgCount=(typeof (this.tabs[t].unfocusMsgCount)=="undefined"?0:this.tabs[t].unfocusMsgCount);if(this.selectedTab!=t){r[this.tabs[t].id]={focused:"N",unfocusMsgCount:isGroupChat?unfocusMsgCount:0};isGroupChat?grp[grp.length]=r:ono[ono.length]=r}else{temp.id=this.tabs[t].id;temp.state={focused:"F",unfocusMsgCount:isGroupChat?unfocusMsgCount:0};temp.gchat=isGroupChat}r={}}if(temp&&temp.id){r[temp.id]=temp.state;temp.gchat?grp[grp.length]=r:ono[ono.length]=r}return[ono,grp]}};App.ui.TabSlider=function(mediator){this.tabWidth=141;this.tabList=[];this.tabPos={};this.tabsToShow=3;this.startIndex=null;this.mediator=mediator;this.init()};App.ui.TabSlider.prototype={init:function(){this.nextArrow=App.D.get("mango-move-next");this.prevArrow=App.D.get("mango-move-prev");App.E.on(this.nextArrow,"click",this.moveNext,this,true);App.E.on(this.prevArrow,"click",this.movePrev,this,true);var w=App.D.getViewportWidth();w-=(75+112+112+30+30);this.maxTabWidth=w-138;this.tabsToShow=parseInt(this.maxTabWidth/this.tabWidth);this.tabsToShow=this.tabsToShow>=5?5:this.tabsToShow},rearrange:function(){for(var i=this.tabList.length-1;i>=0;--i){var type=this.tabList[i].substring(0,1);var id=this.tabList[i].substring(1);if(i>this.startIndex||i<=(this.startIndex-this.tabsToShow)){var t=this.mediator.get(id,type);if(t){t.vanish()}}else{var t=this.mediator.get(id,type);if(t){t.display()}}}},_build:function(){if(!this.isShowArrow()){this.hideArrow()}this.setPosition();this.rearrange()},close:function(key){var id=key;for(var i=0;i<this.tabList.length;i=i+1){if(this.tabList[i]==id){this.tabList.splice(i,1);break}}this._build()},isShowArrow:function(){return(this.tabList.length>this.tabsToShow)},addToList:function(id){var pos=this.tabList.push(id);this.setPosition();if(this.isShowArrow()){this.rearrange();this.showArrow()}},setPosition:function(){this.startIndex=this.tabList.length-1},movePrev:function(){if((this.startIndex-this.tabsToShow)<0){return }if(this.tabList.length>=this.tabsToShow){this.mediator.toggleSelected()}this.startIndex--;this.rearrange()},moveNext:function(){if((this.tabList.length-1)==this.startIndex){return this.setPosition()}if(this.tabList.length>=this.tabsToShow){this.mediator.toggleSelected()}this.startIndex++;this.rearrange()},hideArrow:function(){App.D.setStyle([this.nextArrow,this.prevArrow],"display","none")},showArrow:function(){App.D.setStyle([this.nextArrow,this.prevArrow],"display","block")}};App.util.ActivityHandler=function(){};App.util.ActivityHandler.prototype.addSuccessor=function(successor){this._successor=successor};App.util.ActivityHandler.prototype.handleRequest=function(req){if(this.canHandle(req)){this.handleActivity(req)}else{if(this._successor){this._successor.handleRequest(req)}}};App.util.ActivityHandler.prototype.canHandle=function(){return false};App.util.ActivityHandler.prototype.handleActivity=function(){};App.ui.IM=function(tabMgr,record,chatType,isFocused,settings,config,history){this.tabMgr=tabMgr;this.settings=settings;this.config=config;this.record=record;this.id=record.getId();this.name=record.getName();this.firstName=App.helper.firstName(this.name);this.headerPic=App.helper.formatImage(record.getImage());this.history=history;this.msgQueue=App.util.ChatMessageQueue;this.messages=null;this.isFocused=(isFocused===undefined||isFocused===null)?true:isFocused;this.chatType=chatType||"S";this.soundIndex=8;this.soundVolume=200;this.focused=false;this.recordLoaded=false;this.unfocusMsgCount=(App.config.currentTabCookies&&App.config.currentTabCookies.unfocusMsgCount)?App.config.currentTabCookies.unfocusMsgCount:0;this.pendingMsgs=[];this.typingTimer=null;this.lastSentStatus="0";this.isStoreMessage=this.settings.has("msgs_persistable",App.config.NO);this.lastPresenceOptionId=null;this.convState="";this.onRenderComplete=new YAHOO.util.CustomEvent("renderComplete",this,true,App.U.CustomEvent.FLAT);this.onFocusWindow=new YAHOO.util.CustomEvent("windowFocus",this,true,App.U.CustomEvent.FLAT);this.onBlurWindow=new YAHOO.util.CustomEvent("windowBlur",this,true,App.U.CustomEvent.FLAT);this.onClose=new YAHOO.util.CustomEvent("windowClose",this,true,App.U.CustomEvent.LIST);this.onRecordLoaded=new YAHOO.util.CustomEvent("recordLoaded",this,true,App.U.CustomEvent.FLAT);this.onRenderComplete.subscribe(this.doInitComplete,this,true);this.linkProcessor=new App.util.HyperlinkProcessor();this.smileyParser=new App.util.SmileyParser();this.fragment=document.createDocumentFragment();this.loadReqObj={};this._createUI();if(!this.history){this.getHistory()}this.initPresenceHandler()};App.ui.IM.prototype={maxTitleLen:20,maxTabNameLen:12,maxStatusLen:40,handleWidth:136,popWinWidth:226,popWinHeight:250,minInputHeight:13,msgBunchTime:60000,typingInterval:5000,fileUploadLinkRegex:new RegExp("mangospring/public/files/uploaded_content","i"),fileNameEndMatchRegex:new RegExp("([^_]+)$","i"),doInitComplete:function(){this.loadReqObj.felix_user_id=this.id;this.messages=this.isStoreMessage?this.msgQueue.get(this.id):null;this.onRecordLoaded.subscribe(this.updateModel,this,true);this.onRecordLoaded.subscribe(this.createActionList,this,true);this.onFocusWindow.subscribe(this.scrollBottom,this,true);this.onFocusWindow.subscribe(this.focusInputBox,this,true);this.onFocusActions();this.onRecordLoaded.subscribe(function(){if(App.L.isUndefined(this.has_blocked)||this.has_blocked=="N"||this.isPendingState()){this.enableBox();this.focusInputBox()}},this,true)},_insertAdImage:function(){var adObj=App.ads.getRandomAd();domBuilder(this.chatContent).a({href:adObj.link,title:adObj.title||"",target:"_new",style:"display:block;overflow:hidden;text-align:center"}).img({src:adObj.src}).end().end()},_createUI:function(){var chatWindowWrapperId="chat_window_container_"+this.chatType+this.id;var chatConvId="";var headerId="chat_box_header_"+this.chatType+this.id;var headerPicId="chat_box_pic_"+this.chatType+this.id;var headerPicSrc=this.headerPic||this.defaultPicSrc;var chatInfoId="chat_detail_"+this.chatType+this.id;var chatInfoStatusId="chat_presence_status_"+this.chatType+this.id;var chatInfoStatusTime="chat_presence_status_time_"+this.chatType+this.id;var chatConvId="chat_conv_"+this.chatType+this.id;var chatConvContentId="chatPane"+this.chatType+this.id;var chatHistoryErrorId="chat_history_error_"+this.chatType+this.id;var chatAvailMsgId="chat_not_avail_div_"+this.chatType+this.id;var inputBoxId="inputMsgBox"+this.chatType+this.id;var tabCountId="tab_count_"+this.chatType+this.id;var tabUnfocusMsgCount="unfocus_msg_count_"+this.chatType+this.id;var tabCount=0;var tabName=App.helper.truncate(this.name,this.maxTabNameLen);var titleName=App.helper.truncate(this.name,this.maxTitleLen);var obj=this.record;var status_msg=App.helper.truncate(obj.custom_presence,this.maxStatusLen);var full_status=obj.custom_presence;var presence_cls=!this.isGroupChat()?App.helper.getPresenceClass(this.record.presence_option_id):"";var iefix=(QUIRKS_MODE&&!this.focused&&YAHOO.env.ua.ie);if(obj.isAdmin&&obj.isAdmin()){presence_cls=presence_cls+" "+presence_cls+"_A"}else{if(obj.isModerator&&obj.isModerator()){presence_cls=presence_cls+" "+presence_cls+"_M"}}var tabMarkUp=['<div class="mango-chat-button ',presence_cls,'">','<div class="mango-tab-click" title="Show/Hide Chat Window">','<div class="mango-tab-caption">',tabName,"</div>","</div>",'<div id="',tabCountId,'" class="mango-tab-count" style="display: none;">',tabCount,"</div>",'<div style="display:none" class="mango-new-msg">New: <span id="',tabUnfocusMsgCount,'">0</span></div>','<div class="mango-tab-close" title="Close Chat Window"></div>',(iefix?"</div>":""),'<div id="',chatWindowWrapperId,'" class="mango-chat-window-container" style="',(iefix?"display:none":""),'">','<div class="mango-chat-window">','<div id="',headerId,'" class="mango-chat-box-header">','<div class="mango-window-buttons"><a onclick="return false;" class="mango-close" title="Close Window"></a>','<a class="minimize" title="Minimize Chat Window"></a>',"</div>",'<a href="',obj.getPageURL(),'"><img style="display: block;" title="',this.name,'" id="',headerPicId,'" class="mango-chat-box-pic" src="',headerPicSrc,'"/></a>','<div class="mango-chat-box-header-name">',titleName,"</div></div>",'<div id="',chatInfoId,'" class="mango-chat-detail">','<span id="',chatInfoStatusTime,'" class="mango-chat-presence-status-time" title="',full_status,'">',status_msg,"</span>&nbsp;<br/>",'<span id="',chatInfoStatusId,'" class="mango-chat-presence-status"></span>',"</div>",'<div id="',chatConvId,'" class="mango-chat-conv">','<div id="',chatConvContentId,'" class="mango-chat-conv-content"></div></div>','<div class="mango-chat-message-div" id="',chatAvailMsgId,'">','<div class="mango-chat-not-avail">Loading chat...</div>','<div class="mango-chat-send-message"></div></div>','<div class="mango-chat-input-cont">','<textarea id="',inputBoxId,'" class="mango-chat-input" style="width: 198px; height: 13px;"></textarea>',"</div>",(iefix?"</div>":""),"</div>"];this.tab_handle=document.createElement("div");var chat_tab_bar=App.D.get("mango-chat-tab-bar");var hasTab=null;this.tab_handle.innerHTML=tabMarkUp.join("");hasTab=App.S.query("div.mango-tab",chat_tab_bar,true);if(hasTab){chat_tab_bar.insertBefore(this.tab_handle,hasTab)}else{chat_tab_bar.appendChild(this.tab_handle)}this.tab_handle.id="tab_"+this.chatType+this.id;this.tab_handle.className="mango-tab";this.tab_handle.style.width=this.handleWidth+"px";this.tab_handle.style.display="block";this.chatWinWrapper=App.D.get(chatWindowWrapperId);this.chatHeader=App.D.get(headerId);this.titleElement=App.S.query("div.mango-chat-box-header-name",this.chatHeader,true);this.headerPicEl=App.D.get(headerPicId);this.chatInfo=App.D.get(chatInfoId);this.chatInfoStatus=App.D.get(chatInfoStatusId);this.chatInfoTime=App.D.get(chatInfoStatusTime);this.chatConv=App.D.get(chatConvId);this.chatContent=App.D.get(chatConvContentId);this.chatInput=App.D.get(inputBoxId);this.chatNotAvail=App.D.get(chatAvailMsgId);this.unfocusMsgEl=App.D.get(tabUnfocusMsgCount);App.E.on(this.tab_handle,"click",this.tabClick,null,this);this.keyListener=new YAHOO.util.KeyListener(this.chatInput,{keys:13},{fn:this.keyDown,scope:this,correctScope:true});this.keyListener.enable();App.E.addFocusListener(this.chatInput,this._startTyping,null,this);App.E.addBlurListener(this.chatInput,this._stopTyping,null,this);this.onRenderComplete.fire()},createActionList:function(){if(this.chatInfoStatus&&this.chatInfoStatus.getElementsByTagName("a").length==0){domBuilder(this.chatInfoStatus).a({href:"#"}).on("click",this.toggleActionList,null,this).text(_i18n("vw-action"))}var list_cont=document.createElement("div");list_cont.className="mango-group-member-list mango-action-list";var el=App.D.insertAfter(list_cont,this.chatInfoStatus);this.actionList=new App.ui.ChatActionList(el,this.settings,this.record,this);this.actionList.createMenu();this.hideMenuOnClick()},hideMenuOnClick:function(){App.E.on(this.tab_handle,"click",this._hideMenuList,null,this)},_hideMenuList:function(e){var target=App.E.getTarget(e);var isFileInput=(target.tagName.toLowerCase()=="input"&&target.type.toLowerCase()=="file")?true:false;if(this.actionList&&this.actionList.hasFocus()&&!isFileInput){this.toggleActionList()}},toggleActionList:function(e){try{App.E.stopEvent(e)}catch(e){}this.actionList.toggle();var tElem=this.chatInfoStatus.getElementsByTagName("a")[0];var labelTxt=_i18n("vw-action");if(this.actionList.focused){labelTxt=_i18n("hd-action")}if(tElem){tElem.innerHTML=labelTxt}},onFocusActions:function(){this.handleResize();if(this.isFocused){this.focused=true;this._show()}},focusInputBox:function(){if(this.focused){App.helper.activate(this.chatInput.id)}},handleResize:function(){var convWinWidth;var newTabHeight;var newTextWidth;var heightExtra=31;convWinWidth=this.popWinWidth;newTabHeight=this.popWinHeight;newTextWidth=this.popWinWidth-28;this.chatHeader.style.width=convWinWidth+"px";this.chatInfo.style.width=(convWinWidth-55)+"px";this.chatInput.style.width=newTextWidth+"px";if(QUIRKS_MODE){this.chatInput.style.cssText="width:223px;height:23px;";if(YAHOO.env.ua.ie){this.chatInfo.style.width=convWinWidth+"px"}}this.chatConv.style.width=convWinWidth+"px";this.chatConv.style.height=(newTabHeight-heightExtra-this.minInputHeight)+"px"},handleStateChange:function(state){if(state.getState()==App.config.OFFLINE_STATE||App.config.SUSPEND_STATE==state.getState()){this.close(true)}},changeTabName:function(name){var el=App.S.query("div.mango-chat-box-header-name",this.chatHeader,true);if(el){el.innerHTML=App.helper.truncate(name,this.maxTitleLen)}el=App.S.query("div.mango-tab-caption",this.tab_handle,true);if(el){el.innerHTML=App.helper.truncate(name,this.maxTabNameLen)}this.firstName=App.helper.firstName(name);this.name=name},changeTabPhoto:function(image_src){if(this.headerPicEl){this.headerPicEl.src=image_src}this.headerPic=image_src},initPresenceHandler:function(){App.model.users.onUpdate.subscribe(this.handleUpdate,this,true)},tabClick:function(e){var targ=App.E.getTarget(e);this.hideNewMsg();if(App.D.hasClass(targ,"mango-tab-close")||App.D.hasClass(targ,"mango-close")){this.close(false);App.E.stopEvent(e)}else{if(App.D.hasClass(targ,"mango-tab-click")||App.D.hasClass(targ,"minimize")||App.D.hasClass(targ,"mango-tab-caption")){this.toggle();App.E.stopEvent(e)}else{if(App.D.hasClass(targ,"mango-feed")){this.handleFeeds(targ);App.E.stopEvent(e)}else{if(App.D.hasClass(targ,"mango-rfc")){this.handlePrivateChatRequest();App.E.stopEvent(e)}else{if(targ.href&&targ.href.match(this.fileUploadLinkRegex)){var match=targ.href.match(this.fileNameEndMatchRegex);if(match&&match[1]){var msg=_i18n("file-seen",{file:match[1],user:App.helper.firstName(this.config.get("user_name"))});Janus.hasSeenFile({conv_id:this.conv_id,message:msg})}}else{this.focusInputBox()}}}}}},handleFeeds:function(targ){try{var mca=targ.parentNode.getAttribute("msgCreatedAt");if((targ.parentNode.tagName.toLowerCase()=="p")&&mca){var screenWidth=(screen.width/2)-300,screenHeight=(screen.height/2)-200,params=Ulib.toQuery({conversation_id:this.conv_id,message_id:mca});var win=window.open(HOST_PREF+this.config.get("feedDescURI")+"?"+params,"feedDesc","scrollbars=yes,menubar=0,resizable=1,width=600,height=350,left="+screenWidth+",top="+screenHeight);if(!win){alert(_i18n("popup-block"))}}}catch(e){}},handlePrivateChatRequest:function(){if(!this.inviteReqWin){this.inviteReqWin=new App.ui.SendRFCRequest(this.id,this.name,this.conv_id)}this.inviteReqWin.show()},toggle:function(){if(this.focused){this._hide()}else{this._show()}},_show:function(){App.D.addClass(this.tab_handle,"mango-focused");if(QUIRKS_MODE&&YAHOO.env.ua.ie){App.D.setStyle(this.chatWinWrapper,"display","block")}this.focused=true;this.onFocusWindow.fire(this)},_hide:function(){App.D.removeClass(this.tab_handle,"mango-focused");if(QUIRKS_MODE&&YAHOO.env.ua.ie){App.D.setStyle(this.chatWinWrapper,"display","none")}this.focused=false;this.onBlurWindow.fire(this)},display:function(){App.D.setStyle(this.tab_handle,"display","")},vanish:function(){App.D.setStyle(this.tab_handle,"display","none")},close:function(dontFireCloseCall){this.unloadListeners();var id=this.id;App.helper.removeEl(this.tab_handle);this.onClose.fire(id,this.chatType,dontFireCloseCall);setTimeout(function(){App.util.ChatMessageQueue.doPurge(id)},0)},unloadListeners:function(){App.E.removeListener(this.tab_handle,"click",this.tabClick);this.keyListener.disable();this.onRenderComplete.unsubscribeAll();this.onRecordLoaded.unsubscribeAll();this.onFocusWindow.unsubscribeAll();this.onBlurWindow.unsubscribeAll();this.linkProcessor=null;this.smileyProcessor=null;this.onRenderComplete=null;this.onRecordLoaded=null;this.onFocusWindow=null;this.onBlurWindow=null;App.E.purgeElement(this.chatInput);if(this.inviteReqWin){this.inviteReqWin.destroy()}try{App.ui.socialBar.stateChanged.unsubscribe(this.handleStateChange,this);App.model.users.onUpdate.unsubscribe(this.handleUpdate,this);this.typingTimer.cancel()}catch(e){}},handlePresence:function(obj){if(obj.getId()==this.id){var cls=App.helper.getPresenceClass(obj.presence_option_id);var dv=App.S.query("div.mango-chat-button",this.tab_handle,true);if(obj.isAdmin&&obj.isAdmin()){cls=cls+" "+cls+"_A"}else{if(obj.isModerator&&obj.isModerator()){cls=cls+" "+cls+"_M"}}if(dv){dv.className="mango-chat-button "+cls}cust_msg=App.helper.truncate(obj.getPresenceMsg(),this.maxStatusLen);if(cust_msg){this.chatInfoTime.innerHTML=cust_msg;this.chatInfoTime.title=obj.getPresenceMsg();App.helper.yellowFade(this.chatInfoTime)}}},handleUpdate:function(rec){if(this.id!=rec.getId()){return }this.record.update(rec);this.handlePresence(rec);if(this.lastPresenceOptionId!=rec.getPresenceId()){this.notifyPresenceStatus();this.lastPresenceOptionId=rec.getPresenceId()}this.changeTabName(rec.getName());this.changeTabPhoto(rec.getImage());this.actionList.refresh()},isGroupChat:function(){return(this.chatType==="G")},isPendingState:function(){return(this.convState==="P")},loadRecords:function(record){if(!record.conv_id){return }this.history={msgs:this.messages||this._formatHistoryMsgs(record.history),members:record.members,felix_id:record.user_id,user_name:record.user_name};if(this.isGroupChat()){var memberCounts={memberCounts:{online_member_count:record.active_user_count,moderator_count:record.moderator_count}};this.history=App.L.merge(this.history,memberCounts)}this.has_blocked=record.has_blocked},_formatHistoryMsgs:function(history){if(!history){return }var result=[];var msgArr=[];for(var j=0,ln=history.length;j<ln;j++){if(history[j].msgs.length>0){msgArr=history[j].msgs;for(var i=0,len=msgArr.length;i<len;++i){result[result.length]={from:msgArr[i].from_user_id,to:msgArr[i].to_id,name:history[j].user_name,text:msgArr[i].message,type:msgArr[i].msg_type,msgSubType:msgArr[i].msg_sub_type,time:new Date(msgArr[i].updated_at).getTime(),msgCreatedAt:msgArr[i].created_at}}}}return result},getHistory:function(){this.disableBox();var isSubc=this.record.isSubscriber();if(isSubc){this.loadReqObj.community_id=this.setings.get("community_id")}var uri=isSubc?this.config.get("subcHistURI"):this.config.get("buddyHistURI");this.loadReqObj.fetch_history=this.isStoreMessage?App.config.NO:App.config.YES;RoR.send(uri,Ulib.toQuery(this.loadReqObj),{success:this._parseHistoryJSON,scope:this})},_parseHistoryJSON:function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){this.loadHistoryComplete(resp)}else{if(resp&&resp.error){if(resp.error_code=="NO_SESSION"){App.ui.socialBar.sessionTimedOut();return setTimeout(function(){alert(resp.error)},50)}this.showChatMsg(resp.error)}return }if(App.L.isArray(xhr.argument)){for(var i=0;i<xhr.argument.length;++i){if(App.L.isFunction(xhr.argument[i])){xhr.argument[i].apply(this||window,[resp,xhr])}}}xhr=null},loadHistoryComplete:function(resp){this.setConvState(resp.state);this.setConvId(resp.conv_id);if(!this.isPendingState()){this.loadRecords(resp);this.setHistory()}else{this.notifyPendingStateMessage()}this.clearChatMsg();this.scrollBottom();this.history=null},setHistory:function(){var msgs=(this.history&&this.history.msgs&&this.history.msgs.length>0)?this.history.msgs:null;if(msgs){var markup="";for(var i=0;i<msgs.length;++i){if(msgs[i].type=="S"){this._renderSysMsg(Ulib.clone(msgs[i]))}else{this._renderMsg(Ulib.clone(msgs[i]))}}this.addConvFragment()}this.onRecordLoaded.fire()},clearChatMsg:function(){this.chatNotAvail.innerHTML="";App.D.setStyle(this.chatNotAvail,"display","none")},showChatMsg:function(msg){this.chatNotAvail.innerHTML=msg;App.D.setStyle(this.chatNotAvail,"display","block");App.helper.yellowFade(this.chatNotAvail)},disableBox:function(){this.chatInput.disabled=true;App.D.setStyle(this.chatInput,"cursor","not-allowed")},enableBox:function(){this.chatInput.disabled=false;App.D.setStyle(this.chatInput,"cursor","text")},setConvId:function(conv_id){this.conv_id=conv_id;this.record.update({conv_id:conv_id})},setConvState:function(state){this.convState=state},updateModel:function(){var user_object=null;for(var i=0;i<2;i++){var id=this.history.members[i].felix_user_id;if(id==this.record.getId()){App.model.users.update(id,this.history.members[i]);return }}},keyDown:function(type,args,obj){var evnt=args[1];var input=App.E.getTarget(evnt);App.E.stopEvent(evnt);var text=App.L.trim(input.value);if(!text&&!text.match(/[^\s]/)){return this.clearInput()}text=text.substring(0,App.config.MAX_MSG_LEN);this.sendText(text);this.clearInput()},clearInput:function(){this.chatInput.value=""},sendText:function(msg){var pending_msg={type:"U",text:msg,name:this.config.get("user_name"),to:this.record.getId(),from:this.config.get("felix_id"),time:App.helper.getTime(),msgId:App.helper.rand32()};this._sendMessage(pending_msg);this._renderMsg(pending_msg);this.addConvFragment();this.scrollBottom();this.lastChrVal="";this.lastSentStatus=App.config.BLANK},_sendMessage:function(item){try{var send_data={message:item.text,conv_id:this.conv_id,name:item.name};if(this.isStoreMessage){this.msgQueue.store(this.id,item)}if(!this.isGroupChat()&&this.record.isOffline()){send_data.felix_user_id=this.record.getId();return Janus.sendOfflineMessage(send_data)}Janus.sendMessage(send_data)}catch(e){}},addConvFragment:function(){this.chatContent.appendChild(this.fragment)},_renderMsg:function(msgObj){var newDate=new Date();newDate.setTime(msgObj.time);var klas="other",output="";var from_self=this.config.isYou(msgObj.from);this._renderDateRow(msgObj.time);if(from_self){klas="you"}msgObj.text=App.helper.escapeHTML(msgObj.text);msgObj.text=this.linkProcessor.process(msgObj.text);msgObj.text=this.smileyParser.parse(msgObj.text);this._insertANE(msgObj);if(this.lastLogMsg&&this.lastLogMsg.name==msgObj.name&&this.lastLogMsg.type!="S"&&this.lastLogMsg.from==msgObj.from&&msgObj.time-this.lastLogMsg.time<this.msgBunchTime){}else{domBuilder(this.fragment).h5().addClass(klas).span().addClass("mango-time-stamp ts_"+klas).text(App.helper.renderTime(newDate)).end().span().addClass("ms_chat_name").text(App.helper.firstName(msgObj.name)).end().end()}domBuilder(this.fragment).p().addClass("pic_padding mango-p-"+klas).text(msgObj.text).end();this.lastLogMsg=msgObj},_insertANE:function(msgObj){if(msgObj.msgSubType=="ANE"){msgObj.text+='&nbsp;<img align="absmiddle" src="'+HOST_PREF+'/ce/images/email.png" height="8" width="10" title="'+_i18n("ane-title")+'"/>'}},_renderDateRow:function(time){var newDate=new Date();newDate.setTime(time);var shouldRender=false;var lastDate=new Date();if(this.lastLogMsg){lastDate.setTime(this.lastLogMsg.time)}if(newDate.getDate()!=lastDate.getDate()||newDate.getMonth()!=lastDate.getMonth()){shouldRender=true}if(shouldRender){var classname="mango-date-row";if(!this.lastLogMsg){classname+=" mango-first"}domBuilder(this.fragment).div().addClass(classname).text(App.helper.renderDate(newDate)).end()}},_renderSysMsg:function(msgObj){this._renderDateRow(msgObj.time);this.lastLogMsg=msgObj;var newDate=new Date();newDate.setTime(msgObj.time);var obj=domBuilder(this.fragment).span().addClass("mango-time-stamp").text(App.helper.renderTime(newDate)).end().p({msgCreatedAt:msgObj.msgCreatedAt}).addClass("mango-p-system sys_icon_padding").text(msgObj.text);if((msgObj.msgSubType)&&msgObj.msgSubType=="FED"){domBuilder(obj.currentNode).append(document.createTextNode("(")).end().a({href:"#"}).addClass("mango-feed").text("more").end().append(document.createTextNode(")")).end()}domBuilder(obj.currentNode).end()},_renderTypingStatus:function(xmpp){var name=App.helper.truncate(App.helper.firstName(xmpp.getUserName()),10);var msg="";if(xmpp.isComposing()){msg=_i18n("typing")}else{if(xmpp.isPaused()){msg=_i18n("has-entered")}}if(msg.length>0){name+=" "+msg.toLowerCase()}this.titleElement.innerHTML=name},_startTyping:function(e){if(this.typingTimer){this.typingTimer.cancel()}var input=App.E.getTarget(e);if(!input&&!input.value){return }this.lastChrVal=input.value;this.typingTimer=App.L.later(this.typingInterval,this,this.getTypingStatus,null)},_stopTyping:function(e){this.typingTimer.cancel();var input=App.E.getTarget(e);if(this.lastSentStatus!=App.config.BLANK){this.sendTypingStatus(App.config.BLANK)}},getTypingStatus:function(){try{var currentChrVal=this.chatInput.value;var what2do=false;var status="";var len1=currentChrVal.length;var len2=this.lastChrVal.length;if(len1!=len2&&this.lastSentStatus!=App.config.TYPING){status=App.config.TYPING;what2do=true}else{if(len1!=len2&&this.lastSentStatus==App.config.TYPING){status=App.config.TYPING;what2do=false}else{if(len1==len2&&this.lastSentStatus==App.config.TYPING){status=App.config.HAS_ENTERED;what2do=true}}}this.lastChrVal=currentChrVal;if(what2do){this.sendTypingStatus(status)}this.typingTimer=App.L.later(this.typingInterval,this,this.getTypingStatus,null)}catch(e){}},sendTypingStatus:function(status){if(!App.L.isValue(status)){status=0}var params={conv_id:this.conv_id,userId:this.config.get("felix_id"),userName:this.config.get("user_name")};Janus.typing(status,params);this.lastSentStatus=status},handleIMResponse:function(xmpp){if(xmpp.isTypingMsg()){return this._renderTypingStatus(xmpp)}this.incomingResponse(xmpp)},incomingResponse:function(xmpp){var newData={from:xmpp.getFrom(),type:xmpp.getType(),name:xmpp.getUserName(),text:xmpp.getBody(),to:this.config.get("felix_id"),time:App.helper.getTime(),msgId:App.helper.rand32()};this._renderMsg(Ulib.clone(newData));this.addConvFragment();if(this.isStoreMessage){this.msgQueue.store(this.id,newData)}try{this.titleElement.innerHTML=App.helper.truncate(this.name,this.maxTitleLen);this.notifyMsgArrival(xmpp);if(this.focused){this.scrollBottom()}if(!xmpp.isSystem()){this.playSound()}}catch(e){}},incomingSystemResponse:function(xmpp){var data={text:xmpp.getDesc(),user_id:xmpp.getUserId(),user_name:xmpp.getUserName(),conv_id:xmpp.getTo(),time:App.helper.getTime(),msgCreatedAt:xmpp.getMessageCreatedAt(),msgSubType:xmpp.getMsgSubType()};this._renderSysMsg(data);this.addConvFragment();try{this.titleElement.innerHTML=App.helper.truncate(this.name,this.maxTitleLen);if(this.focused){this.scrollBottom()}}catch(e){}},playSound:function(){if(!App.config.hasFocus&&App.config.SessionConfig.has("play-sound","Y")){if(!this.soundPlayer){this.soundPlayer=FABridge[SOUND_BRIDGE].root()}this.soundPlayer.playSound()}},getStatusMessage:function(){var firstName=App.helper.firstName(this.name);if(this.has_blocked=="Y"){return _i18n("blocked-msg",{name:"<strong>"+firstName+"</strong>"})}else{return this.record.isOffline(this.id)?_i18n("offline-msg",{name:"<strong>"+firstName+"</strong>"}):_i18n("online-msg",{name:"<strong>"+firstName+"</strong>"})}},notifyPresenceStatus:function(){try{if(this.record.has_presence_changed===false){return }if(!this.isGroupChat()){var msg_txt=this.getStatusMessage();var xml='<iq to="'+this.conv_id+'"><system msgType="S" msgSubType="" userId="'+this.id+'" userName="'+this.name+'" /><desc><![CDATA['+msg_txt+"]]></desc></iq>";this.incomingSystemResponse(new XMPP_IQ(xml))}}catch(e){}},notifyPendingStateMessage:function(){var msg_txt=_i18n("rfc-send");var xml='<iq to="'+this.conv_id+'"><system msgType="S" msgSubType="" userId="'+this.id+'" userName="'+this.name+'" /><desc><![CDATA['+msg_txt+"]]></desc></iq>";this.incomingSystemResponse(new XMPP_IQ(xml))},notifyMsgArrival:function(xmpp){if(!this.focused){this.unfocusMsgCount++;this.showNewMsg()}if(!xmpp.isSystem()&&!App.config.SessionConfig.isYou(xmpp.getFrom())){App.helper.Title.blink(App.helper.firstName(xmpp.getUserName())+" says...")}},showNewMsg:function(){App.D.setStyle(this.unfocusMsgEl.parentNode,"display","block");this.unfocusMsgEl.innerHTML=this.unfocusMsgCount;try{this.onRecordLoaded.unsubscribe(this.showNewMsg,this)}catch(e){}},hideNewMsg:function(){App.D.setStyle(this.unfocusMsgEl.parentNode,"display","none");this.unfocusMsgCount=0},scrollTop:function(){this.chatConv.scrollTop=0},scrollBottom:function(){try{this.chatConv.scrollTop=this.chatConv.scrollHeight}catch(e){}},disable:function(){this.chatInput.blur();this.disableBox();this.disable=true},handleActivity:function(req){switch(req.type){case"upload-start":this.showChatMsg(req.message);break;case"upload-end":this.clearChatMsg();break;case"block":alert(req.message);this.close();break;case"unblock":alert(req.message);this.close();break;case"call-now-open":this.toggleActionList();this._hide();break;case"hide-action-list":if(this.actionList.hasFocus()&&req.message===true){this.toggleActionList()}break;case"hide-member-list":if(this.memberList.hasFocus()){this.toggleMemberList()}break}},canHandle:function(req){switch(req.type){case"upload-start":case"upload-end":case"block":case"unblock":case"call-now-open":case"hide-action-list":case"hide-member-list":return true;default:return false}},toString:function(){return String("App.ui.IM - type :: "+this.chatType+" - Id : "+this.id)}};App.L.augmentProto(App.ui.IM,App.util.ActivityHandler,false);App.ui.GroupIM=function(tabMgr,record,chatType,isFocused,settings,config){this.constructor.superclass.constructor.call(this,tabMgr,record,chatType,isFocused,settings,config)};App.L.extend(App.ui.GroupIM,App.ui.IM);App.ui.GroupIM.prototype.doInitComplete=function(){this.loadReqObj.conv_id=this.id;this.loadReqObj.community_id=this.settings.get("id");this.onRecordLoaded.subscribe(this.createActionList,this,true);this.onRecordLoaded.subscribe(this.createMemberList,this,true);this.onRecordLoaded.subscribe(this.hideMenuOnClick,this,true);this.onRecordLoaded.subscribe(function(){this.enableBox();this.focusInputBox()},this,true);this.onFocusWindow.subscribe(this.scrollBottom,this,true);this.onFocusWindow.subscribe(this.focusInputBox,this,true);this.onClose.subscribe(this.makeCloseCall,this,true);this.onFocusActions()};App.ui.GroupIM.prototype.getHistory=function(){this.disableBox();var uri=this.config.get("roomHistURI");RoR.send(uri,Ulib.toQuery(this.loadReqObj),{success:this._parseHistoryJSON,scope:this})};App.ui.GroupIM.prototype.createActionList=function(){App.D.setStyle(this.chatInfoStatus,"cssText","display:block;text-align:right");domBuilder(this.chatInfoStatus).a({href:"#"}).on("click",this.toggleActionList,null,this).text(_i18n("vw-action")).end();var list_cont=document.createElement("div");list_cont.className="mango-group-member-list mango-action-list mango-group-actions";var el=App.D.insertAfter(list_cont,this.chatInfoStatus);this.actionList=new App.ui.GroupChatActionList(el,this.settings,this.record,this);this.actionList.createMenu()};App.ui.GroupIM.prototype.createMemberList=function(){App.D.setStyle(this.chatInfoStatus,"cssText","display:block;text-align:right");domBuilder(this.chatInfoStatus).append(document.createTextNode(" | ")).end().a({href:"#"}).on("click",this.toggleMemberList,null,this).text(_i18n("vw-member")).end();var list_cont=document.createElement("div");list_cont.className="mango-group-member-list mango-action-list mango-group-users";var el=App.D.insertAfter(list_cont,this.chatInfoStatus);App.model.rooms.setMemberCounts(this.id,this.history.memberCounts);this.history.members.sort(function(a,b){if(a.presence_option_id==3){return -1}if(a.presence_option_id==3&&b.presence_option_id==3){return 0}if(a.presence_option_id==4&&(b.presence_option_id>4||b.presence_option_id<3)){return -1}return 1});App.model.rooms.addMembers(this.id,this.history.members);this.memberList=new App.ui.GroupMemberListView(this.id,el,App.model.rooms,this)};App.ui.GroupIM.prototype.hideMenuOnClick=function(){App.E.on(this.tab_handle,"click",this._hideMenuList,null,this)};App.ui.GroupIM.prototype._hideMenuList=function(e){var target=App.E.getTarget(e);var isFileInput=(target.tagName.toLowerCase()=="input"&&target.type.toLowerCase()=="file")?true:false;if(this.actionList&&this.actionList.hasFocus()&&!isFileInput){this.toggleActionList()}if(this.memberList&&this.memberList.hasFocus()&&!isFileInput){this.toggleMemberList()}};App.ui.GroupIM.prototype.toggleMemberList=function(e){try{App.E.stopEvent(e)}catch(ex){}this.memberList.toggle();var tElem=this.chatInfoStatus.getElementsByTagName("a")[1];var labelTxt=_i18n("vw-member");if(this.memberList.focused){labelTxt=_i18n("hd-member")}if(tElem){tElem.innerHTML=labelTxt}};App.ui.GroupIM.prototype.close=function(dontFireCloseCall){this.unloadListeners();if(this.memberList){this.memberList.destroy()}if(this.actionList){this.actionList.remove()}var id=this.id;App.helper.removeEl(this.tab_handle);this.onClose.fire(id,this.chatType,dontFireCloseCall)};App.ui.GroupIM.prototype.makeCloseCall=function(type,args){var dntFireCloseCall=args.pop();if(!dntFireCloseCall){RoR.send(this.config.get("closeChatURI"),Ulib.toQuery({conv_id:args[0],community_id:this.settings.get("id")}),{customevents:{onSuccess:function(type,args){var xhr=args[0];var resp=Ulib.evalJSON(xhr.responseText);if(!resp.success){App.system._failure(xhr)}}}})}};App.ui.GroupIM.prototype._renderTypingStatus=function(xmpp){var name=App.helper.truncate(App.helper.firstName(xmpp.getUserName()),10);var msg="";if(xmpp.isComposing()){msg=_i18n("typing")}else{if(xmpp.isPaused()){msg=_i18n("has-entered")}else{name=App.helper.truncate(this.name,this.maxTitleLen)}}if(msg.length>0){name+=" "+msg.toLowerCase()}this.titleElement.innerHTML=name};App.ui.GroupIM.prototype.toString=function(){return String("App.ui.GroupIM - type :: "+this.chatType+" - Id : "+this.id)};App.util.HyperlinkProcessor=function(){this.URIRegex=/((?:(?:ht|f)tps?):\/\/|w{3,3}\.)[^\s<]*[^\s<\.)]/ig;this.mailRegex=/([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+/ig;this.hrefTpl="<a href='{href}' target='_new'>{text}</a>";this.mailTpl="<a href='mailto:{email}' target='_new'>{text}</a>"};App.util.HyperlinkProcessor.prototype={process:function(str){var match=str.match(this.URIRegex);if(match){for(var i=0,ln=match.length;i<ln;++i){str=str.replace(match[i],this.renderLink(match[i]))}}var match=str.match(this.mailRegex);if(match){for(var i=0,ln=match.length;i<ln;++i){str=str.replace(match[i],this.renderMail(match[i]))}}return str},renderLink:function(href){var anchor=/^http:\/\//.test(href)?href:"http://"+href;return App.L.substitute(this.hrefTpl,{href:anchor,text:App.helper.wordwrap(href,20)})},renderMail:function(email){return App.L.substitute(this.mailTpl,{email:email,text:App.helper.wordwrap(email)})}};App.util.SmileyParser=function(){this.imgBase=HOST_PREF+"/images/default/emoticons";this.imgExt=".gif";this.initialized=false;this.smileyMap={":)":["\\:\\)","2"],":-)":["\\:\\-\\)","2"],":]":["\\:\\]","2"],":))":["\\:\\)\\)","18"],":-))":["\\:\\-\\)\\)","18"],";)":[";\\)","4"],";-)":[";\\-\\)","4"],":)]":["\\:\\)\\]","100"],"/:)":["\\/\\:\\)","20"],":D":["\\:D","5"],":-D":["\\:\\-D","5"],":?":["\\:\\?","39"],":-?":["\\:\\-\\?","39"],":x":["\\:x","21"],":-x":["\\:\\-x","21"],":((":["\\:\\(\\(","17"],":-((":["\\:\\-\\(\\(","17"],":P":["\\:P","8"],":-P":["\\:\\-P","8"],":h":["\\:h","103"],":-h":["\\:\\-h","103"],":*":["\\:\\*","7"],":-*":["\\:\\-\\*","7"],":O":["\\:O","10"],":-O":["\\:\\-O","10"],':">':['\\:"\\>',"9"],":-/":["\\:\\-\\/","06"],":-\\":["\\:\\-\\\\","06"],":(":["\\:\\(","3"],":-(":["\\:\\-\\(","3"],"I-)":["I\\-\\)","28"],"|-)":["\\|\\-\\)","28"],":$":["\\:\\$","32"],":-$":["\\:\\-\\$","32"],"[-(":["\\[\\-\\(","33"],"X-(":["X\\-\\(","35"],"x-(":["x\\-\\(","35"],"=))":["\\=\\)\\)","24"],"B-)":["B\\-\\)","12"],"#-o":["\\#\\-o","34"],":-B":["\\:\\-B","22"]};this._init()};App.util.SmileyParser.prototype._init=function(){var regarr=[];for(var item in this.smileyMap){regarr.push(this.smileyMap[item][0])}var regex="(?:^|\\s|'|\"|\\.)("+regarr.join("|")+")(?:\\s|'|\"|\\.|,|!|\\?|$)";this.regexp=new RegExp(regex);this.initialized=true};App.util.SmileyParser.prototype.parse=function(input,fn){if(typeof fn!="function"){fn=function(){}}var s=0;var substr=input.replace(/\\/g,"\\");var output=[];while(1){var found=this.regexp.exec(substr);if(!found){break}var index=found.index;var matchArr=this.smileyMap[found[1]];var nextIndex=found.index+found[1].length;var str=substr.substr(0,found.index);output.push(str);output.push('<img class="mango-smiley" src="'+this.imgBase+"/"+matchArr[1]+this.imgExt+'">');substr=substr.substr(nextIndex+1)}if(substr){output.push(substr)}return output.join("")};App.ui.ListView=function(id,settings,mediator){this.id=id;this.settings=settings;this.mediator=mediator;this.focused=App.config.DEFAULT_LIST_FOCUS;this.element=null;this.layer=null;this.onFocus=new App.U.CustomEvent("onFocus",this,true)};App.ui.ListView.prototype={add:function(){},remove:function(){},update:function(){},show:function(){with(App.D){setStyle(this.layer,"display","");addClass(App.S.query("div.mango-tab-button",this.element,true),"focused")}this.focused=true;this.mediator.visibilityChanged(this);this.onFocus.fire()},hide:function(){with(App.D){setStyle(this.layer,"display","none");removeClass(App.S.query("div.mango-tab-button",this.element,true),"focused")}this.focused=false;this.mediator.visibilityChanged(this)},isVisible:function(){return this.focused},toggleView:function(e){App.E.stopEvent(e);var t=App.E.getTarget(e);this.isVisible()?this.hide():this.show()},vanish:function(){this.hide();App.D.setStyle(this.element,"display","none")},display:function(){App.D.setStyle(this.element,"display","")}};App.ui.CompositeOnlineListView=function(id,parent,settings,dataSource,mediator,state){if(state.getState()==App.config.OFFLINE_STATE){return false}this.constructor.superclass.constructor.call(this,id,settings,mediator);mediator.add(this);this.parentNode=App.$(parent);this._init(dataSource);dataSource.onAdd.subscribe(this.updateCount,this,true);dataSource.onUpdate.subscribe(this.updateCount,this,true);dataSource.onRemove.subscribe(this.updateCount,this,true)};App.L.extend(App.ui.CompositeOnlineListView,App.ui.ListView);App.ui.CompositeOnlineListView.prototype._init=function(dataSource){var presence={online:dataSource.getByPresence().online};var onlineList=domBuilder(this.parentNode).div({id:"mango-online-tab"}).addClass("mango-button-cont").div({id:"mango-online-tab-button"}).addClass("mango-tab-button").span({id:"mango-buddy-count"}).text(Ulib.truncate(this.settings.get("online_label"),10)).span({title:_i18n("online-count-title")}).addClass("mango-buddy-count-num").text("(<strong>"+presence.online+"</strong>)").end().end().end().div({id:"mango-member-list",style:"display:none"}).addClass("mango-window-wrapper").div().addClass("mango-list-wrapper").end().end();this.element=App.$("mango-online-tab");this.layer=App.$("mango-member-list");if(this.settings.has("show_rooms_list","N")){App.D.setStyle(this.layer,"right","97px")}if(this.settings.has("show_moderators","Y")){this.moderators=new App.ui.ModeratorListView(App.config.MODERATOR_LIST_ID,App.S.query("div.mango-list-wrapper",this.layer,true),this.settings,dataSource,this)}if(this.settings.has("show_visitors","Y")){this.visitors=new App.ui.VisitorListView(App.config.VISITOR_LIST_ID,App.S.query("div.mango-list-wrapper",this.layer,true),this.settings,dataSource,this)}if(this.settings.has("show_my_buddies","Y")){this.friends=new App.ui.FriendListView(App.config.FRIEND_LIST_ID,App.S.query("div.mango-list-wrapper",this.layer,true),this.settings,dataSource,this)}App.E.on(["mango-online-tab-button",App.S.query("h2.minimize",this.element,true)],"click",this.toggleView,null,this);this.countEl=App.S.query("span.mango-buddy-count-num",this.element,true)};App.ui.CompositeOnlineListView.prototype.updateCount=function(){this.countEl.innerHTML="(<strong>"+App.model.users.getByPresence().online+"</strong>)"};App.ui.CompositeOnlineListView.prototype.changeState=function(state){if(App.config.OFFLINE_STATE==state.getState()||App.config.SUSPEND_STATE==state.getState()){this.destroy()}};App.ui.CompositeOnlineListView.prototype.destroy=function(){App.model.users.onAdd.unsubscribe(this.updateCount,this);App.model.users.onUpdate.unsubscribe(this.updateCount,this);App.model.users.onRemove.unsubscribe(this.updateCount,this);App.E.removeListener(["mango-room-tab-button",App.S.query("h2.minimize",this.element,true)],"click",this.toggleView);if(this.settings.has("show_moderators","Y")){this.moderators.destroy();this.moderators=null}if(this.settings.has("show_visitors","Y")){this.visitors.destroy();this.visitors=null}if(this.settings.has("show_my_buddies","Y")){this.friends.destroy();this.friends=null}App.helper.removeEl(this.element)};App.ui.CompositeOnlineListView.prototype.toString=function(){return"App.ui.CompositeOnlineListView { focused => "+this.focused+" }"};App.ui.ModeratorListView=function(id,parent,settings,dataSource){this.moderators=dataSource.select(this.isModerator);this.parentNode=App.$(parent);this.settings=settings;this.config=App.config.SessionConfig;this.attribToExtract="mango_id";this.userModel=dataSource;this.flyout={};this._initView();this.userModel.onUpdate.subscribe(this.update,this,true)};App.ui.ModeratorListView.prototype.isModerator=function(rec){if(App.L.isObject(rec)){return((rec.user_role=="M"||rec.user_role=="A"))}return false};App.ui.ModeratorListView.prototype._initView=function(){domBuilder(this.parentNode).h2().addClass("minimize").span().text(this.settings.get("member_label"));var ul=document.createElement("ul"),h=App.config.listItemHeight,w=App.config.listItemWidth,mod;ul.className="mango-list";this._setHeight(ul);if(!this.hasOnlineUsers()&&this.settings.has("show_offline_members","N")){this._noItem(ul)}else{for(var i=0,len=this.moderators.length;i<len;++i){mod=this.moderators[i];this._renderItem(ul,mod,false)}}domBuilder(this.parentNode).div().addClass("mango-content-wrapper").append(ul);App.E.on(ul,"click",this.click,null,this);ul=null};App.ui.ModeratorListView.prototype.hasOnlineUsers=function(){var users=[];for(var i=0,len=this.moderators.length;i<len;++i){if(this.moderators[i].isOnline()){users.push(this.moderators[i])}}return users.length==0?0:users};App.ui.ModeratorListView.prototype.inArray=function(id){for(var i=0,len=this.moderators.length;i<len;++i){if(id==this.moderators[i].getId()){return i}}return -1};App.ui.ModeratorListView.prototype._setHeight=function(ul){len=this.settings.has("show_offline_members","N")?this.hasOnlineUsers().length:this.moderators.length;if(len>=App.config.listItemCount){ul.style.height=(App.config.listItemCount*App.config.listItemHeight)+"px";ul.style.overflowY="auto"}else{ul.style.height="auto"}};App.ui.ModeratorListView.prototype._renderItem=function(ul,moderator,firstChild){var h=App.config.listItemHeight,w=App.config.listItemWidth,meTxt='<span class="mango-red">[Me]</span>';if(this.settings.has("show_offline_members","N")&&moderator.isOffline()){return false}if(!App.config.SessionConfig.isYou(moderator.getId())){meTxt=""}var userItemType="mango-clearfix mango-user-item";if(moderator.isAdmin()){userItemType=userItemType+" mango-user-item_A"}else{if(moderator.isModerator()){userItemType=userItemType+" mango-user-item_M"}}domBuilder(ul).li({mango_id:moderator.getId(),style:"height:"+h+"px;",id:"mango-onl-mod-"+moderator.getId()}).on("mouseover",this.createFlyout,moderator,this).addClass(App.helper.getPresenceClass(moderator.getPresenceId())+" mango-list-item").a({href:"#"}).addClass(userItemType).div().addClass("mango-flyout-cont mango-not-created").end().img({src:App.helper.formatImage(moderator.getImage(),this.config.get("env"))}).addClass("mango-user-avatar").end().div({style:"width:"+w+"px"}).addClass("item-status").strong().text(Ulib.truncate(moderator.getName(),App.config.userNameMaxLen)+" "+meTxt).end().strong({id:"mango-onl-frnd-user-status"+moderator.getId(),style:"display:block"}).addClass("mango-presence-status").text(moderator.getPresenceMsg());return true};App.ui.ModeratorListView.prototype._noItem=function(ul){domBuilder(ul).li().addClass("mango-no-item").div().addClass("mango-not-available").text(_i18n("no-user",{name:this.settings.get("member_label")}))};App.ui.ModeratorListView.prototype.click=function(e){var t,li,attr;with(App.E){t=getTarget(e);stopEvent(e)}li=App.D.getAncestorByTagName(t,"li");if(!li){return }attr=li.getAttribute(this.attribToExtract);if(!attr){return }this.startChat(attr)};App.ui.ModeratorListView.prototype.startChat=function(id){App.ui.socialBar.openChat(App.config.CHAT_CONV_TYPE,this.userModel.select(id),true)};App.ui.ModeratorListView.prototype.createFlyout=function(e){var t=App.E.getTarget(e);var li=App.D.getAncestorByTagName(t,"li");if(!li){return }var felix_id=li.getAttribute(this.attribToExtract);if(!App.config.SessionConfig.isYou(felix_id)){this.flyout[felix_id]=new App.ui.Flyout(this,App.S.query("div.mango-flyout-cont",li,true),this.userModel.select(felix_id),this.settings)}App.E.removeListener(li.id,"mouseover",this.createFlyout)};App.ui.ModeratorListView.prototype.update=function(rec){if(!rec.isModerator()){return }var idx=this.inArray(rec.getId());var ul=App.S.query("ul.mango-list",this.parentNode,true);if(rec.isOnline()){var li_item=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(li_item)}if(idx==-1&&rec.isModerator()){this._addItem(rec,ul)}else{if(idx>-1){if(this.settings.has("show_offline_members","N")&&rec.isOffline()){this._removeLiAndFlyout(rec)}else{this._updateItem(rec,ul)}}}};App.ui.ModeratorListView.prototype._addItem=function(rec,ul){this.moderators.push(rec);this._renderItem(ul,rec,true)};App.ui.ModeratorListView.prototype._updateItem=function(rec,ul){var li=App.$("mango-onl-mod-"+rec.getId()),meTxt='<span class="mango-red">[Me]</span>';if(!App.config.SessionConfig.isYou(rec.getId())){meTxt=""}if(li){var nameEl,imageEl,statusEl;with(App.S){nameEl=query("div.item-status strong",li,true);imageEl=query("img.mango-user-avatar",li,true);statusEl=query("strong.mango-presence-status",li,true)}if(nameEl){nameEl.innerHTML=Ulib.truncate(rec.getName(),App.config.userNameMaxLen)+" "+meTxt}if(imageEl){imageEl.src=App.helper.formatImage(rec.getImage(),this.config.get("env"))}if(statusEl){statusEl.innerHTML=Ulib.truncate(rec.getPresenceMsg(),App.config.statusMsgMaxLen)}li.className=App.helper.getPresenceClass(rec.presence_option_id)+" mango-list-item";if(this.flyout[rec.getId()]){this.flyout[rec.getId()].updateUserInfo(rec)}}else{this._renderItem(ul,rec,true)}};App.ui.ModeratorListView.prototype._removeLiAndFlyout=function(rec){if(this.flyout[rec.getId()]){this.flyout[rec.getId()].destroy();delete this.flyout[rec.getId()]}var li=App.$("mango-onl-mod-"+rec.getId()),ul=li.parentNode;App.helper.removeEl(li);if(this.moderators.length==0||!this.hasOnlineUsers()){this._noItem(ul)}};App.ui.ModeratorListView.prototype.destroy=function(){for(var i in this.flyout){this.flyout[i].destroy()}this.userModel.onUpdate.unsubscribe(this.update,this);var ul=App.S.query("ul.mango-list",this.parentNode,true);if(ul){App.E.removeListener(ul,"click",this.click);ul.innerHTML="";App.helper.removeEl(App.D.getPreviousSibling(ul.parentNode));App.helper.removeEl(ul)}};App.ui.VisitorListView=function(id,parent,settings,dataSource){this.visitors=dataSource.select(this.isVisitor);this.visitorIds=[];this.parentNode=App.$(parent);this.settings=settings;this.config=App.config.SessionConfig;this.attribToExtract="mango_id";this.userModel=dataSource;this.flyout={};this._initView();this.userModel.onAdd.subscribe(this.add,this,true);this.userModel.onUpdate.subscribe(this.update,this,true);this.userModel.onRemove.subscribe(this.remove,this,true);this.pollTimer=App.L.later(this.settings.get("poll_interval"),this,this.pollPresence)};App.L.augmentProto(App.ui.VisitorListView,App.ui.ModeratorListView,true);App.ui.VisitorListView.prototype.isVisitor=function(rec){if(App.L.isObject(rec)){return(rec.isVisitor()&&!rec.isBuddy())}return false};App.ui.VisitorListView.prototype._initView=function(){domBuilder(this.parentNode).h2().addClass(this.settings.has("show_moderators","N")?"minimize":"").span().text(this.settings.get("visitor_label"));var ul=document.createElement("ul"),h=App.config.listItemHeight,w=App.config.listItemWidth,vis,len=this.visitors.length;ul.className="mango-list mango-visitor-list";this._setHeight(ul);if(len==0){this._noItem(ul)}else{for(var i=0;i<len;++i){vis=this.visitors[i];this.visitorIds.push(vis.getId());this._renderItem(ul,vis,false)}}domBuilder(this.parentNode).div().addClass("mango-content-wrapper").append(ul);App.E.on(ul,"click",this.click,null,this);ul=null};App.ui.VisitorListView.prototype._setHeight=function(ul){len=this.visitors.length;if(len>=App.config.listItemCount){ul.style.height=(App.config.listItemCount*App.config.listItemHeight)+"px";ul.style.overflowY="auto"}};App.ui.VisitorListView.prototype._renderItem=function(ul,vis,firstChild){var h=App.config.listItemHeight,w=App.config.listItemWidth,meTxt='<span class="mango-red">[Me]</span>';if(!App.config.SessionConfig.isYou(vis.getId())){meTxt=""}domBuilder(ul).li({mango_id:vis.getId(),style:"height:"+h+"px;",id:"mango-onl-vis-"+vis.getId()}).on("mouseover",this.createFlyout,vis,this).addClass(App.helper.getPresenceClass(vis.presence_option_id)+" mango-list-item").a({href:"#"}).addClass("mango-clearfix mango-user-item").div().addClass("mango-flyout-cont mango-not-created").end().img({src:App.helper.formatImage(vis.getImage(),this.config.get("env"))}).addClass("mango-user-avatar").end().div({style:"width:"+w+"px"}).addClass("item-status").strong().text(Ulib.truncate(vis.getName(),App.config.userNameMaxLen)+" "+meTxt).end().strong({id:"mango-onl-frnd-user-status"+vis.getId(),style:"display:block"}).addClass("mango-presence-status").text(vis.getPresenceMsg());return true};App.ui.VisitorListView.prototype._noItem=function(ul){domBuilder(ul).li().addClass("mango-no-item").div().addClass("mango-not-available").text(_i18n("no-user",{name:this.settings.get("visitor_label")}))};App.ui.VisitorListView.prototype.hasOnlineUsers=function(){var users=[];for(var i=0,len=this.visitors.length;i<len;++i){if(this.visitors[i].isOnline()){users.push(this.visitors[i])}}return users.length==0?0:users};App.ui.VisitorListView.prototype.inArray=function(id){for(var i=0,len=this.visitors.length;i<len;++i){if(id==this.visitors[i].getId()){return i}}return -1};App.ui.VisitorListView.prototype.add=function(rec){if(!rec.isVisitor()){return }var ul=App.S.query("ul.mango-visitor-list",this.parentNode,true);if(ul){this._setHeight(ul);var li_item=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(li_item);this._addItem(ul,rec)}};App.ui.VisitorListView.prototype._addItem=function(ul,rec){this.visitors.push(rec);this._renderItem(ul,rec,true)};App.ui.VisitorListView.prototype.update=function(rec){if(!rec.isVisitor()){return }var ul=App.S.query("ul.mango-visitor-list",this.parentNode,true);var idx=this.inArray(rec.getId());if(idx==-1){if(!rec.isBuddy()&&rec.isOnline()){var li_item=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(li_item);this._addItem(ul,rec)}}else{if(rec.isOffline()){this._removeLiAndFlyout(rec)}else{if(rec.isBuddy()){this.remove(rec.getId())}else{this._updateItem(ul,rec)}}}};App.ui.VisitorListView.prototype._removeLiAndFlyout=function(rec){if(this.flyout[rec.getId()]){this.flyout[rec.getId()].destroy();delete this.flyout[rec.getId()]}var li=App.$("mango-onl-vis-"+rec.getId()),ul=li.parentNode;App.helper.removeEl(li);if(this.visitors.length==0||!this.hasOnlineUsers()){this._noItem(ul)}};App.ui.VisitorListView.prototype._updateItem=function(ul,rec){var li=App.$("mango-onl-vis-"+rec.getId()),meTxt='<span class="mango-red">[Me]</span>';if(!App.config.SessionConfig.isYou(rec.getId())){meTxt=""}if(li){var nameEl,imageEl,statusEl;with(App.S){nameEl=query("div.item-status strong",li,true);imageEl=query("img.mango-user-avatar",li,true);statusEl=query("strong.mango-presence-status",li,true)}if(nameEl){nameEl.innerHTML=Ulib.truncate(rec.getName(),App.config.userNameMaxLen)+" "+meTxt}if(imageEl){imageEl.src=App.helper.formatImage(rec.getImage(),this.config.get("env"))}if(statusEl){statusEl.innerHTML=Ulib.truncate(rec.getPresenceMsg(),App.config.statusMsgMaxLen)}li.className=App.helper.getPresenceClass(rec.presence_option_id)+" mango-list-item";if(this.flyout[rec.getId()]){this.flyout[rec.getId()].updateUserInfo(rec)}}else{this._addItem(ul,rec)}};App.ui.VisitorListView.prototype.remove=function(key){var idx=this.inArray(key);if(idx>-1){var rec=this.visitors[idx];this.visitors.splice(idx,1);this._removeLiAndFlyout(rec)}};App.ui.VisitorListView.prototype.pollPresence=function(interval){if(App.L.isNumber(interval)){return }};App.ui.VisitorListView.prototype.parsePollResults=function(results){};App.ui.VisitorListView.prototype.destroy=function(){this.userModel.onAdd.unsubscribe(this.add,this);this.userModel.onUpdate.unsubscribe(this.update,this);this.userModel.onRemove.unsubscribe(this.remove,this);this.pollTimer.cancel();for(var i in this.flyout){this.flyout[i].destroy()}var ul=App.S.query("ul.mango-visitor-list",this.parentNode,true);if(ul){App.E.removeListener(ul,"click",this.click);ul.innerHTML="";App.E.purgeElement(ul);App.helper.removeEl(App.D.getPreviousSibling(ul.parentNode));App.helper.removeEl(ul)}};App.ui.FriendListView=function(id,parent,settings,dataSource){this.friends=dataSource.select(this.isFriend);this.parentNode=App.$(parent);this.settings=settings;this.config=App.config.SessionConfig;this.attribToExtract="mango_id";this.userModel=dataSource;this.flyout={};this._initView();dataSource.onUpdate.subscribe(this.update,this,true)};App.L.augmentProto(App.ui.FriendListView,App.ui.ModeratorListView,true);App.ui.FriendListView.prototype.isFriend=function(rec){if(App.L.isObject(rec)){return rec.isBuddy()}return false};App.ui.FriendListView.prototype._initView=function(){domBuilder(this.parentNode).h2().addClass(this.settings.has("show_visitors","N")&&this.settings.has("show_moderators","N")?"minimize":"").span().text(this.settings.get("favorite_label"));var ul=document.createElement("ul"),buddy,len=this.friends.length;ul.className="mango-list mango-friend-list";this._setHeight(ul);if(len==0||(this.settings.has("show_offline_buddies","N")&&!this.hasOnlineUsers())){this._noItem(ul)}else{for(var i=0;i<len;++i){buddy=this.friends[i];this._renderItem(ul,buddy,false)}}domBuilder(this.parentNode).div().addClass("mango-content-wrapper").append(ul);App.E.on(ul,"click",this.click,null,this);ul=null};App.ui.FriendListView.prototype._setHeight=function(ul){len=this.settings.has("show_offline_buddies","N")?this.hasOnlineUsers().length:this.friends.length;if(len>=App.config.listItemCount){ul.style.height=(App.config.listItemCount*App.config.listItemHeight)+"px";ul.style.overflowY="auto"}else{ul.style.height="auto"}};App.ui.FriendListView.prototype._renderItem=function(ul,buddy,firstChild){var h=App.config.listItemHeight,w=App.config.listItemWidth;if(this.settings.has("show_offline_buddies","N")&&buddy.isOffline()){return false}var userItemType="mango-clearfix mango-user-item";if(buddy.isAdmin()){userItemType=userItemType+" mango-user-item_A"}else{if(buddy.isModerator()){userItemType=userItemType+" mango-user-item_M"}}domBuilder(ul).li({mango_id:buddy.getId(),style:"height:"+h+"px;",id:"mango-onl-frnd-"+buddy.getId()}).on("mouseover",this.createFlyout,buddy,this).addClass(App.helper.getPresenceClass(buddy.presence_option_id)+" mango-list-item").a({href:"#"}).addClass(userItemType).div().addClass("mango-flyout-cont mango-not-created").end().img({src:App.helper.formatImage(buddy.getImage(),this.config.get("env"))}).addClass("mango-user-avatar").end().div({style:"width:"+w+"px"}).addClass("item-status").strong().text(Ulib.truncate(buddy.getName(),App.config.userNameMaxLen)).end().strong({id:"mango-onl-frnd-user-status"+buddy.getId(),style:"display:block"}).addClass("mango-presence-status").text(buddy.getPresenceMsg());return true};App.ui.FriendListView.prototype._noItem=function(ul){this._setHeight(ul);domBuilder(ul).li().addClass("mango-no-item").div().addClass("mango-not-available").text(_i18n("no-user",{name:this.settings.get("favorite_label")})+"<br/>"+(this.settings.has("show_offline_buddies","N")?_i18n("add-2-fav",{name:this.settings.get("favorite_label")}):""))};App.ui.FriendListView.prototype.update=function(rec){var idx=this.inArray(rec.getId());if(!rec.isBuddy()){if(idx>-1){return this._removeItem(idx)}else{return }}var ul=App.S.query("ul.mango-friend-list",this.parentNode,true);var no_item_li=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(no_item_li);if(idx==-1&&rec.isBuddy()){this._addItem(rec,ul)}else{if(idx>-1&&rec.isBuddy()){this._updateItem(rec,ul)}else{this._noItem(ul)}}this._setHeight(ul)};App.ui.FriendListView.prototype.inArray=function(id){for(var i=0,len=this.friends.length;i<len;++i){if(id==this.friends[i].getId()){return i}}return -1};App.ui.FriendListView.prototype.hasOnlineUsers=function(){var users=[];for(var i=0,len=this.friends.length;i<len;++i){if(this.friends[i].isOnline()){users.push(this.friends[i])}}return users.length==0?0:users};App.ui.FriendListView.prototype._addItem=function(rec,ul){this.friends.push(rec);var out=this._renderItem(ul,rec,true);if(out){if((this.settings.has("show_offline_buddies","N")&&!this.hasOnlineUsers())){this._noItem(ul)}}this._setHeight(ul)};App.ui.FriendListView.prototype._updateItem=function(rec,ul){if(this.settings.has("show_offline_buddies","N")&&rec.isOffline()){return this._removeLiAndFlyout(rec)}var li=App.$("mango-onl-frnd-"+rec.getId());if(!li&&rec.isOnline()){var no_item_li=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(no_item_li);return this._renderItem(ul,rec,true)}var nameEl,imageEl,statusEl;with(App.S){nameEl=query("div.item-status strong",li,true);imageEl=query("img.mango-user-avatar",li,true);statusEl=query("strong.mango-presence-status",li,true)}if(nameEl){nameEl.innerHTML=Ulib.truncate(rec.getName(),App.config.userNameMaxLen)}if(imageEl){imageEl.src=App.helper.formatImage(rec.getImage(),this.config.get("env"))}if(statusEl){statusEl.innerHTML=Ulib.truncate(rec.getPresenceMsg(),App.config.statusMsgMaxLen)}li.className=App.helper.getPresenceClass(rec.presence_option_id)+" mango-list-item";if(this.flyout[rec.getId()]){this.flyout[rec.getId()].updateUserInfo(rec)}};App.ui.FriendListView.prototype._removeItem=function(index){var rec=this.friends[index];this.friends.splice(index,1);this._removeLiAndFlyout(rec)};App.ui.FriendListView.prototype._removeLiAndFlyout=function(rec){if(this.flyout[rec.getId()]){this.flyout[rec.getId()].destroy();delete this.flyout[rec.getId()]}var li=App.$("mango-onl-frnd-"+rec.getId()),ul=li.parentNode;App.helper.removeEl(li);if(this.friends.length==0||(this.settings.has("show_offline_buddies","N")&&!this.hasOnlineUsers())){this._noItem(ul)}else{this._setHeight(ul)}};App.ui.FriendListView.prototype.destroy=function(){this.userModel.onUpdate.unsubscribe(this.update,this);var ul=App.S.query("ul.mango-friend-list",this.parentNode,true);if(ul){App.E.removeListener(ul,"click",this.click);ul.innerHTML="";for(var i in this.flyout){this.flyout[i].destroy()}App.E.purgeElement(ul);App.helper.removeEl(App.D.getPreviousSibling(ul.parentNode));App.helper.removeEl(ul)}};App.ui.GroupMemberListView=function(roomId,parent,roomModel,successor){this.parentNode=App.$(parent);App.D.setStyle(this.parentNode,"display","none");this.settings=App.config.Settings;this.config=App.config.SessionConfig;this.id=roomId;this.attribToExtract="mango_id";this.roomModel=roomModel;this.flyout={};this.hasCreatedView=false;this.memberModel=this.roomModel.getMembers(this.id);this.members=this.memberModel.selectAll();this.memberModel.onUpdate.subscribe(this.update,this,true);this.memberModel.onAdd.subscribe(this.add,this,true);this.memberModel.onRemove.subscribe(this.remove,this,true);this.addSuccessor(successor)};App.ui.GroupMemberListView.prototype={_initView:function(){var ul=document.createElement("ul"),member,len=this.members.length;ul.className="mango-group-list";this._setHeight(ul);for(var i=0;i<len;++i){member=this.members[i];this._renderItem(ul,member,false)}App.E.on(ul,"click",this.click,null,this);this.parentNode.appendChild(ul);this.hasCreatedView=true;App.D.setStyle(this.parentNode,"display","none");this.focused=false},_setHeight:function(ul){if(this.members.length>App.config.grouplistItemCount){App.D.setStyle(ul,"height",(App.config.grouplistItemCount*App.config.grouplistItemHeight)+"px");App.D.setStyle(ul,"overflowY","auto")}},_renderItem:function(ul,member,firstChild){var h=App.config.grouplistItemHeight,meTxt='<span class="mango-red">[Me]</span>';if(!this.config.isYou(member.getId())){meTxt=""}var userItemType="mango-clearfix mango-user-item";if(member.isAdmin()){userItemType=userItemType+" mango-user-item_A"}else{if(member.isModerator()){userItemType=userItemType+" mango-user-item_M"}}domBuilder(ul).li({mango_id:member.getId(),style:"height:20px;",id:"member-"+App.helper.rand32()}).on("mouseover",this.createFlyout,member,this).addClass(App.helper.getPresenceClass(member.presence_option_id)+" mango-list-item").a({href:"#"}).addClass(userItemType).div().addClass("mango-flyout-cont mango-not-created").end().strong().text(Ulib.truncate(member.getName(),App.config.userNameMaxLen)+" "+meTxt).end()},toggle:function(){if(!this.hasCreatedView){this._initView()}Ulib.toggle(this.parentNode);this.focused=this.focused===true?false:true;this.handleRequest({type:"hide-action-list",message:this.focused})},hasFocus:function(){return this.focused},createFlyout:function(e,member){var t=App.E.getTarget(e);var li=App.D.getAncestorByTagName(t,"li");if(!this.config.isYou(member.getId())){this.flyout[member.getId()]=new App.ui.GroupContextFlyout(this,App.S.query("div.mango-flyout-cont",li,true),member,this.settings)}App.E.removeListener(li.id,"mouseover",this.createFlyout)},getRoomObject:function(){return this.roomModel.select(this.id)},update:function(rec){var li=App.S.query("li[mango_id="+rec.getId()+"]",this.parentNode,true);if(li){li.className=App.helper.getPresenceClass(rec.presence_option_id)+" mango-list-item";var strong=App.S.query("a.mango-user-item strong",li,true);if(strong){strong.innerHTML=Ulib.truncate(rec.getName(),App.config.userNameMaxLen)+" "+(this.config.isYou(rec.getId())?"[Me]":"")}if(this.flyout[rec.getId()]){this.flyout[rec.getId()].updateUserInfo(rec)}}},add:function(rec){var ul=App.S.query("ul.mango-group-list",this.parentNode,true);this.members.push(rec);if(ul){this._setHeight(ul);this._renderItem(ul,rec,false)}},remove:function(key){var li=App.S.query("li[mango_id="+key+"]",this.parentNode,true);if(li){if(this.flyout[key]){this.flyout[key].destroy();delete this.flyout[key]}App.helper.removeEl(li);for(var i=0;i<this.members.length;++i){if(this.members[i].getId()==key){this.members.splice(i,1);break}}}},click:function(e){var t=App.E.getTarget(e);App.E.stopEvent(e);var li=App.D.getAncestorByTagName(t,"li");if(li){var id=li.getAttribute("mango_id");if(id){this.startChat(id)}}},startChat:function(id){var rec=App.model.users.select(id);if(!rec){rec=this.memberModel.select(id);App.model.users.add(rec.getId(),rec,true)}App.ui.socialBar.openChat(App.config.CHAT_CONV_TYPE,rec,true)},destroy:function(){for(var k in this.flyout){this.flyout[k].destroy()}this.flyout=null;this.memberModel.onUpdate.unsubscribe(this.update,this);this.roomModel.removeMembers(this.id);this.parentNode.innerHTML=""}};App.L.augmentProto(App.ui.GroupMemberListView,App.util.ActivityHandler);App.ui.Flyout=function(listRef,parent,rec,settings){this.listRef=listRef;App.ui.Flyout.prototype._count++;this._fl_id="mango-"+this.flyoutContext+"-"+App.ui.Flyout.prototype._count;this.userObject=rec;this.parentNode=App.$(parent);this.settings=settings;this.sendEmail=null;this._initUI();App.D.removeClass(this.parentNode,"mango-not-created")};App.ui.Flyout.prototype._count=0;App.ui.Flyout.prototype.maxNameLen=20;App.ui.Flyout.prototype.maxCustMsgLen=35;App.ui.Flyout.prototype.flyoutWidth=200;App.ui.Flyout.prototype.flyoutContext="OLV";App.ui.Flyout.prototype._initUI=function(){var platform=this._renderPlatformInfo(this.userObject);var userInfo=this._renderUserInfo(this.userObject);var emailDisabled=this.settings.has("show_email_option","N")?"mango-email-disabled":"";var o=domBuilder(this.parentNode).div().addClass("mango-flyout").ul().addClass("mango-flyout-buttons").li().addClass("mango-flyout-chat").a({href:"#"}).append(document.createTextNode(_i18n("btn-chat"))).end().addClass("mango-flyout-chat-anchor").end().end().li().addClass("mango-vertical-bar").text("|").end().li().addClass("mango-flyout-email "+emailDisabled).a({href:"#",disabled:this.settings.has("show_email_option","Y")?false:true}).addClass("mango-flyout-email-anchor "+emailDisabled).append(document.createTextNode(_i18n("btn-email"))).end().end().end().li().addClass("mango-vertical-bar").text("|").end().li().addClass("mango-flyout-more").a({href:"#"}).addClass("mango-flyout-more-anchor").append(document.createTextNode(_i18n("btn-more"))).end().end().div().addClass("mango-flyout-action-menu").end().end().end().div().addClass("mango-flyout-line").end().div().addClass("mango-flyout-body").div().addClass("mango-flyout-main").div().addClass("mango-flyout-img-cont").img({src:App.helper.formatImage(userInfo.image,App.config.SessionConfig.get("env"))}).end().end().div().addClass("mango-flyout-detail").strong().addClass("mango-flyout-name").img({src:platform.image,title:platform.title,style:"border:0;vertical-align:middle"}).end().a({href:userInfo.profile}).addClass(userInfo.profile=="#"?"mango-name-nolink":"mango-name-link").append(document.createTextNode(userInfo.name)).end().end().end().strong().addClass("mango-flyout-status").text(userInfo.status.toString());App.E.on(this.parentNode,"click",this.delegateEvent,null,this);this._initActionList()};App.ui.Flyout.prototype._renderPlatformInfo=function(obj){var obj={};switch(parseInt(obj.user_medium)){case 1:obj.image=HOST_PREF+"/ce/images/mobile.png";obj.title=_i18n("mob-platform");break;case 5:obj.image=HOST_PREF+"/ce/images/desktop.png";obj.title=_i18n("desk-platform");break;default:obj.image=HOST_PREF+"/ce/images/transparent.gif";obj.title=""}return obj};App.ui.Flyout.prototype._initActionList=function(){this.actionList=new App.ui.FlyoutActionList(App.S.query("div.mango-flyout-action-menu",this.parentNode,true),this.settings,this.userObject,null);this.actionList.createMenu()};App.ui.Flyout.prototype._renderUserInfo=function(rec){var status="";try{status=rec.active_status_text;if(rec.active_status_time){var date=new Date();date.setTime(rec.active_status_time);status+=App.helper.renderTime(date,"shortDateTime")}}catch(e){}return{name:Ulib.truncate(rec.getName(),this.maxNameLen),status:status,medium:rec.user_medium,image:rec.getImage(),profile:rec.getPageURL()}};App.ui.Flyout.prototype.delegateEvent=function(e){var t;t=App.E.getTarget(e);App.E.stopEvent(e);switch(t.className){case"mango-name-link":if(t.href!="#"){window.location.assign(App.helper.formatURL(t.href))}break;case"mango-flyout-chat":case"mango-flyout-chat-anchor":this.startChat();break;case"mango-flyout-email":case"mango-flyout-email-anchor":this.sendMail();break;case"mango-flyout-more":case"mango-flyout-more-anchor":this.actionList.toggle();break;default:this.actionList.hide()}};App.ui.Flyout.prototype.updateUserInfo=function(rec){this.userObject.update(rec);this.actionList.clear();this.parentNode.innerHTML="";this.actionList=null;App.E.removeListener(this.parentNode,"click",this.delegateEvent);this._initUI()};App.ui.Flyout.prototype.show=function(x,y,top){App.D.setStyle(this.element,"display","block");top=top||App.$DocumentScrollTop();if(x==null||y==null){return }var wh=App.$ViewportHeight()-10;var h=this.element.offsetHeight;var act_y=y-top;if((h+act_y)>=wh){y-=25}App.D.setXY(this.element,[(x-this.flyoutWidth+2),(y)],true)};App.ui.Flyout.prototype.hide=function(e){var targ=App.E.getRelatedTarget(e);if(!App.D.isAncestor(this.element,targ)&&targ!==this.element){App.D.setStyle(this.element,"display","none");if(this.actionList){this.actionList.hide()}}};App.ui.Flyout.prototype.sendMail=function(){if(this.settings.has("show_email_option","N")){return }if(this.userObject.isAuthenticated()){if(this.sendEmail){return this.sendEmail.show()}var uri=this.userObject.isSubscriber()?App.config.SessionConfig.get("subcEmailURI"):App.config.SessionConfig.get("offlineURI");this.sendEmail=new App.ui.SendMail({felix_user_id:this.userObject.getId(),community_id:this.settings.get("id"),name:Ulib.truncate(this.userObject.getName(),this.maxNameLen)},uri,null,true);this.sendEmail.show()}else{return alert(_i18n("no-email",{name:this.userObject.member_name}))}};App.ui.Flyout.prototype.startChat=function(e){App.ui.socialBar.openChat(App.config.CHAT_CONV_TYPE,this.userObject,true)};App.ui.Flyout.prototype.destroy=function(){App.E.removeListener(this.parentNode,"click",this.delegateEvent);this.actionList.remove();this.actionList=null};App.ui.GroupContextFlyout=function(listRef,parent,rec,settings){this.room_object=listRef.getRoomObject();this.constructor.superclass.constructor.call(this,listRef,parent,rec,settings)};App.L.extend(App.ui.GroupContextFlyout,App.ui.Flyout);App.ui.GroupContextFlyout.prototype.startChat=function(){this.listRef.startChat(this.userObject.getId())};App.ui.GroupContextFlyout.prototype._initActionList=function(){this.actionList=new App.ui.GroupFlyoutActionList(App.S.query("div.mango-flyout-action-menu",this.parentNode,true),this.settings,this.userObject,null,this.room_object);this.actionList.createMenu()};App.ui.BaseActionList=function(parent,settings,rec,successor){this.parentNode=App.$(parent);this.settings=settings;this.record=rec;this.addSuccessor(successor);this.actionMenu=null;App.D.setStyle(this.parentNode,"visibility","hidden")};App.L.augmentProto(App.ui.BaseActionList,App.util.ActivityHandler);App.ui.BaseActionList.prototype.createMenu=function(){};App.ui.BaseActionList.prototype.show=function(){App.D.setStyle(this.parentNode,"visibility","visible");this.focused=true};App.ui.BaseActionList.prototype.hide=function(){App.D.setStyle(this.parentNode,"visibility","hidden");this.focused=false};App.ui.BaseActionList.prototype.toggle=function(){this.focused?this.hide():this.show()};App.ui.BaseActionList.prototype.refresh=function(){this.clear();this.createMenu()};App.ui.BaseActionList.prototype.clear=function(){if(this.actionMenu){this.actionMenu.purge()}this.actionMenu=null};App.ui.BaseActionList.prototype.remove=function(){this.clear();App.helper.removeEl(this.parentNode)};App.ui.BaseActionList.prototype.hasFocus=function(){return this.focused};App.ui.ActionMenu=function(name){this.name=name;this.container=document.createElement("ul");this.container.className="mango-group-action-list";this.menuItems={}};App.ui.ActionMenu.prototype._separatorCount=0;App.ui.ActionMenu.prototype.add=function(menuItemObj){this.menuItems[menuItemObj.name]=menuItemObj;this.container.appendChild(this.menuItems[menuItemObj.name].getEl())};App.ui.ActionMenu.prototype.remove=function(name){this.menuItems[name].remove();delete this.menuItems[name]};App.ui.ActionMenu.prototype.getEl=function(){return this.container};App.ui.ActionMenu.prototype.getItem=function(name){this.menuItems[name]};App.ui.ActionMenu.prototype.addSeparator=function(){App.ui.ActionMenu.prototype._separatorCount++;var li=document.createElement("li");domBuilder(this.container).li().addClass("separator").div().addClass("mango-gray-line").on("click",App.E.stopEvent,null,App.E)};App.ui.ActionMenu.prototype.purge=function(){for(var i in this.menuItems){this.menuItems[i].remove()}this.menuItems={};App.helper.removeEl(this.container)};App.ui.ActionMenuItem=function(name,command){this.name=name;this.element=document.createElement("li");this.anchor=document.createElement("a");this._init(command)};App.ui.ActionMenuItem.prototype._init=function(command){this.anchor.href="#";this.anchor.className="mango-clearfix mango-action-item";this.anchor.innerHTML=Ulib.truncate(this.name,21);App.E.on(this.anchor,"click",command.execute,this,command);this.element.appendChild(this.anchor)};App.ui.ActionMenuItem.prototype.getEl=function(){return this.element};App.ui.ActionMenuItem.prototype.getAnchor=function(){return this.anchor};App.ui.ActionMenuItem.prototype.remove=function(){App.E.purgeElement(this.anchor);App.helper.removeEl(this.element)};App.ui.FileActionMenuItem=function(name,command,options){this.options=options||{};this.constructor.superclass.constructor.call(this,name,command)};App.L.extend(App.ui.FileActionMenuItem,App.ui.ActionMenuItem);App.ui.FileActionMenuItem.prototype._init=function(command){this.anchor.href="#";this.anchor.className="mango-clearfix mango-action-item";this.anchor.innerHTML=this.name;domBuilder(this.anchor).div().addClass("mango-upload-cont").form({method:"post",enctype:"multipart/form-data",action:HOST_PREF+"/fu",style:"margin:0"}).input(App.L.merge({type:"hidden",size:"1",value:"",name:"conversation_id"},this.options)).end().input({type:"hidden",name:"upload_type",value:App.config.CONV_UPLOAD_TYPE}).end().input({type:"hidden",name:"attachment_type",value:App.config.ATTACHMENT_TYPE}).end().input({type:"file",size:"1",name:"file_name"}).addClass("mango-send-file").on("change",command.execute,this,command);this.element.appendChild(this.anchor)};App.ui.ActionCommand=function(fn,scope,args){if(!App.L.isFunction(fn)){throw new Error("Arguments must be of type Function")}this.action=fn;this.scope=scope||this;this.args=App.L.isArray(args)?args:[args]};App.ui.ActionCommand.prototype.execute=function(e,menuItem){this.action.apply(this.scope,Array.prototype.slice.call(arguments).concat(this.args))};App.ui.FlyoutActionList=function(parent,settings,rec,mediator){this.constructor.superclass.constructor.call(this,parent,settings,rec,mediator)};App.L.extend(App.ui.FlyoutActionList,App.ui.BaseActionList);App.ui.FlyoutActionList.prototype.createMenu=function(){var felix_id=this.record.getId(),conv_id=this.record.conv_id,conf=App.config.SessionConfig;var callback={fn:this.update,scope:this};var actionMenu=new App.ui.ActionMenu("flyoutActionMenu");var vwhist=new App.ui.ViewHistory({felix_id:felix_id,conv_id:conv_id});var vwCommand=new App.ui.ActionCommand(vwhist.run,vwhist);var mnuItem=new App.ui.ActionMenuItem(_i18n("vw-hist"),vwCommand);App.D.addClass(mnuItem.getAnchor(),"mango-view-history");actionMenu.add(mnuItem);if(this.settings.has("show_my_buddies","Y")&&this.settings.has("add_buddies","Y")){if(this.record.isAuthenticated()){var fav=!this.record.isBuddy()?new App.ui.Add2Favorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),this.record,callback,_i18n("add2fav",{name:this.settings.get("favorite_label")})):new App.ui.RemoveFrmFavorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),callback,_i18n("del2fav",{name:this.settings.get("favorite_label")}));var favCommand=new App.ui.ActionCommand(fav.execute,fav);mnuItem=new App.ui.ActionMenuItem(fav.label,favCommand);App.D.addClass(mnuItem.getAnchor(),this.record.isBuddy()?"mango-removefav":"mango-addfav");actionMenu.add(mnuItem)}}if(this.record.getPageURL()!="#"){var viewPage=new App.ui.ViewProfilePage(this.record.getPageURL());var viewPageCmd=new App.ui.ActionCommand(viewPage.go,viewPage);mnuItem=new App.ui.ActionMenuItem(_i18n("vw-profile"),viewPageCmd);App.D.addClass(mnuItem.getAnchor(),"mango-view-profile");actionMenu.add(mnuItem)}this.parentNode.appendChild(actionMenu.getEl())};App.ui.FlyoutActionList.prototype.update=function(resp){var data=Ulib.clone(resp.data);App.model.users.update(data.felix_user_id,data)};App.ui.ChatActionList=function(parent,settings,rec,mediator){this.constructor.superclass.constructor.call(this,parent,settings,rec,mediator);this.has_blocked=mediator.has_blocked};App.L.extend(App.ui.ChatActionList,App.ui.BaseActionList);App.ui.ChatActionList.prototype.createMenu=function(){var felix_id=this.record.getId(),conv_id=this.record.conv_id,conf=App.config.SessionConfig;var callback={fn:this.update,scope:this};this.actionMenu=new App.ui.ActionMenu("ChatActionMenu");var mnuItem;var callNowData={dn:"sitegroup",env:conf.get("env"),ch:COMMUNITY_HASH,bu:HOST_DOMAIN,UID:conf.get("felix_id"),UNAME:conf.get("user_name"),OUID:felix_id,CONID:conv_id,CID:this.settings.get("id"),CU:3,CT:"S",CHIST:"false",PCC:"false",SID:conf.get("session_id"),pushPort:conf.get("janus_port"),pushURL:conf.get("janus_url"),add_buddies:this.settings.get("add_buddies"),show_email_option:this.settings.get("show_email_option"),mango_external_uid:""};var callNow=new App.ui.CallNow(callNowData,this,this.has_blocked==App.config.YES);var callNowCommand=new App.ui.ActionCommand(callNow.run,callNow);mnuItem=new App.ui.ActionMenuItem(_i18n("audio-call-label"),callNowCommand);App.D.addClass(mnuItem.getAnchor(),"mango-audio-call");this.actionMenu.add(mnuItem);this.actionMenu.addSeparator();if(this.record.getPageURL()!="#"){var viewPage=new App.ui.ViewProfilePage(this.record.getPageURL());var viewPageCmd=new App.ui.ActionCommand(viewPage.go,viewPage);mnuItem=new App.ui.ActionMenuItem(_i18n("vw-profile"),viewPageCmd);App.D.addClass(mnuItem.getAnchor(),"mango-view-profile");this.actionMenu.add(mnuItem)}var vwhist=new App.ui.ViewHistory({felix_id:felix_id,conv_id:conv_id});var vwCommand=new App.ui.ActionCommand(vwhist.run,vwhist);mnuItem=new App.ui.ActionMenuItem(_i18n("vw-hist"),vwCommand);App.D.addClass(mnuItem.getAnchor(),"mango-view-history");this.actionMenu.add(mnuItem);this.actionMenu.addSeparator();if(this.has_blocked==App.config.NO){var send_file=new App.ui.FileTransfer(this);var fileCommand=new App.ui.ActionCommand(send_file.send,send_file);mnuItem=new App.ui.FileActionMenuItem(_i18n("send-file"),fileCommand,{value:conv_id});App.D.addClass(mnuItem.getAnchor(),"mango-upload-file");this.actionMenu.add(mnuItem)}if(this.record.isAuthenticated()&&this.has_blocked==App.config.NO){if(this.settings.has("show_email_option","Y")){var send_mail=new App.ui.SendMail({felix_user_id:felix_id,community_id:this.settings.get("id"),name:Ulib.truncate(this.record.getName(),this.maxNameLen)},conf.get("offlineURI"),null,this.record.isAuthenticated());var emailCommand=new App.ui.ActionCommand(send_mail.show,send_mail);mnuItem=new App.ui.ActionMenuItem(_i18n("send-mail"),emailCommand);App.D.addClass(mnuItem.getAnchor(),"mango-quick-email");this.actionMenu.add(mnuItem)}this.actionMenu.addSeparator();if(this.settings.has("show_my_buddies","Y")&&this.settings.has("add_buddies","Y")){var fav=!this.record.isBuddy()?new App.ui.Add2Favorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),this.record,callback,_i18n("add2fav",{name:this.settings.get("favorite_label")})):new App.ui.RemoveFrmFavorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),callback,_i18n("del2fav",{name:this.settings.get("favorite_label")}));var favCommand=new App.ui.ActionCommand(fav.execute,fav);mnuItem=new App.ui.ActionMenuItem(fav.label,favCommand);App.D.addClass(mnuItem.getAnchor(),this.record.isBuddy()?"mango-removefav":"mango-addfav");this.actionMenu.add(mnuItem)}}if(App.config.product==App.config.WEBIM){if(!this.has_blocked){this.actionMenu.addSeparator()}var blk=this.has_blocked==App.config.NO?new App.ui.Block({felix_id:felix_id},conf.get("blockURI"),callback,_i18n("block"),this):new App.ui.Unblock({felix_id:felix_id,contact_id:this.record.isContact()},conf.get("unblockURI"),callback,_i18n("unblock"),this);var blkCommand=new App.ui.ActionCommand(blk.confirm,blk);mnuItem=new App.ui.ActionMenuItem(blk.label,blkCommand);App.D.addClass(mnuItem.getAnchor(),(blk instanceof App.ui.Block)?"mango-block":"mango-unblock");this.actionMenu.add(mnuItem)}this.parentNode.appendChild(this.actionMenu.getEl())};App.ui.ChatActionList.prototype.update=function(resp){var data=Ulib.clone(resp.data);App.model.users.update(data.felix_user_id,data)};App.ui.GroupChatActionList=function(parent,settings,rec,successor){this.constructor.superclass.constructor.call(this,parent,settings,rec,successor)};App.L.extend(App.ui.GroupChatActionList,App.ui.BaseActionList);App.ui.GroupChatActionList.prototype.createMenu=function(){var conv_id=this.record.getId(),conf=App.config.SessionConfig;var callback={fn:this.update,scope:this};var actionMenu=new App.ui.ActionMenu("ChatActionMenu");var vwhist=new App.ui.ViewHistory({conv_id:conv_id,theme:this.settings.get("theme")});var vwCommand=new App.ui.ActionCommand(vwhist.run,vwhist);var mnuItem=new App.ui.ActionMenuItem(_i18n("vw-hist"),vwCommand);App.D.addClass(mnuItem.getAnchor(),"mango-view-history");actionMenu.add(mnuItem);var send_file=new App.ui.FileTransfer(this);var fileCommand=new App.ui.ActionCommand(send_file.send,send_file);mnuItem=new App.ui.FileActionMenuItem(_i18n("send-file"),fileCommand,{value:conv_id});App.D.addClass(mnuItem.getAnchor(),"mango-upload-file");actionMenu.add(mnuItem);if(this.record.getPageURL()!="#"){var viewPage=new App.ui.ViewRoomPage(this.record.getPageURL());var viewPageCmd=new App.ui.ActionCommand(viewPage.go,viewPage);if(App.config.product==App.config.WEBIM){mnuItem=new App.ui.ActionMenuItem(_i18n("vw-room-page"),viewPageCmd)}else{mnuItem=new App.ui.ActionMenuItem(_i18n("vw-team-page"),viewPageCmd)}App.D.addClass(mnuItem.getAnchor(),"mango-view-room");actionMenu.add(mnuItem)}this.parentNode.appendChild(actionMenu.getEl())};App.ui.GroupChatActionList.prototype.toggle=function(){if(this.focused){this.hide()}else{this.show();this.handleRequest({type:"hide-member-list",message:""})}};App.ui.GroupChatActionList.prototype.update=function(resp){var data=Ulib.clone(resp.data);App.model.users.update(data.felix_user_id,data)};App.ui.GroupFlyoutActionList=function(parent,settings,rec,mediator,room_object){this.constructor.superclass.constructor.call(this,parent,settings,rec,mediator);this.room_object=room_object;App.event.DataSync.ignoreUnignoreSyncEvent.subscribe(this.refresh,this,true)};App.L.extend(App.ui.GroupFlyoutActionList,App.ui.BaseActionList);App.ui.GroupFlyoutActionList.prototype.createMenu=function(){var felix_id=this.record.getId(),user_name=this.record.getName(),conv_id=this.room_object.getId(),conf=App.config.SessionConfig,mnuItem;var callback={fn:this.update,scope:this};this.actionMenu=new App.ui.ActionMenu("groupFlyoutActionMenu");var vwhist=new App.ui.ViewHistory({felix_id:felix_id,conv_id:conv_id});var vwCommand=new App.ui.ActionCommand(vwhist.run,vwhist);var mnuItem=new App.ui.ActionMenuItem(_i18n("vw-hist"),vwCommand);App.D.addClass(mnuItem.getAnchor(),"mango-view-history");this.actionMenu.add(mnuItem);if(this.settings.has("show_my_buddies","Y")&&this.settings.has("add_buddies","Y")){if(this.record.isAuthenticated()){var fav=!this.record.isBuddy()?new App.ui.Add2Favorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),this.record,callback,_i18n("add2fav",{name:this.settings.get("favorite_label")})):new App.ui.RemoveFrmFavorite({felix_user_id:felix_id,contact_id:this.record.contact_id},conf.get("add2FavURI"),callback,_i18n("del2fav",{name:this.settings.get("favorite_label")}));var favCommand=new App.ui.ActionCommand(fav.execute,fav);mnuItem=new App.ui.ActionMenuItem(fav.label,favCommand);App.D.addClass(mnuItem.getAnchor(),this.record.isBuddy()?"mango-removefav":"mango-addfav");this.actionMenu.add(mnuItem)}}if(this.record.getPageURL()!="#"){var viewPage=new App.ui.ViewProfilePage(this.record.getPageURL());var viewPageCmd=new App.ui.ActionCommand(viewPage.go,viewPage);mnuItem=new App.ui.ActionMenuItem(_i18n("vw-profile"),viewPageCmd);App.D.addClass(mnuItem.getAnchor(),"mango-view-profile");this.actionMenu.add(mnuItem)}if(App.config.product==App.config.WEBIM){this.actionMenu.addSeparator();var warn=new App.ui.Warn({userIdToWarn:felix_id,conv_id:conv_id,userNameToWarn:user_name},null,this.record.isVisitor());var wrnCommand=new App.ui.ActionCommand(warn.confirm,warn);mnuItem=new App.ui.ActionMenuItem(_i18n("warn"),wrnCommand);App.D.addClass(mnuItem.getAnchor(),"mango-warn");this.actionMenu.add(mnuItem);var ignore=Ulib.inArray(conf.get("ignored_user_list"),felix_id)==-1?new App.ui.Ignore({ignoredUserId:felix_id,ignoredUserName:user_name,conv_id:conv_id},callback,_i18n("ignore")):new App.ui.Unignore({userIdToUnignore:felix_id,userNameToUnignore:user_name,conv_id:conv_id},callback,_i18n("unignore"));var ignCommand=new App.ui.ActionCommand(ignore.confirm,ignore);mnuItem=new App.ui.ActionMenuItem(ignore.label,ignCommand);App.D.addClass(mnuItem.getAnchor(),(ignore instanceof App.ui.Ignore)?"mango-ignore":"mango-unignore");this.actionMenu.add(mnuItem);if((conf.has("user_role","A")||conf.has("user_role","M"))&&!this.record.isAdmin()){var remove=new App.ui.RemoveUser({felix_user_id:felix_id,community_id:this.settings.get("id")},conf.get("removeURI"));var remCommand=new App.ui.ActionCommand(remove.confirm,remove);mnuItem=new App.ui.ActionMenuItem(_i18n("remove"),remCommand);App.D.addClass(mnuItem.getAnchor(),"mango-remove-user");this.actionMenu.add(mnuItem)}}this.parentNode.appendChild(this.actionMenu.getEl())};App.ui.GroupFlyoutActionList.prototype.update=function(resp){if(resp.has_ignored===true){var ignored_users=App.config.SessionConfig.get("ignored_user_list");if(ignored_users){ignored_users.push(resp.ignoredUserId)}App.event.DataSync.ignoreUnignoreSyncEvent.fire()}else{if(resp.has_ignored===false){var ignored_users=App.config.SessionConfig.get("ignored_user_list");if(ignored_users){var idx=Ulib.inArray(ignored_users,resp.userIdToUnignore);ignored_users.splice(idx,1)}App.event.DataSync.ignoreUnignoreSyncEvent.fire()}else{var data=Ulib.clone(resp.data);App.model.users.update(data.felix_user_id,data)}}};App.ui.GroupFlyoutActionList.prototype.remove=function(){App.event.DataSync.ignoreUnignoreSyncEvent.unsubscribe(this.refresh,this);this.clear();App.helper.removeEl(this.parentNode)};App.ui.BasicAction=function(data,url,callback){this.data=data;this.reqURI=url;this.callback=this.processCallback(callback)};App.L.augmentProto(App.ui.BasicAction,App.util.ActivityHandler);App.ui.BasicAction.prototype.run=function(e){if(e){App.E.stopEvent(e)}if(this.reqURI){RoR.send(this.reqURI,Ulib.toQuery(this.data),{success:this.success,failure:this.failure,scope:this})}else{alert(_i18n("upcoming"))}};App.ui.BasicAction.prototype.success=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);resp.success?this.callback(resp):this.failure(resp,true)};App.ui.BasicAction.prototype.failure=function(resp,bInvalidResponse){if(bInvalidResponse){if(resp.error){alert(resp.error)}}else{}};App.ui.BasicAction.prototype.processCallback=function(callback){if(!App.L.isObject(callback)){return function(){}}return function(args){callback.fn.apply(callback.scope||this,[args])}};App.ui.Add2Favorite=function(data,url,record,callback,label){this.constructor.superclass.constructor.call(this,data,url,callback);this.record=record;this.label=label;this.self_auth=App.config.SessionConfig.has("is_auth","Y");this.other_auth=this.record.isAuthenticated();this.is_buddy=this.record.isBuddy()&&this.record.isContact()};App.L.extend(App.ui.Add2Favorite,App.ui.BasicAction);App.ui.Add2Favorite.prototype.execute=function(e){if(e){App.E.stopEvent(e)}var buddy_label=Ulib.truncate(App.config.Settings.get("favorite_label"),10);if(!this.is_buddy&&this.self_auth&&this.other_auth){this.run()}else{if(this.self_auth&&!this.other_auth){alert(_i18n("fav-o-login",{name:App.config.Settings.get("favorite_label")}))}else{alert(_i18n("fav-u-login",{name:App.config.Settings.get("favorite_label")}))}}};App.ui.RemoveFrmFavorite=function(data,url,callback,label){this.constructor.superclass.constructor.call(this,data,url,callback);this.label=label};App.L.extend(App.ui.RemoveFrmFavorite,App.ui.BasicAction);App.ui.RemoveFrmFavorite.prototype.execute=function(e){if(e){App.E.stopEvent(e)}var buddy_label=Ulib.truncate(App.config.Settings.get("favorite_label"),10);if(confirm(_i18n("del-confirm",{name:App.config.Settings.get("favorite_label")}))){this.data.remove="Y";this.run();delete this.data.remove}};App.ui.Warn=function(data,callback,canWarn){this.data=data;this.callback=callback;this.canWarn=canWarn};App.ui.Warn.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("warn-confirm"))){if(!this.canWarn){return alert(_i18n("cant-warn"))}Janus.warn(this.data,this.callback)}};App.ui.Ignore=function(data,callback,label){this.data=data;this.callback=callback;this.label=label};App.ui.Ignore.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("ignore-confirm"))){Janus.ignore(this.data,this.callback)}};App.ui.Unignore=function(data,callback,label){this.data=data;this.callback=callback;this.label=label};App.ui.Unignore.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("unignore-confirm"))){Janus.unignore(this.data,this.callback)}};App.ui.RemoveUser=function(data,url,callback){this.constructor.superclass.constructor.call(this,data,url,callback)};App.L.extend(App.ui.RemoveUser,App.ui.BasicAction);App.ui.RemoveUser.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("remove-confirm"))){this.run()}};App.ui.RemoveUser.prototype.success=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){App.model.users.remove(resp.felix_user_id)}else{if(resp.error){alert(resp.error)}}};App.ui.ViewHistory=function(data,url,callback){this.constructor.superclass.constructor.call(this,data,url,callback);this.data.theme=App.config.SessionConfig.get("theme");this.data.authToken=App.config.SessionConfig.get("session_id");this.data.path="history"};App.L.extend(App.ui.ViewHistory,App.ui.BasicAction);App.ui.ViewHistory.prototype.run=function(e){if(e){App.E.stopEvent(e)}this.data.noCache=App.helper.getTime();var url_arr=[HOST_PREF,App.config.SessionConfig.get("pastChatURI"),"?",Ulib.toQuery(this.data),"&","search_in=chats"];if(App.config.product==App.config.WEBIM){var win=window.open(url_arr.join(""),this.data.felix_id+"vw_chat_win","width=980,height=650,menubar=no,resizable=no,location=no,status=no,scrollbars=yes");if(!win){alert(_i18n("popup-block"))}}else{window.location.href=url_arr.join("")}};App.ui.Block=function(data,url,callback,label,successor){this.constructor.superclass.constructor.call(this,data,url,callback);this.label=label;this.addSuccessor(successor)};App.L.extend(App.ui.Block,App.ui.BasicAction);App.ui.Block.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("blok-confirm"))){this.run()}};App.ui.Block.prototype.success=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){this.handleRequest({type:"block",message:resp.notice,data:this.data})}else{this.failure("error",[resp],true)}};App.ui.Unblock=function(data,url,callback,label,successor){this.constructor.superclass.constructor.call(this,data,url,callback);this.label=label;this.addSuccessor(successor)};App.L.extend(App.ui.Unblock,App.ui.BasicAction);App.ui.Unblock.prototype.confirm=function(e){if(e){App.E.stopEvent(e)}if(confirm(_i18n("unblok-confirm"))){this.run()}};App.ui.Unblock.prototype.success=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){this.handleRequest({type:"unblock",message:_i18n("unblock-success")})}else{this.failure("error",[resp],true)}};App.ui.SendMail=function(data,url,callback,is_auth){this.constructor.superclass.constructor.call(this,data,url,callback);this.zIndex=App.ui.SendMail.prototype.Z_INDEX++;this.count=App.ui.SendMail.prototype.COUNT++;this.is_auth=is_auth;if(is_auth){this._initUI()}};App.L.extend(App.ui.SendMail,App.ui.BasicAction);App.ui.SendMail.prototype.Z_INDEX=1000;App.ui.SendMail.prototype.COUNT=0;App.ui.SendMail.prototype.CSS_CLASS="ms_send_email_pop";App.ui.SendMail.prototype.maxTitleLen=25;App.ui.SendMail.prototype._initUI=function(){var contId="ms_email_cont_"+this.count+"_"+this.data.felix_user_id;var textareaId="ms_email_box_"+this.count+"_"+this.data.felix_user_id;var headerSpnId="ms_email_cont_header_"+this.count+"_"+this.data.felix_user_id;var name=Ulib.truncate(this.data.name,this.maxTitleLen);domBuilder("ms_flyout_container").div({id:contId,style:"display:none;z-index:"+this.zIndex}).addClass(this.CSS_CLASS).h2().a({title:_i18n("close"),href:"#"}).addClass("mango-email-close").end().span({id:headerSpnId}).text(_i18n("email-to")+" "+name).end().end().div().addClass("email_box_body").textarea({id:textareaId}).end().button().addClass("mango-send").text(_i18n("send")).end().append(document.createTextNode(" ")).end().button().addClass("mango-cancel").text(_i18n("close")).end();this.element=App.$(contId);this.box=App.$(textareaId);this.sendbtn=App.S.query("button.mango-send",this.element,true);this.cancelbtn=App.S.query("button.mango-cancel",this.element,true);App.E.on(this.sendbtn,"click",this.execute,this,true);App.E.on(this.cancelbtn,"click",this.hide,this,true);App.E.on(this.element,"click",function(e){if(e){App.E.stopEvent(e)}var targ=App.E.getTarget(e);if(App.D.hasClass(targ,"mango-email-close")){this.hide()}else{this.bringToTop()}},this,true);var dd2=new App.U.DDProxy(this.element,null,{dragOnly:true});dd2.setHandleElId(headerSpnId)};App.ui.SendMail.prototype.hide=function(){App.D.setStyle(this.element,"display","none")};App.ui.SendMail.prototype.show=function(e){if(e){App.E.stopEvent(e)}if(!this.is_auth){return alert(_i18n("no-email",{name:this.data.name}))}App.D.setStyle(this.element,"display","");this.center();this.bringToTop();App.helper.activate(this.box.id)};App.ui.SendMail.prototype.center=function(){var nViewportOffset=10,elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,viewPortWidth=App.D.getViewportWidth(),viewPortHeight=App.D.getViewportHeight(),x,y;if(elementWidth<viewPortWidth){x=(viewPortWidth/2)-(elementWidth/2)+App.D.getDocumentScrollLeft()}else{x=nViewportOffset+App.D.getDocumentScrollLeft()}if(elementHeight<viewPortHeight){y=(viewPortHeight/2)-(elementHeight/2)+App.D.getDocumentScrollTop()}else{y=nViewportOffset+App.D.getDocumentScrollTop()}App.D.setXY(this.element,[parseInt(x,10),parseInt(y,10)])};App.ui.SendMail.prototype.bringToTop=function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=App.D.getStyle(p_oOverlay1,"zIndex"),sZIndex2=App.D.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return -1}else{if(nZIndex1<nZIndex2){return 1}else{return 0}}}aOverlays=App.D.getElementsByClassName(this.CSS_CLASS,"DIV",App.$("ms_flyout_container"));aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=App.D.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)){var bRequiresBump=false;if(oTopOverlay!=oElement){bRequiresBump=true}else{if(aOverlays.length>1){var nNextZIndex=App.D.getStyle(aOverlays[1],"zIndex");if(!isNaN(nNextZIndex)&&(nTopZIndex==nNextZIndex)){bRequiresBump=true}}}if(bRequiresBump){App.D.setStyle(this.element,"zIndex",(parseInt(nTopZIndex,10)+2))}}}};App.ui.SendMail.prototype.toggleState=function(bDisable){bDisable=bDisable===true;this.box.disabled=bDisable;this.sendbtn.disabled=bDisable};App.ui.SendMail.prototype.execute=function(e){if(e){App.E.stopEvent(e)}this.data.message=App.L.trim(this.box.value);if(this.data.message.length==0){return }this.run();this.toggleState(true)};App.ui.SendMail.prototype.success=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){this.box.value="";this.hide();alert(_i18n("mail-sent"))}this.toggleState(false)};App.ui.SendMail.prototype.failure=function(resp,bInvalidResponse){if(bInvalidResponse){if(resp.error){alert(resp.error)}}else{}};App.ui.SendMail.prototype.destroy=function(){App.E.removeListener(this.sendbtn,"click",this.execute,this);App.E.removeListener(this.cancelbtn,"click",this.hide,this);App.E.purgeElement(this.element)};App.ui.SendRFCRequest=function(felix_user_id,user_name,conv_id){this.data={felix_user_id:felix_user_id,conv_id:conv_id,name:user_name};this.zIndex=App.ui.SendRFCRequest.prototype.Z_INDEX++;this.count=App.ui.SendRFCRequest.prototype.COUNT++;this.is_auth=true;if(this.is_auth){this._initUI()}};App.L.augmentProto(App.ui.SendRFCRequest,App.ui.SendMail);App.ui.SendRFCRequest.prototype._initUI=function(){var contId="mango-invite-cont-"+this.count+"-"+this.data.felix_user_id;var textareaId="mango-personal-note-"+this.count+"-"+this.data.felix_user_id;var headerSpnId="mango-invite-cont-header-"+this.count+"-"+this.data.felix_user_id;var name=Ulib.truncate(this.data.name,this.maxTitleLen);domBuilder("ms_flyout_container").div({id:contId,style:"display:none;z-index:"+this.zIndex}).addClass(this.CSS_CLASS).h2().a({title:_i18n("close"),href:"#"}).addClass("mango-email-close").end().span({id:headerSpnId}).text(_i18n("invite-to")+" "+name).end().end().div().addClass("email_box_body").textarea({id:textareaId}).end().button().addClass("mango-send").text(_i18n("send")).end().append(document.createTextNode(" ")).end().button().addClass("mango-cancel").text(_i18n("close")).end();this.element=App.$(contId);this.box=App.$(textareaId);this.sendbtn=App.S.query("button.mango-send",this.element,true);this.cancelbtn=App.S.query("button.mango-cancel",this.element,true);App.E.on(this.sendbtn,"click",this.execute,this,true);App.E.on(this.cancelbtn,"click",this.hide,this,true);App.E.on(this.element,"click",function(e){if(e){App.E.stopEvent(e)}var targ=App.E.getTarget(e);if(App.D.hasClass(targ,"mango-email-close")){this.hide()}else{this.bringToTop()}},this,true);var dd2=new App.U.DDProxy(this.element,null,{dragOnly:true});dd2.setHandleElId(headerSpnId)};App.ui.SendRFCRequest.prototype.execute=function(e){if(e){App.E.stopEvent(e)}this.data.message=App.L.trim(this.box.value);if(this.data.message.length==0){this.data.message="\t"}this.run()};App.ui.SendRFCRequest.prototype.run=function(){Janus.sendRFC(this.data);this.done()};App.ui.SendRFCRequest.prototype.done=function(){alert(_i18n("invite-success"));this.box.value="";this.hide();this.toggleState(false)};App.ui.SendRFCRequest.prototype.destroy=function(){App.E.removeListener(this.sendbtn,"click",this.execute,this);App.E.removeListener(this.cancelbtn,"click",this.hide,this);App.E.purgeElement(this.element);this.element.innerHTML="";App.D.remove(this.element)};App.ui.FileTransfer=function(successor){this.uploading=false;this.chatTab=null;this.callbackHandler={upload:function(xhr){this.handleRequest({type:"upload-end",message:""});this.uploading=false;if(xhr.argument){var form=xhr.argument[0];form.reset();App.S.query("input[type=hidden]",form,true).value=xhr.argument[1]}},scope:this};this.addSuccessor(successor)};App.L.augmentProto(App.ui.FileTransfer,App.util.ActivityHandler);App.ui.FileTransfer.prototype.send=function(e){var el=App.E.getTarget(e);if(e){App.E.stopEvent(e)}if(el&&el.value!=""&&!this.uploading){App.A.setForm(el.form,true);var hidden_elems=App.S.query("input[type=hidden]",el.form);var conv_id=hidden_elems[0].value;var upload_type=hidden_elems[1].value;this.handleRequest({type:"upload-start",message:_i18n("uploading")});this.uploading=true;var param_hash={felix_id:App.config.SessionConfig.get("felix_id"),conversation_id:conv_id,user_name:App.config.SessionConfig.get("user_name"),session_id:App.config.SessionConfig.get("session_id"),upload_type:upload_type,attachment_type:App.config.ATTACHMENT_TYPE};var params=Ulib.toQuery(param_hash);var action=el.form.action+"?"+params;this.callbackHandler.argument=[el.form,conv_id];App.A.asyncRequest("POST",action,this.callbackHandler)}else{App.E.stopEvent(e)}};App.ui.CallNow=function(data,successor,isBlocked){this.constructor.superclass.constructor.call(this,data);this.isBlocked=isBlocked;this.user=successor.record;this.addSuccessor(successor)};App.L.extend(App.ui.CallNow,App.ui.BasicAction);App.L.augmentProto(App.ui.CallNow,App.util.ActivityHandler);App.ui.CallNow.prototype.run=function(e){if(e){App.E.stopEvent(e)}if(this.validate(this.user)){this.data.noCache=App.helper.getTime();App.ui.oneOOneAudio(this.data,this.data.OUID);this.handleRequest({type:"call-now-open",message:""})}return false};App.ui.CallNow.prototype.validate=function(user){var isCallNow=false;if(user.isOffline()){alert(_i18n("user-offline-for-audio-call"))}else{if(this.isBlocked){alert(_i18n("user-blocked-for-audio-call"))}else{isCallNow=true}}return isCallNow};App.ui.VideoCall=function(data,successor,isBlocked){this.constructor.superclass.constructor.call(this,data);this.user=successor.record;this.isBlocked=isBlocked;this.addSuccessor(successor)};App.L.extend(App.ui.VideoCall,App.ui.BasicAction);App.L.augmentProto(App.ui.VideoCall,App.util.ActivityHandler);App.ui.VideoCall.prototype.run=function(e){if(e){App.E.stopEvent(e)}if(this.validate(this.user)){this.data.noCache=App.helper.getTime();App.ui.oneOOneVideo(this.data,this.data.OUID);this.handleRequest({type:"call-now-open",message:""})}return false};App.ui.VideoCall.prototype.validate=function(user){var VideoCall=false;if(user.isOffline()){alert(_i18n("user-visitor-for-video-call"))}else{if(this.isBlocked){alert(_i18n("user-blocked-for-video-call"))}else{VideoCall=true}}return VideoCall};App.ui.ViewRoomPage=function(url){this.url=url};App.ui.ViewRoomPage.prototype.go=function(e){if(this.url!="#"){window.location.assign(App.helper.formatURL(this.url))}};App.ui.ViewProfilePage=function(url){this.constructor.superclass.constructor.call(this,url)};App.L.extend(App.ui.ViewProfilePage,App.ui.ViewRoomPage);App.ui.oneOOneAudio=function(data,windowName){var win=window.open(HOST_PREF+App.config.SessionConfig.get("chatURI")+"?"+Ulib.toQuery(data),windowName," height=420 ,width=460, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no");if(!win){alert(_i18n("popup-block"))}};App.ui.oneOOneVideo=function(data,windowName){var win=window.open(HOST_PREF+App.config.SessionConfig.get("chatURI")+"?"+Ulib.toQuery(data),windowName," height=400 ,width=350, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no");if(!win){alert(_i18n("popup-block"))}};App.ui.oneOOneChat=function(data,windowName){var win=window.open(HOST_PREF+App.config.SessionConfig.get("chatURI")+"?"+Ulib.toQuery(data),windowName," height=420 ,width=460, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no");if(!win){alert(_i18n("popup-block"))}};App.ui.CompositeRoomsListView=function(id,parent,settings,dataSource,mediator,state){if(state.getState()==App.config.OFFLINE_STATE){return false}this.constructor.superclass.constructor.call(this,id,settings,mediator);mediator.add(this);this.parentNode=App.$(parent);this.roomsModel=dataSource;this._init(dataSource)};App.L.extend(App.ui.CompositeRoomsListView,App.ui.ListView);App.ui.CompositeRoomsListView.prototype._init=function(dataSource){var onlineList=domBuilder(this.parentNode).div({id:"mango-room-tab"}).addClass("mango-button-cont").div({id:"mango-room-tab-button"}).addClass("mango-tab-button").span({id:"mango-room-count"}).text(Ulib.truncate(this.settings.get("my_rooms_label"),10)).span().addClass("mango-room-count-num").text("(<strong>"+dataSource.totalRooms()+"</strong>)").end().end().end().div({id:"mango-room-list",style:"display:none"}).addClass("mango-window-wrapper").div().addClass("mango-list-wrapper");this.element=App.$("mango-room-tab");this.layer=App.$("mango-room-list");if(this.settings.has("show_admin_created_rooms","Y")){this.adminRooms=new App.ui.AdminRoomsView(App.config.ADMIN_ROOMS_LIST_ID,App.S.query("div.mango-list-wrapper",this.layer,true),this.settings,dataSource)}if(this.settings.has("show_my_rooms","Y")){this.userRooms=new App.ui.UserRoomsView(App.config.USER_ROOMS_LIST_ID,App.S.query("div.mango-list-wrapper",this.layer,true),this.settings,dataSource)}var container=App.D.getFirstChild(this.layer);var obj=domBuilder(container).div({id:"mango-create-adhoc-room"}).addClass("mango-clearfix");if(App.config.product==App.config.WEBIM){if(this.settings.has("allow_create_groups","Y")){obj=domBuilder(obj.currentNode).a({id:"mango-create-room",href:"#",title:_i18n("create-tip")}).text(_i18n("create-room-lbl")).on("click",this.toggleCreateRoom,null,this).end().span().addClass("mango-vertical-separator").end()}}else{obj=domBuilder(obj.currentNode).a({href:HOST_PREF+"/ce/"+App.config.productPath+App.config.SessionConfig.get("createGrp"),id:"mango-create-room",title:_i18n("create-team-tip")}).text(_i18n("create-room-lbl")).end().span().addClass("mango-vertical-separator").end()}if(this.settings.has("allow_search_groups","Y")){obj=domBuilder(obj.currentNode).a({href:HOST_PREF+"/ce/"+App.config.productPath+App.config.SessionConfig.get("findGrp"),id:"mango-find-more-room",title:_i18n("find-team-tip")}).text(_i18n("find-room-lbl")).end().span().addClass("mango-vertical-separator").end()}if(App.config.product==App.config.WEBIM){obj=domBuilder(obj.currentNode).a({href:"#",id:"mango-refresh-room-list",title:_i18n("refresh-tip")}).text(_i18n("refresh-room-lbl")).on("click",this.refresh,null,this).end()}if(this.settings.has("allow_create_groups","Y")){domBuilder(container).div({id:"mango-adhoc-room-container",style:"display:none"}).form({id:"frm_sg_adhoc_room",style:"margin:0"}).on("submit",this.createRoom,null,this).label().text(_i18n("lbl-room-name")).end().input({type:"text",id:"mango-adhoc-room",value:"",name:"room_name"}).addClass("mango-text").end().div().addClass("mango-create-button-cont").input({type:"submit",value:_i18n("create"),id:"mango-save-room"}).addClass("mango-submit").end().append(document.createTextNode("  ")).end().input({type:"reset",value:_i18n("cancel-button"),id:"mango-cancel-room"}).addClass("mango-submit").on("click",this.toggleCreateRoom).end()}domBuilder(container).div({id:"mango-room-list-error"});App.E.on(["mango-room-tab-button",App.S.query("h2.minimize",this.element,true)],"click",this.toggleView,null,this);this.adhocSaveBut=App.$("mango-save-room")};App.ui.CompositeRoomsListView.prototype.toggleCreateRoom=function(e){Ulib.toggle("mango-adhoc-room-container");try{App.helper.activate("mango-adhoc-room");App.E.stopEvent(e)}catch(ex){}};App.ui.CompositeRoomsListView.prototype.createRoom=function(e){App.E.stopEvent(e);var form=App.E.getTarget(e);var room_el=App.S.query("input[type=text]",form,true);var v=App.L.trim(room_el.value);if(v.match(/[><]/g)){return alert(_i18n("no-lt-gt"))}if(v){this.adhocSaveBut.value=_i18n("creating-txt");var conf=App.config.SessionConfig;RoR.send(conf.get("createRoomURI"),Ulib.toQuery({community_id:conf.get("community_id"),group_name:v,default_group_id:conf.get("default_group_id")}),{success:this._createRoomComplete,scope:this,argument:room_el})}};App.ui.CompositeRoomsListView.prototype._createRoomComplete=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){this.adhocSaveBut.value=_i18n("create");xhr.argument.value="";this.toggleCreateRoom();this.addNewRoom(resp.room_id,resp.room_obj)}else{App.system._failure(xhr)}};App.ui.CompositeRoomsListView.prototype.addNewRoom=function(room_id,room_obj){room_obj=this.roomsModel.add(room_id,room_obj);App.ui.socialBar.openChat(App.config.GROUP_CONV_TYPE,room_obj,true);var el=App.S.query("span.mango-room-count-num",this.element,true);if(el){el.innerHTML="(<strong>"+this.roomsModel.totalRooms()+"</strong>)"}};App.ui.CompositeRoomsListView.prototype.refresh=function(e){App.E.stopEvent(e);var a=App.E.getTarget(e);a.innerHTML=_i18n("refresh-pending");App.E.removeListener(a,"click",this.refresh);var conf=App.config.SessionConfig;RoR.send(conf.get("refreshRoomsURI"),null,{success:this._refreshComplete,scope:this,argument:[a]})};App.ui.CompositeRoomsListView.prototype._refreshComplete=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);if(resp&&resp.success){this.destroy();App.log(" channel disconnected due to refresh group as we'll be realoding the app ");App.net.Socket.disconnect();App.ui.socialBar.saveState();App.ui.socialBar.destroy();App.system.reboot()}else{xhr.argument[0].innerHTML=_i18n("refresh-room-lbl");App.E.on(xhr.argument.pop(),"click",this.refresh,null,this);alert(resp.error)}};App.ui.CompositeRoomsListView.prototype.changeState=function(state){if(App.config.OFFLINE_STATE==state.getState()||App.config.SUSPEND_STATE==state.getState()){this.destroy()}};App.ui.CompositeRoomsListView.prototype.destroy=function(){with(App.E){removeListener("frm_sg_adhoc_room","submit",this.createRoom);removeListener(["mango-cancel-room","mango-create-room"],"submit",this.toggleCreateRoom);removeListener(["mango-room-tab-button",App.S.query("h2.minimize",this.element,true)],"click",this.toggleView)}if(this.adminRooms){this.adminRooms.destroy()}if(this.userRooms){this.userRooms.destroy()}App.helper.removeEl(this.element)};App.ui.CompositeRoomsListView.prototype.toString=function(){return"App.ui.CompositeRoomsListView { focused => "+this.focused+" }"};App.ui.AdminRoomsView=function(id,parent,settings,dataSource){this.rooms=dataSource.select(this.isAdminCreatedRoom);this.parentNode=App.$(parent);this.settings=settings;this.roomsModel=dataSource;this.attribToExtract="mango_id";this._initView();this.roomsModel.onAdd.subscribe(this.add,this,true);this.roomsModel.onUpdate.subscribe(this.update,this,true);this.roomsModel.onRemove.subscribe(this.remove,this,true)};App.L.augmentProto(App.ui.AdminRoomsView,App.ui.ModeratorListView,true);App.ui.AdminRoomsView.prototype.isAdminCreatedRoom=function(rec){if(App.config.product==App.config.WEBIM){if(App.L.isObject(rec)){return(rec.is_user_defined_group==false)}}else{return true}return false};App.ui.AdminRoomsView.prototype._initView=function(){domBuilder(this.parentNode).h2().addClass("minimize").span().text(this.settings.get("admin_created_room_label"));var ul=document.createElement("ul"),room,len=this.rooms.length;ul.className="mango-list mango-admin-rooms-list";this._setHeight(ul);if(len==0){this._noItem(ul)}else{for(var i=0;i<len;++i){room=this.rooms[i];this.renderItem(ul,room,false)}}domBuilder(this.parentNode).div().addClass("mango-content-wrapper").append(ul);App.E.on(ul,"click",this.click,null,this);ul=null};App.ui.AdminRoomsView.prototype._setHeight=function(ul){len=this.rooms.length;if(len>=App.config.listItemCount){ul.style.height=(App.config.listItemCount*App.config.listItemHeight)+"px";ul.style.overflowY="auto"}};App.ui.AdminRoomsView.prototype._noItem=function(ul){domBuilder(ul).li().addClass("mango-no-item").div().addClass("mango-not-available").text(_i18n("no-admin-room"))};App.ui.AdminRoomsView.prototype.renderItem=function(ul,room,firstChild){var h=App.config.listItemHeight,w=App.config.listItemWidth;var label="";if(App.config.product==App.config.WEBIM){label="room-moderator-lbl"}else{label="room-members-lbl"}domBuilder(ul).li({mango_id:room.id,style:"height:"+h+"px;",id:"mango-rml-adm-"+room.id},(firstChild?"afterBegin":undefined)).addClass("mango-room mango-list-item").a({href:"#"}).addClass("mango-clearfix mango-user-item").img({src:room.conv_image_url,height:25,width:25}).addClass("mango-room-icon").end().div({style:"width:"+w+"px"}).addClass("item-status").strong().text(Ulib.truncate(room.getName(),App.config.roomNameMaxLen)).end().p({id:"mango-rml-room-status"+room.id,style:"display:block"}).strong().addClass("mango-presence-status").text(_i18n(label)+" : "+room.getModeratorCount()+" / "+_i18n("room-active-user-lbl")+" : "+room.getActiveCount())};App.ui.AdminRoomsView.prototype.add=function(room){if(this.isAdminCreatedRoom(room)){this.rooms.push(room);var ul=App.S.query("ul.mango-admin-rooms-list",this.parentNode,true);var li=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(li);this._setHeight(ul);this.renderItem(ul,room,true)}};App.ui.AdminRoomsView.prototype.update=function(room){var strongEl=App.S.query("#mango-rml-room-status"+room.id+" strong",null,true);var label="";if(App.config.product==App.config.WEBIM){label="room-moderator-lbl"}else{label="room-members-lbl"}if(strongEl){strongEl.innerHTML=_i18n(label)+" : "+room.getModeratorCount()+" / "+_i18n("room-active-user-lbl")+" : "+room.getActiveCount()}};App.ui.AdminRoomsView.prototype.remove=function(){};App.ui.AdminRoomsView.prototype.click=function(e){var t,li,attr;with(App.E){t=getTarget(e);stopEvent(e)}li=App.D.getAncestorByTagName(t,"li");if(!li){return }attr=li.getAttribute(this.attribToExtract);if(!attr){return }this.startChat(attr)};App.ui.AdminRoomsView.prototype.startChat=function(id){App.ui.socialBar.openChat(App.config.GROUP_CONV_TYPE,this.roomsModel.select(id),true)};App.ui.AdminRoomsView.prototype.destroy=function(){this.roomsModel.onAdd.unsubscribe(this.add,this);this.roomsModel.onUpdate.unsubscribe(this.update,this);this.roomsModel.onRemove.unsubscribe(this.remove,this);App.E.removeListener(App.S.query("ul.mango-list",this.parentNode,true),this.click,this);this.parentNode.innerHTML=""};App.ui.UserRoomsView=function(id,parent,settings,dataSource){this.rooms=dataSource.select(this.isUserCreatedRoom);this.parentNode=App.$(parent);this.settings=settings;this.attribToExtract="mango_id";this.roomsModel=dataSource;this._initView();this.roomsModel.onAdd.subscribe(this.add,this,true)};App.L.augmentProto(App.ui.UserRoomsView,App.ui.AdminRoomsView,true);App.ui.UserRoomsView.prototype.isUserCreatedRoom=function(rec){if(App.config.product==App.config.WEBIM){if(App.L.isObject(rec)){return(rec.is_user_defined_group)}}else{if(App.L.isObject(rec)){return(rec.is_my_team=="Y")}}return false};App.ui.UserRoomsView.prototype._initView=function(){var ul=document.createElement("ul"),h=App.config.listItemHeight,w=App.config.listItemWidth,room,len=this.rooms.length;domBuilder(this.parentNode).h2().addClass(this.settings.has("show_admin_created_rooms","N")?"minimize":"").span().text(this.settings.get("user_created_room_label"));ul.className="mango-list mango-user-rooms-list";this._setHeight(ul);if(len==0){this._noItem(ul)}else{for(var i=0;i<len;++i){room=this.rooms[i];this.renderItem(ul,room,false)}}domBuilder(this.parentNode).div().addClass("mango-content-wrapper").append(ul);App.E.on(ul,"click",this.click,null,this);ul=null};App.ui.UserRoomsView.prototype._noItem=function(ul){domBuilder(ul).li().addClass("mango-no-item").div().addClass("mango-not-available").text(_i18n("no-user-room"))};App.ui.UserRoomsView.prototype.add=function(room){if(this.isUserCreatedRoom(room)){this.rooms.push(room);var ul=App.S.query("ul.mango-user-rooms-list",this.parentNode,true);var li=App.S.query("li.mango-no-item",ul,true);App.helper.removeEl(li);this._setHeight(ul);this.renderItem(ul,room,true)}};App.ui.CompositeUserSettingsListView=function(id,parent,settings,dataSource,mediator,state){this.constructor.superclass.constructor.call(this,id,settings,mediator);mediator.add(this);this.parentNode=App.$(parent);this.state=state;this.config=App.config.SessionConfig;this.statusEl=App.$("status_change");this.isSavingUserDetail=false;this.isSigningIn=false;this.isOffline=this.state.getState()=="offline";this.isSessionTimeOut=false;this.sendTranscript=true;this._init()};App.L.extend(App.ui.CompositeUserSettingsListView,App.ui.ListView);App.ui.CompositeUserSettingsListView.prototype.headerMaxNameLen=18;App.ui.CompositeUserSettingsListView.prototype.savingText=_i18n("saving-txt");App.ui.CompositeUserSettingsListView.prototype.saveButtonTxt=_i18n("save-button");App.ui.CompositeUserSettingsListView.prototype.pwdMinLen=6;App.ui.CompositeUserSettingsListView.prototype.pwdMaxLen=20;App.ui.CompositeUserSettingsListView.prototype.emailRegex=/^([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+$/;App.ui.CompositeUserSettingsListView.prototype._init=function(){var list=domBuilder(this.parentNode).div({id:"mango-user-tab"}).addClass("mango-button-cont").div({id:"mango-user-tab-button"}).addClass("mango-tab-button ").addClass(App.helper.getPresenceClass(this.config.get("presence_id"))).div({id:"mango-usertab-status-img"}).text(Ulib.truncate(this.settings.get("status_label"),10)).end().end().div({id:"mango-user-win",style:"display:none"}).addClass("mango-window-wrapper").div().addClass("mango-list-wrapper");this.element=App.$("mango-user-tab");this.tabElement=App.$("mango-user-tab-button");this.layer=App.$("mango-user-win");this.createHeader(list.currentNode);list=domBuilder(list.currentNode).div().addClass("mango-content-wrapper").div({id:"mango-user-tab-content"});this.createTopLinks(list.currentNode,"mango-usertab-header-links");this.createSettingsForm(list.currentNode);this.createEditProfileForm(list.currentNode);this.createSignInForm(list.currentNode);this.createUserPresenceStatusBlock(list.currentNode);this.createTranscriptForm(list.currentNode);this.createUserDetailBlock(list.currentNode);this._initInPlaceEdit();App.E.on([this.tabElement,App.S.query("h2.minimize",this.element,true)],"click",this.toggleView,null,this);this.positionLayer()};App.ui.CompositeUserSettingsListView.prototype.positionLayer=function(){if(this.state.getState()==App.config.OFFLINE_STATE){if(!QUIRKS_MODE||YAHOO.env.ua.gecko){App.D.setStyle(this.layer,"right","15px")}}};App.ui.CompositeUserSettingsListView.prototype.createHeader=function(node){domBuilder(node).h2().addClass("minimize").span().addClass("mango-community-name").text(Ulib.truncate(this.settings.get("name"),25))};App.ui.CompositeUserSettingsListView.prototype.createTopLinks=function(node,id){var obj=domBuilder(node).div({id:id});var space=true;var command="";if((this.state.getState()==App.config.ONLINE_STATE)){if(this.settings.has("show_tips","Y")){if(App.C.get("no_tips",parseInt)==0){command="none"}App.C.set("no_tips",0,{path:"/"});obj=domBuilder(obj.currentNode).span().addClass("mango-vertical-separator").end().a({href:"#",id:"mango-show-tips"}).on("click",this.toggleTips,null,this).text(command?_i18n("show-tips"):_i18n("hide-tips")).end();space=false;domBuilder(document.body).div({id:"ms_notification_sticky",style:"display:"+command}).div().addClass("close").text("x").on("click",function(e){this.toggleTips()},null,this)}obj=domBuilder(obj.currentNode).span().addClass("mango-vertical-separator").end().a({href:"#",id:"mango-edit-settings"}).text(_i18n("edit-settings")).on("click",this.toggleSettings,null,this).end();if(this.config.has("is_auth","N")){obj=domBuilder(obj.currentNode).span().addClass("mango-vertical-separator").end().a({href:"#",id:"mango-edit-prof"}).text(_i18n("edit-prof")).on("click",this.toggleEditProfile,null,this).end();space=false}}if(this.settings.has("auth_type","I")&&App.config.product==App.config.WEBIM){if(this.config.has("is_auth","N")||this.state.getState()==App.config.OFFLINE_STATE){obj=domBuilder(obj.currentNode).span().addClass("mango-vertical-separator").end().a({href:"#",id:"mango-signin"}).text(_i18n("sign-in")).on("click",this.toggleSignIn,null,this).end();space=false}}if(space){obj.currentNode.appendChild(document.createTextNode(" "))}};App.ui.CompositeUserSettingsListView.prototype.createSettingsForm=function(node){if(this.state.getState()==App.config.ONLINE_STATE){this._loadSettings();var list=domBuilder(node).div({id:"mango-edit-settings-container",style:"display:none"}).form({id:"mango-frm-save-settings",style:"margin:0;padding:0"}).on("submit",this.saveSettings,null,this).div({id:"mango-save-settings-status"}).end().div({style:"position:absolute;right: 5px",title:_i18n("close")}).addClass("mango-box-close").on("click",this.toggleSettings,null,this).end().div({style:"margin-top: 10px"}).strong({style:"display:block; margin-bottom: 5px;"}).text(_i18n("setting-header-1")).end().ul().addClass("mango-settings-list").li().label({"for":"mango-show-toaster"}).addClass("mango-align-input").input({type:"checkbox",id:"mango-show-toaster",name:"show_toaster",value:App.config.YES}).end().append(document.createTextNode(_i18n("setting-lbl-1"))).end().end().end().end().strong({style:"display:block; margin-bottom: 5px;"}).text(_i18n("setting-header-2")).end().ul().addClass("mango-settings-list").li().label({"for":"mango-play-sound"}).addClass("mango-align-input").input({type:"checkbox",id:"mango-play-sound",name:"play_sound",value:App.config.YES}).end().append(document.createTextNode(_i18n("setting-lbl-2"))).end().end().end().end().div({style:"padding:0;margin:0;text-align:center"}).input({type:"submit",value:_i18n("save-button"),id:"mango-save-settings"}).addClass("mango-submit").end().end();this.settingsStatusEl=App.$("mango-save-settings-status");this.settingsCont=App.$("mango-edit-settings-container");App.$("mango-show-toaster").checked=this.config.has("show-toaster","Y")?true:false;App.$("mango-play-sound").checked=this.config.has("play-sound","Y")?true:false}};App.ui.CompositeUserSettingsListView.prototype.createEditProfileForm=function(node){if(this.state.getState()==App.config.ONLINE_STATE&&this.config.has("is_auth","N")){domBuilder(node).div({id:"mango-edit-user-profile-container",style:"display:none"}).form({id:"mango-frm-save-user-detail",style:"margin:0;padding:0"}).on("submit",this.saveUserDetail,null,this).div({id:"save-user-profile-status"}).end().div({style:"position:absolute;right: 0px; top: 45px;",title:_i18n("close")}).addClass("mango-box-close").on("click",this.toggleEditProfile,null,this).end().label({"for":"user_full_name"}).text(_i18n("lbl-name")).end().input({type:"text",id:"user_full_name",value:this.config.get("user_name")}).addClass("mango-text").end().label({"for":"user_email_id",style:"margin-top:8px"}).text(_i18n("lbl-email")+" ("+_i18n("optional")+")").end().input({type:"text",id:"user_email_id",value:""}).addClass("mango-text").end().div({style:"padding:0;margin:10px 0 0 0;text-align:center"}).input({type:"submit",value:_i18n("save-button"),id:"mango-save-user-detail"}).addClass("mango-submit").end().end();this.detailStatusEl=App.$("save-user-profile-status");this.saveDetailButton=App.$("mango-save-user-detail");this.editProfileCont=App.$("mango-edit-user-profile-container")}};App.ui.CompositeUserSettingsListView.prototype.createSignInForm=function(node){if(this.settings.has("auth_type","I")){domBuilder(node).div({id:"mango-signin-container",style:"display:none"}).form({id:"mango-frm-signin",method:"post",action:"/mangospring",autocomplete:"on",style:"margin:0;padding:0"}).div({id:"mango-signin-status"}).end().div({style:"position:absolute;right: 0px; top: 45px;",title:_i18n("close")}).addClass("mango-box-close").on("click",this.toggleSignIn,null,this).end().label({"for":"signin_user_id"}).text(_i18n("lbl-login")).append(document.createTextNode(":")).end().end().input({type:"text",id:"signin_user_id",value:"",name:"user_id",autocomplete:"on"}).addClass("mango-text").end().label({"for":"signin_pwd",style:"margin-top:8px"}).text(_i18n("lbl-pwd")).append(document.createTextNode(":")).end().end().input({type:"password",id:"signin_pwd",name:"password",value:"",autocomplete:"on"}).addClass("mango-text").end().div({style:"padding:0;margin:10px 0 0 0;text-align:center"}).input({type:"submit",value:_i18n("login-button"),id:"mango-signin-button"}).addClass("mango-submit").end().end().div({style:"margin-top:8px;font-size:11px;line-height:normal"}).text(_i18n("sign-up-title")).a({href:HOST_PREF+"/ce/"+App.config.productPath+"/user/signup?community_id="+this.config.get("community_id"),target:"_ms_signup",title:_i18n("sign-up")}).addClass("mango-sg-signup").text(" "+_i18n("sign-up"));this.signInButton=App.$("mango-signin-button");this.signInStatusEl=App.$("mango-signin-status");this.signInCont=App.$("mango-signin-container");App.E.on("mango-frm-signin","submit",this.signIn,null,this)}};App.ui.CompositeUserSettingsListView.prototype.createUserPresenceStatusBlock=function(node){var is_online=(this.state.getState()==App.config.ONLINE_STATE);var obj=domBuilder(node).div({id:"mango-user-presence-change"}).addClass("mango-user-presence-status").div().addClass("mango-user-available").div({id:"mango-status-change"}).addClass("mango-status-text").img({src:HOST_PREF+"/ce/images/transparent.gif"}).addClass(App.helper.getPresenceClass(this.config.get("presence_id"))).end().append(document.createTextNode(" ")).end().append(document.createTextNode(is_online?_i18n("online-txt"):_i18n("offline-txt"))).end().append(document.createTextNode(". ")).end().a({href:"#"}).on("mousedown",this.togglePresence,null,this).text(is_online?_i18n("go-offline"):_i18n("go-online")).end()};App.ui.CompositeUserSettingsListView.prototype.createTranscriptForm=function(node){if(this.state.getState()=="online"&&this.settings.has("transcripts_enabled","Y")){var obj=domBuilder(node).div({id:"transcript_container",style:"display:none"}).form({id:"frm_transcript",style:"margin:0"}).on("submit",this._sendTranscript,null,this).div({id:"mango-transcript-msg"}).text(_i18n("trans-text")).end().label({"for":"transcript_email_id"}).text(_i18n("lbl-email")).append(document.createTextNode(" ")).end().span({id:"transcript_status"}).end().end().input({type:"text",title:_i18n("trans-title"),id:"transcript_email_id",value:this.config.has("is_auth","Y")?this.config.get("email_id"):""}).addClass("mango-text").end().div({style:"text-align:center"}).addClass("mango-create-button-cont").input({type:"submit",value:_i18n("yes"),id:"send_transcript_yes"}).addClass("mango-submit").end().append(document.createTextNode("  ")).end().input({type:"submit",value:_i18n("no"),id:"send_transcript_no"}).on("click",function(){this.sendTranscript=false},null,this).addClass("mango-submit").end()}};App.ui.CompositeUserSettingsListView.prototype.createUserDetailBlock=function(node){var is_online=this.state.getState()==App.config.ONLINE_STATE;var obj=domBuilder(node).div().addClass("mango-user-details");if(is_online){domBuilder(obj.currentNode).div({id:"mango-name-tip"}).text(_i18n("name-tip-text"));if(this.config.has("is_auth","Y")){domBuilder(obj.currentNode).div({id:"mango-photo-upload-cont"}).form({id:"ms-photo-upload-frm",enctype:"multipart/form-data",method:"post",action:HOST_DOMAIN+"/fileupload"}).input({type:"hidden",id:"ms-user-upload-type",name:"upload_type",value:App.config.USER_UPLOAD_TYPE}).end().input({type:"file",id:"ms-photo-upload",name:"photo_upload",size:"1",title:_i18n("upload-title")}).on("change",this.uploadAvatar,null,this).end().end().end()}domBuilder(obj.currentNode).img({id:"ms-user-avatar",src:App.helper.formatImage(this.config.get("image_url")),align:"middle"}).end().input({type:"hidden",value:this.config.get("user_name"),id:"edit_user_name"}).end().strong({id:"mango-guest-user-name",title:_i18n("inplace-title")}).addClass(this.config.has("is_auth","N")?"editable":"").text(Ulib.truncate(this.config.get("user_name"),18)).end().input({type:"hidden",value:this.config.get("custom_presence"),id:"mango-edit-custom-presence"}).end().div().addClass("mango-custom-presence-wrapper").div({id:"mango-custom-presence",title:_i18n("inplace-title")+" [ "+this.config.get("custom_presence")+" ]"}).addClass("editable").text(this.config.get("custom_presence")).end().end();this.guestNameEl=App.$("mango-guest-user-name");this.userAvatarImg=App.$("ms-user-avatar")}};App.ui.CompositeUserSettingsListView.prototype._initInPlaceEdit=function(){App.E.onAvailable("mango-custom-presence",function(){this.editable=new App.util.Editable("mango-custom-presence",{dataSrc:"mango-edit-custom-presence",dntSaveExecuteCallback:true});this.editable.addCallback({fn:this._updateCustomPresence,scope:this});this.editable.beforeSave.subscribe(function(type,args){var reqObj=args[0];reqObj.presence_option_id=this.config.get("presence_id")},this,true);if(this.config.has("is_auth","N")){this.name_editable=new App.util.Editable("mango-guest-user-name",{updateURI:this.config.get("visDetailURI"),dataSrc:"edit_user_name"});this.name_editable.beforeSave.subscribe(function(type,args){var reqObj=args[0];reqObj.community_id=this.config.get("community_id");reqObj.name=reqObj.text;delete reqObj.text},this,true);this.name_editable.afterSave.subscribe(function(type,args){var resp=args[0];this.changeUserDetail(resp);Janus.updateParams({userName:resp.name})},this,true)}},this,true)};App.ui.CompositeUserSettingsListView.prototype._updateCustomPresence=function(params){var cPresence=App.$("mango-custom-presence");cPresence.title=_i18n("inplace-title")+" [ "+params.text+" ]";var callback={fn:App.model.users.update,scope:App.model.users};params.custom_presence=params.text;Janus.customPresence(params,callback)};App.ui.CompositeUserSettingsListView.prototype.toggleTips=function(e){var tipAnchor=null;if(e&&App.E.getTarget(e)){tipAnchor=App.E.getTarget(e);App.E.stopEvent(e)}else{tipAnchor=App.$("mango-show-tips")}if(!this.tipsEl){this.tipsEl=App.$("ms_notification_sticky")}Ulib.toggle(this.tipsEl);if(App.D.getStyle(this.tipsEl,"display")=="none"){tipAnchor.innerHTML=_i18n("show-tips")}else{tipAnchor.innerHTML=_i18n("hide-tips")}};App.ui.CompositeUserSettingsListView.prototype.toggleEditProfile=function(e){App.E.stopEvent(e);Ulib.toggle("mango-edit-user-profile-container");if(this.settingsCont){App.D.setStyle(this.settingsCont,"display","none")}if(this.signInCont){App.D.setStyle(this.signInCont,"display","none")}try{App.helper.activate("user_full_name")}catch(ex){}};App.ui.CompositeUserSettingsListView.prototype.toggleSettings=function(e){App.E.stopEvent(e);Ulib.toggle("mango-edit-settings-container");if(this.editProfileCont){App.D.setStyle(this.editProfileCont,"display","none")}if(this.signInCont){App.D.setStyle(this.signInCont,"display","none")}};App.ui.CompositeUserSettingsListView.prototype.toggleSignIn=function(e){App.E.stopEvent(e);try{Ulib.toggle("mango-signin-container");App.helper.activate("signin_user_id");if(this.editProfileCont){App.D.setStyle(this.editProfileCont,"display","none")}if(this.settingsCont){App.D.setStyle(this.settingsCont,"display","none")}}catch(ex){}};App.ui.CompositeUserSettingsListView.prototype.signIn=function(e){App.E.stopEvent(e);var form=App.E.getTarget(e);if(!this.isSigningIn){var data={user_id:App.S.query("input[type=text]",form,true).value,password:App.S.query("input[type=password]",form,true).value};if(this._validateSignIn(data)){this.signInButton.value=_i18n("login-txt");this.isSigningIn=true;try{if(this.state.getState()==App.config.ONLINE_STATE){App.net.Socket.close()}}catch(e){}this.callServer(data)}}};App.ui.CompositeUserSettingsListView.prototype.callServer=function(data){RoR.send(this.config.get("loginURI"),Ulib.toQuery(data),{success:this.signInComplete,scope:this})};App.ui.CompositeUserSettingsListView.prototype._validateSignIn=function(data){if(!data.user_id){return this.showMessage(_i18n("blank-input",{name:"Login Id"}),this.signInStatusEl)}if(!this.emailRegex.test(data.user_id)){return this.showMessage(_i18n("wrong-login-id",{name:"Login Id"}),this.signInStatusEl)}if(!data.password){return this.showMessage(_i18n("blank-input",{name:"Password"}),this.signInStatusEl)}if(data.password.length<this.pwdMinLen){return this.showMessage(_i18n("pwd-min-err",{name:this.pwdMinLen}),this.signInStatusEl)}if(data.password.length>this.pwdMaxLen){return this.showMessage(_i18n("pwd-max-err",{name:this.pwdMaxLen}),this.signInStatusEl)}return true};App.ui.CompositeUserSettingsListView.prototype.signInComplete=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);this.signInButton.value=_i18n("login-button");this.isSigningIn=false;if(App.L.isObject(resp)&&resp.success){this.showMessage(_i18n("login-success"),this.signInStatusEl,true);try{this.goOffline(true);this.goOnline()}catch(e){}}else{this.showMessage(resp.error,this.signInStatusEl)}};App.ui.CompositeUserSettingsListView.prototype.changeUserDetail=function(data){this.guestNameEl.innerHTML=Ulib.truncate(data.name,this.headerMaxNameLen);try{App.$("edit_user_name").value=data.name;App.$("user_full_name").value=data.name}catch(e){}try{if(data.email.indexOf("@pool")>-1){data.email=""}}catch(e){}this.config.set({user_name:data.name,email_id:data.email});App.net.Socket.changeUserName(data.name);this.fillTranscriptEmail(data.email);var ck_obj={user_name:data.name};App.util.JSONCookie.write("usr_dtl",ck_obj,{expires:new Date(new Date().getTime()+(1000*60*60*24*14))});var xml='<iq><system msgType="S" msgSubType="VDM" userId="'+data.f_id+'" userName="'+data.name+'"/></iq>';App.ui.socialBar.handleSubTypes(new XMPP_IQ(xml))};App.ui.CompositeUserSettingsListView.prototype.fillTranscriptEmail=function(email){App.$("transcript_email_id").value=email};App.ui.CompositeUserSettingsListView.prototype.changeUserAvatar=function(image){this.userAvatarImg.src=image};App.ui.CompositeUserSettingsListView.prototype.changeCustomPresence=function(type,args){var obj=args[0];if(obj.custom_presence&&this.config.isYou(obj.felix_id)){App.$("edit_cust_presence").value=obj.custom_presence;App.$("custom_presence").innerHTML=obj.custom_presence}};App.ui.CompositeUserSettingsListView.prototype._loadSettings=function(){var setting=App.C.get("mango_prefs",App.J.parse);if(!setting){setting={"show-toaster":App.config.YES,"play-sound":App.config.YES}}this.config.set(setting)};App.ui.CompositeUserSettingsListView.prototype.saveSettings=function(e){App.E.stopEvent(e);setting={"show-toaster":App.$("mango-show-toaster").checked?App.config.YES:App.config.NO,"play-sound":App.$("mango-play-sound").checked?App.config.YES:App.config.NO};App.config.SessionConfig.set(setting);App.C.set("mango_prefs",App.J.stringify(setting),{path:"/",expires:new Date(new Date().setFullYear(new Date().getFullYear()+2))});this.showMessage(_i18n("sv-success"),this.settingsStatusEl,true)};App.ui.CompositeUserSettingsListView.prototype.saveUserDetail=function(e){App.E.stopEvent(e);if(!this.isSavingUserDetail){var data={name:App.L.trim(App.$("user_full_name").value),email_id:App.L.trim(App.$("user_email_id").value)};if(this._validateUserDetail(data)){this.saveDetailButton.value=this.savingText;this.isSavingUserDetail=true;RoR.send(this.config.get("visDetailURI"),Ulib.toQuery(data),{success:this.saveDetailComplete,scope:this})}}};App.ui.CompositeUserSettingsListView.prototype._validateUserDetail=function(data){if(!data.name){this.showMessage(_i18n("blank-input",{name:"Name"}),this.detailStatusEl);return false}if(data.name.match(/[><]/g)){this.showMessage(_i18n("no-lt-gt"),this.detailStatusEl);return false}if(data.email_id&&!this.emailRegex.test(data.email_id)){this.showMessage(_i18n("email-error"),this.detailStatusEl);return false}return true};App.ui.CompositeUserSettingsListView.prototype.saveDetailComplete=function(xhr){var resp=Ulib.evalJSON(xhr.responseText);this.saveDetailButton.value=_i18n("save-button");this.isSavingUserDetail=false;if(App.L.isObject(resp)&&resp.success){this.showMessage(_i18n("sv-success"),this.detailStatusEl,true);this.changeUserDetail(resp);Janus.updateParams({userName:resp.name})}else{this.showMessage(resp.error||_i18n("sv-failed"),this.detailStatusEl)}};App.ui.CompositeUserSettingsListView.prototype.showMessage=function(str,el,hideAfterInterval){App.$(el).innerHTML=str;App.helper.yellowFade(el);if(hideAfterInterval){App.L.later(3000,this,this.hideMessage,[el])}return false};App.ui.CompositeUserSettingsListView.prototype.hideMessage=function(el){App.$(el).innerHTML=""};App.ui.CompositeUserSettingsListView.prototype.uploadAvatar=function(e){var file=App.E.getTarget(e);var callback={upload:function(){file.form.reset()},scope:this};var params=Ulib.toQuery({felix_id:this.config.get("felix_id"),user_name:this.config.get("user_name"),session_id:this.config.get("session_id"),conversation_id:this.config.get("default_group_id"),upload_type:"UUP"});with(App.A){setForm(file.form,true);asyncRequest("POST",HOST_PREF+"/fileupload?"+params,callback)}};App.ui.CompositeUserSettingsListView.prototype.togglePresence=function(e){if(this.state.getState()==App.config.ONLINE_STATE){App.L.later(0,this,this.goOffline);if(Janus.hasSentMessage()&&this.settings.has("transcripts_enabled","Y")){this.showTranscript()}else{App.L.later(30,this,this.endSession,{community_id:this.settings.get("id"),send_transcript:App.config.NO})}}else{this.goOnline()}};App.ui.CompositeUserSettingsListView.prototype.showTranscript=function(){Ulib.toggle("transcript_container");try{App.helper.activate("transcript_email_id")}catch(e){}};App.ui.CompositeUserSettingsListView.prototype.hideTranscript=function(){Ulib.toggle("transcript_container")};App.ui.CompositeUserSettingsListView.prototype._sendTranscript=function(e){var t=App.E.getTarget(e);App.E.stopEvent(e);var data={community_id:this.settings.get("id"),send_transcript:App.config.NO};if(this.sendTranscript){var email=this.validateTranscriptDetail(t);if(email){data.email_id=email;data.send_transcript=App.config.YES}else{return }}this.hideTranscript();this.endSession(data)};App.ui.CompositeUserSettingsListView.prototype.validateTranscriptDetail=function(form){var email=App.S.query("input[type=text]",form,true);if(!email.value){return this.showMessage(_i18n("blank-input",{name:"Email"}),"transcript_status")}else{if(!this.emailRegex.test(email.value)){return this.showMessage(_i18n("email-error"),"transcript_status")}}return email.value};App.ui.CompositeUserSettingsListView.prototype.changeState=function(state){if(App.config.OFFLINE_STATE==state.getState()||App.config.SUSPEND_STATE==state.getState()){this._removeAvatarBlock();this._removeTopLinks();App.D.addClass(this.tabElement,App.helper.getPresenceClass(this.config.get("presence_id")))}else{this.goOnline()}if(App.config.SUSPEND_STATE==state.getState()){this.destroy()}else{if(App.config.OFFLINE_STATE==state.getState()){App.net.Socket.close()}}this.positionLayer()};App.ui.CompositeUserSettingsListView.prototype._removeAvatarBlock=function(){App.E.removeListener("ms-photo-upload","change",this.uploadAvatar);if(this.editable){this.editable.destroy()}if(this.name_editable){this.name_editable.destroy()}App.helper.removeEl(App.S.query("div.mango-user-details",this.parentNode,true))};App.ui.CompositeUserSettingsListView.prototype._removeTopLinks=function(){with(App.E){if(!this.config.has("is_auth",App.config.YES)){removeListener("mango-signin","click",this.toggleSignIn);removeListener("mango-edit-prof","click",this.toggleEditProfile)}purgeElement("mango-edit-prof");purgeElement("mango-edit-settings");App.D.remove(["mango-edit-settings-container","mango-edit-user-profile-container"])}var obj=domBuilder("mango-usertab-header-links").text("");this.createTopLinks(obj.currentNode,"");var presence_block=App.$("mango-user-presence-change");App.E.purgeElement(presence_block.getElementsByTagName("a")[0]);var parent=presence_block.parentNode;App.helper.removeEl(presence_block);this.createUserPresenceStatusBlock(parent)};App.ui.CompositeUserSettingsListView.prototype.goOffline=function(bSkipCookie){this.config.set({presence_id:App.config.OFFLINE_ID,custom_presence:App.config.OFFLINE_STATE});this.state.goOfflineState();if(!bSkipCookie){App.C.set("off_state","Y",{path:"/"})}};App.ui.CompositeUserSettingsListView.prototype.endSession=function(data){RoR.send(this.config.get("logoutURI"),Ulib.toQuery(data))};App.ui.CompositeUserSettingsListView.prototype.goOnline=function(){this.destroy();App.ui.socialBar.destroy();App.C.set("off_state","N",{path:"/"});App.system.reboot()};App.ui.CompositeUserSettingsListView.prototype.destroy=function(){App.E.removeListener(["mango-user-tab-button",App.S.query("h2.minimize",this.element,true)],"click",this.toggleView);this.element.innerHTML="";App.helper.removeEl(this.element)};App.ui.CompositeUserSettingsListView.prototype.toString=function(){return"App.ui.CompositeUserSettingsListView { focused => "+this.focused+" }"};App.ui.CompositeUpdatesListView=function(id,parent,settings,response,mediator,state){this.constructor.superclass.constructor.call(this,id,settings,mediator);mediator.add(this);this.parentNode=App.$(parent);this.state=state;this.config=App.config.SessionConfig;this.hasUpdated=false;this.isOffline=this.state.getState()=="offline";this.newCount=0;this.totalCount=0;this._init(response)};App.L.extend(App.ui.CompositeUpdatesListView,App.ui.ListView);App.ui.CompositeUpdatesListView.prototype.headerMaxNameLen=18;App.ui.CompositeUpdatesListView.prototype.maxListItemCount=8;App.ui.CompositeUpdatesListView.prototype.listItemHeight=38;App.ui.CompositeUpdatesListView.prototype._init=function(response){var list=domBuilder(this.parentNode).div({id:"mango-update-tab"}).addClass("mango-button-cont").div({id:"mango-update-tab-button"}).addClass("mango-tab-button ").div({id:"mango-updatetab-img"}).text("&nbsp;").span({style:"display:none",id:"mango-update-tooltip"}).end().end().end().div({id:"mango-update-win",style:"display:none"}).addClass("mango-window-wrapper").div().addClass("mango-list-wrapper");this.element=App.$("mango-update-tab");this.tabElement=App.$("mango-update-tab-button");this.layer=App.$("mango-update-win");this.tipElement=App.$("mango-update-tooltip");this.createHeader(list.currentNode);list=domBuilder(list.currentNode).div().addClass("mango-content-wrapper").div({id:"mango-update-loader",style:"display:none"}).end().div({id:"mango-update-tab-content"});this.container=list.currentNode;App.E.on([this.tabElement,App.S.query("h2.minimize",this.element,true)],"click",this.toggleView,null,this);this.printCount(this.container,response);this.onFocus.subscribe(this.firstTimeFocus,this,true);this.onFocus.subscribe(this.hideNewTip,this,true);this.dispatcher=new App.util.SubTypeDispatcher();var callback={add:this.onAddItem,remove:this.onRemoveItem,scope:this};this.dispatcher.add(new App.ui.PrivacyTypeHandler(this.container,callback));this.dispatcher.add(new App.ui.SentChatRequestHandler(this.container,callback))};App.ui.CompositeUpdatesListView.prototype.createHeader=function(node){domBuilder(node).h2().addClass("minimize").span().text(Ulib.truncate(_i18n("update-tab"),this.headerMaxNameLen)).end().end()};App.ui.CompositeUpdatesListView.prototype.createFilterBlock=function(node){domBuilder(node).div().text("Filter block")};App.ui.CompositeUpdatesListView.prototype.printCount=function(node,response){var hasNew=false;var cookie=App.C.get("mango-update",parseInt);hasNew=this.hasNewUpdates(response.updates,this.config.get("last_signin_at"),this.config.get("last_active_at"));if(hasNew&&!cookie){this.showNewTip()}};App.ui.CompositeUpdatesListView.prototype.hasNewUpdates=function(updates,last_signin,last_active){var hasNew=false;if(!updates||!App.L.isArray(updates)||!last_signin||!last_active){return hasNew}last_signin=new Date(last_signin).getTime();last_active=new Date(last_active).getTime();var iter=updates.length;if(iter>0){do{var d=updates[iter-1];if(d){d=new Date(d.created_at).getTime();if(d<=last_signin&&d>=last_active){hasNew=true;break}}}while(--iter)}return hasNew};App.ui.CompositeUpdatesListView.prototype.changeState=function(state){if(App.config.OFFLINE_STATE==state.getState()||App.config.SUSPEND_STATE==state.getState()){this.destroy()}if(App.config.OFFLINE_STATE==state.getState()){App.C.set("mango-update","0",{path:"/"})}};App.ui.CompositeUpdatesListView.prototype.showNewTip=function(txt){this.tipElement.innerHTML=txt||_i18n("new-updates");App.D.setStyle(this.tipElement,"display","")};App.ui.CompositeUpdatesListView.prototype.hideNewTip=function(){App.D.setStyle(this.tipElement,"display","none")};App.ui.CompositeUpdatesListView.prototype.firstTimeFocus=function(){this.hideNewTip();if(!this.hasUpdated){this.showLoading();this.getUpdates()}this.onFocus.unsubscribe(this.firstTimeFocus);App.C.set("mango-update","1",{path:"/"})};App.ui.CompositeUpdatesListView.prototype.showLoading=function(msg){if(!this.loaderEl){this.loaderEl=App.$("mango-update-loader")}this.loaderEl.innerHTML=msg||_i18n("loading");App.D.setStyle(this.loaderEl,"display","")};App.ui.CompositeUpdatesListView.prototype.hideLoading=function(){App.D.setStyle(this.loaderEl,"display","none")};App.ui.CompositeUpdatesListView.prototype.getUpdates=function(){RoR.send("/ce/community/get_notifications",null,{success:this._parseUpdates,scope:this})};App.ui.CompositeUpdatesListView.prototype._parseUpdates=function(xhr){var response=Ulib.evalJSON(xhr.responseText);if(response.success){if(response.updates.length>0){for(var i=0,obj;obj=response.updates[i];i++){this.dispatcher.dispatch(obj.request_type,obj)}this.hideLoading()}else{return this.showLoading(_i18n("no-updates"))}}};App.ui.CompositeUpdatesListView.prototype.handleUpdates=function(xmpp){this.dispatcher.dispatch(xmpp.getMsgSubType(),xmpp)};App.ui.CompositeUpdatesListView.prototype.onAddItem=function(type,args){this.totalCount++;if(!this.isVisible()){this.showNewTip()}this.hideLoading();this._setHeight()};App.ui.CompositeUpdatesListView.prototype.onRemoveItem=function(type,args){this.totalCount--;if(this.totalCount==0){this.showLoading(_i18n("no-updates"))}this._setHeight()};App.ui.CompositeUpdatesListView.prototype._setHeight=function(h){if(this.totalCount<this.maxListItemCount){App.D.setStyle(this.container,"cssText","overflow: none; height:auto;")}else{if(this.totalCount>this.maxListItemCount){App.D.setStyle(this.container,"cssText","overflow: none; height:"+(this.maxListItemCount*this.listItemHeight)+"px;")}}};App.ui.CompositeUpdatesListView.prototype.destroy=function(type,args){App.E.removeListener([this.tabElement,App.S.query("h2.minimize",this.element,true)],"click",this.toggleView,null,this);this.element.innerHTML="";App.helper.removeEl(this.element)};App.ui.PrivacyTypeHandler=function(container,callback){this.typesToHandle=["RFC"];this.requestModel={};this.container=App.$(container);this.onAdd=new App.U.CustomEvent("onAdd",this,true);this.onRemove=new App.U.CustomEvent("onRemove",this,true);this.onUpdate=new App.U.CustomEvent("onUpdate",this,true);this._init(callback)};App.L.extend(App.ui.PrivacyTypeHandler,App.util.BaseTypeHandler);App.ui.PrivacyTypeHandler.prototype._init=function(callback){this.onAdd.subscribe(callback.add,callback.scope,true);this.onRemove.subscribe(callback.remove,callback.scope,true)};App.ui.PrivacyTypeHandler.prototype.canHandle=function(type){return(App.helper.find(type,this.typesToHandle)>-1)};App.ui.PrivacyTypeHandler.prototype.handleType=function(xmpp){var obj=xmpp instanceof XMPP_IQ?this.createObjectFromXMPP(xmpp):xmpp;var reqObj=this.requestModel[obj.felix_user_id];if(!reqObj){reqObj=this.addNewRecord(obj);if(reqObj){this.render(reqObj);this.onAdd.fire(reqObj)}}else{if(obj.type=="RCA"){delete this.requestModel[obj.felix_user_id];this.remove(obj.felix_user_id)}}};App.ui.PrivacyTypeHandler.prototype.addNewRecord=function(obj){if(!this.requestModel[obj.felix_user_id]){this.requestModel[obj.felix_user_id]=new App.config.ChatRequestObject(obj);return this.requestModel[obj.felix_user_id]}return null};App.ui.PrivacyTypeHandler.prototype.createObjectFromXMPP=function(xmpp){var obj={felix_user_id:xmpp.getUserId(),conv_id:xmpp.getTo(),user_name:xmpp.getUserName(),message:xmpp.getDesc(),type:xmpp.getMsgSubType()};return obj};App.ui.PrivacyTypeHandler.prototype.render=function(obj){var hide_flyout=App.L.trim(obj.message).length==0;var el=domBuilder(this.container).div({id:"mango-update-item"+obj.getFelixId()}).addClass("mango-update-item-cont").div().addClass("mango-update-item").p({style:"visibility:"+(hide_flyout?"hidden":"")}).strong().text("Message:<br/>").end().append(document.createTextNode(Ulib.truncate(obj.getMessage(),50))).end().end().div().text(_i18n("invite-txt",{name:Ulib.truncate(obj.getName(),10)})).end().div({mango_id:obj.getFelixId(),id:"mango-update-controls"+obj.getFelixId()}).addClass("mango-update-item-controls").on("click",this.handleClick,null,this).a({href:"#"}).addClass("mango-rfc-accept").text(_i18n("accept")).end().span().addClass("mango-vertical-separator").end().a({href:"#"}).addClass("mango-rfc-reject").text(_i18n("reject")).end().span().addClass("mango-vertical-separator").end().a({href:"#"}).addClass("mango-rfc-block").text(_i18n("block")).end().end().end()};App.ui.PrivacyTypeHandler.prototype.handleClick=function(e){var t=App.E.getTarget(e);var parent_el=App.D.getAncestorByTagName(t,"div");var felix_id=parent_el.getAttribute("mango_id");switch(t.className.toLowerCase()){case"mango-rfc-accept":this.accept(felix_id);break;case"mango-rfc-reject":this.reject(felix_id);break;case"mango-rfc-block":this.block(felix_id);break}};App.ui.PrivacyTypeHandler.prototype.remove=function(felix_id){var el=App.$("mango-update-item"+felix_id);if(!el){return }if(el){App.E.removeListener("mango-update-controls"+felix_id,"click",this.handleClick)}delete this.requestModel[felix_id];var anim=new YAHOO.util.Anim(el,{opacity:{to:0,from:1}},0.5,YAHOO.util.Easing.easeOut);anim.onComplete.subscribe(function(){App.D.remove(el);this.onRemove.fire()},this,true);anim.animate()};App.ui.PrivacyTypeHandler.prototype.accept=function(felix_id){var obj=this.requestModel[felix_id];if(obj){var conv_id=obj.getConvId();Janus.sendRCA({conv_id:conv_id});this.remove(felix_id)}};App.ui.PrivacyTypeHandler.prototype.reject=function(felix_id){var obj=this.requestModel[felix_id];if(obj){var conv_id=obj.getConvId();Janus.sendRCR({conv_id:conv_id});this.remove(felix_id)}};App.ui.PrivacyTypeHandler.prototype.block=function(felix_id){var blk=new App.ui.Block({felix_id:felix_id},App.config.SessionConfig.get("blockURI"),null,_i18n("block"),this);blk.confirm()};App.ui.PrivacyTypeHandler.prototype.handleRequest=function(req){if(req.type=="block"){alert(_i18n("block-msg2"));this.remove(req.data.felix_id)}};App.ui.SentChatRequestHandler=function(container,callback){this.typesToHandle=["CRS","RCA"];this.requestModel={};this.container=App.$(container);this.onAdd=new App.U.CustomEvent("onAdd",this,true);this.onRemove=new App.U.CustomEvent("onRemove",this,true);this.onUpdate=new App.U.CustomEvent("onUpdate",this,true);this._init(callback)};App.L.extend(App.ui.SentChatRequestHandler,App.util.BaseTypeHandler);App.L.augmentProto(App.ui.SentChatRequestHandler,App.ui.PrivacyTypeHandler);App.ui.SentChatRequestHandler.prototype.handleType=function(xmpp){var obj=xmpp instanceof XMPP_IQ?this.createObjectFromXMPP(xmpp):xmpp;var reqObj=this.requestModel[obj.felix_user_id];if(!reqObj&&obj.type=="CRS"){reqObj=this.addNewRecord(obj);if(reqObj){this.render(reqObj);this.onAdd.fire(reqObj)}}else{if(obj.type=="RCA"){delete this.requestModel[obj.felix_user_id];this.remove(obj.felix_user_id)}}};App.ui.SentChatRequestHandler.prototype.render=function(obj){var el=domBuilder(this.container).div({id:"mango-update-item"+obj.getFelixId()}).addClass("mango-update-item-cont").div().addClass("mango-update-item").text(_i18n("invite-u-txt",{name:Ulib.truncate(obj.getName(),10)})).div({mango_id:obj.getFelixId(),id:"mango-update-controls"+obj.getFelixId()}).addClass("mango-update-item-controls").on("click",this.handleClick,null,this).a({href:"#"}).addClass("mango-ok").text(_i18n("ok-button")).end().end().end()};App.ui.SentChatRequestHandler.prototype.handleClick=function(e){var t=App.E.getTarget(e);var parent_el=App.D.getAncestorByTagName(t,"div");var felix_id=parent_el.getAttribute("mango_id");switch(t.className.toLowerCase()){case"mango-ok":this.remove(felix_id);break}};App.ui.ListViewMediator=function(){this.lists=[];this.currentVisible=null};App.ui.ListViewMediator.prototype.add=function(list){this.lists.push(list)};App.ui.ListViewMediator.prototype.visibilityChanged=function(list){for(var i=0,len=this.lists.length;i<len;++i){var l=this.lists[i];if(l!==list&&l.isVisible()&&list.isVisible()){l.hide()}}};App.ui.UIState=function(taskbarInstance,state){return{goOfflineState:function(){state=App.config.OFFLINE_STATE;taskbarInstance.changeState(this)},goOnlineState:function(){state=App.config.ONLINE_STATE;taskbarInstance.changeState(this)},goSuspendState:function(){state=App.config.SUSPEND_STATE;taskbarInstance.changeState(this)},getState:function(){return state}}};App.net.PresenceHandler=function(model){this.model=model;this.presenceChange=new YAHOO.util.CustomEvent("presenceChanged",this)};App.net.PresenceHandler.prototype={getInstance:function(){return this},update:function(obj){var rec=this.model.select(obj.felix_id);if(rec){var p_option_id=rec.presence_option_id;var data={presence_option_id:obj.presence,custom_presence:obj.msg,active_status_text:((obj.presence==3||obj.presence==4)?"Active Since: ":"Last Message: "),active_status_time:new Date().getTime(),has_presence_changed:(p_option_id!=obj.presence),user_image:obj.image};this.model.update(obj.felix_id,data);this.presenceChange.fire({felix_id:obj.felix_id,presence:obj.presence,record:rec,custom_presence:obj.msg,has_changed:(p_option_id!=obj.presence),user_image:obj.image});if(App.config.SessionConfig.has("show-toaster","Y")){var show_toaster=false;if(rec.isModerator()&&App.config.Settings.has("show_moderators","Y")){show_toaster=true}else{if(rec.isBuddy()&&App.config.Settings.has("show_my_buddies","Y")){show_toaster=true}}if(show_toaster){App.ui.PresenceToaster.notify({userName:rec.member_name,userImage:obj.image,status:this.getPresenceText(obj.presence),custom_presence:rec.custom_presence})}}}else{if(obj.presence==App.config.ONLINE_ID){var data={felix_user_id:obj.felix_id,member_name:obj.name,user_image:obj.image,user_medium:obj.platform,is_authenticated:obj.is_auth?App.config.YES:App.config.NO};this.model.add(data.felix_user_id,data)}}},onChange:function(xmpp){this.update({felix_id:xmpp.getFrom(),presence:xmpp.getShow(),msg:xmpp.getStatus(),name:xmpp.getUserName(),platform:xmpp.getPlatform(),image:xmpp.getUserImageFromMSTag(),is_auth:xmpp.isRealUser()})},getPresenceText:function(option_value){switch(parseInt(option_value)){case 3:return"online";case 4:return"busy";case 2:case 5:return"offline";case 6:return"idle";default:return"offline"}},getPresenceValue:function(option_text){switch(option_text.toLowerCase()){case"na":return 1;case"online":return 3;case"busy":return 4;case"offline":return 2;case"invisible":return 5;case"idle":return 6;default:return 2}}}})(MangoSpring);function errLog(error){MangoSpring.error(error.message+"  at  "+error.lineNumber||"")}(function(App){var _MessageQueue=function(){this._list=[]};_MessageQueue.prototype._maxlength=20;_MessageQueue.prototype.insert=function(messageObj){this._list.push(messageObj)};_MessageQueue.prototype.getMessages=function(){return this._list.slice(-this._maxlength)};_MessageQueue.prototype.purge=function(){this._list.splice(0,this._maxlength)!==null};_MessageQueue.prototype.size=function(){return this._list.length};App.util.ChatMessageQueue=function(){var _queue={};var _add=function(id,obj){if(!_queue[id]){_queue[id]=new _MessageQueue()}var q=_queue[id];var l=q.size(),thresh=App.util.ChatMessageQueue.PURGE_THRESHOLD;if(l>thresh&&l%thresh===0){q.purge()}q.insert(obj)};var _remove=function(){_queue={}};return{clearAll:function(){_remove()},doPurge:function(id){var q=_queue[id];if(q&&q.size()%App.util.ChatMessageQueue.PURGE_THRESHOLD===0){q.purge()}},store:function(id,msgObj){_add(id,Ulib.clone(msgObj))},get:function(id){var q=_queue[id];if(q){return q.getMessages()}return null},PURGE_THRESHOLD:20}}()})(MangoSpring);function up_launchWM(sessionUserID,targetMemberID,type){if(isInProgress){return }type=type||"E";var uri="/ce/community/start_one_o_one_ext";var params={externalID:targetMemberID,fetch_history:"N",type:type};var isInProgress=true;RoR.send(uri,Ulib.toQuery(params),{success:function(xhr){isInProgress=false;try{var resp=Ulib.evalJSON(xhr.responseText);if(resp.success){var external_member=resp.external_member;var member=MangoSpring.model.users.add(external_member.felix_user_id,external_member);var tabInstance=MangoSpring.ui.socialBar.openChat(MangoSpring.config.CHAT_CONV_TYPE,member,true,true);if(tabInstance){tabInstance.loadHistoryComplete(resp)}}else{alert(resp.error)}}catch(e){}},failure:function(){isInProgress=false},scope:this})}(function(App){MangoSpring.namespace("ads");App.ads.getRandomAd=function(){var rand=function(n){return Math.floor(Math.random()*(n))};var randIndex=rand(App.ads.list.length);return App.ads.list[randIndex]};App.ads.list=[{src:HOST_PREF+"/ce/images/ads/easter.jpg",link:"http://purpletrail.com/partytrail/party_ideas/holiday_parties/easter/",title:"Easter Ideas & Invitations"},{src:HOST_PREF+"/ce/images/ads/designs.jpg",link:"http://purpletrail.com/pt2/cons/events/create_invite",title:"Make Invitations Online || Free Design Invitations"},{src:HOST_PREF+"/ce/images/ads/invitation.jpg",link:"http://purpletrail.com/",title:"Online invitations and party ideas"},{src:HOST_PREF+"/ce/images/ads/partyideas.jpg",link:"http://purpletrail.com/partytrail/",title:"Online Invitations, Christmas Invitations, Holiday Invitations and party ideas at purpletrail.com"},{src:HOST_PREF+"/ce/images/ads/printable.jpg",link:"http://purpletrail.com/partytrail/printable_party_games/",title:"Printable Party Games"}];App.ads.slidingAdImages=[{src:HOST_PREF+"/ce/images/ads/easter_big.png",link:"http://purpletrail.com/partytrail/party_ideas/holiday_parties/easter/",title:"Easter Ideas & Invitations"},{src:HOST_PREF+"/ce/images/ads/designs_big.png",link:"http://purpletrail.com/pt2/cons/events/create_invite",title:"Make Invitations Online || Free Design Invitations"},{src:HOST_PREF+"/ce/images/ads/invitation_big.png",link:"http://purpletrail.com/",title:"Online invitations and party ideas"},{src:HOST_PREF+"/ce/images/ads/partyideas_big.png",link:"http://purpletrail.com/partytrail/",title:"Online Invitations, Christmas Invitations, Holiday Invitations and party ideas at purpletrail.com"},{src:HOST_PREF+"/ce/images/ads/printable_big.png",link:"http://purpletrail.com/partytrail/printable_party_games/",title:"Printable Party Games"}]})(MangoSpring);