(function(){var util;var lib={};var dojo={};dojo.loadedUris=new Object();dojo.loadingUris=new Object();dojo.version="";dojo.suffix=".js";dojo.path="";dojo.setSuffix=function(suffix){this.suffix=suffix};dojo.setVersion=function(version){this.version=version};dojo.setPath=function(path){this.path=path};dojo.raise=function(message,exception){log(message)};dojo.loadUri=function(uri,cb,failCb,bSync){if(this.loadedUris[uri]){return 1}var contents=this.getText(uri,cb,failCb,true,bSync);if(contents==null){return !bSync}return this.loadText(contents,uri)};dojo.loadText=function(contents,uri){var value=safeEval(contents);if(value){this.loadedUris[uri]=true;return true}else{return false}return false};dojo.require=function(name,cb,failCb,bSync){if(!name){return }if(Class.objectExists(name)){return true}var path=this.path+"/script/"+name.replace(/\./g,"/")+this.version+this.suffix;var ok=this.loadUri(path,cb,failCb,bSync);if(!ok){dojo.raise("Could not load '"+name+"'; last tried '"+path+"'");return false}if(!Class.objectExists(name)){dojo.raise("symbol '"+name+"' is not defined after loading '"+path+"'");return false}return true};dojo._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];dojo.getXmlhttpObject=function(){var http=null;var last_e=null;try{http=new XMLHttpRequest()}catch(e){}if(!http){for(var i=0;i<3;++i){var progid=dojo._XMLHTTP_PROGIDS[i];try{http=new ActiveXObject(progid)}catch(e){last_e=e}if(http){dojo._XMLHTTP_PROGIDS=[progid];break}}}if(!http){return dojo.raise("XMLHTTP not available",last_e)}return http};dojo.getText=function(uri,async_cb,fail_cb,fail_ok,bSync,bNoLoad){var http=this.getXmlhttpObject();if(!bSync){http.onreadystatechange=function(){if(4==http.readyState){try{if((!http.status)||((200<=http.status)&&(300>http.status))){var cType=http.getResponseHeader("Content-Type");var bXML=false;if(cType=="text/xml"){bXML=true}if(bNoLoad&&async_cb){try{return async_cb(bXML?http.responseXML:http.responseText)}catch(e){return }}else{if(dojo.loadText(bXML?http.responseXML:http.responseText,uri)){if(async_cb){async_cb();return }}}}}catch(e){log("Failed to load file: "+uri+". e: "+e)}if(!bNoLoad){gWindowMgr.createNotifyDlg({id:getUniqueId()+"networkError",caption:gLang.meeboMessage},gLang.disruption+gLang.pleaseCheck);if(fail_cb){fail_cb()}}}}}if(!/^https?:/i.test(uri)){uri=window.location.protocol+"//"+document.domain+uri}http.open("GET",uri,!bSync);try{http.send(null);if(!bSync){return null}if((http.status)&&((200>http.status)||(300<=http.status))){throw Error("Unable to load "+uri+" status:"+http.status)}}catch(e){if((!fail_ok)||(!bSync)){log(e)}return null}return http.responseText};dojo.loadFile=function(url,lastCb){if(!url){return false}var bSync=lastCb?false:true;var urlList=(typeof url=="string")?new Array(url):url;function removeLoadedFiles(){while(urlList.length&&Class.objectExists(urlList[0])){urlList.splice(0,1)}}function innerLoadFile(serializerCb){removeLoadedFiles();if(!urlList.length){serializerCb();if(lastCb){lastCb()}return }var url=urlList[0];urlList.splice(0,1);function req(){if(!dojo.require(url,function(){innerLoadFile(serializerCb)},serializerCb,bSync)){serializerCb();return }}if(!ui.isGecko||bSync){req()}else{runInMainContext(this,req)}}removeLoadedFiles();if(urlList.length){gSerializer.serialize(innerLoadFile);return false}return true};function Class(pkg,ctor,ctorIfExtending){var module=(ctorIfExtending?ctor.extend(ctorIfExtending):Class.create(ctor));if(pkg){var i=pkg.lastIndexOf(".");Class.getObject(pkg.slice(0,Math.max(i,0)))[pkg.slice(i+1)]=module}return module}Class.create=function(decl){function ctor(){if(typeof this.initialize=="function"){return this.initialize.apply(this,arguments)}}ctor.prototype=new decl(function(context,method,args){var parent=decl;if(!args){args=[]}while(parent=parent.prototype){if(parent[method]){return parent[method].apply(context,args)}}throw new Error("method does not exist")});ctor.extend=Class._extend;ctor.prototype.constructor=ctor;ctor.prototype.supa=function(method){var supa=this.supa,supaMethod=this.supaMethod;try{if(supaMethod&&supaMethod!=method){this.supa=this.constructor.prototype.supa;this.supaMethod=method;return this.supa.apply(this,arguments)}else{if(method in decl.prototype){var args=Array.prototype.slice.call(arguments,1);this.supa=decl.prototype.supa;this.supaMethod=method;return decl.prototype[method].apply(this,args)}else{return decl.prototype.supa.apply(this,arguments)}}}finally{this.supa=supa;this.supaMethod=supaMethod}};return ctor};Class._extend=function(sub){sub.prototype=this.prototype;return Class.create(sub)};Class.getObject=function(pkg){var parts=pkg.split(".");if(typeof window=="undefined"){var object=eval(parts[0]+" = typeof "+parts[0]+' == "undefined" ? {} : '+parts[0]+";");parts.shift()}else{var object=window}while(parts.length){var part=parts.shift();if(!part){continue}if(!object[part]){object[part]={}}object=object[part]}return object};Class.objectExists=function(pkg){var parts=pkg.split("."),obj=window;while(parts.length){obj=obj[parts.shift()];if(!obj){return false}}return true};var ui={};ui.KEY_BACKSPACE=8;ui.KEY_TAB=9;ui.KEY_RETURN=13;ui.KEY_ESC=27;ui.KEY_LEFT=37;ui.KEY_UP=38;ui.KEY_RIGHT=39;ui.KEY_DOWN=40;ui.KEY_DELETE=46;ui.bEnabled=true;ui.enableEvents=function(){ui.bEnabled=true};ui.disableEvents=function(){ui.bEnabled=false};ui.globalEvents={};ui.connectGlobalEvent=function(doc,event,callback){var id=ui.retrieveEventId(doc.body);if(!this.globalEvents[id]){this.globalEvents[id]={}}if(this.globalEvents[id][event]){ui.disconnectGlobalEvent(doc,event)}this.globalEvents[id][event]=callback;ui.attachEvent(doc.body,event,callback,true)};ui.disconnectGlobalEvent=function(doc,event){var id=ui.retrieveEventId(doc.body);if(!this.globalEvents[id]||!this.globalEvents[id][event]){return }var win=gWin(doc);if(ui.isIE&&!arguments.callee.disconnecting&&win.event&&win.event.type==event&&win.event.srcElement!=doc.body){arguments.callee.disconnecting=true;this.globalEvents[id][event](win.event);arguments.callee.disconnecting=false}ui.detachEvent(doc.body,event,this.globalEvents[id][event],true);delete this.globalEvents[id][event]};ui.retrieveEventId=function(element){if(!element||!element.getAttribute){return }var id=element.getAttribute("ev_id");if(!id){id=String(getUniqueId());element.setAttribute("ev_id",id)}return id};ui.hookEvents={};ui.hookCallback=null;ui.setHookEvents=function(hookEvents,hookCallback){if(!hookEvents||!hookCallback){return }ui.hookEvents={};ui.hookCallback=hookCallback;var ev;for(var i=0;(ev=hookEvents[i]);i++){ui.hookEvents[ev]=true}};ui.connectedEvents={};ui.connectEvent=function(element,event,context,callback,bIncludeEv,bIncludeEl){if(!element||!event||!context||!callback){return }var args=Array.prototype.slice.call(arguments,6);var f=function(event){if(typeof ui=="undefined"||!ui.bEnabled){return }var e=event||gWin(element).event;var argArray=(bIncludeEv?(bIncludeEl?[e,element]:[e]):(bIncludeEl?[element]:[])).concat(args);var returnValue=hitch(context,callback).apply(context,argArray);eventlog(element.id+" "+event);return returnValue};if(!element.__eventHash){element.__eventHash={}}if(element.__eventHash[event]){ui.disconnectEvent(element,event,element.__eventHash[event])}element.__eventHash[event]=f;var id=ui.retrieveEventId(element);if(id){ui.connectedEvents[id]=element}ui.attachEvent(element,event,f)};ui.disconnectEvent=function(element,event){if(!element||!event||!element.__eventHash){return }var callback=element.__eventHash[event];if(!callback){return }delete element.__eventHash[event];ui.detachEvent(element,event,callback)};ui.disconnectAllEvents=function(element){var doc=gDoc(element);if(element==doc){for(var id in ui.connectedEvents){var element=ui.connectedEvents[id];if(doc==document||doc==gDoc(element)){arguments.callee(element)}}}else{for(var event in element.__eventHash){try{ui.detachEvent(element,event,element.__eventHash[event])}finally{delete element.__eventHash[event]}}delete ui.connectedEvents[element.getAttribute("ev_id")]}};ui.USE_CAPTURE=false;ui.normaliseEvent=function(element,event,useCapture){var doc=gDoc(element);var win=gWin(element);if(event=="focus"&&element==win){if(isDefined(doc.onfocusin)){event="focusin";element=doc}else{if(isDefined(win.onfocus)){event="focus"}else{event="focus";element=doc;useCapture=true}}}else{if(event=="blur"&&element==win){if(isDefined(doc.onfocusout)){event="focusout";element=doc}else{if(isDefined(win.onblur)){event="blur"}else{event="blur";element=doc;useCapture=true}}}else{if(event=="focusie7"&&element==win){event="focus";element=win}}}return{element:element,event:event,useCapture:useCapture}};ui.attachEvent=function(element,event,callback,useCapture){if(!element||!event||!callback){return }var normalised=ui.normaliseEvent(element,event,useCapture);element=normalised.element;event=normalised.event;useCapture=normalised.useCapture;if(element.attachEvent){element.attachEvent("on"+event,callback)}else{if(element.addEventListener){if(event.toLowerCase()=="mousewheel"){event="DOMMouseScroll"}if(event=="contextmenu"&&ui.isFirefox&&ui.isMac){event="mouseup";var originalCallback=callback;callback=function(e){if(e.button==2){originalCallback(e)}}}if(ui.isSafari&&event.toLowerCase()=="dblclick"){element.ondblclick=callback}else{element.addEventListener(event,callback,typeof useCapture=="boolean"?useCapture:ui.USE_CAPTURE)}}}};ui.detachEvent=function(element,event,callback,useCapture){if(!element||!event||!callback){return }var normalised=ui.normaliseEvent(element,event,useCapture);element=normalised.element;event=normalised.event;useCapture=normalised.useCapture;if(element.detachEvent){element.detachEvent("on"+event,callback)}else{if(element.removeEventListener){if(event.toLowerCase()=="mousewheel"){event="DOMMouseScroll"}if(ui.isSafari&&event.toLowerCase()=="dblclick"){delete element.ondblclick}else{element.removeEventListener(event,callback,typeof useCapture=="boolean"?useCapture:ui.USE_CAPTURE)}}}};ui.setEventHandled=function(event,ignoreHook){if(!event){event=window.event}if(!ignoreHook&&ui.hookEvents[event.type]){ui.hookCallback()}if(event&&event.preventDefault){event.stopPropagation()}else{event.cancelBubble=true}ui.preventDefault(event)};ui.preventDefault=function(event){if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}};ui.isCursorInClient=function isCursorInClient(event){var rc=ui.getClientRect();var x=ui.getCursorX(event);if(x<0||x>=rc.w){return false}var y=ui.getCursorY(event);if(y<0||y>=rc.h){return false}return true};ui.getCursorPos=function getCursorPos(event){return{x:ui.getCursorX(event),y:ui.getCursorY(event)}};ui.getCursorX=function getCursorX(event){if(ui.isSafari&&event&&!isDefined(event.clientX)){return(event.target)?0:-1}var doc=gDoc(event&&(event.target||event.srcElement));if(ui.isIE&&ui.isIE<=5.5){doc=gDoc()}var win=gWin(doc);var x=0;if(ui.isIE||ui.isOpera){x=win.event.clientX+doc.documentElement.scrollLeft+doc.body.scrollLeft-(doc.documentElement.clientLeft+doc.body.clientLeft)}else{x=event.clientX+win.scrollX}return x};ui.getCursorY=function getCursorY(event){if(ui.isSafari&&event&&!isDefined(event.clientY)){return(event.target)?0:-1}var doc=gDoc(event&&(event.target||event.srcElement));if(ui.isIE&&ui.isIE<=5.5){doc=gDoc()}var win=gWin(doc);var y=0;if(ui.isIE||ui.isOpera){y=win.event.clientY+doc.documentElement.scrollTop+doc.body.scrollTop-(doc.documentElement.clientTop+doc.body.clientTop)}else{y=event.clientY+win.scrollY}return y};ui.getMouseButton=function(event){var win=gWin(event);if(!event){event=win.event}var button=event.button;if(ui.isIE||ui.isSafari){if(button&1){button=0}else{if(button&2){button=2}else{if(button&4){button=1}}}}return button};ui.getClientRect=function getClientRect(docHint){var doc=gDoc(docHint);return new ui.rect(0,0,doc.body.clientWidth,doc.body.clientHeight)};ui.getClientCenter=function(docHint){var rect=ui.getClientRect(docHint);return{x:parseInt(rect.w/2),y:parseInt(rect.h/2)}};ui.isBrowser=function(name){var ua=navigator.userAgent,i;if((i=ua.indexOf(name))>=0){ui.m_version=parseFloat(ua.substr(i+name.length+1));return ui.m_version}return false};ui.isOS=function(name){var ua=navigator.userAgent.toLowerCase();return(ua.indexOf(name)>=0)};ui.isWebKit=ui.isBrowser("WebKit");ui.isChrome=ui.isBrowser("Chrome");ui.isSafari=ui.isBrowser("Safari");ui.isSafari3=ui.isSafari&&navigator.userAgent.indexOf("Version/3.")>=0;ui.isSafari2=ui.isSafari&&!ui.isSafari3;ui.isFluid=(window.fluid!=null);ui.isIPhone=navigator.userAgent.indexOf("iPhone")>=0;ui.isIE=ui.isBrowser("MSIE");ui.isOpera=ui.isBrowser("Opera");ui.isOpera9=ui.isOpera&&navigator.userAgent.indexOf("Opera/9")>=0;ui.isNS=ui.isBrowser("Netscape6/");ui.isGecko=ui.isBrowser("Gecko")&&!ui.isSafari;ui.isFirefox=ui.isBrowser("Firefox");ui.isFirefox3=ui.isFirefox&&navigator.userAgent.indexOf("Firefox/3")>=0;ui.isMac=ui.isOS("mac");ui.isWin=ui.isOS("win");ui.isLinux=ui.isOS("linux");ui.isUnix=ui.isOS("x11");ui.isHttps=(document.location.href.indexOf("https")==0);ui.isIE7=(ui.isIE&&ui.m_version>=7);if(ui.isSafari3){ui.m_version=3}else{if(ui.isSafari2){ui.m_version=2}}ui.isQuirks=function(doc){var mode=doc.compatMode;return(!mode||mode=="BackCompat")};ui.getVersion=function(){return ui.m_version};ui.getClient=function(){if(ui.isSafari){return"Safari"}else{if(ui.isIPhone){return"iPhone"}else{if(ui.isIE){return"MSIE"}else{if(ui.isOpera){return"Opera"}else{if(ui.isNS){return"Netscape"}else{if(ui.isFirefox){return"Firefox"}else{if(ui.isGecko){return"Gecko"}else{return"unknown"}}}}}}}};if(ui.isSafari){ui.isGecko=false}ui.cleanUp=function(element){var doc=gDoc(element);ui.disconnectAllEvents(doc);var divs=doc.getElementsByTagName("DIV");for(var i=0;i<divs.length;i++){if(divs[i].ptr){divs[i].ptr=null}}};ui.emptyTags=/^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i;ui.createHTML=function(obj){if(isString(obj)){return obj}var html="<"+obj.tag;for(attribute in obj){var value=obj[attribute];switch(attribute){case"tag":case"textContent":case"children":continue;break;case"className":attribute="class";break;case"htmlFor":attribute="for";break;case"style":if(!isString(value)){var styles=value;value="";for(style in styles){var styleName=style=="cssFloat"?"float":style.replace(/([A-Z])/g,"-$1").toLowerCase();value+=styleName+": "+styles[style]+";"}}}html+=" "+attribute+'="'+value+'"'}html+=">";if(!ui.emptyTags.test(obj.tag)){if(obj.children){for(var i=0;i<obj.children.length;i++){html+=arguments.callee(obj.children[i])}}else{if(obj.textContent){html+=escapeHTML(obj.textContent)}}html+="</"+obj.tag+">"}return html};ui.createDOM=function(obj,doc){doc=doc||document;var div=doc.createElement("div");div.innerHTML=ui.createHTML(obj);return div.firstChild};util={};function isDefined(o){return typeof o!="undefined"}function isNumber(n){return typeof n=="number"||n instanceof Number}function isString(s){return typeof s=="string"||s instanceof String}function isFunction(f){return typeof f=="function"||f instanceof Function}function isArray(a){return a instanceof Array}function callee(args){var method=args.callee,obj=this;return function(){return method.apply(obj,args)}}function safeEval(func){try{eval(func)}catch(e){return false}return true}function argsToArray(args,offset){offset=offset||0;return Array.prototype.slice.call(args,offset)}function objectToArray(o){if(!o){return[]}var array=[];for(var prop in o){if(o[prop]){array.push(o[prop])}}return array}function arrayToObject(a){if(!a){return{}}var o={};for(var i=0;i<a.length;i++){o[String(a[i])]=a[i]}return o}function isEmpty(hash){if(!hash){return false}for(var id in hash){if(hash[id]!=null){return false}}return true}function doFunctions(funcArray){if(!funcArray){return }var args=argsToArray(arguments);if(args){args=args.slice(1)}for(var i=0;i<funcArray.length;i++){if(funcArray[i]){funcArray[i].apply(this,args)}}}function sprintf(){if(!arguments||arguments.length<1||!RegExp||!arguments[0]){return }var str=arguments[0];for(var i=1;i<arguments.length;i++){str=str.replace(new RegExp("%"+i,"g"),arguments[i]||"")}return str}function runInMainContext(){var obj=null;var fnc=arguments[0];if(typeof fnc!="function"){obj=arguments[0];fnc=arguments[1];if(typeof fnc=="string"){fnc=obj[fnc]}}var args=argsToArray(arguments).slice(obj!=null?2:1);setTimeout(function(){try{fnc.apply(obj,args)}catch(e){}},0)}function hitch(object,method){var args=Array.prototype.slice.call(arguments,2);function hitched(){var context=(object===null?this:object);var func=(typeof method=="function"?method:context[method]);return func.apply(context,args.concat(Array.prototype.slice.call(arguments)))}hitched.methodName=method;return hitched}function createDelayedMethod(methodName,method,timeout){return function(){this[methodName]=createDelayedMethod.delayBind(this,method,timeout);this[methodName].apply(this,arguments)}}createDelayedMethod.delayBind=function(object,method,timeout){var g=function(){clearTimeout(g.m_timeout);g.m_args=arguments;g.m_timeout=setTimeout(g.m_run,timeout||0)};g.m_run=function(){method.apply(object,g.m_args)};return g};function getObjectAsString(obj){var str="";if(typeof (obj)=="string"){str='"'+obj.replace(/(["\\])/g,"\\$1")+'"'.replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")}else{if(obj instanceof Array){var arr=[];for(var i=0;i<obj.length;i++){arr.push(getObjectAsString(obj[i]))}str="["+arr.join(", ")+"]"}else{if(obj==null){str="null"}else{if(typeof (obj)=="object"){var arr=[];for(var prop in obj){arr.push(getObjectAsString(prop)+": "+getObjectAsString(obj[prop]))}str="{"+arr.join(", ")+"}"}else{str=String(obj)}}}}return str}function createHandler(type){var arr="m_on"+type;var addFnc="addOn"+type;var removeFnc="removeOn"+type;var doFnc="on"+type;if(!this[arr]){this[arr]=[]}this[addFnc]=function(fnc){this[arr].push(fnc);return fnc};this[removeFnc]=function(fnc){if(!fnc){this[arr]=[];return }for(var i=this[arr].length;i>=0;i--){if(this[arr][i]==fnc){this[arr].splice(i,1);break}}};this[doFnc]=function(){var args=argsToArray(arguments);args.splice(0,0,this[arr].slice());doFunctions.apply(null,args)}}function createSetter(property,signal){return function(value){if(this["m_"+property]==value){return }var oldValue=this["m_"+property];this["m_"+property]=value;if(signal){gPubSub.publish(this,signal,value,oldValue)}}}util.query={};function getQueryVariable(name){return getUrlVariable(name,document.location.search.substring(1))}function getHashVariable(name){var hash=document.location.hash.substr(1);return hash&&getUrlVariable(name,hash)||null}function getUrlVariable(name,string){if(ui.isIE||ui.isSafari){string=decodeURIComponent(string)}var queryArray=string.split("&");for(var i=0;i<queryArray.length;i++){var pair=queryArray[i].split("=");if(decodeURIComponent(pair[0])==name){return decodeURIComponent(pair[1])}}return null}function getObjectAsURIParams(obj){var arr=[];for(var key in obj){arr.push(encodeURIComponent(key)+"="+encodeURIComponent(obj[key]))}return arr.join("&")}util.query.grabHashVariables=function(){util.query.m_hashValues={};var hash=document.location.hash.substr(1);if(hash){if(ui.isIE||ui.isSafari){hash=decodeURIComponent(hash)}document.location.hash="#";var parts=hash.split("&");for(var i=0;i<parts.length;i++){var kvp=parts[i].split("=");util.query.m_hashValues[kvp[0]]=kvp[1]}}};util.query.getHashVariable=function(key){return util.query.m_hashValues[key]};meebo={};meebo.util={};meebo.util.isICQ=function(name){if(!name||!name.length||isEmail(name)){return false}var firstChar=name.charAt(0);var num=parseInt(firstChar,10);if(isNaN(num)){return false}return true};meebo.util.padRoomName=function(name){return name+decToHex(String(new Date().getTime())+String(Math.ceil(Math.random()*1000)))};meebo.util.accessByIP=function(){var host=String(document.location.host);var urlReg=/.+\.meebo\.com/i;return urlReg.exec(host)==null};meebo.util.normalizeRoomName=function(name){if(name){return name.replace(/[^\w]+/g,"").toLowerCase()}};meebo.util.normalizeGroupName=function(name){return name.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," ")};meebo.util.isValidGroupName=function(name){name=meebo.util.normalizeGroupName(name);if(name.length>50){return false}return true};meebo.util.getDefaultGroup=function(protocol){var groupName;switch(String(protocol)){case"yahoo":groupName="Friends";break;case"msn":groupName="Individuals";break;case"meebome":groupName="meebome";break;default:groupName="Buddies"}var groups=gBuddyList.getGroups();for(var i=0,group;(group=groups[i]);i++){if(group.getName().toLowerCase()==groupName.toLowerCase()){groupName=group.getName();break}}return groupName};meebo.util.stripJabber=function(name){if(!name){return""}var slash=name.indexOf("/");if(slash!=-1){var host=name.substr(0,slash);if(!gBuddyList.isJabberGroup(host)){name=host}}return name};meebo.util.stripMeebo=function(name){var atIndex=name.indexOf("@meebo.org");if(atIndex>-1){return name.substr(0,atIndex)}return name};meebo.util.isMeeboGroupChat=function(buddy,network){return network=="meebome"&&/@conference.gc\d*.meebo.org$/i.test(buddy)};meebo.util.splitGroupChatName=function(name){var pieces=name.split("@");return{id:pieces[0],server:pieces[1]}};meebo.util.isDefaultGroupChatGroup=function(groupName){return(groupName=="meebo chatrooms")};meebo.util.getMeeboGroupChatLink=function(message){var urlReg=/https?\:\/\/(.+\.meebo\.com|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\/room\/([^\/]+)\/(#.*)?([^a-zA-Z]|$)/i;var match=urlReg.exec(message);if(match&&match[2]){return match[2]}urlReg=/https?\:\/\/(.+\.meebo\.com|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\/user\/([^\/]+)\/room\/(#.*)?([^a-zA-Z]|$)/i;match=urlReg.exec(message);if(match&&match[2]){return"__"+match[2]}return null};meebo.util.getMeeboApplicationLink=function(message){var urlReg=/https?\:\/\/(.+\.meebo\.com|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\/app\/([^\/]+)\/(#.*)?([^a-zA-Z]|$)/i;var match=urlReg.exec(message);if(match&&match[2]){return match[2]}return null};meebo.util.getMeeboShareLink=function(message){var urlReg=/^https?:\/\/[^\/]*\.meebo\.com\/share\/([^\/]*)\/?$/;var match=urlReg.exec(message);if(match&&match[1]){return match[1]}return null};meebo.util.generateMeeboShareLink=function(shareId){return"http://www.meebo.com/share/"+shareId};meebo.util.getOriginContentPath=function(){return"http"+(ui.isHttps?"s":"")+"://"+((ui.isHttps||meebo.util.accessByIP())?"origin-":"")+"share.meebo.com/content/"};meebo.util.getWallpaperUrl=function(shareId,num,size){size=size||"1024x768";return meebo.util.getOriginContentPath()+shareId+"/wallpapers/"+size+"/"+num+".jpg"};meebo.util.getWallpaperThumbUrl=function(shareId,num){return meebo.util.getWallpaperUrl(shareId,num,"67x50")};meebo.util.getWallpaperPreviewUrl=function(shareId,num){return meebo.util.getWallpaperUrl(shareId,num,"130x98")};meebo.util.createAccount=function(name,network,password){name=stripWhitespace(name);if(!name){return gLang.noName}if(!password){return gLang.noPass}if(network=="meebo"){network="meebome"}network=gNetworks[network];if(network.isCIMPartner()){return gLogon.addCIMAccount(name,password,network)}var logonDetails=meebo.util.normalizeLogon(name,network,password);if(logonDetails.error){return error}name=logonDetails.name,network=logonDetails.network;if(network=="meebome"){name=meebo.util.stripMeebo(name);var account=new meebo.MeeboAccount(name,password);gLogon.setMeeboUser(name,password,"pending");return account}var logon=gLogon.addLogon(name,network);logon.setPassword(password);return logon};meebo.util.normalizeLogon=function(name,network,password){if(network=="meebo"){network="meebome"}network=gNetworks[network];switch(network.getId()){case"gtalk":case"jabber":case"meebome":var domain=(name||"").replace(/^[^@]*@/,"").replace(/\/.*$/,"");for(var n in gNetworks){n=gNetworks[n];if(n.getProtocol().isJabberBased()&&domain in arrayToObject(n.getDomains())){network=n;break}}break}if(!name){var error=gLang.noName}else{if(name.indexOf("@")==-1&&network.getDomains().length){name=normalizeString(name+"@"+network.getDomains()[0])}if(network=="yahoo"){name=name.replace(/@yahoo\.com$/i,"")}}if(!error&&typeof password=="string"&&!password){error=gLang.noPass}return{error:error,name:name,network:network}};meebo.util.platform={getChannelId:function(channelId,namespace){namespace=namespace||"";return"meebo"+namespace+"Channel"+channelId},getAppChannelId:function(appInstanceId){return meebo.util.platform.getChannelId(appInstanceId,"App")},getPlatformChannelId:function(platformInstanceId){return meebo.util.platform.getChannelId(platformInstanceId,"Platform")},getSecureChannelId:function(){return"SecureMeeboChannel1"},generateAuthenticityHash:function(){return"hash"},APP_TYPE_SINGLE:"APP_TYPE_SINGLE",APP_TYPE_MULTI:"APP_TYPE_MULTI",CMD_ECHO:"CMD_ECHO",CMD_APP_MSG:"CMD_APP_MSG",CMD_IM_MSG:"CMD_IM_MSG",CMD_IM_HTML_MSG:"CMD_IM_HTML_MSG",CMD_REQG_BUDDY_ICON:"CMD_REQG_BUDDY_ICON",CMD_REQG_WALLPAPER:"CMD_REQG_WALLPAPER",CMD_REQG_STATUS_MESSAGE:"CMD_REQG_STATUS_MESSAGE",CMD_REQG_ALIAS:"CMD_REQG_ALIAS",CMD_REQS_BUDDY_ICON:"CMD_REQS_BUDDY_ICON",CMD_REQS_WALLPAPER:"CMD_REQS_WALLPAPER",CMD_REQS_STATUS_MESSAGE:"CMD_REQS_STATUS_MESSAGE",CMD_REQP_SHARE:"CMD_REQP_SHARE",CMD_REQP_INVITE:"CMD_REQP_INVITE",EVT_APP_MSG:"EVT_APP_MSG",EVT_IM_MSG:"EVT_IM_MSG",EVT_IM_HTML_MSG:"EVT_IM_HTML_MSG",EVT_JOIN:"EVT_JOIN",EVT_LEAVE:"EVT_LEAVE",EVT_OPEN:"EVT_OPEN",EVT_DEACTIVE:"EVT_DEACTIVE",EVT_CLOSE:"EVT_CLOSE",SCMD_REQG_ACCOUNT_INFO:"SCMD_REQG_ACCOUNT_INFO"};Class("meebo.util.CallbackManager",function(){this.initialize=function(namespace){this.m_callbacks={};this.m_namespace=namespace||"CallbackManager-"+Math.floor(Math.random()*1000000);this.m_callbackCount=0};this.scheduleCallback=function(callback,callbackId){var callbackId=callbackId||this.m_namespace+(this.m_callbackCount++);this.m_callbacks[callbackId]=callback;return callbackId};this.executeCallback=function(callbackId,result){var result=this.m_callbacks[callbackId].call(this,result);delete this.m_callbacks[callbackId];return result}});Class("meebo.util.FlashMessageBridge",function(){this.swfUrl=window.location.protocol+"//platformapi.meebo.com/js/JsToLocalConnectionBridge.swf";this.initialize=function(channelId,messageHandler,parentEl){if(meebo.util.FlashMessageBridge.bridges[channelId]){return meebo.util.FlashMessageBridge.bridges[channelId]}else{this.m_channelId=channelId;meebo.util.FlashMessageBridge.bridges[this.m_channelId]=this;this.m_id=this.m_channelId+"_element";this.m_readyCallbacks=[];this.m_callbackManager=new meebo.util.CallbackManager(this.m_channelId);this.m_messageHandler=messageHandler;this.createSwf(parentEl||document.body)}};this.getFlashInterface=function(){if(ui.isIE){return window[this.m_id]}else{if(ui.isSafari){return document.getElementById(this.m_id)}else{return document[this.m_id]}}};this.createSwf=function(parentEl){var embedUrl=this.swfUrl;if(ui.isIE){embedUrl+="?"+new Date().getTime()}var html;if(ui.isIE){html='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="'+this.m_id+'" name="'+this.m_id+'" width="1" height="1" align="middle" data="'+embedUrl+'"><param name="movie" value="'+embedUrl+'" /><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="FlashVars" value="readyHandlerName=meebo.util.FlashMessageBridge.bridges.'+this.m_channelId+".onInterfaceReady&messageHandlerName=meebo.util.FlashMessageBridge.bridges."+this.m_channelId+".giveMessage&responseHandlerName=meebo.util.FlashMessageBridge.bridges."+this.m_channelId+".giveResponse&channelId="+this.m_channelId+'" /></object>'}else{html='<embed src="'+embedUrl+'" quality="high" width="1" height="1" swLiveConnect="true" id="'+this.m_id+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" flashvars="readyHandlerName=meebo.util.FlashMessageBridge.bridges.'+this.m_channelId+".onInterfaceReady&messageHandlerName=meebo.util.FlashMessageBridge.bridges."+this.m_channelId+".giveMessage&responseHandlerName=meebo.util.FlashMessageBridge.bridges."+this.m_channelId+".giveResponse&channelId="+this.m_channelId+'" />'}var container=document.createElement("div");container.style.position="absolute";container.style.top="1px";container.style.left="1px";container.style.zIndex=99999999;container.innerHTML=html;parentEl.appendChild(container)};this.onInterfaceReady=function(){this.m_ready=true;doFunctions.call(this,this.m_readyCallbacks);this.m_readyCallbacks=[]};this.ensureReady=function(callback){if(this.m_ready){callback.call(this)}else{this.m_readyCallbacks.push(callback)}};this.sendMessage=function(receiverChannelId,message,responseCallback){this.ensureReady(function(){if(responseCallback){var callbackId=this.m_callbackManager.scheduleCallback(responseCallback)}setTimeout(hitch(this,function(){this.getFlashInterface().giveMessage(receiverChannelId,message,callbackId)}),0)})};this.giveResponse=function(callbackId,response){setTimeout(hitch(this.m_callbackManager,"executeCallback",callbackId,response),0)};this.giveMessage=function(message,callbackId){this.ensureReady(function(){var responseCallback;if(callbackId){responseCallback=hitch(this,function(response){this.getFlashInterface().giveResponse(callbackId,response)})}setTimeout(hitch(this,this.m_messageHandler,message,responseCallback),0)})}});meebo.util.FlashMessageBridge.bridges={};(function(){if(!window.Meebo){Meebo={}}Meebo.platform=function(readyCallback){readyCallbacks.push(readyCallback);if(bridge){doReadyCallbacks()}};Meebo.platform.setMessageHandler=function(handler){messageHandler=handler};var api={setBuddyIcon:function(url,responseCallback){bridge.sendMessage(meeboChannelId,{command:meebo.util.platform.CMD_REQS_BUDDY_ICON,data:url},responseCallback)},setWallpaper:function(url,responseCallback){bridge.sendMessage(meeboChannelId,{command:meebo.util.platform.CMD_REQS_WALLPAPER,data:url},responseCallback)},setStatusMessage:function(message,responseCallback){bridge.sendMessage(meeboChannelId,{command:meebo.util.platform.CMD_REQS_STATUS_MESSAGE,data:message},responseCallback)},getBuddyIcon:function(responseCallback){bridge.sendMessage(meeboChannelId,{command:meebo.util.platform.CMD_REQG_BUDDY_ICON},responseCallback)},getAlias:function(responseCallback){bridge.sendMessage(meeboChannelId,{command:meebo.util.platform.CMD_REQG_ALIAS},responseCallback)}};var bridge;var meeboChannelId;var appChannelId;var messageHandler;var readyCallbacks=[];function handleMessage(message,responseCallback){if(messageHandler){messageHandler(message,responseCallback)}}function init(){meeboChannelId=getQueryVariable("meeboChannel");appChannelId=meebo.util.platform.getAppChannelId(Math.floor(Math.random()*100000));bridge=new meebo.util.FlashMessageBridge(appChannelId,handleMessage,document.body);doReadyCallbacks()}function doReadyCallbacks(){var callback;while(callback=readyCallbacks.shift()){callback(api)}}function ContentLoaded(w,f){var d=w.document,D="DOMContentLoaded",u=w.navigator.userAgent.toLowerCase(),v=parseFloat(u.match(/.+(?:rv|it|ml|ra|ie)[\/: ]([\d.]+)/)[1]);function init(e){if(!document.loaded){document.loaded=true;f((e.type&&e.type==D)?e:{type:D,target:d,eventPhase:0,currentTarget:d,timeStamp:+new Date,eventType:e.type||e})}}if(/webkit\//.test(u)&&v<525.13){(function(){if(/complete|loaded/.test(d.readyState)){init("khtml-poll")}else{setTimeout(arguments.callee,10)}})()}else{if(/msie/.test(u)&&!w.opera){d.attachEvent("onreadystatechange",function(e){if(d.readyState=="complete"){d.detachEvent("on"+e.type,arguments.callee);init(e)}});if(w==top){(function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,10);return }init("msie-poll")})()}}else{if(d.addEventListener&&(/opera\//.test(u)&&v>9)||(/gecko\//.test(u)&&v>=1.8)||(/khtml\//.test(u)&&v>=4)||(/webkit\//.test(u)&&v>=525.13)){d.addEventListener(D,function(e){d.removeEventListener(D,arguments.callee,false);init(e)},false)}else{var oldonload=w.onload;w.onload=function(e){init(e||w.event);if(typeof oldonload=="function"){oldonload(e||w.event)}}}}}}ContentLoaded(window,init)})()})();