/* All source code is (c) Mibbit.com. Unauthorized use/reverse engineering/copying is prohibited. */

VERSION=2207;var JSON=JSON||{};(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());var M_S="";var BASE_URL=window.location.host;var UPLOAD_URL=BASE_URL;var BASE_PROTOCOL=window.location.protocol;function cp(A,B){for(v in A){if(A.hasOwnProperty(v)){B[v]=A[v]}}}function cmpArray(B,A){if(B.length!=A.length){return false}for(var C=0;C<B.length;C++){for(var D in B[C]){if(B[C].hasOwnProperty(D)&&A[C].hasOwnProperty(D)){if(B[C][D]!==A[C][D]){return false}}}}return true}function googtrack(A){try{pageTracker._trackPageview("/"+A)}catch(B){}}function islight(C){if(!C){return true}try{if(C.substring(0,1)=="#"){C=C.substring(1,C.length);var B,A,E;if(C.length==6){E=parseInt(C.substring(0,2),16);A=parseInt(C.substring(2,4),16);B=parseInt(C.substring(4,6),16);return(E+A+B>(128*3))}else{if(C.length==3){E=parseInt(C.substring(0,1),16);A=parseInt(C.substring(1,2),16);B=parseInt(C.substring(2,3),16);return(E+A+B>(8*3))}}}}catch(D){}return true}function isValidColor(D){if(D.substring(0,1)=="#"){if(D.length!=4&&D.length!=7){return false}for(var A=1;A<D.length;A++){var B=D.charAt(A);if("0123456789abcdefABCDEF".indexOf(B)==-1){return false}}return true}else{var C=" "+D.toLowerCase()+" ";return(" aqua grey gray navy silver black green olive teal blue lime purple white fuchsia maroon red yellow ".indexOf(C)!=-1)}return false}function isValidNumber(B){for(var A=0;A<B.length;A++){if("0123456789".indexOf(B.charAt(A))==-1){return false}}return true}function Hints(){this.stickyWords=[];this.allWords=[];this.wordCounts={}}Hints.MINIMUM_LENGTH=3;Hints.MAX_WORDS=500;Hints.MAX_STICKY_WORDS=15;Hints.commonWords=" the and for are but not you all any can had her was one our out day get has him his how man new now old see two way who boy did its let put say she too use lol ftw hey that with have this will your from they know want been good much some time very when come here just like long make many more only over such take than them well were  what book cool  there their which ";Hints.prototype.feedContentSticky=function(A,E){this.feedContent(A,E);var B=A.match(/[^\s\#\!\@\$\%\^\&\*\(\)\_\+\-\=\{\}\[\]\:\;\"\'\,\.\/\<\>\?\~\|\\]+/g);if(B){for(var D=0;D<B.length;D++){var C=B[D].toLowerCase();if(!E||!E[C]){if(Hints.commonWords.indexOf(" "+C+" ")==-1&&C.length>=Hints.MINIMUM_LENGTH&&!C.match(/^[0-9]+$/)){this.addUniqueArray(C,this.stickyWords);if(this.stickyWords.length>Hints.MAX_STICKY_WORDS){this.stickyWords.shift()}}}}}};Hints.prototype.addUniqueArray=function(B,A){if(!B){return }for(var C=0;C<A.length;C++){if(A[C]==B){return }}A.push(B)};Hints.prototype.feedContent=function(A,D){var B=A.match(/[^\s\#\!\@\$\%\^\&\*\(\)\_\+\-\=\{\}\[\]\:\;\"\'\,\.\/\<\>\?\~\|\\]+/g);if(B){for(var C=0;C<B.length;C++){if(!D||!D[B[C].toLowerCase()]){this.feedWord(B[C])}}}};Hints.prototype.feedWord=function(A){A=A.toLowerCase();if(Hints.commonWords.indexOf(" "+A+" ")!=-1||A.length<Hints.MINIMUM_LENGTH||A.match(/^[0-9]+$/)){return }this.allWords.push(A);if(this.wordCounts[A]){this.wordCounts[A]++}else{this.wordCounts[A]=1}if(this.allWords.length>Hints.MAX_WORDS){var B=this.allWords.shift();this.wordCounts[B]--;if(this.wordCounts[B]==0){delete this.wordCounts[B]}}};Hints.prototype.findNextTopWord=function(C){var B=null;var D=0;for(var A in this.wordCounts){if(this.wordCounts.hasOwnProperty(A)&&!C[A]){if(this.wordCounts[A]>D){D=this.wordCounts[A];B=A}}}return B};Hints.prototype.getTopWords=function(E){var C=[];for(var B=0;B<Math.min(this.stickyWords.length,Hints.MAX_STICKY_WORDS);B++){C.push(this.stickyWords[B])}var D={};for(var B=0;B<E;B++){var A=this.findNextTopWord(D);if(A==null){break}D[A]=this.wordCounts[A];this.addUniqueArray(A,C)}return C};var Sounds={};if(navigator.userAgent.indexOf("MSIE")!=-1){Sounds.useMethod="bgsound"}else{if(navigator.userAgent.indexOf("Opera")!=-1){Sounds.useMethod="object"}else{Sounds.useMethod="embed"}}Sounds.alert=function(A){if(defaultPrefs.sounds[A]&&defaultPrefs.sounds[A].enabled){Sounds.play(defaultPrefs.sounds[A].sound)}};Sounds.play=function(C){var A="";if(C.toLowerCase().indexOf(".wav")==C.length-4){A="audio/x-wav"}else{if(C.toLowerCase().indexOf(".mp3")==C.length-4){A="audio/mpeg"}}var B=document.getElementById("current_sound");if(B){B.parentNode.removeChild(B)}B=null;if(Sounds.useMethod=="bgsound"){B=document.createElement("bgsound");B.id="current_sound";B.setAttribute("src",C);B.setAttribute("loop",1);document.body.appendChild(B)}else{if(Sounds.useMethod=="embed"){B=document.createElement("embed");B.id="current_sound";B.setAttribute("src",C);B.setAttribute("hidden","true");B.setAttribute("autostart","true");B.setAttribute("loop","false");B.setAttribute("type",A);B.style.visibility="hidden";B.style.position="absolute";B.style.height="0px";document.body.appendChild(B)}else{if(Sounds.useMethod=="object"){B=document.createElement("object");B.id="current_sound";B.setAttribute("data",C);B.setAttribute("type",A);B.setAttribute("autoplay","true");B.style.visibility="hidden";B.style.position="absolute";B.style.height="0px";document.body.appendChild(B)}}}};function ChatGuiModule(I,B,C,J,E,K){try{this.needsRedraw=false;this.container=I;this.prefs=C;this.doc=I.ownerDocument;this.cbacks=J;this.mHandler=new ChatMessageHandler(this);this.channel=null;this.nick="unknown";this.users={};this.ucid=0;this.isShowing=true;var A=this.prefs.showInputOptions;if(!E){A=false}this.createRenderer();this.tinyRenderer=new ParserNothing();this.motdRenderer=new ParserSimpleFormatter(new ParserChannels(J.channelclickcb,new ParserLinks(new ParserIRCColor(new ParserNothing()),this.prefs),this.prefs));var D={};D.ircLink=function(W){var L=W.substring(6,W.length);var U="";var V=L.indexOf("/");if(V!=-1){U=L.substring(V+1,L.length);L=L.substring(0,V);var P=U.substring(0,1);if("#&+".indexOf(P)==-1){U="#"+U}}try{var S="mib_"+mysession;if(myuser){S=myuser}var N="";var M="";var R=defaultPrefs.defaultCharset;if(myaccount){var O=myaccount.ircserverdetails;if(O){for(var Q=0;Q<O.length;Q++){if(O[Q].addr==L){S=O[Q].nick;N=O[Q].pass;M=O[Q].authmethod;R=O[Q].charset;break}}}}ircHandler.connectServer(L,S,N,U,false,false,M,R)}catch(T){}};this.whoisRenderer=new ParserChannels(J.channelclickcb,new ParserLinks(new ParserNothing(),this.prefs,D),this.prefs);this.channelListRenderer=new ParserChannels(J.channelclickcb,new ParserLinks(new ParserIRCColor(new ParserNothing())),this.prefs);var F={};cp(this.prefs,F);F.parseReplaceImages=false;this.topicRenderer=new ParserSimpleFormatter(new ParserChannels(J.channelclickcb,new ParserLinks(new ParserIRCColor(new ParserNothing()),F,D),this.prefs));I.style.border="0";I.style.fontSize="13px";I.style.position="absolute";I.style.textAlign="left";I.style.overflow="hidden";this.margins={left:0,right:0,top:ChatGuiModule.HEADER_HEIGHT,bottom:ChatGuiModule.FOOTER_HEIGHT};if(!ChatGuiModule.NEED_RESIZE_HANDLER&&this.prefs.useTabList){this.margins.left=this.prefs.tabListWidth}I.style.top=this.margins.top+"px";I.style.bottom=this.margins.bottom+"px";I.style.left=this.margins.left+"px";I.style.right=this.margins.right+"px";this.cod=this.createAltChat();cp({display:"block",overflow:"auto",overflowX:"hidden"},this.cod.style);this.cod.className="iescrollfix2";I.appendChild(this.cod);this.infobarWrap=this.doc.createElement("div");cp({padding:"0",margin:"0",position:"absolute",top:"0px",left:"0px",right:"0px",overflow:"hidden"},this.infobarWrap.style);this.infobar=new InfoBar(this.infobarWrap,this.prefs,K);I.appendChild(this.infobarWrap);if(B){this.ulshowing=true;this.uld=this.doc.createElement("div");cp({position:"absolute",right:"0px",overflow:"auto",overflowX:"hidden",textAlign:"left"},this.uld.style);I.appendChild(this.uld);this.userList=new UserList(this.uld,J.userclickcb,this.prefs)}if(B){this.ulinfo=this.doc.createElement("div");cp({position:"absolute",right:"0px",padding:"0",fontFamily:"Sans-Serif",fontSize:"13px",paddingTop:"3px",paddingRight:"3px",paddingBottom:"2px",top:"0px",textAlign:"right"},this.ulinfo.style);this.ulshowhide=this.doc.createElement("span");this.ulshowhide.style.textDecoration="underline";this.ulshowhide.style.cursor="pointer";this.ulshowhide.style.color=(islight(K)?"#444":"#eee");this.ulshowhide.onclick=function(L){return function(){L.setUListDisplay(!L.ulshowing);L.ulshowhide.blur();return false}}(this);this.ulshowhide.appendChild(this.doc.createTextNode(DisplayStrings.get("UList_hide")));this.ulinfo.appendChild(this.ulshowhide);this.ulinfospan=this.doc.createElement("span");this.ulinfospan.style.color=(islight(K)?"#000":"#fff");this.ulinfospan.style.marginLeft="8px";this.ulinfospan.style.marginRight="2px";this.ulinfo.appendChild(this.ulinfospan);I.appendChild(this.ulinfo)}else{this.typingIcon=this.doc.createElement("img");this.pminfo=this.doc.createElement("div");cp({position:"absolute",right:"0px",padding:"0",fontFamily:"Sans-Serif",fontSize:"13px",paddingTop:"3px",paddingRight:"3px",paddingBottom:"2px",top:"0px",textAlign:"right"},this.pminfo.style);this.typingIcon=this.doc.createElement("img");this.typingIcon.style.verticalAlign="middle";cp({display:"none",margin:"auto",width:"16px",height:"16px"},this.typingIcon.style);setPngSrc(this.typingIcon,"/icons/comment.png",16,16);this.pminfo.appendChild(this.typingIcon);I.appendChild(this.pminfo)}this.ieWrapper=this.doc.createElement("div");cp({position:"absolute",overflow:"hidden",bottom:"0px",left:"0px",right:"0px"},this.ieWrapper.style);if(A){J.minify=function(L){return function(M){L.cbacks.sendMinify(M)}}(this);J.showPasteBin=function(L){return function(){L.showPasteBin(true)}}(this);J.hidePasteBin=function(L){return function(){L.showPasteBin(false)}}(this);J.sendPasteBinData=function(L){return function(){L.cbacks.sendPasteBin(L.pasteBin.value())}}(this);J.getLanguageThem=function(L){return function(){return L.translate?L.translateToLanguage:null}}(this.mHandler);J.setLanguageThem=function(L){return function(O,M){if(O=="none"){L.mHandler.translate=false;var N=L.wrapRenderer(DisplayStrings.get("TranslationRecvNone"),{},L.prefs.colorSystem,null,false,L.renderer);L.output("translate",N)}else{L.mHandler.translate=true;L.mHandler.translateToLanguage=O;var N=L.wrapRenderer(DisplayStrings.get("TranslationRecv")+M,{},L.prefs.colorSystem,null,false,L.renderer);L.output("translate",N)}}}(this);J.showFileUpload=function(L){return function(){L.showUploader(true)}}(this);J.hideFileUpload=function(L){return function(){L.showUploader(false)}}(this)}this.frm=this.doc.createElement("form");this.frm.style.display="inline";this.frm.setAttribute("accept-charset","UTF-8");this.frm.onsubmit=J.sendcb;this.richInputElement=new RichInputElement(this.ieWrapper,this.prefs,this.frm,J,A);I.appendChild(this.ieWrapper);this.pasteBinDiv=this.createAltChat();this.pasteBin=new PasteBin(this.pasteBinDiv);I.appendChild(this.pasteBinDiv);this.uploadDiv=this.createAltChat();this.uploader=new Uploader(this.uploadDiv);I.appendChild(this.uploadDiv);this.extraDiv=this.createAltChat();this.extraDiv.style.background="white";this.extraContent=new ExtraContent(this.extraDiv,this.prefs);I.appendChild(this.extraDiv);this.sbWrapper=this.doc.createElement("div");cp({padding:"0",position:"absolute",right:"0px",bottom:"0px",cursor:"pointer",textAlign:"center",fontSize:"13px",verticalAlign:"middle"},this.sbWrapper.style);this.sbWrapper.onclick=function(L){return function(){J.sendcb();L.richInputElement.hin.addInput();L.focus()}}(this);this.sbWrapper.appendChild(document.createTextNode(DisplayStrings.get("SendButton")));I.appendChild(this.sbWrapper);if(ChatGuiModule.NEED_RESIZE_HANDLER){this.onresize=function(L){return function(){L.sizeElements()}}(this);if(window.attachEvent){window.attachEvent("onresize",this.onresize)}else{window.addEventListener("resize",this.onresize,false)}window.setTimeout(function(L){return function(){L.layout();L.sizeElements()}}(this),100)}function G(L){return function(){L.focus()}}this.chatOutput=new ChatOutput(this.cod,this.prefs,G(this));for(var H=0;H<40;H++){this.chatOutput.addLine(this.ucid++,this.wrapRenderer())}this.redraw();this.goToBottom();if(alerts){alerts.attachListeners(this.richInputElement.inputElement)}}catch(I){if(DEBUG){log.log("ChatGuiModule",I,DebugLevel.WARNING)}}}ChatGuiModule.prototype.redraw=function(){if(!this.isShowing){this.needsRedraw=true;return }this.needsRedraw=false;if(this.userList){this.userList.redraw()}this.chatOutput.redraw();this.richInputElement.redraw();this.infobar.redraw();cp({background:this.prefs.sendButtonBackground,border:("1px solid "+this.prefs.sendButtonBorder),color:this.prefs.sendButtonColor,fontFamily:this.prefs.chatInputFontFamily,fontSize:(this.prefs.chatInputFontSize+"px")},this.sbWrapper.style);var A={background:this.prefs.chatPaneBackground,border:("1px solid "+this.prefs.chatPaneBorder)};A.borderRadius=this.prefs.chatPaneRounding+"px";A.MozBorderRadius=this.prefs.chatPaneRounding+"px";A.WebkitBorderRadius=this.prefs.chatPaneRounding+"px";A.padding=this.prefs.chatPaneRounding+"px";cp(A,this.cod.style);cp(A,this.extraDiv.style);cp(A,this.pasteBinDiv.style);cp(A,this.uploadDiv.style);if(this.ulinfospan&&this.userList){if(!this.prefs.showChannelUsers){while(this.ulinfospan.firstChild){this.ulinfospan.removeChild(this.ulinfospan.firstChild)}}else{this.setULStat(this.userList.size()+" "+DisplayStrings.get("UserCount"))}while(this.ulshowhide.firstChild){this.ulshowhide.removeChild(this.ulshowhide.firstChild)}this.ulshowhide.appendChild(this.doc.createTextNode(DisplayStrings.get("UList_hide")))}this.layout()};ChatGuiModule.prototype.setHints=function(A){this.mHandler.hints=A;this.mHandler.UPDATE_HINTS=true};ChatGuiModule.prototype.createAltChat=function(){var A=this.doc.createElement("div");cp({position:"absolute",overflow:"hidden",display:"none",left:"0px",right:"0px"},A.style);return A};ChatGuiModule.prototype.showExtra=function(A){this.extrashowing=A;this.layout();this.goToBottom()};ChatGuiModule.prototype.showUploader=function(A){this.uploader.show(A,this.channel);this.layout();this.goToBottom()};ChatGuiModule.prototype.showPasteBin=function(A){this.pasteBin.show(A);this.layout();this.goToBottom()};ChatGuiModule.prototype.setUListDisplay=function(A){if(this.pasteBin.showing()||(this.uploader&&this.uploader.showing())){return }if(this.userList){this.ulshowing=A;if(this.ulshowhide){this.ulshowhide.firstChild.nodeValue=this.ulshowing?DisplayStrings.get("UList_hide"):DisplayStrings.get("UList_show")}this.layout();this.goToBottom()}};ChatGuiModule.prototype.goToBottom=function(){this.cod.scrollTop=this.cod.scrollHeight};ChatGuiModule.prototype.isAtBottom=function(){return this.cod.scrollTop+this.cod.clientHeight>=(this.cod.scrollHeight-this.prefs.chatFontSize)};ChatGuiModule.prototype.getInput=function(){return this.richInputElement.inputElement.value};ChatGuiModule.prototype.focus=function(){try{this.richInputElement.inputElement.focus()}catch(A){}};ChatGuiModule.prototype.setULStat=function(A){if(!this.ulinfospan){return }if(!this.prefs.showChannelUsers){return }if(this.ulinfospan.firstChild){this.ulinfospan.firstChild.nodeValue=A}else{this.ulinfospan.appendChild(this.doc.createTextNode(A))}};ChatGuiModule.prototype.removeMarker=function(){if(this.addedMarker){this.addedMarker=false;this.chatOutput.removeLines("--MARKER--")}};ChatGuiModule.prototype.addMarker=function(){if(!this.addedMarker){this.addedMarker=true;this.chatOutput.addMarker("--MARKER--")}};ChatGuiModule.prototype.setMyTyping=function(A){if(this.userList){this.userList.setUserTyping(this.nick,A)}};ChatGuiModule.prototype.getMe=function(){if(this.userList){return this.userList.getUser(this.nick)}return null};ChatGuiModule.prototype.clearOutput=function(){this.chatOutput.clear();for(var A=0;A<40;A++){this.chatOutput.addLine(this.ucid++,this.wrapRenderer())}this.goToBottom()};ChatGuiModule.prototype.output=function(C,B){var A=this.isAtBottom();if(!this.isShowing&&this.prefs.showMarkers){if(!this.addedMarker){this.addMarker()}}this.chatOutput.addLine(C+" "+this.ucid++,B);if(A){this.goToBottom()}};ChatGuiModule.prototype.outputFull=function(A){this.outputFullID(this.ucid++,A)};ChatGuiModule.prototype.outputFullID=function(D,C,A){var B=this.isAtBottom();this.chatOutput.addFullLine(D,C,A);if(B){this.goToBottom()}};ChatGuiModule.prototype.clearUsers=function(){if(this.userList){this.users={};this.richInputElement.hin.clearWords();this.mHandler.clearUsers();this.userList.clear();this.createRenderer()}else{delete this.users[this.nick.toLowerCase()];this.richInputElement.hin.removeWord(this.nick)}};ChatGuiModule.prototype.close=function(){if(this.userList){this.userList.destroy()}if(this.onresize){if(window.detachEvent){window.detachEvent("onresize",this.onresize)}else{window.removeEventListener("resize",this.onresize,false)}}};ChatGuiModule.prototype.isIgnored=function(A){return(typeof this.mHandler.ignoredUsers[A]!="undefined")};ChatGuiModule.prototype.setIgnoreUser=function(C,B){var A=null;if(this.userList){A=this.userList.getUser(C)}if(B){this.mHandler.ignoredUsers[C]=true;if(A){A.oldIcon=A.icon;A.setIcon({name:"ignored",title:"Ignored"})}}else{delete this.mHandler.ignoredUsers[C];if(A&&A.oldIcon){A.setIcon(A.oldIcon)}}};ChatGuiModule.prototype.activecb=function(A){this.isShowing=A;if(A&&this.needsRedraw){this.redraw()}if(!A){this.removeMarker()}else{if(this.richInputElement.layout()||this.infobar.layout()){this.layout()}}try{if(A){this.goToBottom();window.setTimeout(function(C){return function(){C.focus()}}(this),200)}else{window.focus()}}catch(B){if(DEBUG){log.log("activecb",B,DebugLevel.WARNING)}}};ChatGuiModule.prototype.layout=function(A,D){try{this.richInputElement.layout();this.infobar.layout();var B=this.richInputElement.getHeight()+2+(this.prefs.cgmMargins*2);var H=this.prefs.cgmMargins+this.infobar.getHeight();var C=this.prefs.cgmMargins+2+this.prefs.userListWidth;cp({padding:"0",margin:"0",position:"absolute",top:"0px",left:"0px",height:(this.infobar.getHeight()+"px"),right:(C+"px"),overflow:"hidden"},this.infobarWrap.style);this.setMargins(this.infobarWrap,1,1,0,1);var G=this.prefs.cgmMargins;if(!ChatGuiModule.NEED_RESIZE_HANDLER&&this.prefs.useTabList){G+=this.prefs.tabListWidth}InfoBar.setGooglePos(G,this.prefs.cgmMargins+ChatGuiModule.HEADER_HEIGHT);cp({position:"absolute",overflow:"hidden",bottom:"0px",left:"0px",height:(this.richInputElement.getHeight()+"px"),right:((this.prefs.needSendButton?C:0)+"px")},this.ieWrapper.style);this.setMargins(this.ieWrapper,0,1,1,1);this.sbWrapper.style.display=this.prefs.needSendButton?"block":"none";this.sbWrapper.style.height=this.richInputElement.getHeight()+"px";this.sbWrapper.style.width=this.prefs.userListWidth+"px";this.setMargins(this.sbWrapper,0,1,1,0);if(this.pminfo){this.pminfo.style.width=this.prefs.userListWidth+"px";this.pminfo.style.height=this.infobar.getHeight()+"px";this.setMargins(this.pminfo,1,1,0,0)}else{if(this.ulinfo){this.ulinfo.style.width=this.prefs.userListWidth+"px";this.ulinfo.style.height=this.infobar.getHeight()+"px";this.setMargins(this.ulinfo,1,1,0,0)}}if(this.pasteBin.showing()||(this.uploader&&this.uploader.showing())){this.pasteBinDiv.style.top=H+"px";this.pasteBinDiv.style.bottom=B+"px";this.setMargins(this.pasteBinDiv,1,1,0,1);if(this.uploadDiv){this.uploadDiv.style.top=H+"px";this.uploadDiv.style.bottom=B+"px";this.setMargins(this.uploadDiv,1,1,0,1)}this.cod.style.display="none";if(this.ulshowing){this.uld.style.display="none"}if(this.extrashowing){this.extraDiv.style.display="none"}}else{var F=this.prefs.extraContentWidth+2+this.prefs.cgmMargins;this.cod.className="iescrollfix2";this.cod.style.display="block";this.cod.style.top=H+"px";this.cod.style.bottom=B+"px";this.cod.style.left=((this.extrashowing&&this.prefs.extraContentPosition=="left")?F:"0")+"px";this.cod.style.right=((this.ulshowing?C:0)+((this.extrashowing&&this.prefs.extraContentPosition!="left")?F:0))+"px";this.setMargins(this.cod,1,1,0,1);if(this.uld){this.setMargins(this.uld,1,1,0,0)}if(this.ulshowing){cp({position:"absolute",right:((this.extrashowing&&this.prefs.extraContentPosition=="right")?F:"0")+"px",overflow:"auto",display:"block",top:H+"px",bottom:B+"px",width:(this.prefs.userListWidth-(2*this.prefs.ulistPaneRounding))+"px",overflowX:"hidden",textAlign:"left"},this.uld.style)}else{if(this.uld){this.uld.style.display="none"}}if(this.extrashowing){cp({display:"block",top:(H+"px"),bottom:(B+"px"),width:(this.prefs.extraContentWidth+"px"),left:((this.prefs.extraContentPosition=="left"?"0px":"auto")),right:((this.prefs.extraContentPosition=="left")?"auto":(((this.ulshowing&&this.prefs.extraContentPosition!="right")?C:0)+"px"))},this.extraDiv.style);this.setMargins(this.extraDiv,1,1,0,1)}else{this.extraDiv.style.display="none"}}if(ChatGuiModule.NEED_RESIZE_HANDLER){this.sizeElements()}}catch(E){if(DEBUG){log.log("ChatGuiModule.layout",E,DebugLevel.WARNING)}}};ChatGuiModule.prototype.sizeElements=function(){var E=(document.body.clientHeight-this.margins.top-this.margins.bottom);var C=(document.body.clientWidth-this.margins.left-this.margins.right);this.container.style.height=E+"px";this.container.style.width=C+"px";var B=(E-(this.richInputElement.getHeight()+2)-this.infobar.getHeight()-(defaultPrefs.cgmMargins*4)-4);var F=C-2-(defaultPrefs.cgmMargins*2);this.cod.style.height=(B-(2*this.prefs.chatPaneRounding))+"px";if(this.ulshowing){this.uld.style.height=(B-(2*this.prefs.ulistPaneRounding))+"px"}this.extraDiv.style.height=B+"px";if(this.pasteBinDiv){this.pasteBinDiv.style.height=(B-(2*this.prefs.chatPaneRounding))+"px";this.pasteBinDiv.style.width=(F-(2*this.prefs.chatPaneRounding))+"px"}if(this.uploadDiv){this.uploadDiv.style.height=(B-(2*this.prefs.chatPaneRounding))+"px";this.uploadDiv.style.width=(F-(2*this.prefs.chatPaneRounding))+"px"}var A=parseInt(this.cod.style.left);var D=parseInt(this.cod.style.right);this.cod.style.width=(F-(2*this.prefs.chatPaneRounding)-A-D)+"px";A=parseInt(this.ieWrapper.style.left);D=parseInt(this.ieWrapper.style.right);this.ieWrapper.style.width=(F-A-D)+"px";A=parseInt(this.infobarWrap.style.left);D=parseInt(this.infobarWrap.style.right);this.infobarWrap.style.width=(F-A-D)+"px"};ChatGuiModule.prototype.setMargins=function(D,A,B,E,F){var C=this.prefs.cgmMargins+"px";if(A){D.style.marginTop=C}if(B){D.style.marginRight=C}if(E){D.style.marginBottom=C}if(F){D.style.marginLeft=C}};ChatGuiModule.prototype.disconnected=function(){try{var A=(new Date()).getTime();this.output("system",this.wrapRenderer("You have disconnected from the server",{},"red","system",false,this.tinyRenderer,A));this.clearUsers()}catch(B){if(DEBUG){log.log("disconnected","disconnected error... "+B,DebugLevel.WARNING)}}};ChatGuiModule.medias=[{prf:"parseYouTubes",cb:"youtube",de:"Show YouTube video",icon:"/gfx/youtube.png",icon_w:42,icon_h:30,match:/youtube\.com\/watch\?.*v\=([a-zA-Z0-9\_\-]*)/i,extraInfo:true},{prf:"parseJustinTV",cb:"justintv",de:"Show Justin.tv live stream",icon:"/gfx/justintv.png",icon_w:42,icon_h:30,match:/justin\.tv\/([a-zA-Z0-9]*)/i,extraInfo:false}];ChatGuiModule.prototype.checkLink=function(B){for(var D=0;D<ChatGuiModule.medias.length;D++){var C=ChatGuiModule.medias[D];var A=B.match(C.match);if(A){return{icon_w:C.icon_w,icon_h:C.icon_h,icon:C.icon,cb:C.cb,de:C.de,match:A,enabled:(this.prefs&&this.prefs[C.prf])}}}return false};ChatGuiModule.prototype.openLink=function(A){var B=this.checkLink(A);if(B){this.showExtra(true);if(B.cb=="youtube"){this.extraContent.showYouTube(B.match[1],A,function(D){return function(){D.showExtra(false)}}(this))}else{if(B.cb=="justintv"){this.extraContent.showJustinTV(B.match,A,function(D){return function(){D.showExtra(false)}}(this))}else{if(B.cb=="gmap"){if(B.match.length==4){var C={lon:parseFloat(B.match[1]),lat:parseFloat(B.match[2]),zoom:parseInt(B.match[3])};this.extraContent.showMap(C,A,function(D){return function(){D.showExtra(false)}}(this))}}}}}else{this.showExtra(true);this.extraContent.showWeb(A,function(D){return function(){D.showExtra(false)}}(this))}};ChatGuiModule.prototype.createRenderer=function(){this.renderer=new ParserNothing();if(this.parseAnsi){this.renderer=new ParserAnsiCodes(this.renderer)}if(this.parseSimpleHTML){this.renderer=new ParserSimpleHTML(this.renderer)}if(this.prefs.parseSimple){this.renderer=new ParserSimpleFormatter(this.renderer)}if(this.prefs.parseNicks){this.renderer=new ParserNicks(this.users,this.renderer,function(B){return function(D,C){B.nickRenderer(D,C)}}(this))}if(this.prefs.parseColor){this.renderer=new ParserIRCColor(this.renderer)}if(this.prefs.parseSmilies){this.renderer=new ParserSmileys(this.renderer,this.prefs)}if(this.prefs.parseChannels&&this.cbacks.channelclickcb){this.renderer=new ParserChannels(this.cbacks.channelclickcb,this.renderer,this.prefs)}if(this.prefs.parseTex){this.renderer=new ParserTexFormatter(this.renderer,function(B){return function(){B.goToBottom()}}(this))}var A={};A.youtube=function(B){return function(D,C){if(D[1]){B.showExtra(true);B.extraContent.showYouTube(D[1],C,function(){B.showExtra(false)})}}}(this);A.justintv=function(B){return function(D,C){if(D[1]){B.showExtra(true);B.extraContent.showJustinTV(D,C,function(){B.showExtra(false)})}}}(this);A.gmap=function(B){return function(C,E){if(C.length==4){var D={lon:parseFloat(C[1]),lat:parseFloat(C[2]),zoom:parseInt(C[3])};B.showExtra(true);B.extraContent.showMap(D,E,function(){B.showExtra(false)})}}}(this);A.web=function(B){return function(C){B.showExtra(true);B.extraContent.showWeb(C,function(){B.showExtra(false)})}}(this);A.mediaCheck=function(B){return function(D){var C=B.checkLink(D);if(!C.enabled){return false}return C}}(this);A.ircLink=function(M){var B=M.substring(6,M.length);var K="";var L=B.indexOf("/");if(L!=-1){K=B.substring(L+1,B.length);B=B.substring(0,L);var F=K.substring(0,1);if("#&+".indexOf(F)==-1){K="#"+K}}try{var I="mib_"+mysession;if(myuser){I=myuser}var D="";var C="";var H=defaultPrefs.defaultCharset;if(myaccount){var E=myaccount.ircserverdetails;if(E){for(var G=0;G<E.length;G++){if(E[G].addr==B){I=E[G].nick;D=E[G].pass;C=E[G].authmethod;H=E[G].charset;break}}}}ircHandler.connectServer(B,I,D,K,false,false,C,H)}catch(J){}};if(this.prefs.parseLinks){this.renderer=new ParserLinks(this.renderer,this.prefs,A)}if(DEBUG){log.log("createRenderer","Created a new renderer",DebugLevel.INFO)}};ChatGuiModule.prototype.nickRenderer=function(A,B){try{if(A==this.nick.toLowerCase()){B.style.color=this.prefs.nickHighlightMe;B.style.fontWeight="bold"}else{B.style.color=this.prefs.nickHighlight}if(this.prefs.chatBackgroundHighlight){var E=this.chatOutput;var C=this.prefs;B.onmouseover=function(){return function(){if(A){E.highlight(A.toLowerCase(),{background:C.chatBackgroundHighlight})}}}();B.onmouseout=function(){return function(){if(A){E.highlight(A.toLowerCase(),{background:C.chatBackground})}}}()}}catch(D){}};ChatGuiModule.prototype.wrapRenderer=function(E,N,D,A,F,H,K,I,J,M){if(!D){D=this.prefs.colorChat}var C=this.prefs;var G=this.cbacks.nickclick;var L=this.chatOutput;var B=(M?M:((F?C.nickColorMe:(J?C.nickColorGuest:(I?"#a20814":C.nickColor)))));return{render:function(O){L.renderData(O,C,A,B,G,D,H,E,N)},renderNick:function(O){L.renderNick(O,C,A,B,G)},renderTime:function(O){L.renderTime(O,C,K)}}};ChatGuiModule.prototype.processPacket=function(A){this.mHandler.processPacket(A)};ChatGuiModule.BASE_HEADER_HEIGHT=77+6;ChatGuiModule.HEADER_HEIGHT=77+6+20+6;ChatGuiModule.FOOTER_HEIGHT=0;ChatGuiModule.NEED_RESIZE_HANDLER=false;function ChatMessageHandler(A){this.cgm=A;this.prefs=A.prefs;this.SHOWLOGMESSAGES=true;this.SHOW_NOTICES=true;this.UPDATE_HINTS=false;this.userDetails={};this.ignoredUsers={};this.bridgebots=[];this.translate=false;this.translateFromLanguage="";this.translateToLanguage=""}ChatMessageHandler.prototype.clearUsers=function(){this.userDetails={};this.ignoredUsers={}};ChatMessageHandler.prototype.processPacket=function(K){try{var B=(new Date()).getTime();if(K.cmd=="whoisreply"){this.cgm.outputFull(new WhoisRenderer(K,this.prefs,this.cgm.whoisRenderer))}else{if(K.cmd=="motd"&&this.prefs.showMOTD){var A=this.cgm.wrapRenderer(K.motd,{},"#888",null,false,this.cgm.renderer,B);A.render=function(U){var T=U.prefs;return function(V){V.style.overflow="hidden";V.style.fontFamily="monospace";V.style.paddingBottom="1px";V.style.paddingTop="1px";V.style.paddingLeft="3px";V.style.fontSize=T.chatFontSize+"px";V.style.color="#888";V.style.background=T.chatBackground;V.setAttribute("valign","top");U.motdRenderer.reset();U.motdRenderer.addData(K.message);U.motdRenderer.flush(V)}}(this.cgm);this.cgm.output("motd",A);if(this.UPDATE_HINTS){this.hints.feedContent(K.message,this.cgm.users)}}else{if(K.cmd=="infobar"){if(K.type=="announcement"){this.cgm.infobar.showAnnouncement(K.message)}else{if(K.type=="link"){this.cgm.infobar.showLink(K)}else{if(K.type=="topic"){this.cgm.infobar.showTopic(K.topic,this.cgm.topicRenderer)}}}}else{if(K.cmd=="whowas"){var I=">>> "+K.nick+" was "+K.user+"@"+K.host+" "+K.realname;this.cgm.output("whowas",this.cgm.wrapRenderer(I,{},this.prefs.colorNotice,null,false,this.cgm.renderer,B))}else{if(K.cmd=="who"){var I=">>> "+K.nick+" ("+K.user+"@"+K.host+" "+K.realname+") "+K.serv+" ("+K.hops+" hops) "+K.chan+" "+K.flag;this.cgm.output("who",this.cgm.wrapRenderer(I,{},this.prefs.colorNotice,null,false,this.cgm.renderer,B))}else{if(K.cmd=="channellist"){this.cgm.outputFull(new ChannelListRenderer(K,this.cgm.channelListRenderer))}else{if(K.cmd=="invite"){this.cgm.output(K.nick,this.cgm.wrapRenderer("%%% "+K.nick+" "+DisplayStrings.get("InviteText")+" "+K.localchannel,{},this.prefs.colorInvite,null,false,this.cgm.renderer,B));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb()}}else{if(K.cmd=="notice"&&this.SHOW_NOTICES){if(!this.cgm.isIgnored(K.nick)){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(K.notice,{},this.prefs.colorNotice,K.nick,K.nick==this.cgm.nick,this.cgm.renderer,B,true));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb(K.notice.indexOf(this.cgm.nick)!=-1)}}}else{if(K.cmd=="ban"){if(this.prefs.showBans){this.cgm.output("::ban",this.cgm.wrapRenderer("--- "+K.by+" "+DisplayStrings.get("BanText")+" "+K.nick,{},this.prefs.colorBan,null,false,this.cgm.renderer,B))}}else{if(K.cmd=="unban"){if(this.prefs.showBans){this.cgm.output("::ban",this.cgm.wrapRenderer("--- "+K.by+" "+DisplayStrings.get("UnbanText")+" "+K.nick,{},this.prefs.colorBan,null,false,this.cgm.renderer,B))}}else{if(K.cmd=="typing"){if(this.cgm.userList){this.cgm.userList.setUserTyping(K.nick,K.typing)}else{if(this.cgm.typingIcon){this.cgm.typingIcon.style.display=K.typing?"inline":"none"}}}else{if(K.cmd=="topic"){this.cgm.output("::topic",this.cgm.wrapRenderer(K.topic,{},this.prefs.colorTopic,null,false,this.cgm.renderer));if(K.nick){var R=new Date();this.cgm.output("::topic",this.cgm.wrapRenderer(DisplayStrings.get("TopicText")+" "+K.nick+" "+DisplayStrings.get("TopicText2")+" "+R,{},this.prefs.colorTopicWho,null,false,this.cgm.renderer))}if(this.UPDATE_HINTS){this.hints.feedContentSticky(K.topic,this.cgm.users)}}else{if(K.cmd=="topicwho"){var R=new Date();R.setTime(K.date*1000);this.cgm.output("topic",this.cgm.wrapRenderer(DisplayStrings.get("TopicText")+" "+K.creator+" "+DisplayStrings.get("TopicText2")+" "+R,{},this.prefs.colorTopicWho,null,false,this.cgm.renderer))}else{if(K.cmd=="away"){if(this.cgm.userList&&this.cgm.userList.getUser(K.nick)){var F=this.cgm.userList.getUser(K.nick);if(K.reason){F.setDesc(K.reason);this.cgm.userList.setUserActive(K.nick,false);if(this.prefs.showAwaysBacks){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("--- "+K.nick+" "+DisplayStrings.get("AwayText")+" ("+K.reason+")",{},this.prefs.colorAway,null,false,this.cgm.renderer,B))}}else{F.setDesc(K.nick);this.cgm.userList.setUserActive(K.nick,true);if(this.prefs.showAwaysBacks){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("--- "+K.nick+" "+DisplayStrings.get("BackText"),{},this.prefs.colorBack,null,false,this.cgm.renderer,B))}}}}else{if(K.cmd=="msg"){if(this.cgm.userList){this.cgm.userList.setUserTyping(K.nick,false);this.cgm.userList.setUserActivity(K.nick)}if(!this.cgm.isIgnored(K.nick)){if(K.msg.toLowerCase().indexOf(this.cgm.nick.toLowerCase())!=-1){Sounds.alert("mentionednick")}Sounds.alert("newmsg");if(alerts){alerts.notify({cmd:"newmsg"})}var E=B;if(K.dtime){E=B-K.dtime}K.msg=myfilters.apply(K.msg,true);if(K.msg){var D=false;if(this.bridgebots[K.nick]){if(K.msg.substring(0,3)=="[**"){var P=K.msg.indexOf(" ");if(P!=-1){this.processPacket({cmd:"emote",nick:K.msg.substring(3,P),emote:K.msg.substring(P+1,K.msg.length-2),ncolor:"#844"});return }}else{if(K.msg.substring(0,1)=="["){var P=K.msg.indexOf("]");if(P!=-1){K.nick=K.msg.substring(1,P);K.msg=K.msg.substring(P+2,K.msg.length);D="#844"}}}}if(this.translate&&K.nick!=this.cgm.nick){this.translateText(K.msg,function(T){return function(V){var U=V.error?K.msg:(V.translation+" ("+K.msg+")");T.output(K.nick.toLowerCase(),T.wrapRenderer(U,(typeof K.md=="undefined")?{}:K.md,(K.nick==T.nick)?T.prefs.colorChatMe:T.prefs.colorChat,K.nick,K.nick==T.nick,T.renderer,E,false,!K.idd,D));if(T.cbacks.activitycb){T.cbacks.activitycb(K.msg.toLowerCase().indexOf(T.nick.toLowerCase())!=-1)}}}(this.cgm))}else{this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(K.msg,(typeof K.md=="undefined")?{}:K.md,(K.nick==this.cgm.nick)?this.prefs.colorChatMe:this.prefs.colorChat,K.nick,K.nick==this.cgm.nick,this.cgm.renderer,E,false,!K.idd,D));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb(K.msg.toLowerCase().indexOf(this.cgm.nick.toLowerCase())!=-1)}}}}if(this.UPDATE_HINTS){this.hints.feedContent(K.msg,this.cgm.users)}}else{if(K.cmd=="emote"){if(this.cgm.userList){this.cgm.userList.setUserTyping(K.nick,false);this.cgm.userList.setUserActivity(K.nick)}K.emote=myfilters.apply(K.emote,true);if(K.emote&&!this.cgm.isIgnored(K.nick)){if(K.emote.toLowerCase().indexOf(this.cgm.nick.toLowerCase())!=-1){Sounds.alert("mentionednick")}Sounds.alert("newmsg");if(alerts){alerts.notify({cmd:"newmsg"})}if(this.translate&&K.nick!=this.cgm.nick){this.translateText(K.emote,function(T){return function(V){var U=V.error?K.emote:(V.translation+" ("+K.emote+")");T.output(K.nick.toLowerCase(),T.wrapRenderer(K.nick+" "+U,{},(K.nick==T.nick)?T.prefs.colorEmoteMe:T.prefs.colorEmote,null,K.nick==T.nick,T.renderer,B,false,!K.idd,K.ncolor));if(T.cbacks.activitycb){T.cbacks.activitycb(K.emote.toLowerCase().indexOf(T.nick.toLowerCase())!=-1)}}}(this.cgm))}else{this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(K.nick+" "+K.emote,{},(K.nick==this.cgm.nick)?this.prefs.colorEmoteMe:this.prefs.colorEmote,null,K.nick==this.cgm.nick,this.cgm.renderer,B,false,!K.idd,K.ncolor));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb(K.emote.toLowerCase().indexOf(this.cgm.nick.toLowerCase())!=-1)}}}if(this.UPDATE_HINTS){this.hints.feedContent(K.emote,this.cgm.users)}}else{if(K.cmd=="rmsg"){K.msg=myfilters.apply(K.msg,true);if(K.msg&&!this.cgm.isIgnored(K.nick)){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(K.msg,{},this.prefs.colorChatRecent,K.nick,false,this.cgm.renderer,B-K.dtime))}}else{if(K.cmd=="remote"){K.emote=myfilters.apply(K.emote,true);if(K.emote&&!this.cgm.isIgnored(K.nick)){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(K.nick+" "+K.emote,{},this.prefs.colorEmoteRecent,null,false,this.cgm.renderer,B-K.dtime))}}else{if(K.cmd=="mode"){if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+K.msg,{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}else{if(K.cmd=="usermode"){function S(T,V,W,U){return W+" "+DisplayStrings.get("ModeChange1")+" "+DisplayStrings.get(T?"ModeGiven":"ModeTaken")+" "+V+" "+DisplayStrings.get(T?"ModeTo":"ModeFrom")+" "+U}if(typeof K.owner!="undefined"){if(this.cgm.userList){this.cgm.userList.setUserMode(K.nick,"owner",K.owner)}if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+S(K.owner,DisplayStrings.get("ModeOwner"),K.by,K.nick),{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}if(typeof K.admin!="undefined"){if(this.cgm.userList){this.cgm.userList.setUserMode(K.nick,"admin",K.admin)}if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+S(K.admin,DisplayStrings.get("ModeAdmin"),K.by,K.nick),{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}if(typeof K.halfop!="undefined"){if(this.cgm.userList){this.cgm.userList.setUserMode(K.nick,"halfop",K.halfop)}if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+S(K.halfop,DisplayStrings.get("ModeHalfop"),K.by,K.nick),{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}if(typeof K.op!="undefined"){if(this.cgm.userList){this.cgm.userList.setUserMode(K.nick,"op",K.op)}if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+S(K.op,DisplayStrings.get("ModeOp"),K.by,K.nick),{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}if(typeof K.voice!="undefined"){if(this.cgm.userList){this.cgm.userList.setUserMode(K.nick,"voice",K.voice)}if(this.prefs.showUserModes){this.cgm.output("::mode",this.cgm.wrapRenderer("+++ "+S(K.voice,DisplayStrings.get("ModeVoice"),K.by,K.nick),{},this.prefs.colorUserMode,null,false,this.cgm.renderer,B))}}}else{if(K.cmd=="nicklist"){var H=new Array();for(var N=0;N<K.nicks.length;N++){var C=K.nicks[N];var G=this.getIcon(C.mibbituser,C.device);var O=C.nick;if(C.mibbitaway){O=C.mibbitaway}var M={};M.admin=!!C.admin;M.op=!!C.op;M.halfop=!!C.halfop;M.voice=!!C.voice;M.owner=!!C.owner;M.active=!C.mibbitaway;if(this.cgm.userList){var J=-1;if(C.hasOwnProperty("idletime")){J=parseInt(C.idletime)}this.cgm.userList.addUser({id:C.nick,countrycode:C.cc,localtime:C.ct,timezone:C.tz,nick:C.nick,icon:G,desc:O,modes:M,idleTime:J})}this.cgm.users[C.nick.toLowerCase()]=C.nick;this.cgm.richInputElement.hin.addWord(C.nick);if(this.userDetails[C.nick.toLowerCase()]){cp({device:C.device,mibbituser:C.mibbituser,embed:C.embed,host:C.host},this.userDetails[C.nick.toLowerCase()])}else{this.userDetails[C.nick.toLowerCase()]={device:C.device,mibbituser:C.mibbituser,embed:C.embed,host:C.host}}}if(this.cgm.userList){this.cgm.setULStat(this.cgm.userList.size()+" "+DisplayStrings.get("UserCount"))}}else{if(K.cmd=="join"){Sounds.alert("userjoin");if(alerts){alerts.notify({cmd:"userjoin"})}var G=this.getIcon(K.mibbituser,K.device);var O=K.nick;if(K.mibbitaway){O=K.mibbitaway}if(this.cgm.userList){var J=-1;if(K.hasOwnProperty("idletime")){J=parseInt(K.idletime)}var M={};M.admin=false;M.op=false;M.halfop=false;M.voice=false;M.owner=false;M.active=!K.mibbitaway;if(this.cgm.userList){this.cgm.userList.addUser({id:K.nick,countrycode:K.cc,localtime:K.ct,timezone:K.tz,nick:K.nick,icon:G,desc:O,modes:M,idleTime:J})}this.cgm.setULStat(this.cgm.userList.size()+" "+DisplayStrings.get("UserCount"))}if(this.prefs.showJoinsParts){var I="*** "+K.nick+" "+DisplayStrings.get("JoinText")+" "+K.localchannel;if(this.prefs.showJoinInfo){I+=" "+K.user+"@"+K.host+" ";if(K.mibbituser){if(K.device){I+=" ["+K.device+"]"}if(K.embed){I+=" (Widget)"}else{I+=" (Mibbit)"}}}this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(I,{},this.prefs.colorJoin,null,false,this.cgm.renderer,B))}this.cgm.users[K.nick.toLowerCase()]=K.nick;this.cgm.richInputElement.hin.addWord(K.nick);this.userDetails[K.nick.toLowerCase()]={user:K.user,host:K.host,device:K.device,embed:K.embed,mibbituser:K.mibbituser}}else{if(K.cmd=="userdetails"){if(this.userDetails[K.nick.toLowerCase()]){if(this.userDetails[K.nick.toLowerCase()]){this.userDetails[K.nick.toLowerCase()].user=K.user;this.userDetails[K.nick.toLowerCase()].host=K.host}else{this.userDetails[K.nick.toLowerCase()]={user:K.user,host:K.host}}}}else{if(K.cmd=="part"){if(this.cgm.userList&&this.cgm.userList.getUser(K.nick)){Sounds.alert("userpart");if(alerts){alerts.notify({cmd:"userpart"})}this.cgm.userList.removeUser(K.nick);this.cgm.setULStat(this.cgm.userList.size()+" "+DisplayStrings.get("UserCount"));delete this.cgm.users[K.nick.toLowerCase()];this.cgm.richInputElement.hin.removeWord(K.nick);delete this.userDetails[K.nick.toLowerCase()];delete this.ignoredUsers[K.nick];if(this.prefs.showJoinsParts){var I;if(K.quit){I="*** "+K.nick+" "+DisplayStrings.get("QuitText")+" ("+K.message+")"}else{I="*** "+K.nick+" "+DisplayStrings.get("LeftText");I+=(K.localchannel?(" "+K.localchannel):".");if(K.message){I+=" ("+K.message+")"}}if(this.prefs.showPartInfo){I+=" "+K.user+"@"+K.host+" ";if(K.mibbituser){if(K.device){I+=" ["+K.device+"]"}if(K.embed){I+=" (Widget)"}else{I+=" (Mibbit)"}}}this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer(I,{},this.prefs.colorPart,null,false,this.cgm.renderer,B))}}if(K.nick==this.cgm.nick){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("!!! You left "+K.localchannel,{},this.prefs.colorPart,null,false,this.cgm.renderer,B));this.cgm.clearUsers()}}else{if(K.cmd=="kick"){if(this.cgm.userList&&this.cgm.userList.getUser(K.nick)){Sounds.alert("userpart");if(alerts){alerts.notify({cmd:"userpart"})}this.cgm.userList.removeUser(K.nick);this.cgm.setULStat(this.cgm.userList.size()+" "+DisplayStrings.get("UserCount"));delete this.cgm.users[K.nick.toLowerCase()];this.cgm.richInputElement.hin.removeWord(K.nick);delete this.userDetails[K.nick.toLowerCase()];delete this.ignoredUsers[K.nick];if(K.reason){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("*** "+K.nick+" "+DisplayStrings.get("KickText")+" "+K.kicker+" ("+K.reason+")",{},this.prefs.colorKick,null,false,this.cgm.renderer,B))}else{this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("*** "+K.nick+" "+DisplayStrings.get("KickText")+" "+K.kicker,{},this.prefs.colorKick,null,false,this.cgm.renderer,B))}}if(K.nick==this.cgm.nick){this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("!!! You have been kicked from "+K.localchannel,{},this.prefs.colorKick,null,false,this.cgm.renderer,B));this.cgm.clearUsers()}}else{if(K.cmd=="init"){this.cgm.nick=K.nick;if(!this.cgm.userList){this.cgm.users[K.nick.toLowerCase()]=K.nick;this.cgm.richInputElement.hin.addWord(K.nick)}}else{if(K.cmd=="changenick"){if(this.cgm.userList&&this.cgm.userList.getUser(K.nick)){var H=this.cgm.userList.getUser(K.nick);if(H.description==K.nick){H.setDesc(K.newnick)}this.cgm.userList.setUserNick(K.nick,K.newnick)}if(this.cgm.isIgnored(K.nick)){delete this.ignoredUsers[K.nick];this.ignoredUsers[K.newnick]=true}if(this.cgm.users[K.nick.toLowerCase()]){this.cgm.users[K.newnick.toLowerCase()]=K.newnick;this.cgm.richInputElement.hin.addWord(K.newnick);this.cgm.output(K.nick.toLowerCase(),this.cgm.wrapRenderer("*** "+K.nick+" "+DisplayStrings.get("NickText")+" "+K.newnick,{},this.prefs.colorChangeNick,null,false,this.cgm.renderer,B));if(K.nick.toLowerCase()!=K.newnick.toLowerCase()){delete this.cgm.users[K.nick.toLowerCase()];this.cgm.richInputElement.hin.removeWord(K.nick)}}if(this.userDetails[K.nick.toLowerCase()]){this.userDetails[K.newnick.toLowerCase()]=this.userDetails[K.nick.toLowerCase()];delete this.userDetails[K.nick.toLowerCase()]}if(K.nick==this.cgm.nick){this.cgm.nick=K.newnick}}else{if(K.cmd=="log"&&this.SHOWLOGMESSAGES){this.cgm.output("::log",this.cgm.wrapRenderer(K.message,{},this.prefs.colorSystem,K.nick,false,this.cgm.tinyRenderer,B));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb()}}else{if(K.cmd=="error"){this.cgm.output("::error",this.cgm.wrapRenderer(K.msg,{},this.prefs.colorSystem,"",false,this.cgm.tinyRenderer,B));if(this.cgm.cbacks.activitycb){this.cgm.cbacks.activitycb()}}else{if(K.cmd=="pastereply"){if(K.error){this.cgm.output("::paste",this.cgm.wrapRenderer(K.error,{},this.prefs.colorNotice,"PasteBin",false,this.cgm.renderer,B,true))}else{this.cgm.richInputElement.insertText(BASE_PROTOCOL+"//"+BASE_URL+K.url+" ")}}else{if(K.cmd=="minifyreply"){this.cgm.richInputElement.insertText("http://miburl.com/"+(ISWIDGET?"W":"M")+K.uniq+" ")}else{if(K.cmd=="upprogress"){if(this.cgm.uploader){this.cgm.uploader.showProgress(K.perc,K.done,K.outof)}}else{if(K.cmd=="upcompleted"){this.cgm.uploader.reset();this.cgm.richInputElement.hideMenu();this.cgm.richInputElement.insertText(UGCBASE_URL+"/up/"+K.uniq+" ")}else{if(K.cmd=="removechat"){if(this.prefs.allowChatRemoval){this.cgm.chatOutput.removeLines(K.chatid);this.cgm.goToBottom()}}else{if(K.cmd=="banlist"){var R=new Date();R.setTime(K.ctime*1000);var L=this.cgm.wrapRenderer(null,{},this.prefs.colorBan,null,false,this.cgm.renderer);L.render=BanListRenderer(K,this.prefs,this.cgm.cbacks.unbancb);this.cgm.output("banlist",L)}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}catch(Q){if(DEBUG){log.log("cmh.process",Q,DebugLevel.WARNING)}}};ChatMessageHandler.prototype.getIcon=function(B,A){var C={name:"user",title:""};if(B){if(A){if(A=="ipod"){C={name:"ipod",title:"iPod Mibbitian"}}else{if(A=="iphone"){C={name:"iphone",title:"iPhone Mibbitian"}}else{if(A=="wii"){C={name:"wii",title:"Wii Mibbitian"}}}}}else{C={name:"mibbituser",title:"Mibbitian"}}}return C};ChatMessageHandler.prototype.translateText=function(B,A){google.language.translate({text:B,type:"text"},this.translateFromLanguage,this.translateToLanguage,A)};var DisplayStrings={};DisplayStrings.get=function(A){if(!DisplayStrings[defaultPrefs.language]||!DisplayStrings[defaultPrefs.language][A]){return DisplayStrings["en"][A]}return DisplayStrings[defaultPrefs.language][A]};function UserList(D,C,A,B){this.guiElement=D;this.doc=D.ownerDocument;this.usercallback=C;this.prefs=A;this.guiElement.style.background=this.prefs.ulistPaneBackground;this.guiElement.style.border="1px solid "+this.prefs.ulistPaneBorder;this.guiElement.style.borderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.MozBorderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.WebkitBorderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.padding=this.prefs.ulistPaneRounding+"px";this.pendingOperations=[];this.activeIcon="icon";this.createGroups();this.clear();if(!B){this.timer=window.setInterval(function(E){return function(){for(var F in E.userList){if(E.userList.hasOwnProperty(F)){if(E.userList[F].refreshTime()){E.refreshUserGui(F)}}}}}(this),1000*10)}}UserList.prototype.destroy=function(){window.clearInterval(this.timer)};UserList.prototype.createGroups=function(){this.ugroups=[];for(var A=0;A<this.prefs.userListGroups.length;A++){var B=new UserListGroup(this.guiElement,this.prefs.userListGroups[A],this.prefs.userListSort,this.prefs);this.ugroups.push(B)}};UserList.prototype.clear=function(){this.closeUserMenu();for(var A in this.userList){if(this.userList.hasOwnProperty(A)){this.removeUserGui(this.userList[A])}}this.userList={};delete this.selectedUser};UserList.prototype.findGroup=function(A){for(var B=0;B<this.ugroups.length;B++){if(A.inGroup(this.ugroups[B].def)){return this.ugroups[B]}}return false};UserList.prototype.redraw=function(){this.closeUserMenu();for(var A in this.userList){if(this.userList.hasOwnProperty(A)){this.userList[A].redraw();this.removeUserGui(this.userList[A])}}while(this.guiElement.firstChild){this.guiElement.removeChild(this.guiElement.firstChild)}this.createGroups();for(var A in this.userList){if(this.userList.hasOwnProperty(A)){this.insertUserGui(this.userList[A])}}this.guiElement.style.background=this.prefs.ulistPaneBackground;this.guiElement.style.border="1px solid "+this.prefs.ulistPaneBorder;this.guiElement.style.borderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.MozBorderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.WebkitBorderRadius=this.prefs.ulistPaneRounding+"px";this.guiElement.style.padding=this.prefs.ulistPaneRounding+"px"};UserList.prototype.flushQueue=function(){while(this.pendingOperations.length>0){var A=this.pendingOperations.shift();if(A.type=="add"){this.insertUserGui(A.user)}else{if(A.type=="remove"){this.removeUserGui(A.user)}else{if(A.type=="refresh"){this.refreshUserGui(A.user)}}}}};UserList.prototype.queueJob=function(A,B){this.pendingOperations.push({type:A,user:B})};UserList.prototype.size=function(){var B=0;for(var A=0;A<this.ugroups.length;A++){B+=this.ugroups[A].num}return B};UserList.prototype.activeSize=function(){var B=0;for(var A in this.userList){if(this.userList.hasOwnProperty(A)&&this.userList[A].active){B++}}return B};UserList.prototype.getUser=function(A){return this.userList[A]};UserList.prototype.removeUserGui=function(A){if(this.selectedUser){this.queueJob("remove",A);return }A.group.removeUser(A)};UserList.prototype.refreshUserGui=function(A){if(this.selectedUser){this.queueJob("refresh",A);return }this.removeUserGui(this.userList[A]);this.insertUserGui(this.userList[A])};UserList.prototype.insertUserGui=function(A){if(this.selectedUser){this.queueJob("add",A);return }A.group=this.findGroup(A);A.group.addUser(A)};UserList.prototype.addUser=function(B){var D={};D.click=function(E){return function(F){E.showUserMenu(F);return false}}(this);D.mouseover=function(E){return function(F){if(!E.selectedUser||E.selectedUser!=F){F.mainElement.style.background=E.prefs.userListHover}}}(this);D.mouseout=function(E){return function(F){if(!E.selectedUser||E.selectedUser!=F){F.mainElement.style.background="transparent"}}}(this);D.cycleIcons=function(E){return function(){if(E.activeIcon=="icon"){E.activeIcon="flag"}else{if(E.activeIcon=="flag"){E.activeIcon="time"}else{if(E.activeIcon=="time"){E.activeIcon="icon"}}}var F={};F[E.activeIcon]=true;for(var G in E.userList){if(E.userList.hasOwnProperty(G)){E.userList[G].updateIcons(F)}}}}(this);var C=new UserListUser(B.id,B,this.doc,this.prefs,D);var A={};A[this.activeIcon]=true;C.updateIcons(A);if(typeof (this.userList[C.userid])!="undefined"){this.removeUser(C.userid)}this.insertUserGui(C);this.userList[C.userid]=C};UserList.prototype.removeUser=function(A){if(typeof (this.userList[A])=="undefined"){return false}if(this.selectedUser&&this.selectedUser==this.userList[A]){delete this.selectedUser}var B=this.userList[A];this.removeUserGui(this.userList[A]);delete this.userList[A];return true};UserList.prototype.setUserActive=function(A,B){if(typeof (this.userList[A])=="undefined"){return false}this.userList[A].setActive(B);this.refreshUserGui(A);return true};UserList.prototype.setUserActivity=function(A){if(typeof (this.userList[A])=="undefined"){return false}this.userList[A].setActivity();this.refreshUserGui(A);return true};UserList.prototype.setUserMode=function(B,A,C){if(typeof (this.userList[B])=="undefined"){return false}this.userList[B].setMode(A,C);this.refreshUserGui(B);return true};UserList.prototype.setUserNick=function(A,C){if(typeof (this.userList[A])=="undefined"){return false}var B=this.userList[A];B.setNickname(C);this.removeUser(A);B.userid=C;this.insertUserGui(B);this.userList[B.userid]=B;return true};UserList.prototype.setUserTyping=function(A,B){if(typeof (this.userList[A])=="undefined"){return false}this.userList[A].setTyping(B);return true};UserList.prototype.showUserMenu=function(B){if(this.selectedUser&&this.selectedUser==B){var E=(new Date()).getTime()-this.selectedMenuTime;if(E<this.prefs.doubleClickTime&&this.prefs.doubleClickToPM){this.usercallback(B.userid,"usermenu0")}this.closeUserMenu();this.usercallback(B.userid,"closed");return }this.selectedMenuTime=(new Date()).getTime();this.closeUserMenu();this.selectedUser=B;var A=this.doc.createElement("div");B.guiElement.onmouseout=function(H){return function(J){if(!J){J=event}var I=J.relatedTarget||J.toElement;while(I!=null&&I!=document.body){if(I==B.guiElement){return }I=I.parentNode}if(H.closetimer){window.clearTimeout(H.closetimer)}H.closetimer=window.setTimeout(function(){H.closeUserMenu()},H.prefs.userListMenuAutoCloseTime)}}(this);B.guiElement.onmouseover=function(H){return function(){if(H.closetimer){window.clearTimeout(H.closetimer);delete H.closetimer}}}(this);A.style.background=this.prefs.userListMenuBackground;A.style.borderBottom="1px solid #444";A.style.padding="2px";var D=this.usercallback(B.userid,"getoptions");for(var C=0;C<D.length;C++){var F=this.doc.createElement("div");F.onclick=function(I,H){return function(){if(I.usercallback){I.usercallback(B.userid,H)}I.closeUserMenu()}}(this,D[C].id);F.appendChild(this.doc.createTextNode(D[C].desc));var G=F.style;G.cursor="pointer";G.color=this.prefs.userListMenuColor;G.overflow="hidden";G.whiteSpace="nowrap";G.fontSize=this.prefs.userListMenuFontSize+"px";G.fontFamily=this.prefs.userListMenuFontFamily;G.textDecoration="none";G.paddingLeft="2px";G.paddingRight="2px";if(C!=(D.length-1)){G.borderBottom="1px solid #aaa"}if(this.prefs.userListMenuBackgroundHover){F.onmouseover=function(I,H){return function(){I.style.background=H}}(F,this.prefs.userListMenuBackgroundHover);F.onmouseout=function(I,H){return function(){I.style.background=H}}(F,this.prefs.userListMenuBackground)}A.appendChild(F)}B.guiElement.appendChild(A);window.setTimeout(function(H,I){return function(){var K=I.guiElement.offsetTop+I.guiElement.offsetHeight;var J=H.clientHeight;if(I.guiElement.offsetTop<H.scrollTop){H.scrollTop=I.guiElement.offsetTop}if(K>H.scrollTop+J){H.scrollTop=K-J}}}(this.guiElement,B),50);B.mainElement.style.background=this.prefs.userListSelected};UserList.prototype.closeUserMenu=function(){if(this.selectedUser){this.selectedUser.mainElement.style.background="transparent";this.selectedUser.guiElement.removeChild(this.selectedUser.guiElement.lastChild);this.selectedUser.guiElement.onmouseover=null;this.selectedUser.guiElement.onmouseout=null;if(this.closetimer){window.clearTimeout(this.closetimer);delete this.closetimer}delete this.selectedUser}this.flushQueue()};function UserListGroup(D,C,B,A){this.def=C.def;this.title=C.title;this.prefs=A;this.sorter=B;this.hideOnEmpty=C.hideOnEmpty;this.startHidden=C.startHidden;this.num=0;this.sortedUserList=[];this.showing=true;this.div=D.ownerDocument.createElement("div");this.alldiv=D.ownerDocument.createElement("div");if(this.title!=""){this.titdiv=D.ownerDocument.createElement("div");this.titdiv.style.fontFamily=this.prefs.userGroupFontFamily;this.titdiv.style.fontSize=this.prefs.userGroupFontSize+"px";this.titdiv.style.color=this.prefs.userGroupColor;this.titdiv.style.background=this.prefs.userGroupBackground;this.titdiv.style.textAlign="center";this.titdiv.style.cursor="pointer";this.titdiv.onclick=function(E){return function(){E.showing=!E.showing;E.div.style.display=E.showing?"block":"none";E.updateTitle()}}(this);this.tittxt=D.ownerDocument.createTextNode(this.title);this.titdiv.appendChild(this.tittxt);this.alldiv.appendChild(this.titdiv)}this.alldiv.appendChild(this.div);this.update();if(this.startHidden){this.showing=false;this.div.style.display="none"}D.appendChild(this.alldiv)}UserListGroup.prototype.updateTitle=function(){if(this.tittxt){this.tittxt.nodeValue=this.showing?this.title:(this.title+" ("+this.num+")")}};UserListGroup.prototype.update=function(){this.updateTitle();this.alldiv.style.display=(this.num==0&&this.hideOnEmpty)?"none":"block"};UserListGroup.prototype.removeUser=function(A){this.div.removeChild(A.guiElement);for(var B=0;B<this.sortedUserList.length;B++){if(this.sortedUserList[B]==A){this.num--;this.sortedUserList.splice(B,1);break}}this.update()};UserListGroup.prototype.addUser=function(A){var B=UserListUser.findPosition(this.sortedUserList,this.sorter,A,0,this.sortedUserList.length);this.num++;if(B==this.sortedUserList.length){this.div.appendChild(A.guiElement);this.sortedUserList.push(A)}else{this.div.insertBefore(A.guiElement,this.sortedUserList[B].guiElement);this.sortedUserList.splice(B,0,A)}this.update()};function UserListUser(D,C,E,A,B){this.prefs=A;this.callbacks=B;this.doc=E;this.userid=D;this.nick=C.nick;this.icon=C.icon;this.description=C.desc;this.countrycode=C.countrycode;if(typeof C.localtime!="undefined"){this.localtime=parseInt(C.localtime)-(new Date()).getTime()}this.timezone=C.timezone;this.showingIcons={icon:true,country:false,time:false};this.typing=false;this.active=C.modes.active;this.idletime=-1;if(C.idleTime!=-1){this.idletime=Math.floor((new Date()).getTime()/1000)-C.idleTime}this.recalcChatting();this.mode={owner:C.modes.owner,admin:C.modes.admin,op:C.modes.op,halfop:C.modes.halfop,voice:C.modes.voice};this.modeIcons={};this.guiElement=this.doc.createElement("div");this.mainElement=this.doc.createElement("div");this.guiElement.appendChild(this.mainElement);this.redraw()}UserListUser.prototype.recalcChatting=function(){if(this.idletime==-1){this.chatting=false}else{this.chatting=(((new Date()).getTime()/1000)-this.idletime<this.prefs.userListChattingTime)}};UserListUser.prototype.updateIcons=function(A){this.showingIcons=A;if(this.guiUserTime){this.guiUserTime.style.display=this.showingIcons.time?"inline":"none"}if(this.guiUserFlag){this.guiUserFlag.style.display=this.showingIcons.flag?"inline":"none"}if(this.guiUserIcon){this.guiUserIcon.style.display=this.showingIcons.icon?"inline":"none"}};UserListUser.prototype.redraw=function(){while(this.mainElement.firstChild){this.mainElement.removeChild(this.mainElement.firstChild)}this.mainElement.onmouseover=function(C){return function(){C.callbacks.mouseover(C)}}(this);this.mainElement.onmouseout=function(C){return function(){C.callbacks.mouseout(C)}}(this);delete this.guiUserTime;delete this.guiUserFlag;delete this.guiUserIcon;delete this.prefixCharSpan;delete this.modeIcon;this.guiUserTime=this.doc.createElement("img");this.guiUserTime.style.marginRight="2px";this.guiUserTime.style.verticalAlign=this.prefs.userListIconAlign;this.guiUserTime.style.display=this.showingIcons.time?"inline":"none";this.guiUserTime.onclick=function(C){return function(){C.callbacks.cycleIcons()}}(this);this.updateLocalTime();this.guiUserFlag=this.doc.createElement("img");this.guiUserFlag.style.marginRight="2px";this.guiUserFlag.style.verticalAlign=this.prefs.userListIconAlign;this.guiUserFlag.style.display=this.showingIcons.flag?"inline":"none";this.guiUserFlag.onclick=function(C){return function(){C.callbacks.cycleIcons()}}(this);if(this.countrycode){this.guiUserFlag.title=this.countrycode}setPngSrc(this.guiUserFlag,"/flags/"+(this.countrycode?this.countrycode.toLowerCase():"--")+".png",this.prefs.userListIconWidth,this.prefs.userListIconHeight);if(this.icon&&this.prefs.userListShowIcons){this.guiUserIcon=this.doc.createElement("img");this.guiUserIcon.style.marginRight="2px";this.guiUserIcon.style.display=this.showingIcons.icon?"inline":"none";this.guiUserIcon.onclick=function(C){return function(){C.callbacks.cycleIcons()}}(this);this.setIcon(this.icon)}else{delete this.guiUserIcon}this.mainElement.onclick=function(C){return function(E){if(!E){E=window.event}var D=E.target?E.target:E.srcElement;if(D==C.guiUserTime||D==C.guiUserFlag||D==C.guiUserIcon){return }C.callbacks.click(C)}}(this);this.guiNickspan=this.doc.createElement("span");var B=this.guiNickspan.style;B.fontFamily=this.prefs.userListFontFamily;B.fontSize=this.prefs.userListFontSize+"px";B.color=this.prefs.userListColorNormal;B.cursor="pointer";B.whiteSpace="nowrap";this.guiNickspan.appendChild(this.doc.createTextNode(this.nick));if(this.prefs.userListShowPrefixChars){this.prefixCharSpan=this.doc.createElement("span");this.prefixCharSpan.style.fontFamily=this.prefs.userListFontFamily;this.prefixCharSpan.style.fontSize=this.prefs.userListFontSize+"px";this.prefixCharSpan.style.color=this.prefs.userListColorNormal;this.prefixCharSpan.style.fontWeight="bold";this.prefixCharSpan.style.cursor="pointer"}else{if(this.prefs.userListShowSingleMode){this.modeIcon=this.doc.createElement("img");this.modeIcon.style.verticalAlign=this.prefs.userListModeIconAlign;setPngSrc(this.modeIcon,"/icons/mode_none.png",this.prefs.userListModeIconWidth,this.prefs.userListModeIconHeight)}}if(this.guiUserIcon){this.mainElement.appendChild(this.guiUserIcon)}if(this.guiUserFlag){this.mainElement.appendChild(this.guiUserFlag)}if(this.guiUserTime){this.mainElement.appendChild(this.guiUserTime)}if(this.prefixCharSpan){this.mainElement.appendChild(this.prefixCharSpan)}if(this.modeIcon&&this.prefs.userListShowModesLeft){this.mainElement.appendChild(this.modeIcon);this.modeIcon.style.paddingRight=this.prefs.userListModeSpacing+"px"}this.mainElement.appendChild(this.guiNickspan);if(this.modeIcon&&!this.prefs.userListShowModesLeft){this.mainElement.appendChild(this.modeIcon);this.modeIcon.style.paddingLeft=this.prefs.userListModeSpacing+"px"}this.mainElement.style.whiteSpace="nowrap";this.mainElement.style.padding=this.prefs.userListPadding+"px";this.setDesc(this.description);this.modeIcons={};for(var A=0;A<UserListUser.modeOrder.length;A++){this.setMode(UserListUser.modeOrder[A],this.mode[UserListUser.modeOrder[A]])}this.guiElement.style.overflow="hidden";this.render()};UserListUser.modeOrder=["owner","admin","op","halfop","voice"];UserListUser.compare=function(D,B,G){var A=G;var F=A.split(",");for(var E=0;E<F.length;E++){var C=F[E];if(C=="chatting"||C=="active"){if(D[C]!=B[C]){return(D[C]&&!B[C])?-1:1}}else{if(C=="owner"||C=="admin"||C=="op"||C=="halfop"||C=="voice"){if(D.mode[C]!=B.mode[C]){return(D.mode[C]&&!B.mode[C])?-1:1}}}}if(D.nick.toLowerCase()>B.nick.toLowerCase()){return 1}if(D.nick.toLowerCase()<B.nick.toLowerCase()){return -1}return 0};UserListUser.findPosition=function(B,H,D,E,F){var C=(F-E);if(C==0){return F}if(C==1){if(UserListUser.compare(D,B[E],H)>0){return F}return E}if(C==2){if(UserListUser.compare(D,B[E],H)>0){if(UserListUser.compare(D,B[F-1],H)>0){return F}else{return F-1}}else{return E}}var A=Math.floor((E+F)/2);var G=UserListUser.compare(D,B[A],H);if(G<0){return UserListUser.findPosition(B,H,D,E,A)}else{if(G==0){return A}else{if(G>0){return UserListUser.findPosition(B,H,D,A,F)}}}};UserListUser.prototype.inGroup=function(C){var E=C.split(",");for(var B=0;B<E.length;B++){var A=E[B];var D=true;if(A.substring(0,1)=="!"){A=A.substring(1,A.length);D=false}if(A=="chatting"||A=="active"){if(this[A]!=D){return false}}else{if(A=="owner"||A=="admin"||A=="op"||A=="halfop"||A=="voice"){if(this.mode[A]!=D){return false}}}}return true};UserListUser.prototype.refreshTime=function(){this.updateLocalTime();var B=this.guiNickspan.style;var A=this.chatting;this.recalcChatting();if(this.prefs.userListBoldOnChat){B.fontWeight=this.chatting?"bold":"normal"}this.setDesc(this.description);return(A!=this.chatting)};UserListUser.prototype.updateLocalTime=function(){if(!this.guiUserTime){return }if((typeof this.localtime)=="undefined"||(typeof this.timezone)=="undefined"){this.guiUserTime.title="";setPngSrc(this.guiUserTime,"/icons/mode_none.png",16,16);return }function F(I){return("00"+I).substr(-2)}var E=new Date(this.localtime+(new Date()).getTime());var H=E.getUTCHours()+":"+F(E.getUTCMinutes())+":"+F(E.getUTCSeconds());var D="+";var G=this.timezone;if(G<0){D="-";G=-G}var C=Math.floor(G/60);var A=G-(60*C);this.guiUserTime.title=H+" UTC"+D+F(C)+F(A);var B=E.getUTCHours();if(B>22||B<8){setPngSrc(this.guiUserTime,"/icons/night.png",this.prefs.userListIconWidth,this.prefs.userListIconHeight)}else{if(B>=8&&B<12){setPngSrc(this.guiUserTime,"/icons/morning.png",this.prefs.userListIconWidth,this.prefs.userListIconHeight)}else{if(B>=12&&B<18){setPngSrc(this.guiUserTime,"/icons/day.png",this.prefs.userListIconWidth,this.prefs.userListIconHeight)}else{if(B>=18&&B<=22){setPngSrc(this.guiUserTime,"/icons/evening.png",this.prefs.userListIconWidth,this.prefs.userListIconHeight)}}}}};UserListUser.prototype.render=function(){var A=this.guiNickspan.style;if(this.prefs.userListBoldOnChat){A.fontWeight=this.chatting?"bold":"normal"}if(!this.active){A.color=this.prefs.userListColorInactive;return }A.color=this.typing?this.prefs.userListColorTyping:this.prefs.userListColorNormal};UserListUser.prototype.setNickname=function(A){this.nick=A;this.guiNickspan.firstChild.nodeValue=A};UserListUser.prototype.setIcon=function(B){this.icon=B;if(this.guiUserIcon){this.guiUserIcon.style.verticalAlign=this.prefs.userListIconAlign;if(SUPPORTS_DATA_URLS&&this.icon.data){setPngSrc(this.guiUserIcon,this.icon.data,this.prefs.userListIconWidth,this.prefs.userListIconHeight)}else{if(this.icon.name){var A=this.prefs["ulicon_"+this.icon.name];if(SUPPORTS_DATA_URLS&&UserListUser.defaultIcons[A]){A=UserListUser.defaultIcons[A]}setPngSrc(this.guiUserIcon,A,this.prefs.userListIconWidth,this.prefs.userListIconHeight)}else{setPngSrc(this.guiUserIcon,this.icon.src,this.prefs.userListIconWidth,this.prefs.userListIconHeight)}}if(this.icon.title){this.guiUserIcon.title=this.icon.title}}};UserListUser.defaultIcons=[];UserListUser.defaultIcons["/icons/user.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ3SURBVDjLpZNtSNNRFIcNKunF1rZWBMJqKaSiX9RP1dClsjldA42slW0q5oxZiuHrlqllLayoaJa2jbm1Lc3QUZpKFmmaTMsaRp%2BkMgjBheSmTL2%2F%2FkqMBJlFHx44XM7vOfdyuH4A%2FP6HFQ9zo7cpa%2FmM6RvCrVDzaVDy6C5JJKv6rwSnIhlFd0R0Up%2FGwF2KWyl01CTSkM%2FdQoQRzAurCjRCGnRUUE2FaoSL0HExiYVzsQwcj6RNrSqo4W5Gh6Yc4%2B1qDDTkIy%2BGhYK4nTgdz0H2PrrHUJzs71NQn86enPn%2BCVN9GnzruoYR63mMPbkC59gQzDl7pt7rc9f7FNyUhPY6Bx9gwt4E9zszhWWpdg6ZcS8j3O7zCTuEpnXB%2B3MNZkUUZu0NmHE8XsL91oSWwiiEc3MeseLrN6woYCWa%2FZl8ozyQ3w3Hl2lYy0SwlCUvsVi%2FGv2JwITnYPDun2Hy6jYuEzAF1jUBCVYpO6kXo%2BNuGMeBAgcgfwNkvgBOPgUqXgKvP7rBFvRhE1crp8Vq1noFYSlacVyqGk0D86gbART9BDk9BFnPCNJbCY5aCFL1Cyhtp0RWAp74MsKSrkq9guHyvfMTtmLc1togpZoyqYmyNoITzVTYRJCiXYBIQ3CwFqi83o3JDhX6C0M8XsGIMoQ4OyuRlq1DdZcLkmbgGDX1iIEKNxAcbgTEOqC4ZRaJ6Ub86K7CYFEo8Qo%2BGBQlQyXBczLZpbloaQ9k1NUz%2FkD2myBBKxRZpa5hVcQslalatoUxizxAVVrN3CW21bFj9F858Q9dnIRmDyeuybM71uxmH9BNBB1q6zybV7H9s1Ue4PM3%2Fgu%2FAEbfqfWy2twsAAAAAElFTkSuQmCC";UserListUser.defaultIcons["/icons/user_green.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJkSURBVDjLpZNbSJNhHIeli4jAKOhun9KNbUpaURFRREkFVjpNRcssXOKYZ9J0ihnN05zSUpflzMOnW5tuammajUkWpCbbrOxwEzZJw7Rt2pxJh%2F16%2FYSBILPo4uE98P8974nXA4DH%2F7Dq5GQn%2B5NdxcK8lsK8msIczcKYlv35rwST3ZwxRw8Ljh5qmU4i0VCYbfWC%2BT5nfE2BQ%2BfFBOdbqeUdEOyEWZrCRBWFNQX2ehZMGh4mHkkwM3AYlgYKVoUXZpTe%2BCKnoJcd2uJW0Jbi%2Fc32vg%2BWF82Yel4Hm%2BkYbMYYzH1Qoy9v28LrxsT1bgU34nYMWYfvYdqgwcJLFUHN9K1GFWp4%2Fga3R0hX0huDLp8ercnci0XDXXx%2F08GwMKIEnbsPJxJPjsbfrt28qiBNSW%2BKrcpRhhSxMeTogrQ0CI3XTjEs9XVTLQgu3I6z5RntqbR86wpBqkKxTmvukMTK9mPgdwN6bRVoeCdEtTEN0gEBxE94uDOSgcezMoSJdyGiRNic3Fi7wSVIrissTmo6jhaziGEpeHNQgLJn8SjSX0B%2BdxSy20NRMZQEST8fCXIu4iuzql0CUx7n13SXENd7z6G0n8dQ3HeRGed1RSKrjYt0VRD49UeRqQmGpTcfg5m%2BP1yCV1d9nVadiBQcwS1DKgnGkFWjkfsgHFe0XNJGEEkYJE%2F5OF95EDZ9AYaz%2FZwuwWhTSo4xx%2Bcnvy4Q0dLdpPDSqoRL%2FBEu3glTfsAiyRSseIWPaoEnrZf6RJUnvI0sC3SeKd1DLiwAoSX%2BCCkKIBxwhoi4X2selvuNtwg83f7Gf%2BEP0qq8jpoy%2F%2FYAAAAASUVORK5CYII%3D";UserListUser.defaultIcons["/icons/user_gray.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AMLFgk308wItwAAAlxJREFUOMulkk1LG1EUht97ZzqZzEfMBEMmDJGsIuYPdBdX6sK1f6CpIGUsRWgXVUwRrN20G1234C9wmYUrcaEgyjhuugkBNeAHdTQRep17b7pKqNIqtAfO5nDOw3nfc0i328X%2FhPqnYq1W%2BxxF0RwACCHAOYfjOF9XVlaqD3vpw8LS0tIHxthcPp%2BHruvwPA%2BqquLq6urF4uLilycBjLGaaZo4PT2FpmlotVrIZDJQFAXNZvPNk4CLiwvc3NygXC7DNE3c3t6Ccw7GGCilZHV11XzUA9u2f05NTenpdBqcc5ycnMCyLADAxsbG3fDwcPwoIJPJBI7jPAcAwzBQKpUQxzEIIRgcHAzHx8fv%2FiphZmZGbzQax%2FV6HZTSfqqqis3NTRwdHTWnp6eN32dI7w98308RQt4SQhZGR0dxcHCAYrEIAAjDEJVKBdvb25BSLgshPq2trXX6G8zOztJSqTRPKV1QFAXdbhdCCBSLRXieB03TcH19jXQ6DSnle8657%2Fv%2Bsz6AUvoqiqJ3ExMTIIRgZ2cHlFIYhoFcLgdFUXB4eAjGGMrlMsnlch%2BllK%2F7EtbX1%2FnIyIiyu7sLXdcRxzFarRaiKAKlFIlEApZlgXMOy7IwNjaG%2Ff19Vq1W9d4GVFVVnJ%2BfI5lMQgiBbDaLQqEASilc10UymcTQ0BAuLy975mp9Ca7rzgdBwAFgb28Puq7DMAwMDAxAVVWkUik4joMgCNButxGGISsUCsv3rrC1tWXX63X37Ozsm23bnhAiL6VMAICUEpTSH51O57vrui8nJyePK5VK%2Bx7gX%2BMXoSjuu9RmlbQAAAAASUVORK5CYII%3D";UserListUser.defaultIcons["/icons/user_ipod.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFhSURBVDjLjVJRSsNAEJ3WpkKgIA2hVIL%2FfngJv%2F3rNbyD4BU8QD57AOkBjOQCPUHIX2m1YAtCku64b5NZtnSrThhmNzvz5s1jesxMsDzPX5RSj7jrSBIPh4ONzvlpNps9m0IkwrMsW%2B73e%2F7L1us1z%2Bfzd6kbUGdAhr0uv0hpUowPUTteWP9EvL9happGyo4BaoUyouurARDMmZ1YfFama13XpwCYD5mK2RZR192AGU1a2l4GLQAfdbSRW2aqO59lcNHXUSeVH1U7N7dFwkoAqqryA0CHh9tL20GUJuqZ%2B3A4pO322z%2BCW4QOq9WKNpuNuUdRRHEcUxAErdjnRpClQnFZlpbBbrcz76PR6ESDvo%2BBdE6SxDjOeoHsu3cE%2FBQGoCnu6uOO6NVAAMbjMem1pqIo7BjQ4VcGLsBkMjFdXRGn0%2Bn%2FAMIwNA4QnyHHLJ1Hg7c0Te%2BALo5Eia5rPRZS9wNIBbXTpSVpqgAAAABJRU5ErkJggg%3D%3D";UserListUser.defaultIcons["/icons/user_iphone.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF6SURBVDjLjZO%2FS8NAFMe%2Fl8Q0ASUUXRwK9R9wFDfdunV19Q9wcmg3%2FwHp4FLo4CA4Ce3o6OLWUZwKpbRLMdDFCKH5dd73SkvQkvTgeLnLe5%2F3vXfvhJQSu4xutyuDIEC73Rb5fQM7jizLMBwO%2F%2B1b%2BUWv1%2BsoRZdCiGO1PFJzT33r4Hq9DsuyigFRFN02Gg1UKpWNc5qmehJimmYxgE6e5%2BGsX4VrZQgzHlfiwI7xdP5VroAOzCZMidaFgGVIENH5sPAdZeUAwzAQxzGECrSpVt0Qq0ygErKbAh5DqOC7dxWj0gtKEGSl5QAWiYCX009t18Wj9UxvK8DYBugHz3hN%2BhiNRnp9%2BPAINlzpLawBTedqlflkpcC%2FuUYVKFewrsF4PNZ2MpnozLPZbJOg9AgMYNdx0BJUq9U2CQoBvEYGzOdz2LYN3%2FfhOA4Wi4UG839hDVTf%2F4RhuJ9XwLdAy%2F5Qr1EWAqbT6f1gMGgul0sdmAMjSRK4rvv2F%2FALQmi5wbpDa1QAAAAASUVORK5CYII%3D";UserListUser.defaultIcons["/icons/user_wii.png"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHBSURBVDjLlVM9aMJQEP6eNEF0sbiUouLgoLRkKXS1IG4dC6Xg2LXQRXATHbqVzq4iQjc3sVscnUSnYIdIB9GC4L%2FxL333IEFsBj04jpf77nt3l%2B8x0zRxaMViMbTdbtXVahVer9dYLBY%2F0%2Bk0mcvltEPsGRzMMIyPQCAQ9ng8IAJd14OdTuedp%2B4PsS4ngslkctFoNNBsNgWB2%2B3GaDQKOWEdCTgY2WyW9Xo9QbBcLoUfTSDLsoiMMUFgkRxNwHeAdDpt%2Bnw%2B8EUKp29O5rhEvnEoigJJktBqteD3%2B0%2FrgINNulHTNCjzGR5%2B%2B1Bvb67x%2BvLF%2Fdmxg3K5HOZB2%2B12MncxfzAYxJ25wcXjE5ixZCu9m%2FwufybfUqnLUqmUtwmomAtKi0ajcrVaxWAwQKFQEHOfK1dQajUwrwdSrw8ZEiKRSC4ej0NV1TwjJXI2IxaLyZwA4%2FFYFHL12T6fz%2B3o9XrhcrmQyWTQbreZ6IAnZS5dVCoVEpFYmFVEPpvNxJm%2B0zmRSIhoj0AJunU4HNogq3C%2FEwtHuqBfaxNQkhJ8NpGwAPtxs9n8c5ug2%2B2iXq%2Fbojl0S41URKPuv2Dm9JxPsT8W0mO2IJm2EgAAAABJRU5ErkJggg%3D%3D";UserListUser.prototype.setDesc=function(C){this.description=C;var A=C;if(this.idletime!=-1){var B=Math.floor((new Date()).getTime()/1000)-this.idletime;if(B<60){A="("+B+"s) "+C}else{if(B<3600){A="("+Math.floor(B/60)+"m) "+C}else{A="("+Math.floor(B/3600)+"h) "+C}}}this.mainElement.setAttribute("title",A)};UserListUser.prototype.setTyping=function(A){this.typing=A;this.render()};UserListUser.prototype.setActive=function(A){this.active=A;this.render()};UserListUser.prototype.setActivity=function(){this.chatting=true;this.idletime=Math.floor((new Date()).getTime()/1000);if(this.prefs.userListBoldOnChat){this.guiNickspan.style.fontWeight="bold"}this.setDesc(this.description)};UserListUser.prototype.getDesc=function(A){if(A=="owner"){return DisplayStrings.get("ModeOwner")}else{if(A=="admin"){return DisplayStrings.get("ModeAdmin")}else{if(A=="op"){return DisplayStrings.get("ModeOp")}else{if(A=="halfop"){return DisplayStrings.get("ModeHalfop")}else{if(A=="voice"){return DisplayStrings.get("ModeVoice")}}}}}return""};UserListUser.prototype.getIconURL=function(A,C){var B="/icons/mode_none.png";if(A=="owner"){B=this.prefs.iconModeOwner;if(!C&&SUPPORTS_DATA_URLS&&B=="/icons/mode_owner.png"){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAK4SURBVDjLjZPrT1JhHMfPq%2FNH%2BK6ty2bhJcswzUa2hTMaEmCsZmWuUU0HQuAVEWHMgCnLy2yOhiOKIs0L08ByXgab1TTRNlO7ULwylTOZ9iL9djiVrdLmi%2B%2BbZ7%2FP5znP93kOAYDYKt1F%2B0k6cR4ZK86jSCS3m9sW7pGxwh5FwlqfOmnNW34w7NUcInck6Ck%2BQNJgZNjExYTzOl67iuG%2FnQuf7kjEp2eT%2FxV45AlknyopMmLJweRDGR05Jt1KBDvLMdoiRp8uLeKpTiO3FHiUiWR%2FWTI12sBD8JEC%2FkYBvLXpeGrIwHCTGOPuKgxYRXCXsan7ilTyD0G%2FOpn0lqdQfisfwccq%2BJuEGKjjYHpqkklvLQc%2BiwiBe2p06%2FmwSVOo5kvJjISgCyLpgij%2FbQGCHWX0p4rgNZ7AyxdjWFxcxPLyMuZmZ%2BBUHUOHlodnd26g%2FeYpmIQsSn86niR81akBf9PZn%2BfMo%2BEsTIy%2FwtLSEgP%2FyuzbGbQUsnFXdhJd5gtoLMxAOWdvgKCb5Xr1aevDzXno0WZufHg3t7nz3%2Fn08T1qclhouHgUZZl71ulwfxRYncZ9omGPWOstG6urq8ywUqmESqWCWq1GaWkpsxaNRmEx3YKaEz8Vg%2F%2B5RpPJtEJRFDMcA1tbW9HW1obKyspNQUwqkUj2bfkODAbDSiQSYYYrKipgs9lgt9tRU1OzKZDL5RAKhb8FRc8vJxR0nTsvtvMGxBb%2BN8dQO2ISjUYDh8MBp9MJWsysPXhjR0GnBGIbbzrbytGmaw%2FzCRr%2BLOu9iqrBEhT1FqDAmo9wOAydTgeXywW32426ujqEQiFoBlSoH9NDO6REvkOERFl8lKB3HqRtIdoWOC5Lp3jXchakUum80WhkQLoXmM1mCASC%2BdySMwvZtVlf0zWpYzT8ZfeVXYPEdr%2FpTvMdjX2sh%2B52%2FVQAAAAASUVORK5CYII%3D"}}else{if(A=="admin"){B=this.prefs.iconModeAdmin;if(!C&&SUPPORTS_DATA_URLS&&B=="/icons/mode_admin.png"){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH2SURBVDjLjZNLTxNRGIaJv6ZNWeBwkZFLQtGAC4l%2FwKULV%2B7YILeSYukEUhJoSASVuCI0hpAYDSUQCJBSoAaC0wbBUi4aWphpO52Zlpa%2BnnOqCAptJ3k3M3me73LOlAAoyZfDqQdOEvyO89%2FvRcGZ5HeWmySFYdWHVOQN0vE58jrLJMFJ82hewVU4%2BbMfqdPxP9VBn%2BA4D88wP59PwFqmsH7UgeTJEMlsTuIyI5uRsDfCMcmtAtoyhVmOu5kkHZuFsiNA3XuEi%2BQCdhxluL0D%2FSvpoO%2BvhIksiItNiPqqyXgfIL403gjfoTsIL70gQBdim3VQvz2FFnwOxf8E8kYF0rIVYqcRM70Vgf%2FPe%2FohwsutOJdcpBpP4Mek%2BjPEfbWQVzkG%2B7tNcNsqt68tkcLZTIzM6YZ21IbolgHq9j1o%2Bz04nKhHRnlH2p6A32LCvFD55fIYr960VHgSSqCFVDJBEeugh%2Bzw2jnpc0%2F5rthuRMBaioWBqrVrFylXOUpankIi0AjJY0DC3wD9oA9rAnc2bat%2Bn%2B%2B2UkH8XHaTZfGQlg3QdlsIbIVX4KSPAv%2B60L%2BSO%2FPECmJiI1lYM9SQBR7b3einfn6kEMwEIZd5Q48sQQt1Qv%2FxFqt2Tp5x3B8sBmYC71h926az6njdUR6hMy8O17wqFqb5Bd2o%2F0SFzIZrAAAAAElFTkSuQmCC"}}else{if(A=="op"){B=this.prefs.iconModeOp;if(!C&&SUPPORTS_DATA_URLS&&B=="/icons/mode_op.png"){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIwSURBVDjLlZLNS5RRFMafe9%2F3vjPOjI1jaKKEVH40tGgRBWEibfoPQoKkVdtoEQQF4T%2FQqkVtWrSTFrVsF1FgJbWpIAh1k2PNh%2BPrfL4f95zTQk0HHKkDD%2Fcc7vP8uHCuEhF0q%2FKnmXNgGR248PZFN4%2FGISXMC8L89DBPV0Dp4%2FSsazJjrtfb9%2Fvdxfn%2FBgjzY5M8Aq8nBya%2BV3h93vtnQHFxat4kszntJAAAxus1YvnZQV5V%2FjyTEZarwnwFLGeFZdT0ZFOJdD84qoCDOpQ7grZfRNj020JSEOKvwvxGiF%2Bq0tL0N5PuO%2BMk0nC0B0BDsYCCImyzAIktBBloMwKJLSgKYcMAcdhC2KpVlIig%2BH5qxcv0n0xmj4Gbq%2BBwC2wtJLbgHUlMEFJwUpMIGpto16u%2BkJzSACAk%2BWCzvNbe%2BAVljkOYIcQQou3TbvdOJo%2Bg4aNdqzaF%2BPT43HJVA8DQpcVIiPPtaqlEUQzlDELsTpgYwgTAQIjQqlUCtpQfn1spdmxh%2BPJSQyw9CrbKgM7tvcISQAxlBhC3GuCYXk3cWP25m3M7dk88qbWBRDVApaATOSjPBdXXwYEP5QyCgvjE%2FkwHgInHtHYBnYA2owhrPiiuw0sOw3EZFEagIB7qChDiYaUcNIoFtP1KxCTPhWiDw7WbXk9vKpnOgsI4exjg6Mbq96YQPxm79uPOvqvbXx4O3KrF6w8osv2df17kr5YXJq7vnw%2FS0v3k7Ie7xtud%2FwAaRnP%2BCw8iKQAAAABJRU5ErkJggg%3D%3D"}}else{if(A=="halfop"){B=this.prefs.iconModeHalfop;if(!C&&SUPPORTS_DATA_URLS&&B=="/icons/mode_halfop.png"){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AEcFw4LBS60hgAAAgdJREFUOMuVk01L1FEUh5%2F7f5txRp3G0EIJIUyRFi2iRZhFm75BRJD0JYIWbfoCrVrUR5A%2BRJvA1GjTJgh1pdaMb%2BPMOPN%2FO%2Be00MyJHOrC5d7L%2Fd2HA889mBnnzfqnuzfrK%2FP0y3j0Gaa6aKr9IucD6ivzj4JwcCqIhvjx4fb%2FA0z1TVgcJhqooqJsvb8V%2FTOgtjT3MixWqp5fACCMhrBc079l3c7ne4Om9tBUH6B2w9Qmw4FKqVAeQdNdNG45F0zQbdRIjhqYGCaKqWKiBCa6HJYvXPcLZXwvAjycGhLXkM42luVYklEoTRCFw0iakCcxWdIhSZs4M6P2cW49Ghy5WqxcQo820OQQzXMsy9Esd5rlWCaYOPzSDHH7gG5rH5MTjSY2Gx%2FsbHb3vuPCK6flmcjxmh%2Fv%2FcFZ4naDbnMfE%2BXawtox4PKdpdREZ7v79bqkGc4fw%2FKTx6KYChBiInSau2guXFtY77Uwfn%2B1bbm8jg93wKv%2BriIXEMWFo2SdNpoJ0083Ti0EPe5FZzwvxNImuBJeoYqLAqS1jcYNnD%2BGxFmPxh6Aik55XgBeAS%2BcJGk2kKxFVBzHDxRJ0v4AEx13zqdd26Lb2E1V7J2JoMkm0cAQxXIFSfoDLu5tfD0y0bdTj789O3v35dUozWwbSfM%2F%2FvyZ1lxbnH7Sr3XNjNUXRZafh9Gv80%2BU7IiCRcqEfQAAAABJRU5ErkJggg%3D%3D"}}else{if(A=="voice"){B=this.prefs.iconModeVoice;if(!C&&SUPPORTS_DATA_URLS&&B=="/icons/mode_voice.png"){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEzSURBVDjLxdOxasJAHAZwwbfKkjlbJVMpJaYmxtSoNVoSsCLlekQSjcZNRUFFIUNxD5nqY7Rr%2BwiuX89M3a62lA4f3PL97n%2FHXQ5A7jfJ%2FRng%2B%2F1LSsn72UAQ%2BHlWJp5Hj4Q8gguE4VAIw0GWwSAQWPl1sZhjv39Gr%2FfAB4bDAJNJhCgaYTweYbNZIY5jrNcruM49HwiCPg6HF6RpiiRJsFwuQQhhYAS7WecD7KzY7bbwPA%2BUUnS7Xdi2zdZPqNVMPnC6qPl8Cl3XoSgKZFmGJEkwTYOlzAc6HRez2RSu66DRqKNQuIAoigy7hmGU%2BEC73USr1WDlajayZZkZoqoKm0rlA807S6jeVoRKRRPK5RtB14tvJ8hxbGhaEWc%2FJLZrXisVKcvxR8AX6Irl4%2F8%2B03fzCbreyRfHFw9qAAAAAElFTkSuQmCC"}}else{if(!C&&SUPPORTS_DATA_URLS){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AgIEC4bWjk0fAAAAhlJREFUOMuNk01IVFEYhp97517vzJ2RMfNvSMpaGBEEQRhJCaHGJIlESzctgqBNFIEuXLUICqRIcCG0SsQBhVy0ScpZNIXTTlsEFhiONJmOzYzOz73nzmkxNDWS07yr8y3e53zveTmKlJJKis31ls2tA%2FNls1qNORCcIBCc%2BCdQ%2Fa%2B59xFOOoy0VmkdeAXA6kx3ZcDfZpFaAMVF%2FM0DYnOXihEyWRbHOytvEAhOIFILSCeJdNI0nhsuwme7OTL4kkZXnsXxzv0B0lpFOsniWWwBn2i5OEzdqctkvw7Sdv0x9XYWbT%2BAojejuLxIZxekg7Q3ECKBFBHsnSRGyxZiM4%2Byt8bf%2BY2Gk9QePYC1%2BRrNbEPRfDi5b4hMDN%2Bxq6w8mSRmeP9sUKpHVTAOnqbuRAe5%2BCia2YDqcWNvLOPYGXzt1%2Fj8dIp1j4%2FeoWh5hENXZnF2o9jpMJnYCLrqR9E72IzME%2Bi7AaqHldH7xE2TnnvRYtS1Fz0lQFPnTazEc0TyC1ptPZq3n%2BXQNIm8wmErg%2Bp28d1j0nVnseTRijfPIFJhrI0x7J%2Fr1PgDuLxBPoamiRdq6B95XzIc3%2FPYGoBIfyC79hBnZxt3cztKzVmWQyF%2BYNA%2F9K7iX9GKlXlBNzGa%2FEj9DEtTM2zrbvruVjYDaAVRQGQL6N7zKHobS5NjpNwegrcjVCMl%2BqwLI5%2FDthykLcmaHi7ceku1%2BgVgItZywzDzOgAAAABJRU5ErkJggg%3D%3D"}}}}}}return B};UserListUser.prototype.setMode=function(F,I){this.mode[F]=I;if(this.prefs.userListShowPrefixChars){var H="";if(!this.prefs.userListShowSingleMode){for(var B=0;B<UserListUser.modeOrder.length;B++){var F=UserListUser.modeOrder[B];if(this.mode[F]){var I=this.getIconURL(F,true);if(I.length>0){H+=I.substring(0,1)}}}}else{for(var B=0;B<UserListUser.modeOrder.length;B++){var E=UserListUser.modeOrder[B];if(this.mode[E]){var I=this.getIconURL(E,true);if(I.length>0){H=I.substring(0,1)}break}}}if(this.prefixCharSpan.firstChild){this.prefixCharSpan.firstChild.nodeValue=H}else{this.prefixCharSpan.appendChild(this.doc.createTextNode(H))}}else{if(!this.prefs.userListShowSingleMode){if(I&&!this.modeIcons[F]){this.modeIcons[F]=this.doc.createElement("img");this.modeIcons[F].style.verticalAlign=this.prefs.userListModeIconAlign;var J=this.getIconURL(F);setPngSrc(this.modeIcons[F],J,this.prefs.userListModeIconWidth,this.prefs.userListModeIconHeight);this.modeIcons[F].title=this.getDesc(F);this.modeIcons[F].style.paddingLeft=this.prefs.userListModeSpacing+"px";var D=null;var G=false;for(var B=0;B<UserListUser.modeOrder.length;B++){if(G&&this.modeIcons[UserListUser.modeOrder[B]]){D=this.modeIcons[UserListUser.modeOrder[B]]}if(UserListUser.modeOrder[B]==F){G=true}}if(D!=null){this.mainElement.insertBefore(this.modeIcons[F],D)}else{this.mainElement.appendChild(this.modeIcons[F])}}if(!I&&this.modeIcons[F]){this.mainElement.removeChild(this.modeIcons[F]);delete this.modeIcons[F]}}else{var C="";var A="none";for(var B=0;B<UserListUser.modeOrder.length;B++){var E=UserListUser.modeOrder[B];if(this.mode[E]){if(A=="none"){A=E}if(C!=""){C+=", "}C+=this.getDesc(E)}}var J=this.getIconURL(A);setPngSrc(this.modeIcon,J,this.prefs.userListModeIconWidth,this.prefs.userListModeIconHeight);this.modeIcon.title=C}}};function RichInputElement(E,A,C,B,D){this.container=E;this.doc=E.ownerDocument;this.prefs=A;this.callbacks=B;this.hasOptions=D;this.menus=[];this.ieHeight=10;this.opHeight=10;this.container.style.border="1px solid "+this.prefs.chatInputBarBorder;this.container.style.background=this.prefs.chatInputBarBackground;this.ieWrapper=this.doc.createElement("div");this.ieWrapper.style.padding=this.prefs.chatInputPadding+"px";this.ieWrapper.style.margin=this.prefs.chatInputSpacing+"px";this.ieWrapper.style.overflow="hidden";this.inputElement=this.doc.createElement("input");this.inputElement.setAttribute("type","text");this.inputElement.style.width="100%";this.inputElement.style.padding="0";this.inputElement.style.border="0";this.inputElement.style.margin="0";this.ieWrapper.appendChild(C);C.appendChild(this.inputElement);E.appendChild(this.ieWrapper);this.hin=new HistoricalInput(C,this.inputElement,this.prefs.inputHistorySize,true);this.hin.typingcb=B.typingcb;this.activeMenu={content:this.ieWrapper,menu:null};this.redraw();this.layout()}RichInputElement.prototype.redraw=function(){try{this.ieWrapper.style.border="1px solid "+this.prefs.chatInputBorder;this.ieWrapper.style.background=this.prefs.chatInputBackground;this.ieWrapper.style.padding=this.prefs.chatInputPadding+"px";this.ieWrapper.style.margin=this.prefs.chatInputSpacing+"px";this.inputElement.style.background=this.prefs.chatInputBackground;this.inputElement.style.color=this.prefs.chatInputColor;this.inputElement.style.fontFamily=this.prefs.chatInputFontFamily;this.inputElement.style.fontSize=this.prefs.chatInputFontSize+"px";this.container.style.border="1px solid "+this.prefs.chatInputBarBorder;this.container.style.background=this.prefs.chatInputBarBackground;this.container.style.color=this.prefs.colorInText;this.container.style.borderRadius=this.prefs.chatInputRounding+"px";this.container.style.MozBorderRadius=this.prefs.chatInputRounding+"px";this.container.style.WebkitBorderRadius=this.prefs.chatInputRounding+"px";this.hideMenu();this.removeOptions();if(this.hasOptions){this.initOptions()}}catch(A){if(DEBUG){log.log("RichInputElement.redraw",A,DebugLevel.WARNING)}}};RichInputElement.prototype.layout=function(){try{if(this.activeMenu.content==this.ieWrapper&&this.inputElement.offsetHeight!=0&&this.inputElement.offsetHeight!=this.ieHeight){this.ieHeight=this.inputElement.offsetHeight;if(this.hasOptions){this.opHeight=this.menudiv.offsetHeight}return true}}catch(A){if(DEBUG){log.log("RichInputElement.layout",A,DebugLevel.WARNING)}}return false};RichInputElement.prototype.setMaxLength=function(A){try{this.inputElement.maxLength=A}catch(B){}};RichInputElement.prototype.initOptions=function(){this.activeMenu={content:this.ieWrapper,menu:null};this.activeMenuTab=null;this.menudiv=this.doc.createElement("div");this.menudiv.style.color=this.prefs.colorInMenuSep;this.menudiv.style.margin=this.prefs.chatInputSpacing+"px";this.menudiv.style.marginTop="auto";this.menudiv.style.paddingLeft="4px";this.menudiv.style.paddingTop="1px";this.menudiv.style.paddingBottom="1px";this.menudiv.style.fontFamily=this.prefs.chatInputMenuFontFamily;this.menudiv.style.fontSize=this.prefs.chatInputMenuFontSize+"px";if(this.prefs.ioSmilies){this.smilieWrapper=this.doc.createElement("div");this.smilieWrapper.style.display="none";this.smilieWrapper.style.overflow="hidden";var H={};for(var F=0;F<this.prefs.iconSmileys.length;F++){var J=this.prefs.iconSmileys[F];if(!H[J.src]&&J.src&&J.code){H[J.src]=true;var C=this.doc.createElement("img");C.style.width="19px";C.style.height="19px";C.style.marginRight="1px";C.style.verticalAlign="middle";var K=defaultPrefs.iconSmileysBase+J.src;C.src=K;C.onclick=function(M,L){return function(){try{M.insertText(L)}catch(N){if(DEBUG){log.log("smiley click",N,DebugLevel.WARNING)}}M.hideMenu()}}(this,J.code);this.smilieWrapper.appendChild(C)}}this.container.appendChild(this.smilieWrapper);this.addMenuItem("smilies",DisplayStrings.get("MenuSmilies"),this.smilieWrapper)}if(this.prefs.ioColors){this.colorWrapper=this.doc.createElement("div");this.colorWrapper.style.display="none";this.colorWrapper.style.overflow="hidden";for(var F=0;F<RichInputElement.colors.length;F++){var I=this.doc.createElement("div");I.style.width="19px";I.style.height="19px";I.style.marginRight="1px";I.style.cssFloat="left";I.style.styleFloat="left";I.style.background=RichInputElement.colors[F].color;I.onclick=function(M,L){return function(){M.setColor(L);M.hideMenu()}}(this,RichInputElement.colors[F]);this.colorWrapper.appendChild(I)}this.container.appendChild(this.colorWrapper);this.addMenuItem("colors",DisplayStrings.get("MenuColors"),this.colorWrapper)}if(this.prefs.ioTranslation&&this.callbacks.getLanguageMe){this.translateWrapper=this.doc.createElement("div");this.translateWrapper.style.display="none";this.translateWrapper.style.overflow="hidden";this.translateWrapper.style.fontSize="13px";var G=this.doc.createElement("form");G.style.display="inline";G.onsubmit=function(){return false};this.translateWrapper.appendChild(G);G.appendChild(this.doc.createTextNode(DisplayStrings.get("TranslateMe")));G.appendChild(this.getLanguageSelector(this.callbacks.setLanguageMe));G.appendChild(this.doc.createTextNode(DisplayStrings.get("TranslateThem")));G.appendChild(this.getLanguageSelector(this.callbacks.setLanguageThem));this.container.appendChild(this.translateWrapper);this.addMenuItem("translation",DisplayStrings.get("MenuTranslation"),this.translateWrapper)}if(this.prefs.ioPastebin&&this.callbacks.showPasteBin){this.pastebinWrapper=this.doc.createElement("div");this.pastebinWrapper.style.display="none";this.pastebinWrapper.style.overflow="hidden";this.pastebinWrapper.style.fontSize="13px";var D=this.doc.createElement("span");D.onclick=function(L){return function(){L.hideMenu();L.callbacks.sendPasteBinData();return false}}(this);cp({color:this.prefs.colorInLinks,fontSize:"11px",marginLeft:"4px",cursor:"pointer",textDecoration:"underline"},D.style);D.appendChild(this.doc.createTextNode("Paste"));this.pastebinWrapper.appendChild(this.doc.createTextNode("Paste text above, then click:"));this.pastebinWrapper.appendChild(D);this.pastebinWrapper.appendChild(this.doc.createTextNode(" | "));this.container.appendChild(this.pastebinWrapper);this.addMenuItem("pastebin",DisplayStrings.get("MenuPasteBin"),this.pastebinWrapper,this.callbacks.showPasteBin,this.callbacks.hidePasteBin)}if(this.prefs.ioUpload&&this.callbacks.showFileUpload){this.fileuploadWrapper=this.doc.createElement("div");this.fileuploadWrapper.style.display="none";this.fileuploadWrapper.style.overflow="hidden";this.fileuploadWrapper.style.fontSize="13px";this.fileuploadWrapper.appendChild(this.doc.createTextNode("Choose a file to upload "));this.container.appendChild(this.fileuploadWrapper);this.addMenuItem("fileupload",DisplayStrings.get("MenuUploadFile"),this.fileuploadWrapper,this.callbacks.showFileUpload,this.callbacks.hideFileUpload)}if(this.prefs.ioMinify&&this.callbacks.minify){this.minifyWrapper=this.doc.createElement("div");this.minifyWrapper.style.display="none";this.minifyWrapper.style.overflow="hidden";this.minifyWrapper.style.fontSize="13px";var G=this.doc.createElement("form");G.style.display="inline";var A=this.doc.createElement("input");A.type="text";A.size="20";A.style.fontSize="11px";A.style.border="0";A.style.background="white";G.appendChild(A);var B=this.doc.createElement("span");B.onclick=function(L){return function(){try{L.hideMenu();L.callbacks.minify(A.value)}catch(M){}return false}}(this);G.onsubmit=B.onclick;cp({color:this.prefs.colorInLinks,fontSize:"11px",marginLeft:"4px",cursor:"pointer",textDecoration:"underline"},B.style);B.appendChild(this.doc.createTextNode("Minify"));this.minifyWrapper.appendChild(this.doc.createTextNode("URL:"));this.minifyWrapper.appendChild(G);this.minifyWrapper.appendChild(B);this.minifyWrapper.appendChild(this.doc.createTextNode(" | "));this.container.appendChild(this.minifyWrapper);var E=function(){return function(){A.value="";A.focus()}}();this.addMenuItem("minify","Minify URL",this.minifyWrapper,function(){window.setTimeout(E,100)})}this.container.appendChild(this.menudiv)};RichInputElement.prototype.removeOptions=function(){if(this.smilieWrapper){this.container.removeChild(this.smilieWrapper);delete this.smilieWrapper}if(this.colorWrapper){this.container.removeChild(this.colorWrapper);delete this.colorWrapper}if(this.translateWrapper){this.container.removeChild(this.translateWrapper);delete this.translateWrapper}if(this.pastebinWrapper){this.container.removeChild(this.pastebinWrapper);delete this.pastebinWrapper}if(this.fileuploadWrapper){this.container.removeChild(this.fileuploadWrapper);delete this.fileuploadWrapper}if(this.minifyWrapper){this.container.removeChild(this.minifyWrapper);delete this.minifyWrapper}if(this.menudiv){this.container.removeChild(this.menudiv);delete this.menudiv}delete this.needSeparator};RichInputElement.prototype.getHeight=function(){var A=this.ieHeight;A+=this.prefs.chatInputPadding*2;A+=this.prefs.chatInputSpacing*2;A+=2;if(this.hasOptions){A+=this.opHeight;A+=this.prefs.chatInputSpacing;A+=2}return A};RichInputElement.prototype.insertText=function(A){window.setTimeout(function(B){return function(){B.hin.insertText(A)}}(this),100)};RichInputElement.prototype.getLanguageSelector=function(B){var F=this.doc.createElement("select");F.style.marginRight="8px";F.style.fontSize="11px";F.onchange=function(){B(F.value,RichInputElement.languageDisplayNames[F.value])};for(var E=0;E<RichInputElement.languages.length;E++){var D=this.doc.createElement("option");var A=RichInputElement.languages[E];var C=RichInputElement.languageDisplayNames[A];D.appendChild(this.doc.createTextNode(C));D.value=A;F.appendChild(D)}return F};RichInputElement.prototype.addMenuSeparator=function(){var A=this.doc.createTextNode(" | ");this.menudiv.appendChild(A)};RichInputElement.prototype.selectMenu=function(A){if(this.activeMenu==this.menus[A]){this.hideMenu()}else{this.showMenu(this.menus[A])}this.menus[A].menu.blur()};RichInputElement.prototype.addMenuItem=function(F,B,C,E,A){if(this.needSeparator){this.addMenuSeparator()}this.needSeparator=true;this.menus[F]={};this.menus[F].content=C;this.menus[F].showcb=E;this.menus[F].hidecb=A;this.menus[F].menu=this.doc.createElement("span");this.menus[F].menu.appendChild(this.doc.createTextNode(B));this.menus[F].menu.style.color=this.prefs.colorInMenu;this.menus[F].menu.style.cursor="pointer";this.menus[F].menu.onmouseover=function(G){return function(){G.menus[F].menu.style.textDecoration="underline"}}(this);this.menus[F].menu.onmouseout=function(G){return function(){G.menus[F].menu.style.textDecoration="none"}}(this);this.menus[F].menu.onclick=function(H,G){return function(){if(H.activeMenu==G){H.hideMenu()}else{if(H.activeMenu.content==H.ieWrapper){H.saveInPos=H.hin.getPos()}H.showMenu(G)}G.menu.blur();return false}}(this,this.menus[F]);var D=this.doc.createElement("span");cp({color:this.prefs.colorInLinks,fontSize:"11px",marginLeft:"4px",cursor:"pointer",textDecoration:"underline"},D.style);D.appendChild(this.doc.createTextNode(DisplayStrings.get("InputMenuClose")));D.onclick=function(G){return function(){G.hideMenu();return false}}(this);this.menus[F].content.appendChild(D);this.menudiv.appendChild(this.menus[F].menu)};RichInputElement.prototype.hideMenu=function(){if(this.activeMenu&&this.activeMenu.content!=this.ieWrapper){this.showMenu({content:this.ieWrapper,menu:null});this.inputElement.focus();window.setTimeout(function(A){return function(){A.hin.goToPos(A.saveInPos)}}(this),10)}};RichInputElement.prototype.showMenu=function(A){if(this.activeMenu){this.activeMenu.content.style.display="none";if(this.activeMenu.menu!=null){this.activeMenu.menu.style.color=this.prefs.colorInMenu}if(this.activeMenu.hidecb){this.activeMenu.hidecb()}}this.activeMenu=A;if(this.activeMenu&&this.activeMenu.showcb){this.activeMenu.showcb()}if(this.activeMenu.menu!=null){this.activeMenu.menu.style.color=this.prefs.colorInMenuActive}this.activeMenu.content.style.display="block";if(this.activeMenu.content!=this.ieWrapper){this.activeMenu.content.style.border="1px solid "+this.prefs.chatInputBorder;this.activeMenu.content.style.background=this.prefs.chatInputBackground;this.activeMenu.content.style.padding=this.prefs.chatInputPadding+"px";this.activeMenu.content.style.margin=this.prefs.chatInputSpacing+"px";this.activeMenu.content.style.height=this.ieHeight+"px"}};RichInputElement.prototype.setColor=function(A){this.inputElement.style.color=A.color;if(this.callbacks.setColorcb){if(A.code==1){this.callbacks.setColorcb(null)}else{this.callbacks.setColorcb(A.code)}}};RichInputElement.colors=[{code:0,color:"#ffffff"},{code:1,color:"#000000"},{code:2,color:"#000080"},{code:3,color:"#008000"},{code:4,color:"#ff0000"},{code:5,color:"#800040"},{code:6,color:"#800080"},{code:7,color:"#ff8040"},{code:8,color:"#ffff00"},{code:9,color:"#80ff00"},{code:10,color:"#008080"},{code:11,color:"#00ffff"},{code:12,color:"#0000ff"},{code:13,color:"#ff00ff"},{code:14,color:"#808080"},{code:15,color:"#c0c0c0"}];RichInputElement.languages=["none","ar","bg","ca","zh","zh-CN","zh-TW","hr","cs","da","nl","en","et","tl","fi","fr","de","el","iw","hi","hu","id","it","ja","ko","lv","lt","no","fa","pl","pt-PT","ro","ru","sr","sk","sl","es","sv","th","tr","uk","vi"];RichInputElement.languageDisplayNames={"none":" -- None --","ar":"Arabic","bg":"Bulgarian","ca":"Catalan","zh":"Chinese","zh-CN":"Chinese(Simple)","zh-TW":"Chinese(Trad)","hr":"Croatian","cs":"Czech","da":"Danish","nl":"Dutch","en":"English","et":"Estonian","tl":"Filipino","fi":"Finnish","fr":"French","de":"German","el":"Greek","iw":"Hebrew","hi":"Hindi","hu":"Hungarian","id":"Indonesian","it":"Italian","ja":"Japanese","ko":"Korean","lv":"Latvian","lt":"Lithuanian","no":"Norwegian","fa":"Persian","pl":"Polish","pt-PT":"Portuguese","ro":"Romanian","ru":"Russian","sr":"Serbian","sk":"Slovak","sl":"Slovenian","es":"Spanish","sv":"Swedish","th":"Thai","tr":"Turkish","uk":"Ukranian","vi":"Vietnamese"};function HistoricalInput(F,C,H,E){this.dedupe=E;this.history=new Array();this.ptr=0;this.maxLength=H;this.inElement=C;this.dictionary={};this.dictionaryChars="\\_\\|a-zA-Z0-9\\-\\[\\]\\\\`\\^\\{\\}";this.tabbing=false;this.tabOptions=[];this.tabIndex=0;this.typingcb=null;function D(I){return function(){I.addInput();return false}}function B(I){return function(J){return I.keyPress(J)}}function G(I){return function(J){return I.keyDown(J)}}function A(I){return function(J){I.history[I.ptr]=I.inElement.value;if(I.typingcb){I.typingcb(I.inElement.value)}}}C.setAttribute("autocomplete","off");C.setAttribute("spellcheck","true");if(F.addEventListener){F.addEventListener("submit",D(this),false);C.addEventListener("keydown",G(this),false);C.addEventListener("keypress",B(this),false);C.addEventListener("keyup",A(this),false)}else{F.attachEvent("onsubmit",D(this));C.attachEvent("onkeydown",G(this));C.attachEvent("onkeypress",B(this));C.attachEvent("onkeyup",A(this))}}HistoricalInput.prototype.addWord=function(A){this.dictionary[A.toLowerCase()]=A};HistoricalInput.prototype.removeWord=function(A){delete this.dictionary[A.toLowerCase()]};HistoricalInput.prototype.clearWords=function(){this.dictionary={}};HistoricalInput.prototype.addInput=function(){this.tabbing=false;this.history[0]=this.inElement.value;this.inElement.value="";if(this.dedupe&&(this.history[0]==this.history[1])){this.history[0]=""}else{if(this.history.length>=this.maxLength){this.history.pop()}this.history.unshift("")}this.ptr=0;return false};HistoricalInput.prototype.prevHistory=function(){if(this.ptr<(this.history.length-1)){this.ptr++;this.inElement.value=this.history[this.ptr];this.goToEnd()}};HistoricalInput.prototype.nextHistory=function(){if(this.ptr>0){this.ptr--;this.inElement.value=this.history[this.ptr]}};HistoricalInput.prototype.insertText=function(A){var B=this.inElement.value;var C=this.getPos();this.inElement.value=B.substring(0,C)+A+B.substring(C,B.length);this.goToPos(C+A.length)};HistoricalInput.prototype.goToEnd=function(){this.goToPos(this.inElement.value.length)};HistoricalInput.prototype.goToPos=function(C){try{if(typeof this.inElement.selectionStart!="undefined"){this.inElement.setSelectionRange(C,C)}else{if(this.inElement.createTextRange){var A=this.inElement.createTextRange();A.move("character",C);A.select()}}}catch(B){}};HistoricalInput.prototype.getPos=function(){try{if(typeof this.inElement.selectionStart!="undefined"){return this.inElement.selectionStart}else{if(this.inElement.createTextRange){var A=document.selection.createRange();var B=A.getBookmark();return B.charCodeAt(2)-2}}}catch(C){}return v.length};HistoricalInput.prototype.tabComplete=function(){if(!this.dictionary){return }var L=this.inElement.value;var H=this.getPos();var N=L.substring(0,H);var A=L.substring(H,L.length);if(this.tabbing){N=N.substring(0,N.length-this.tabOptions[this.tabIndex].length);this.tabIndex++;if(this.tabIndex==this.tabOptions.length){this.tabIndex=0}var B=N+this.tabOptions[this.tabIndex];this.inElement.value=B+A;this.goToPos(B.length);return }var M=new RegExp("["+this.dictionaryChars+"]+$");var I=N.match(M);if(I&&I.length==1){I=I[0].toLowerCase();var E=N.substring(0,N.length-I.length);var G=new Array();for(nick in this.dictionary){if(this.dictionary.hasOwnProperty(nick)){var D=nick.substring(0,I.length).toLowerCase();if(D==I){G.push(this.dictionary[nick]+(E==""?": ":" "))}}}if(G.length===0){return }else{if(G.length==1){this.inElement.value=E+G[0]+A;this.goToPos(E.length+G[0].length)}else{var J=G[0].length;for(var F=0;F<(G.length-1);F++){while(J>0){if(G[F].substring(0,J).toLowerCase()==G[F+1].substring(0,J).toLowerCase()){break}J--}}if(J>I.length){var C=E+G[0].substring(0,J).toLowerCase();this.inElement.value=C+A;this.goToPos(C.length)}else{this.tabbing=true;this.tabOptions=G;this.tabIndex=0;var K=E+this.tabOptions[this.tabIndex];this.inElement.value=K+A;this.goToPos(K.length)}}}}};HistoricalInput.prototype.keyDown=function(A){if(!A){A=window.event}if(this.tabbing&&A.keyCode!=9){this.tabbing=false}if(A.keyCode==9){this.tabComplete()}else{if(!A.shiftKey&&!A.altKey&&A.keyCode==38){this.prevHistory()}else{if(!A.shiftKey&&!A.altKey&&A.keyCode==40){this.nextHistory()}}}this.keyPress(A)};HistoricalInput.prototype.keyPress=function(A){if(!A){A=window.event}if((A.keyCode==9)||(!A.shiftKey&&!A.altKey&&A.keyCode==38)||(!A.shiftKey&&!A.altKey&&A.keyCode==40)){if(A.stopPropagation){A.stopPropagation();A.preventDefault()}else{A.cancelBubble=true;A.returnValue=false}return false}return true};function InfoBar(C,A,B){this.prefs=A;this.container=C;this.document=C.ownerDocument;this.isl=islight(B);this.colorLink=this.isl?"#00f":"#ff8";this.colorLinkText=this.isl?"#222":"#eee";this.container.style.zIndex="100";this.lastChangedTime=0;this.showingGoogle=false;this.adiv=this.document.createElement("div");cp({textAlign:"left",whiteSpace:"nowrap",margin:"1px"},this.adiv.style);this.adiv.style.fontFamily=this.prefs.infobarFontFamily;this.adiv.style.fontSize=this.prefs.infobarFontSize+"px";this.adiv.style.padding=this.prefs.infobarPadding+"px";this.adiv.style.color=this.prefs.infobarColor;this.container.style.background=this.prefs.infobarBackground;this.adiv.onmouseover=function(D){return function(){D.expand(true)}}(this);this.adiv.onmouseout=function(D){return function(){D.expand(false)}}(this);this.container.appendChild(this.adiv);this.gdiv=this.document.createElement("div");this.gdiv.style.display="none";this.container.appendChild(this.gdiv);this.div=this.adiv;this.divHeight=10;this.showTopic("Mibbit");if(InfoBar.googlead){this.setDiv(true)}}InfoBar.prototype.getHeight=function(){if(this.showingGoogle){return 60}return this.divHeight+2};InfoBar.prototype.redraw=function(){if(this.showingGoogle){return }this.adiv.style.fontFamily=this.prefs.infobarFontFamily;this.adiv.style.fontSize=this.prefs.infobarFontSize+"px";this.adiv.style.padding=this.prefs.infobarPadding+"px";this.adiv.style.color=this.prefs.infobarColor;this.adiv.style.border=this.prefs.infobarBorder?("1px solid "+this.prefs.infobarBorder):"0";this.adiv.style.margin=this.prefs.infobarBorder?"0px":"1px";this.container.style.background=this.prefs.infobarBackground};InfoBar.prototype.layout=function(){try{if(this.adiv&&this.adiv.offsetHeight!=0&&this.adiv.offsetHeight!=this.divHeight){this.divHeight=this.adiv.offsetHeight;return true}}catch(A){if(DEBUG){log.log("Infobar.layout",A,DebugLevel.WARNING)}}return false};InfoBar.prototype.showTopic=function(B,A){if(this.showingGoogle){return }this.lastChangedTime=(new Date()).getTime();this.clear();var C=this.document.createElement("span");if(A){A.reset();A.addData(B);A.flush(C)}else{C.appendChild(this.document.createTextNode(B))}this.adiv.appendChild(C);this.setDiv(false)};InfoBar.prototype.expand=function(A){if(this.showingGoogle){return }if(A){cp({overflow:"auto",height:"auto",background:this.prefs.infobarBackgroundHighlight},this.container.style);cp({color:this.prefs.infobarColorHighlight,textAlign:"left",whiteSpace:"normal"},this.div.style);this.div.style.border=this.prefs.infobarBorderHighlight?("1px solid "+this.prefs.infobarBorderHighlight):"0";this.div.style.margin=this.prefs.infobarBorderHighlight?"0px":"1px"}else{cp({overflow:"hidden",height:(this.getHeight()+"px"),background:this.prefs.infobarBackground,padding:"0"},this.container.style);cp({color:this.prefs.infobarColor,textAlign:"left",whiteSpace:"nowrap"},this.div.style);this.div.style.border=this.prefs.infobarBorder?("1px solid "+this.prefs.infobarBorder):"0";this.div.style.margin=this.prefs.infobarBorder?"0px":"1px"}};InfoBar.prototype.clear=function(){while(this.adiv.firstChild){this.adiv.removeChild(this.adiv.firstChild)}};InfoBar.prototype.setDiv=function(A){this.div=A?this.gdiv:this.adiv;this.adiv.style.display=A?"none":"block";this.gdiv.style.display=A?"block":"none";this.showingGoogle=A;this.lastChangedTime=(new Date()).getTime()};InfoBar.setGooglePos=function(A,B){if(InfoBar.googlediv){InfoBar.googlediv.style.left=A+"px";InfoBar.googlediv.style.top=B+"px"}};InfoBar.setGoogleVisibility=function(A){if(InfoBar.googlediv){InfoBar.googlediv.style.display=A?"block":"none"}};InfoBar.createGoogle=function(E,B){var A=(E>=468)?InfoBar.gOptionsFull:InfoBar.gOptionsHalf;var D=20;if(Math.random()>=0.5){A=(E>=468)?InfoBar.gOptionsFullAlt:InfoBar.gOptionsHalfAlt;InfoBar.UPDATE_PERIOD=5*60*1000}if(!InfoBar.enableGoogle){return }try{if(google&&google.ads){A.hints=myHints.getTopWords(D);InfoBar.googlediv=document.createElement("div");cp({position:"absolute",zIndex:"200",visibility:"hidden"},InfoBar.googlediv.style);document.body.appendChild(InfoBar.googlediv);var C=InfoBar.colorSchemes[B.adScheme];if(C){cp(C,A)}InfoBar.googlead=new google.ads.Ad("pub-8840091489419990",InfoBar.googlediv,A);window.setInterval(function(){return function(){InfoBar.googlead.refresh({"hints":myHints.getTopWords(D)});if(DEBUG){log.log("InfoBar update","Updating...",DebugLevel.INFO)}}}(),InfoBar.UPDATE_PERIOD)}}catch(F){if(DEBUG){log.log("InfoBar.createGoogle",F,DebugLevel.WARNING)}}};InfoBar.prototype.showLink=function(B){if(this.showingGoogle){return }this.clear();if(B.iconurl){var A=this.document.createElement("img");setPngSrc(A,B.iconurl,16,16);cp({marginRight:"2px",marginLeft:"2px",verticalAlign:"middle"},A.style);this.adiv.appendChild(A)}var E=this.document.createElement("a");E.style.color=this.colorLink;E.href=B.link;E.title="(Opens in new window)";E.target="_blank";E.appendChild(this.document.createTextNode(B.linkText));this.adiv.appendChild(E);if(InfoBar.showNewWindow){var C=this.document.createElement("span");C.style.color="#c44";C.style.fontSize="11px";C.appendChild(this.document.createTextNode(" ("+DisplayStrings.get("InfoBarNewWindow")+") "));this.adiv.appendChild(C)}var D=this.document.createElement("a");D.style.textDecoration="none";D.style.color=this.colorLinkText;D.href=B.link;D.title="(Opens in new window)";D.target="_blank";D.appendChild(this.document.createTextNode(" - "+B.description));this.adiv.appendChild(D);this.setDiv(false)};InfoBar.showNewWindow=true;InfoBar.UPDATE_PERIOD=10*60*1000;InfoBar.gOptionsHalf={format:"234x60",ad_slot:"0692964597"};InfoBar.gOptionsFull={format:"468x60",ad_slot:"9332152032"};InfoBar.gOptionsHalfAlt={format:"468x60",ad_slot:"9198447671"};InfoBar.gOptionsFullAlt={format:"468x60",ad_slot:"9145983279"};InfoBar.enableGoogle=false;InfoBar.colorSchemes={"mibbit":{},"black":{color_bg:"000000",color_border:"444444",color_link:"ffffcc",color_text:"eeeeee"},"white":{color_bg:"ffffff",color_border:"ffffff",color_link:"0000ff",color_text:"000000"}};function Tab(D,K,B,C,J,I,L,G,F,E){this.tabGroup=D;this.settings=F;this.id=B;this.title=J;this.content=C;this.doc=K.ownerDocument;this.raised=G;this.activity=false;this.activityMe=false;this.tabtype=L;this.lastActiveTime=(new Date()).getTime();this.activecallback=E.activecb;this.li=K;this.li.style.cursor="pointer";this.li.onclick=function(M){return function(){E.clickcb(M.id);return false}}(this);this.tabspan=this.doc.createElement("span");cp({display:"block",position:"relative",paddingRight:"4px"},this.tabspan.style);this.titlelink=this.doc.createElement("span");cp({textDecoration:"none",verticalAlign:"top",position:"relative"},this.titlelink.style);if(this.tabtype.icon){this.ico=this.doc.createElement("img");var A=this.tabGroup.tabHeight-2;var H=this.tabGroup.tabHeight-2;if(this.tabtype.iconHeight&&this.tabtype.iconWidth){if(this.tabtype.iconHeight<H){H=this.tabtype.iconHeight;A=this.tabtype.iconWidth}}cp({width:A+"px",height:H+"px",display:"inline",marginRight:"3px",verticalAlign:"top"},this.ico.style);setPngSrc(this.ico,this.tabtype.icon,A,H);this.titlelink.appendChild(this.ico)}this.titlenode=this.doc.createTextNode(J);this.titlelink.appendChild(this.titlenode);this.li.title=I;this.tabspan.appendChild(this.titlelink);this.li.appendChild(this.tabspan);if(E.closecb){this.closelink=this.doc.createElement("img");cp({cursor:"pointer",width:"12px",height:"12px",marginLeft:"3px",verticalAlign:"top"},this.closelink.style);this.closelink.title="Close tab";this.closelink.onclick=function(M){return function(N){E.closecb(M.id);return false}}(this);if(SUPPORTS_DATA_URLS){this.closelink.src=Tab.CLOSE_ICON_GREY}else{setPngSrc(this.closelink,"/gfx/close-win-grey.png",12,12)}this.closelink.style.border="0";if(SUPPORTS_DATA_URLS){this.closelink.onmouseover=function(){this.src=Tab.CLOSE_ICON_RED};this.closelink.onmouseout=function(){this.src=Tab.CLOSE_ICON_GREY}}else{this.closelink.onmouseover=function(){setPngSrc(this,"/gfx/close-win-red.png",12,12)};this.closelink.onmouseout=function(){setPngSrc(this,"/gfx/close-win-grey.png",12,12)}}this.titlelink.appendChild(this.closelink)}this.redraw()}Tab.CLOSE_ICON_GREY="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZRJREFUeNpUUsmKwkAQrUgr7iAGRXDHQy4BQ5QcRL%2FCfzCf5Ed49qggeBDFHObggAEX3NAWDy644nQ10zJT0Kmi8up11auWms0moJ1OJ3k6nZbW67V2OBxymAuFQnYsFrNSqVQ3GAxSzBH8bLdbZTQaVVmR4fV6IZFIcJLr9arPZjN9v9%2BriqI0otHoN0Hm8Xhcfb1eRiQSgff7DcJ8Ph8%2FSGTbNjCyumO5XJZut5vh9%2FuhVqtBsVgESZJ4AcamaQL%2BQ8xqtSqR4%2FGoYQKt3W5DuVz%2B3JDP56HVavEYMYglrDLndDp5cjgccl%2BpVLjvdDpgWRZvC%2B1%2Bv%2BccHo%2FnX88ulwsejwc8n08eCzCa2%2B0GgtJRSnUctlAogKZpnFnchKDBYMDFQCwJh8PWbrfTESDAojVR1O%2F3uRCIldig8mQyMefzubHZbCAQCHzaOJ%2FPKCkw%2FXE3vWw2WydMf5pOpxu%2FhAb8MbGHZDLZy2QyDTYXJTggW8i3qqp19gy%2BFouFxmbiT0OWZTsej1vMdy%2BXC0UhfgQYAHHGvjzBMv27AAAAAElFTkSuQmCC";Tab.CLOSE_ICON_RED="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAexJREFUeNo0kM9qE1EUxr87c2cyk8mkSaj%2FTdvEKKJghWKK0C61WYhZ%2BAaCiIuSpU%2FgogvpQgR9CBddZmcNGlCCEHShtNqmVawK02SSSSYzk%2Bu5EzyzOPd%2B891zfuew3c1NMPoCt5cf7X275%2F%2F5veb4%2FhIosgm9ZZw8XU%2FMF15pdvpAQECtVSoYH%2F266X1qP%2FHcbk1XlVLKti3LNC0WhiXPdSvi71GRGea%2Bmkod8tB188Odr4%2BjKKpadhpUJA6ZlGQKFuXA61dHO1%2FonlxXH166eD%2FoOjXNsnH2wSMIRYX%2F8wdBAvaNZczeuYtBu41wNLzMBDo86vfWpBlCwNneRmZlhaw0Fb2wry2S9jruqFG3kLxc0IBM0yEd%2FY%2FvY5jM6mq8CKfxhrQPUGVBCemPl7himhBhFHeQzCyRAOg%2BIYM8q6QJMR1MehWeO9GKBeogmWfKZRw336HbbCJTXkaKNBmM%2FvPcbEvh2Vx9uhaB9OJ1HDcacAlDojh0lhqbLg48m62zvRcv88Pvu8%2F8zn6113WQ5DzGkBWjgYtBGMJOZ2DMzW%2BZxdI6F2FwYBYubMgK6Q6q%2F7tJTDmsTdmYW9gyCsUN6VVrt26D6dph4tz5t4TXkcuYBOMZxrmnnzrTsK5cfU7mpyIYf574Y%2FwTYAACmspImYROsgAAAABJRU5ErkJggg%3D%3D";Tab.prototype.newSettings=function(A){this.tabtype=A;this.setRaised(this.raised)};Tab.prototype.setTitle=function(A){this.title=A;this.titlenode.nodeValue=this.title};Tab.prototype.setTabStyle=function(){if(this.tabGroup.tabStyle=="list"){cp({styleFloat:"none",cssFloat:"none",marginRight:"0px",textAlign:"left",marginBottom:"1px"},this.li.style);this.tabspan.style.cssFloat="none";this.tabspan.style.styleFloat="none";if(this.closelink){this.titlelink.removeChild(this.closelink);this.titlelink.insertBefore(this.closelink,this.titlelink.firstChild);this.closelink.style.marginLeft="0px";this.closelink.style.marginRight="4px"}}else{cp({styleFloat:"left",cssFloat:"left",marginRight:this.settings.spacing+"px",textAlign:"center",marginBottom:"0px"},this.li.style);this.tabspan.style.cssFloat="left";this.tabspan.style.styleFloat="left";if(this.closelink){this.titlelink.removeChild(this.closelink);this.titlelink.appendChild(this.closelink);this.closelink.style.marginLeft="4px";this.closelink.style.marginRight="0px"}}this.redraw()};Tab.prototype.redraw=function(){this.li.style.height=this.tabGroup.tabHeight+"px";this.tabspan.style.height=this.tabGroup.tabHeight+"px";this.tabspan.style.fontSize=this.settings.fontSize+"px";this.tabspan.style.lineHeight=this.settings.fontSize+"px";this.titlelink.style.fontSize=this.settings.fontSize+"px";this.titlelink.style.lineHeight=this.settings.fontSize+"px";this.titlelink.style.fontFamily=this.settings.fontFamily;this.titlelink.style.fontWeight=this.settings.fontWeight;this.titlelink.style.marginLeft=this.settings.padding+"px";this.titlelink.style.marginRight=this.settings.padding+"px";this.titlelink.style.top=this.settings.padding+"px";if(this.tabtype.icon){var A=this.tabGroup.tabHeight-2;var B=this.tabGroup.tabHeight-2;if(this.tabtype.iconHeight&&this.tabtype.iconWidth){if(this.tabtype.iconHeight<B){B=this.tabtype.iconHeight;A=this.tabtype.iconWidth}}this.ico.style.width=A+"px";this.ico.style.height=B+"px";setPngSrc(this.ico,this.tabtype.icon,A,B)}this.setRaised(this.raised)};Tab.prototype.setRaised=function(D){this.raised=D;var G=D?"over":"normal";function A(J){var I=J.indexOf(" ");if(I!=-1){J=J.substring(0,I)}var H="ffffff";if(J.charAt(0)=="#"){if(J.length==7){H=J.substring(1,J.length)}if(J.length==4){H=J.substring(1,2)+J.substring(1,2)+J.substring(2,3)+J.substring(2,3)+J.substring(3,4)+J.substring(3,4)}}else{if(J.length==6){H=J}}return H}var C=A(this.tabtype.background);var B=A(this.settings.background);var E=A(this.tabtype.border);var F="/img/tab?"+(this.tabGroup.tabStyle=="list"?"vertical&":"")+"color="+C+(E?"&bcolor="+E:"")+(B?"&bgcolor="+B:"")+(D?"&selected=true":"");if(this.tabGroup.tabHeight!=20){F+="&height="+this.tabGroup.tabHeight}this.tabspan.style.background="transparent url("+F+"&right=true) no-repeat scroll right top";this.li.style.background="transparent url("+F+") no-repeat scroll left top";if(D){this.titlelink.style.color=this.settings.color}else{this.titlelink.style.color=(this.activityMe?this.settings.colorActivityMe:(this.activity?this.settings.colorActivity:this.settings.colorInactive))}if(this.closelink){this.closelink.style.display=this.tabGroup.individualCloses?"inline":(D?"inline":"none")}if(this.tabGroup.tabStyle=="list"){this.li.style.marginLeft=D?"4px":"0px"}else{this.li.style.marginLeft="0px"}};Tab.prototype.close=function(){if(!this.raised){return }if(this.activecallback){this.activecallback(this.id,false)}this.content.style.display="none";this.setRaised(false)};Tab.prototype.open=function(){if(this.raised){return false}this.content.style.display="block";this.setRaised(true);if(this.activecallback){this.activecallback(this.id,true)}this.lastActiveTime=(new Date()).getTime();this.inactive();return true};Tab.prototype.active=function(B){if(!this.raised){if(!this.activityMe&&B){var A=this.tabGroup.activityCountMe;this.tabGroup.activityCountMe++;if(A==0){this.tabGroup.activitycb(true)}this.activityMe=true;this.titlelink.style.color=this.settings.colorActivityMe}if(!this.activity){if(this.tabGroup.activityCount==0){this.tabGroup.activitycb(true)}this.tabGroup.activityCount++;this.activity=true;if(!this.activityMe){this.titlelink.style.color=this.settings.colorActivity}}}};Tab.prototype.inactive=function(){if(this.activityMe){this.tabGroup.activityCountMe--}if(this.activity){this.tabGroup.activityCount--;if(this.tabGroup.activityCount==0){this.tabGroup.activitycb(false)}else{if(this.tabGroup.activityCountMe==0){this.tabGroup.activitycb(true)}}}this.activity=false;this.activityMe=false};Tab.prototype.getHeight=function(){return(this.settings.padding*2)+this.titlelink.offsetHeight};function TabGroup(E,B,C,D,A){this.prefs=B;this.doc=E.ownerDocument;this.tabs={};this.deadid=0;this.sortedTabs=[];this.activityCount=0;this.activityCountMe=0;this.e=E;this.tabStyle="top";this.topPadding=D;this.tabHeight=A;this.e.style.textAlign="left";this.uld=this.doc.createElement("div");this.uld.style.overflow="hidden";this.uld.style.zIndex="90";this.ul=this.doc.createElement("ul");cp({listStyleType:"none",listStyleImage:"none",listStylePosition:"outside",margin:"0",padding:"0",verticalAlign:"bottom",overflow:"hidden"},this.ul.style);var F=this.doc.createElement("div");F.style.position="relative";this.uld.appendChild(this.ul);F.appendChild(this.uld);E.appendChild(F);this.arrows=C;if(this.arrows){this.arrowDiv=this.doc.createElement("div");this.arrowDiv.style.position="absolute";this.arrowDiv.style.right="0px";this.arrowDiv.style.top=ChatGuiModule.BASE_HEADER_HEIGHT+"px";this.arrowDiv.style.width="40px";this.arrowDiv.style.height=this.tabHeight+"px";this.arrowDiv.style.textAlign="right";this.arrowDiv.style.paddingTop=this.topPadding+"px";this.arrowDiv.style.background=this.prefs.tabBackgroundColor;this.e.appendChild(this.arrowDiv);this.arrowDivInner=this.doc.createElement("div");this.arrowDivInner.style.display="none";this.arrowDiv.appendChild(this.arrowDivInner);this.arrowLeft=this.doc.createElement("a");this.arrowLeft.appendChild(this.doc.createTextNode("<"));this.arrowLeft.href="javascript:void(0)";this.arrowLeft.style.color="#eee";this.arrowLeft.style.fontSize="15px";this.arrowLeft.style.fontWeight="bold";this.arrowLeft.style.textDecoration="none";this.arrowLeft.onclick=function(G){return function(){var H=G.getShowIndex();if(H>0){G.setShowIndex(H-1)}}}(this);this.arrowRight=this.doc.createElement("a");this.arrowRight.appendChild(this.doc.createTextNode(">"));this.arrowRight.href="javascript:void(0)";this.arrowRight.style.color="#eee";this.arrowRight.style.fontSize="15px";this.arrowRight.style.fontWeight="bold";this.arrowRight.style.textDecoration="none";this.arrowRight.onclick=function(G){return function(){var H=G.getShowIndex();if((H+1)<G.size()){G.setShowIndex(H+1)}}}(this);this.arrowDivInner.appendChild(this.arrowLeft);this.arrowDivInner.appendChild(this.doc.createTextNode(" "));this.arrowDivInner.appendChild(this.arrowRight);this.uld.style.marginRight="40px"}this.setStyle(this.tabStyle=="list");this.redraw()}TabGroup.prototype.addLogo=function(){this.logoe=this.doc.createElement("li");this.logoe.style.listStyleType="none";this.logoe.style.margin="0";this.logoe.style.padding="0";this.logoe.style.styleFloat="left";this.logoe.style.cssFloat="left";this.logoe.style.marginRight=this.tabSettings.spacing+"px";this.logoe.style.paddingLeft="4px";this.logoe.style.textAlign="center";this.logoe.style.display="block";this.logoe.style.whiteSpace="nowrap";var B=this.doc.createElement("img");B.style.width="16px";B.style.height="16px";setPngSrc(B,"/gfx/frogSmall.png",16,16);B.style.display="inline";this.logoe.appendChild(B);var A=this.doc.createElement("a");A.href="http://www.mibbit.com";A.target="_blank";A.appendChild(this.doc.createTextNode("Chat by Mibbit.com"));A.style.marginLeft="4px";A.style.color="#ccc";A.style.fontWeight="bold";A.style.fontSize="13px";A.style.textDecoration="none";this.logoe.appendChild(A);this.ul.appendChild(this.logoe)};TabGroup.prototype.removeLogo=function(){try{this.ul.removeChild(this.logoe)}catch(A){}};TabGroup.prototype.closeAll=function(){for(i in this.tabs){if(this.tabs.hasOwnProperty(i)){this.tabs[i].close()}}};TabGroup.prototype.changeTab=function(B,C){if(!this.tabs[B]){return false}var A=this.tabs[B];delete this.tabs[B];this.tabs[C]=A;A.id=C;return true};TabGroup.prototype.moveTab=function(B,C){if(!this.tabs[B]){return false}var A=this.tabs[B];this.uninsertTab(A);A.id=C;this.insertTab(A)};TabGroup.prototype.deadTab=function(A){if(!this.tabs[A]){return false}var B=A+".dead"+this.deadid;this.changeTab(A,B);this.tabs[B].setTitle(this.tabs[B].title+" (dead)");this.tabs[B].closelink.onclick=function(C){return function(){C.removeTab(B)}}(this);this.deadid++;return true};TabGroup.prototype.existsTab=function(A){if(!this.tabs[A]){return false}return true};TabGroup.prototype.selectTab=function(A){if(!this.tabs[A]){return false}this.closeAll();this.tabs[A].open();return true};TabGroup.prototype.addTab=function(A,I,K,J,D,F,M,B,N){try{if(this.tabs[A]){if(DEBUG){log.log("addTab","We already have a tab of that ID! "+A,DebugLevel.WARNING)}}if(!B){this.closeAll()}function C(O){return function(Q){var P=true;if(F){P=F(Q)}if(P){O.removeTab(Q)}}}var E=this.doc.createElement("li");E.style.listStyleType="none";E.style.margin="0";E.style.padding="0";E.style.paddingLeft="4px";E.style.display="block";E.style.position="relative";E.style.whiteSpace="nowrap";var H={};H.activecb=D;if(N){H.closecb=C(this)}H.clickcb=function(O){return function(P){if(typeof O.tabs[P]!="undefined"){O.closeAll();O.tabs[P].open()}}}(this);var L=new Tab(this,E,A,I,K,J,M,!B,this.tabSettings,H);L.setTabStyle();this.insertTab(L);if(this.arrowDivInner&&this.size()>1){this.arrowDivInner.style.display="block"}return L}catch(G){if(DEBUG){log.log("addTab","exception "+G,DebugLevel.WARNING)}}};TabGroup.prototype.insertTab=function(D){var E;var B;for(var A=0;A<this.sortedTabs.length;A++){var C=this.sortedTabs[A];if(C.id>D.id){E=C.li;break}B=C.li}if(B&&B.style.display=="none"){D.li.style.display="none"}if(E){this.ul.insertBefore(D.li,E)}else{this.ul.appendChild(D.li)}this.tabs[D.id]=D;this.sortedTabs.push(D);this.sortedTabs.sort(function(G,F){if(G.id>F.id){return 1}if(G.id<F.id){return -1}return 0})};TabGroup.prototype.uninsertTab=function(B){this.ul.removeChild(B.li);for(var A=0;A<this.sortedTabs.length;A++){if(this.sortedTabs[A]==B){this.sortedTabs.splice(A,1);break}}delete this.tabs[B.id]};TabGroup.prototype.removeTab=function(C){var B=this.tabs[C];if(!B){return false}B.content.parentNode.removeChild(B.content);B.inactive();this.uninsertTab(B);if(B.raised){var A=0;var D;for(i in this.tabs){if(this.tabs.hasOwnProperty(i)){if(this.tabs[i].lastActiveTime>A){A=this.tabs[i].lastActiveTime;D=this.tabs[i]}}}if(D){D.open()}}if(this.arrowDivInner&&this.size()<2){this.arrowDivInner.style.display="none"}return true};TabGroup.prototype.setShowIndex=function(A){for(var C=0;C<this.sortedTabs.length;C++){var B=this.sortedTabs[C];if(C<A){B.li.style.display="none"}else{B.li.style.display="block"}}};TabGroup.prototype.getShowIndex=function(){for(var B=0;B<this.sortedTabs.length;B++){var A=this.sortedTabs[B];if(A.li.style.display=="block"){return B}}return 0};TabGroup.prototype.size=function(){return this.sortedTabs.length};TabGroup.prototype.moveRight=function(){for(var A=0;A<this.sortedTabs.length;A++){if(this.sortedTabs[A].raised){if(A==(this.sortedTabs.length-1)){return }this.closeAll();this.sortedTabs[A+1].open();break}}};TabGroup.prototype.moveLeft=function(){for(var A=0;A<this.sortedTabs.length;A++){if(this.sortedTabs[A].raised){if(A==0){return }this.closeAll();this.sortedTabs[A-1].open();break}}};TabGroup.prototype.activitycb=function(B){if(!this.arrowDivInner){return }var A=(this.activityCountMe>0);if(B){this.arrowLeft.style.color=A?this.tabSettings.colorActivityMe:this.tabSettings.colorActivity;this.arrowRight.style.color=A?this.tabSettings.colorActivityMe:this.tabSettings.colorActivity}else{this.arrowLeft.style.color=this.tabSettings.colorArrows;this.arrowRight.style.color=this.tabSettings.colorArrows}};TabGroup.prototype.redraw=function(){this.individualCloses=this.prefs.tabIndividualCloses;this.tabSettings={fontFamily:this.prefs.tabFontFamily,fontSize:this.prefs.tabFontSize,fontWeight:"bold",padding:this.prefs.tabPadding,color:this.prefs.tabTextColor,colorActivityMe:this.prefs.tabTextColorActivityMe,colorActivity:this.prefs.tabTextColorActivity,colorInactive:this.prefs.tabTextColorInactive,spacing:this.prefs.tabSpacing,colorArrows:this.prefs.tabTextColorArrows,background:this.prefs.tabBackgroundColor};this.e.style.background=this.prefs.tabBackgroundColor;if(this.arrowDiv){this.arrowDiv.style.background=this.prefs.tabBackgroundColor}if(this.arrows){if(this.activityCountMe>0){this.arrowLeft.style.color=this.tabSettings.colorActivityMe;this.arrowRight.style.color=this.tabSettings.colorActivityMe}else{if(this.activityCount>0){this.arrowLeft.style.color=this.tabSettings.colorActivity;this.arrowRight.style.color=this.tabSettings.colorActivity}else{this.arrowLeft.style.color=this.tabSettings.colorArrows;this.arrowRight.style.color=this.tabSettings.colorArrows}}}for(i in this.tabs){if(this.tabs.hasOwnProperty(i)){this.tabs[i].settings=this.tabSettings;this.tabs[i].setTabStyle()}}var A=0;for(i in this.tabs){if(this.tabs.hasOwnProperty(i)){var B=this.tabs[i].getHeight();if(B>A){A=B}}}if(A!=0&&A!=this.tabHeight){this.tabHeight=A;this.setStyle(this.tabStyle=="list")}};TabGroup.prototype.toggleStyle=function(){this.setStyle(this.tabStyle=="top");this.prefs.useTabList=(this.tabStyle=="list")};TabGroup.prototype.setStyle=function(A){if(ChatGuiModule.NEED_RESIZE_HANDLER&&A){return }if(this==tabs){ChatGuiModule.HEADER_HEIGHT=ChatGuiModule.BASE_HEADER_HEIGHT+(A?0:(this.topPadding+this.tabHeight))}this.tabStyle=(A?"list":"top");this.e.style.height=A?"auto":this.tabHeight+"px";this.e.style.overflow=A?"auto":"hidden";this.e.style.top=A?ChatGuiModule.HEADER_HEIGHT+"px":"";this.e.style.bottom=A?ChatGuiModule.FOOTER_HEIGHT+"px":"";this.e.style.left=A?"0px":"";this.e.style.width=A?defaultPrefs.tabListWidth+"px":"auto";this.e.style.position=A?"absolute":"static";this.e.style.paddingTop=A?"0px":this.topPadding+"px";this.uld.style.height=A?"auto":this.tabHeight+"px";this.uld.style.marginRight=A?"0px":(this.arrows?"40px":"0px");this.ul.style.height=A?"auto":this.tabHeight+"px";if(this.logoe){this.logoe.style.styleFloat=A?"none":"left";this.logoe.style.cssFloat=A?"none":"left";this.logoe.style.marginRight=(A?"0":this.tabSettings.spacing)+"px";this.logoe.style.marginBottom=A?"1px":"0px";this.logoe.style.textAlign=A?"left":"center"}for(var B=0;B<this.sortedTabs.length;B++){this.sortedTabs[B].setTabStyle();this.sortedTabs[B].content.style.top=ChatGuiModule.HEADER_HEIGHT+"px";this.sortedTabs[B].content.style.left=(A?defaultPrefs.tabListWidth:0)+"px";this.sortedTabs[B].li.style.display="block"}if(this.arrows){this.arrowDiv.style.display=(A?"none":"block")}};function setPngSrc(D,F,B,C){D.style.width=B+"px";D.style.height=C+"px";var E=navigator.appVersion.split("MSIE");var A=parseFloat(E[1]);if((A>=5.5)&&document.body.filters){D.src=M_S+"/icons/blank.gif";D.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='scale')"}else{D.src=F}}function ParserNothing(){this.pendingData="";this.metaData={};this.flush=function(A){A.appendChild(A.ownerDocument.createTextNode(this.pendingData));this.pendingData=""}}ParserNothing.prototype.setMetaData=function(A){this.metaData=A};ParserNothing.prototype.reset=function(){if(this.childRenderer){this.childRenderer.reset()}this.pendingData=""};ParserNothing.prototype.addData=function(A){this.pendingData+=A};function ParserLinks(C,A,B){this.childRenderer=C;this.flush=function(O){var H=this.pendingData.match(ParserLinks.regexp);if(H){for(var L=0;L<H.length;L++){if(H[L].length==1){this.childRenderer.addData(H[L])}else{if(H[L].substring(0,6).toLowerCase()=="irc://"&&B.ircLink){this.childRenderer.flush(O);var M=O.ownerDocument.createElement("span");M.style.textDecoration="underline";M.style.cursor="pointer";M.style.color=(A?A.colorIRCLinks:"red");M.style.outline="none";M.appendChild(O.ownerDocument.createTextNode(H[L]));M.onclick=function(T){return function(){B.ircLink(T);M.blur();return false}}(H[L]);O.appendChild(M)}else{var Q=false;var R=null;if(this.metaData&&this.metaData.links&&this.metaData.links[H[L]]){R=this.metaData.links[H[L]]}if(B&&B.mediaCheck){var P=B.mediaCheck(H[L]);if(P){this.childRenderer.flush(O);var M=O.ownerDocument.createElement("img");M.style.border="2px dotted #cc6";M.style.cursor="pointer";M.style.width=P.icon_w+"px";M.style.height=P.icon_h+"px";M.src=M_S+P.icon;M.onclick=function(T,U,V){return function(){B[V](T,U);return false}}(P.match,H[L],P.cb);M.title=P.de+" ("+H[L]+")";O.appendChild(M);if(P.extraInfo||R&&R.id||R&&R.idata){var E=O.ownerDocument.createElement("img");E.style.height="16px";E.style.width="16px";E.src=M_S+"/icons/information.png";E.style.paddingLeft="2px";if(R&&R.id){E.title="Getting info...";M.id=R.id;E.id=R.id+"_i"}else{var G="";for(var K in R.idata){if(R.idata.hasOwnProperty(K)&&K!="thumb"){G=G+K.toUpperCase()+": "+R.idata[K]+" \n"}}E.title=G;M.title=G;if(R.idata.thumb){M.src=R.idata.thumb}}O.appendChild(E)}Q=true}}if(!Q){this.childRenderer.flush(O);var J=H[L];var M=O.ownerDocument.createElement("a");M.href=(R&&R.url)?R.url:J;if(A&&A.openLinksInExtra){M.onclick=function(T){return function(){B.web(T);return false}}(H[L])}var S=H[L];var I=S.indexOf("?");if(I!=-1){S=S.substring(0,I)}var F=S.match(/^(.+)\.(jpg|jpeg|png|gif)$/i);var N=O.ownerDocument.createTextNode((R&&R.display)?R.display:H[L]);var D=M;if(F&&A&&A.parseReplaceImages){N=O.ownerDocument.createElement("img");N.style.width=A.parseReplaceImagesWidth+"px";N.style.height=A.parseReplaceImagesHeight+"px";if(R&&R.id||R&&R.idata){N.src="/icons/information.png"}else{N.src=ParserLinks.thumbnailURL+"?x="+A.parseReplaceImagesWidth+"&y="+A.parseReplaceImagesHeight+"&url="+encodeURIComponent(H[L])}D=N}M.style.outline="none";M.style.color=(A?(M.id?A.colorLinksWait:A.colorLinks):"blue");M.target="_blank";M.title=((R&&R.hover)?R.hover:(H[L]+" (new window)"));M.appendChild(N);O.appendChild(M);if((R&&R.id||R&&R.hover||R&&R.idata)){var E=O.ownerDocument.createElement("img");E.style.height="16px";E.style.width="16px";E.src=M_S+"/icons/information.png";E.style.paddingLeft="2px";if(R&&R.id){E.title="Getting info...";D.id=R.id;E.id=R.id+"_i"}else{if(R&&R.idata){var G="";for(var K in R.idata){if(R.idata.hasOwnProperty(K)&&K!="thumb"){G=G+K.toUpperCase()+": "+R.idata[K]+" \n"}}E.title=G;M.title=G;if(R.idata.thumb&&F&&A&&A.parseReplaceImages){D.src=R.idata.thumb}}else{E.title=M.title}}O.appendChild(E)}}}}}}this.childRenderer.flush(O);this.pendingData=""}}ParserLinks.prototype=new ParserNothing();ParserLinks.thumbnailURL="http://go.mibbit.com/thumb.php";ParserLinks.regexp=/((http[s]?:\/\/|ftp:\/\/|irc:\/\/)([0-9a-zA-Z\$\-\#\~\_\.\+\!\*\'\[\]\{\}\|\\\^\`\,\/\%\;\:\@\&\?\=]+))|(.+?)/gi;function ParserSmileys(C,A){this.childRenderer=C;this.smileys=A.iconSmileys;this.prefs=A;var D="";for(var B=0;B<this.smileys.length;B++){var E=this.smileys[B].code;if(E!=""){D+="("+E.replace(/([\\\|\^\+\-\*\.\[\]\(\)\?\$\{\}\!\=\:])/g,"\\$1")+")|"}}this.re=new RegExp(D+"(.+?)","g");this.flush=function(K){var J=this.pendingData.match(this.re);if(J){for(var I=0;I<J.length;I++){if(J[I].length==1){this.childRenderer.addData(J[I])}else{this.childRenderer.flush(K);for(var H=0;H<this.smileys.length;H++){if(J[I]==this.smileys[H].code){var G=K.ownerDocument.createElement("img");G.style.border="0";G.style.height=(this.prefs.sizeSmiliesToText?"1em":(this.prefs.iconSmileysHeight?(this.prefs.iconSmileysHeight+"px"):""));G.style.width=(this.prefs.sizeSmiliesToText?"1em":(this.prefs.iconSmileysWidth?(this.prefs.iconSmileysWidth+"px"):""));G.src=this.prefs.iconSmileysBase+this.smileys[H].src;var F=K.ownerDocument.createElement("span");F.style.display="none";F.appendChild(K.ownerDocument.createTextNode(J[I]));F.onclick=function(M,L){return function(){var N=(M.style.display=="none");M.style.display=N?"inline":"none";L.style.display=N?"none":"inline";return false}}(G,F);G.onclick=F.onclick;K.appendChild(G);K.appendChild(F);break}}}}}this.childRenderer.flush(K);this.pendingData=""}}ParserSmileys.prototype=new ParserNothing();ParserSmileys.width=19;ParserSmileys.height=19;function ParserNicks(A,C,B){this.childRenderer=C;this.nicks=A;this.nickRendererCallback=B;this.flush=function(E){var D=this.pendingData.replace(/([^a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)([a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)([^a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)/g,function(F){return function(I,H,G,L){if(G&&F.nicks.hasOwnProperty(G.toLowerCase())&&F.nicks[G.toLowerCase()]){if(H){F.childRenderer.addData(H)}F.childRenderer.flush(E);var J=E.ownerDocument.createElement("span");F.nickRendererCallback(G.toLowerCase(),J);J.appendChild(E.ownerDocument.createTextNode(G));E.appendChild(J);if(L){F.childRenderer.addData(L)}}else{var K=(H?H:"")+(G?G:"")+(L?L:"");if(K!==""){F.childRenderer.addData(K)}}}}(this));this.childRenderer.flush(E);this.pendingData=""}}ParserNicks.prototype=new ParserNothing();function ParserChannels(C,B,A){this.childRenderer=B;this.flush=function(F){var E=this.pendingData.match(ParserChannels.regexp);if(E){for(var D=0;D<E.length;D++){if(E[D].length==1){this.childRenderer.addData(E[D])}else{this.childRenderer.flush(F);var G=F.ownerDocument.createElement("span");cp({color:A.colorChannels,cursor:"pointer",textDecoration:"underline",outline:"none"},G.style);G.onclick=function(H){return function(){C(H);return false}}(E[D]);G.appendChild(F.ownerDocument.createTextNode(E[D]));F.appendChild(G)}}}this.childRenderer.flush(F);this.pendingData=""}}ParserChannels.prototype=new ParserNothing();ParserChannels.regexp=/(\#([\S]+))|(.+?)/g;function ParserSimpleFormatter(A){this.childRenderer=A;this.flush=function(H){var G=this.pendingData.match(ParserSimpleFormatter.regexp);if(G){for(var B=0;B<G.length;B++){if(G[B].length==1){this.childRenderer.addData(G[B])}else{var D="none";var C=G[B].substring(0,1);var F=G[B].substring(G[B].length-1,G[B].length);if(G[B].length>2){if(C=="_"&&F=="_"){D="underline"}else{if(C=="*"&&F=="*"){D="bold"}else{if(C=="/"&&F=="/"){D="italic"}}}}if(D=="none"){this.childRenderer.addData(G[B])}else{this.childRenderer.flush(H);var E=H.ownerDocument.createElement("span");if(D=="italic"){E.style.fontStyle="italic"}if(D=="underline"){E.style.textDecoration="underline"}if(D=="bold"){E.style.fontWeight="bold"}E.appendChild(H.ownerDocument.createTextNode(G[B]));H.appendChild(E)}}}}this.childRenderer.flush(H);this.pendingData=""}}ParserSimpleFormatter.prototype=new ParserNothing();ParserSimpleFormatter.regexp=/([\/\_\*a-zA-Z0-9]+)|(.+?)/g;function ParserIRCColor(A){this.childRenderer=A;this.isBold=false;this.isUnderline=false;this.fColor=null;this.bColor=null;this.colors={0:"#ffffff",1:"#000000",2:"#000080",3:"#008000",4:"#ff0000",5:"#800040",6:"#800080",7:"#ff8040",8:"#ffff00",9:"#80ff00",10:"#008080",11:"#00ffff",12:"#0000ff",13:"#ff00ff",14:"#808080",15:"#c0c0c0"};this.output=function(C){var B=C;if(this.isBold||this.isUnderline||(this.fColor!==null)||(this.bColor!==null)){B=C.ownerDocument.createElement("span");if(this.isBold){B.style.fontWeight="bold"}if(this.isUnderline){B.style.textDecoration="underline"}if(this.fColor){B.style.color=this.fColor}if(this.bColor){B.style.background=this.bColor}C.appendChild(B)}this.childRenderer.flush(B)};this.reset=function(){this.isBold=false;this.isUnderline=false;this.fColor=null;this.bColor=null;this.partial="";this.pendingData="";if(this.childRenderer){this.childRenderer.reset()}};this.flush=function(I){var F=this.pendingData;for(var G=0;G<F.length;G++){var D=F.charAt(G);if(D=="\u0003"){var E="";var K=0;var L=0;var J=false;if(G+1<F.length){G++;for(;G<F.length;G++){var C=F.charAt(G);if(C>="0"&&C<="9"){if((!J&&K==2)||(J&&L==2)){G--;break}else{E=E+C;if(J){L++}else{K++}}}else{if(C==","){if(J){G--;break}E=E+C;J=true}else{G--;break}}}this.output(I);var B=E.split(",");var H=true;if(typeof (B[0])!="undefined"&&B[0]!==""){this.fColor=this.colors[parseInt(B[0],10)&15];H=false}if(typeof (B[1])!="undefined"&&B[1]!==""){this.bColor=this.colors[parseInt(B[1],10)&15];H=false}if(H){this.bColor=null;this.fColor=null}}}else{if(D=="\u0002"){this.output(I);this.isBold=!this.isBold}else{if(D=="\u001f"){this.output(I);this.isUnderline=!this.isUnderline}else{if(D=="\u000f"){this.output(I);this.reset()}else{this.childRenderer.addData(D)}}}}}this.output(I);this.pendingData=""}}ParserIRCColor.prototype=new ParserNothing();function ParserAnsiCodes(A){this.childRenderer=A;this.isBold=false;this.isUnderline=false;this.isItalic=false;this.fColor=null;this.bColor=null;this.colors={0:"#ffffff",1:"#000000",2:"#000080",3:"#008000",4:"#ff0000",5:"#800040",6:"#800080",7:"#ff8040",8:"#ffff00",9:"#80ff00",10:"#008080",11:"#00ffff",12:"#0000ff",13:"#ff00ff",14:"#808080",15:"#c0c0c0"};this.output=function(C){var B=C;if(this.isBold||this.isUnderline||(this.fColor!==null)||(this.bColor!==null)){B=C.ownerDocument.createElement("span");if(this.isBold){B.style.fontWeight="bold"}if(this.isUnderline){B.style.textDecoration="underline"}if(this.isItalic){B.style.fontStyle="italic"}if(this.fColor){B.style.color=this.fColor}if(this.bColor){B.style.background=this.bColor}C.appendChild(B)}this.childRenderer.flush(B)};this.reset=function(){this.isBold=false;this.isUnderline=false;this.isItalic=false;this.fColor=null;this.bColor=null;this.partial="";this.pendingData="";if(this.childRenderer){this.childRenderer.reset()}};this.flush=function(G){var B=this.pendingData;for(var D=0;D<B.length;D++){var E=B.charAt(D);if(E=="\u001b"){D++;if(D<B.length&&B.charAt(D)=="["){var F="";D++;while(D<B.length){var C=B.charAt(D);if(C=="m"){break}F=F+C;D++}}else{}}else{this.childRenderer.addData(E)}}this.output(G);this.pendingData=""}}ParserAnsiCodes.prototype=new ParserNothing();function ParserSimpleHTML(A){this.childRenderer=A;this.isBold=false;this.isUnderline=false;this.isItalic=false;this.fColor=null;this.bColor=null;this.output=function(C){var B=C;if(this.isBold||this.isUnderline||(this.fColor!==null)||(this.bColor!==null)){B=C.ownerDocument.createElement("span");if(this.isBold){B.style.fontWeight="bold"}if(this.isUnderline){B.style.textDecoration="underline"}if(this.isItalic){B.style.fontStyle="italic"}if(this.fColor){B.style.color=this.fColor}if(this.bColor){B.style.background=this.bColor}C.appendChild(B)}this.childRenderer.flush(B)};this.reset=function(){this.isBold=false;this.isUnderline=false;this.isItalic=false;this.fColor=null;this.bColor=null;this.partial="";this.pendingData="";if(this.childRenderer){this.childRenderer.reset()}};this.flush=function(L){var G=this.pendingData;for(var I=0;I<G.length;I++){var B=G.charAt(I);if(B=="<"){I++;if(I<G.length){var D="";var H=false;while(I<G.length){var J=G.charAt(I);if(J==">"){H=true;break}else{if(J=="<"){I--;break}}D=D+J;I++}if(H){var F=D.toLowerCase();var K=true;var C=F.indexOf(" ");if(C!=-1){F=F.substring(0,C)}if(F.substring(0,1)=="/"){F=F.substring(1,F.length);K=false}var E={"b":1,"i":1,"u":1,"fade":1,"alt":1,"snd":1,"font":1,"black":1,"blue":1,"cyan":1,"gray":1,"green":1,"pink":1,"purple":1,"orange":1,"red":1,"yellow":1};if(E[F]){if(F=="b"){isBold=K}if(F=="i"){isItalic=K}if(F=="u"){isUnderline=K}}else{this.childRenderer.addData("<"+D+">")}}else{this.childRenderer.addData("<"+D)}}else{}}else{this.childRenderer.addData(B)}}this.output(L);this.pendingData=""}}ParserSimpleHTML.prototype=new ParserNothing();function ParserTexFormatter(B,A){this.childRenderer=B;this.flush=function(G){var F=this.pendingData.match(ParserTexFormatter.regexp);if(F){for(var E=0;E<F.length;E++){if(F[E].length==1){this.childRenderer.addData(F[E])}else{this.childRenderer.flush(G);var D=G.ownerDocument.createElement("img");D.onload=A;D.src=ParserTexFormatter.texURL+encodeURIComponent(F[E].substring(3,F[E].length-3));D.title=F[E];G.appendChild(D);var C=G.ownerDocument.createElement("span");C.appendChild(G.ownerDocument.createTextNode(F[E]));C.style.display="none";G.appendChild(C);D.onclick=function(I,H){return function(){var J=(I.style.display=="none");I.style.display=J?"inline":"none";H.style.display=J?"none":"inline";return false}}(D,C);C.onclick=D.onclick}}}this.childRenderer.flush(G);this.pendingData=""}}ParserTexFormatter.prototype=new ParserNothing();ParserTexFormatter.regexp=/(\{\$\ .*? \$\})|(.+?)/g;ParserTexFormatter.texURL="http://go.mibbit.com/tex.php?";function ChatOutput(B,C,A){this.prefs=C;this.container=B;this.doc=B.ownerDocument;this.focusElement=A;this.output=[];this.table=this.doc.createElement("table");cp({tableLayout:"fixed",borderCollapse:"collapse",border:"0",width:"100%",height:"100%"},this.table.style);this.table.setAttribute("cellpadding","0");this.table.setAttribute("cellspacing","0");this.table.style.background=this.prefs.chatOutputBackground;this.container.appendChild(this.table);this.defaultChatLine={render:function(D){D.style.overflow="hidden";D.style.fontFamily="Arial, Helvetica, sans-serif";D.style.paddingBottom="1px";D.style.paddingTop="1px";D.style.paddingLeft="3px";D.style.fontSize="13px";D.style.borderTop="1px solid #c8c8ff";D.setAttribute("valign","top");D.appendChild(D.ownerDocument.createTextNode(" "));D.style.height="1em"},renderNick:function(D){D.style.background="#cad69f";D.style.fontFamily="Arial, Helvetica, sans-serif";D.style.fontSize="11px";D.style.borderRight="1px solid #888";D.appendChild(D.ownerDocument.createTextNode(" "))},renderTime:function(D){D.style.background="#e4eace";D.style.fontFamily="Arial, Helvetica, sans-serif";D.style.fontSize="11px";D.style.borderRight="1px solid #888";D.appendChild(D.ownerDocument.createTextNode(" "))}}}ChatOutput.prototype.clear=function(){while(this.table.rows.length>0){this.table.deleteRow(0);this.output.shift()}};ChatOutput.prototype.redraw=function(){this.table.style.background=this.prefs.chatOutputBackground;var A=this.output;this.output=[];while(this.table.rows.length>0){this.table.deleteRow(0)}for(var B=0;B<A.length;B++){if(A[B].r){this.addFullLine(A[B].id,A[B].r,A[B].cb)}else{if(A[B].chat){this.addLine(A[B].id,A[B].chat)}else{this.addMarker(A[B].id)}}}};ChatOutput.prototype.removeLines=function(A){var C=A+" ";for(var B=0;B<this.output.length;B++){if(this.output[B].id.substring(0,C.length)==C||this.output[B].id==A){this.table.deleteRow(B);this.output.splice(B,1);B--}}};ChatOutput.prototype.highlight=function(A,B){var D=A+" ";for(var C=0;C<this.output.length;C++){if(this.output[C].id.substring(0,D.length)==D||this.output[C].id==A){cp(B,this.output[C].echat.style)}}};ChatOutput.prototype.getcs=function(){var A=1;if(this.prefs.chatOutputShowTimes){A++}if(this.prefs.chatOutputShowNicks){A++}return A};ChatOutput.prototype.restrict=function(){var A=this.getcs();if(this.prefs.chatOutputMaxLines!=0){while(this.table.rows.length>0){if(this.table.rows[0].cells.length==A&&this.table.rows.length<this.prefs.chatOutputMaxLines){break}this.table.deleteRow(0);this.output.shift()}}};ChatOutput.prototype.addMarker=function(C){var A=this.table.insertRow(-1);this.output.push({id:""+C});var B=A.insertCell(-1);B.className="iescrollfix";B.colSpan=this.getcs();B.style.borderTop="1px solid red";this.restrict()};ChatOutput.prototype.addLine=function(E,D){var B=this.table.insertRow(-1);var G;var A;var C;if(this.prefs.chatOutputRTL){C=B.insertCell(-1);if(this.prefs.chatOutputShowNicks){A=B.insertCell(-1)}if(this.prefs.chatOutputShowTimes){G=B.insertCell(-1)}}else{if(this.prefs.chatOutputShowTimes){G=B.insertCell(-1)}if(this.prefs.chatOutputShowNicks){A=B.insertCell(-1)}C=B.insertCell(-1)}this.output.push({id:""+E,chat:D,echat:C});if(this.prefs.chatOutputShowTimes){G.style.width=this.prefs.chatOutputTimeWidth+"px";G.style.overflow="hidden";if(D&&D.renderTime){D.renderTime(G)}else{this.defaultChatLine.renderTime(G)}}function F(I,J,H){try{I.style[J]=H}catch(I){}}if(this.prefs.chatOutputShowNicks){A.style.width=this.prefs.chatOutputNickWidth+"px";A.style.overflow="hidden";F(A,"wordWrap","break-word");if(D&&D.renderNick){D.renderNick(A)}else{this.defaultChatLine.renderNick(A)}}C.className="iescrollfix";F(C,"whiteSpace","pre-wrap");F(C,"whiteSpace","-moz-pre-wrap");F(C,"whiteSpace","-pre-wrap");F(C,"whiteSpace","-o-pre-wrap");F(C,"wordWrap","break-word");if(D){D.render(C)}else{this.defaultChatLine.render(C)}this.restrict()};ChatOutput.prototype.addFullLine=function(F,E,H){var C=this.table.insertRow(-1);this.output.push({id:""+F,r:E,cb:H});var D=C.insertCell(-1);D.className="iescrollfix";D.colSpan=this.getcs();cp({borderTop:"1px solid "+this.prefs.chatPaneBorder,borderBottom:"1px solid "+this.prefs.chatPaneBorder,padding:"3px"},D.style);var A=this.doc.createElement("div");A.className="iescrollfix2";D.appendChild(A);E(A);var G=this.doc.createElement("div");G.className="iescrollfix2";G.style.textAlign="right";var B=this.doc.createElement("img");setPngSrc(B,"/gfx/close-win-red.png",12,12);B.style.marginRight="4px";B.border=0;B.title=DisplayStrings.get("ChatOutputRemove");B.style.cursor="pointer";B.onclick=function(I){return function(){try{I.removeLines(F);if(I.focusElement){I.focusElement()}if(H){H()}}catch(J){}return false}}(this);G.appendChild(B);D.appendChild(G);this.restrict()};ChatOutput.prototype.renderData=function(J,E,A,B,G,D,H,F,K){cp({overflow:"hidden",fontFamily:E.chatFontFamily,paddingBottom:(E.chatPaddingBottom+"px"),paddingTop:(E.chatPaddingTop+"px"),paddingLeft:"3px",fontSize:(E.chatFontSize+"px"),color:D,background:E.chatBackground},J.style);if(E.chatBackgroundLines!=""){J.style.borderTop="1px solid "+E.chatBackgroundLines}J.setAttribute("valign","top");if(E.chatOutputRTL){J.style.direction="rtl"}var C;if(!E.chatOutputShowNicks){C=J.ownerDocument.createElement("span");if(E.chatBackgroundHighlight){C.onmouseover=function(L){return function(){if(A){L.highlight(A.toLowerCase(),{background:E.chatBackgroundHighlight})}}}(this);C.onmouseout=function(L){return function(){if(A){L.highlight(A.toLowerCase(),{background:E.chatBackground})}}}(this)}if(G){C.onclick=function(){G(A)}}C.style.fontFamily=E.nickFontFamily;C.style.fontSize=E.nickFontSize+"px";C.style.color=B;if(A){C.appendChild(J.ownerDocument.createTextNode(E.chatOutputNickLeft+A+E.chatOutputNickRight))}}if(C&&!E.chatOutputRTL){J.appendChild(C)}if(F){try{H.reset();if(K){H.setMetaData(K)}H.addData(F);H.flush(J)}catch(I){if(DEBUG){log.log("Renderer","Render error "+I,DebugLevel.WARNING)}}}else{J.style.height="1em"}if(C&&E.chatOutputRTL){J.appendChild(C)}};ChatOutput.prototype.renderNick=function(E,D,A,C,B){cp({overflow:"hidden",fontFamily:D.nickFontFamily,paddingBottom:(D.chatPaddingBottom+"px"),paddingTop:(D.chatPaddingTop+"px"),paddingRight:"3px",fontSize:(D.nickFontSize+"px"),background:D.nickBackground,color:C},E.style);if(B){E.onclick=function(){B(A)}}if(D.chatBackgroundLines!=""){E.style.borderTop="1px solid "+D.nickBackground}if(D.nickBorderRight){if(D.chatOutputRTL){E.style.borderLeft="1px solid "+D.nickBorderRight}else{E.style.borderRight="1px solid "+D.nickBorderRight}}E.setAttribute("align",D.chatOutputRTL?"left":"right");E.setAttribute("valign",D.nickVerticalAlign);if(D.chatOutputRTL){E.style.direction="rtl"}E.appendChild(E.ownerDocument.createTextNode(A?A:" "));if(D.chatBackgroundHighlight){E.onmouseover=function(F){return function(){if(A){F.highlight(A.toLowerCase(),{background:D.chatBackgroundHighlight})}}}(this);E.onmouseout=function(F){return function(){if(A){F.highlight(A.toLowerCase(),{background:D.chatBackground})}}}(this)}};ChatOutput.prototype.renderTime=function(F,D,G){cp({overflow:"hidden",fontFamily:D.timeFontFamily,paddingBottom:(D.chatPaddingBottom+"px"),paddingTop:(D.chatPaddingTop+"px"),paddingLeft:"2px",fontSize:(D.timeFontSize+"px"),color:D.timeColor,background:D.timeBackground},F.style);if(D.chatBackgroundLines!=""){F.style.borderTop="1px solid "+D.timeBackground}if(D.timeBorderRight){if(D.chatOutputRTL){F.style.borderLeft="1px solid "+D.timeBorderRight}else{F.style.borderRight="1px solid "+D.timeBorderRight}}F.setAttribute("align",D.chatOutputRTL?"right":"left");F.setAttribute("valign",D.nickVerticalAlign);if(D.chatOutputRTL){F.style.direction="rtl"}function C(L,M,K){L=""+L;while(L.length<M){L=K+L}return L}var A=["January","February","March","April","May","June","July","August","September","October","November","December"];var J=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function E(L,K){K=K.replace(/%H/g,C(L.getHours(),2,"0"));K=K.replace(/%I/g,C((L.getHours()%12)||12,2,"0"));K=K.replace(/%k/g,C(L.getHours(),2," "));K=K.replace(/%l/g,C((L.getHours()%12)||12,2," "));K=K.replace(/%M/g,C(L.getMinutes(),2,"0"));K=K.replace(/%p/g,L.getHours()>11?"PM":"AM");K=K.replace(/%P/g,L.getHours()>11?"pm":"am");K=K.replace(/%S/g,C(L.getSeconds(),2,"0"));K=K.replace(/%Y/g,L.getFullYear());K=K.replace(/%y/g,C(L.getYear()%100,2,"0"));K=K.replace(/%m/g,C(L.getMonth()+1,2,"0"));K=K.replace(/%b/g,A[L.getMonth()].substring(0,3));K=K.replace(/%B/g,A[L.getMonth()]);K=K.replace(/%a/g,J[L.getDay()].substring(0,3));K=K.replace(/%A/g,J[L.getDay()]);K=K.replace(/%d/g,C(L.getDate(),2,"0"));K=K.replace(/%e/g,C(L.getDate(),2," "));K=K.replace(/%%/g,"%");return K}if(G){var H=new Date();H.setTime(G);var B=new Date();var I="";if(H.getYear()==B.getYear()&&H.getMonth()==B.getMonth()&&H.getDate()==B.getDate()){I=E(H,D.formatTime)}else{I=E(H,D.formatDate)}F.appendChild(F.ownerDocument.createTextNode(I))}else{F.appendChild(F.ownerDocument.createTextNode(" "))}};function ExtraContent(B,A){this.element=B;this.doc=B.ownerDocument;this.prefs=A}ExtraContent.prototype.showExtraContent=function(C,B){this.clear();var F=this.doc.createElement("div");cp({textAlign:"center",marginTop:"8px",marginBottom:"4px",fontSize:"15px",fontWeight:"bold"},F.style);var E=this.doc.createElement("span");cp({color:"#00f",cursor:"pointer",textDecoration:"underline"},E.style);E.onclick=function(G){return function(){G.clear();B();return false}}(this);E.appendChild(this.doc.createTextNode("Close"));if(C){var D=this.doc.createElement("a");D.style.color="#00f";D.href=C;D.target="_blank";D.appendChild(this.doc.createTextNode("Original"));F.appendChild(D);F.appendChild(this.doc.createTextNode(" | "))}F.appendChild(E);this.element.appendChild(F);var A=this.doc.createElement("div");this.element.appendChild(A);return A};ExtraContent.prototype.clear=function(){while(this.element.firstChild){this.element.removeChild(this.element.firstChild)}};ExtraContent.prototype.showWeb=function(C,A){var F=this.showExtraContent(C,A);var B=this.prefs.extraContentWidth;var D=Math.floor(B*240/320);var E=this.doc.createElement("iframe");E.style.width=B+"px";E.style.height=D+"px";F.appendChild(E);E.src=C};ExtraContent.prototype.showMap=function(C,B,D){var F=this.showExtraContent(B,D);if(GBrowserIsCompatible()){var I=this.prefs.extraContentWidth;var E=Math.floor(I*240/320);var H=this.doc.createElement("div");H.style.width=I+"px";H.style.height=E+"px";H.style.position="relative";F.appendChild(H);var A=new GMap2(H);var G=new GLatLng(C.lon,C.lat);A.setCenter(G,C.zoom);A.addOverlay(new GMarker(G));A.addControl(new GLargeMapControl())}};ExtraContent.prototype.showJustinTV=function(F,C,A){var E=this.showExtraContent(C,A);var B=this.prefs.extraContentWidth;var D=Math.floor(B*263/320);E.innerHTML='<object type="application/x-shockwave-flash" height="'+D+'" width="'+B+'" data="http://www.justin.tv/widgets/jtv_player.swf?channel='+F+'" bgcolor="#000000"><param name="allowFullScreen" value="true" /><param name="movie" value="http://www.justin.tv/widgets/jtv_player.swf" /><param name="flashvars" value="channel='+F+'&auto_play=true&start_volume=25" /></object>'};ExtraContent.prototype.showYouTube=function(F,C,A){var E=this.showExtraContent(C,A);var B=this.prefs.extraContentWidth;var D=Math.floor(B*344/425);E.innerHTML='<object width="'+B+'" height="'+D+'"><param name="movie" value="http://www.youtube.com/v/'+F+'&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'+F+'&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="'+B+'" height="'+D+'"></embed></object>'};function PasteBin(A){this.container=A;this.doc=A.ownerDocument;this.id=PasteBin.ID++;this.loaded=false;this.iframe=this.doc.createElement("iframe");if(this.iframe.attachEvent){this.iframe.attachEvent("onload",function(B){return function(){B.initIframe()}}(this))}else{this.iframe.addEventListener("load",function(B){return function(){B.initIframe()}}(this),false)}this.iframe.style.width="100%";this.iframe.style.height="100%";this.iframe.frameBorder="0";this.iframe.src="/e.html";A.appendChild(this.iframe)}PasteBin.prototype.initIframe=function(){this.idoc=this.iframe.contentDocument?this.iframe.contentDocument:(this.iframe.contentWindow?this.iframe.contentWindow.document:null);if(this.idoc!=null){try{this.idoc.designMode="on";this.loaded=true}catch(A){if(DEBUG){log.log("PasteBin","Can't set designMode",DebugLevel.WARNING)}}}else{if(DEBUG){log.log("PasteBin","Can't find doc...",DebugLevel.WARNING)}}};PasteBin.prototype.show=function(A){this.container.style.display=A?"block":"none";if(A){window.setTimeout(function(B){return function(){if(!B.loaded){B.initIframe()}B.iframe.contentWindow.focus()}}(this),100)}};PasteBin.prototype.showing=function(){return(this.container.style.display=="block")};PasteBin.prototype.value=function(){var A=this.idoc.body.innerHTML;A=A.replace(/<br>/gi,"\n");A=A.replace(/<p>/i,"");A=A.replace(/<p>/gi,"\n");A=A.replace(/<\/td>/gi,"\t");A=A.replace(/<\/tr>/gi,"\n");A=A.replace(/<\/pre>/gi,"\n");A=A.replace(/<.*?>/g,"");A=A.replace(/&nbsp;/gi," ");A=A.replace(/&lt;/gi,"<");A=A.replace(/&gt;/gi,">");A=A.replace(/&amp;/gi,"&");return A};function Uploader(C){this.container=C;this.doc=C.ownerDocument;C.style.background="transparent";C.style.textAlign="center";this.uploadiframe=this.doc.createElement("iframe");this.uploadiframe.style.marginTop="16px";this.uploadiframe.style.width="360px";this.uploadiframe.style.height="80px";this.uploadiframe.style.overflow="hidden";this.uploadiframe.style.margin="auto";this.uploadiframe.frameborder="0";this.uploadiframe.src="/upload.html";this.container.appendChild(this.uploadiframe);this.uploadProgress=this.doc.createElement("div");this.uploadProgress.style.background="green";this.uploadProgress.style.width="0px";this.uploadProgress.style.height="20px";var B=this.doc.createElement("div");B.style.background="#ccc";B.style.margin="auto";B.style.width="200px";B.style.height="20px";B.style.border="1px solid #444";B.style.marginTop="8px";B.style.textAlign="left";B.appendChild(this.uploadProgress);C.appendChild(B);this.uploadProgressText=this.doc.createTextNode("");var A=this.doc.createElement("div");A.style.marginTop="4px";A.style.fontSize="11px";A.style.color="#444";A.appendChild(this.uploadProgressText);C.appendChild(A);var D=this.doc.createElement("div");D.style.marginTop="4px";D.style.fontSize="11px";D.style.color="#844";D.appendChild(this.doc.createTextNode("Maximum of "+Uploader.FILE_LIMIT+"Mb allowed"));C.appendChild(D)}Uploader.prototype.reset=function(){this.uploadiframe.src="/upload.html";if(this.uploadProgress){this.uploadProgress.style.width="0px";this.uploadProgressText.nodeValue=""}};Uploader.FILE_LIMIT=4;Uploader.prototype.show=function(C,B){this.container.style.display=C?"block":"none";if(!C){this.reset()}else{var A=this.uploadiframe.contentDocument;if(!A){A=this.uploadiframe.contentWindow.document}if(A){var E=A.getElementById("upform");var D=A.getElementById("upfi");E.action="/upload/"+mysession;E.onsubmit=function(F){return function(){try{if(F&&F.files&&F.files.item(0)){if(F.files.item(0).fileSize>(Uploader.FILE_LIMIT*1024*1024)){alert("Sorry, but your limit is "+Uploader.FILE_LIMIT+"Mb. Stay tuned for premium accounts.");return false}}}catch(G){}return true}}(D);A.getElementById("upch").value=B}else{if(DEBUG){log.log("showUploader","contentDocument?",DebugLevel.WARNING)}}}};Uploader.prototype.showing=function(){return this.container.style.display=="block"};Uploader.prototype.showProgress=function(D,B,C){var A=D*2;this.uploadProgress.style.width=A+"px";this.uploadProgressText.nodeValue=B+"/"+C+" ("+D+"%)"};function helpRenderer(G){cp({overflow:"hidden",fontFamily:"Arial,Helvetica,sans-serif",paddingBottom:"1px",paddingTop:"1px",paddingLeft:"3px",fontSize:"13px",borderTop:"1px solid #c8c8ff"},G.style);G.setAttribute("valign","top");var J=G.ownerDocument;var A=J.createElement("table");cp({padding:"2px",border:"1px solid #444",background:"#cce",fontSize:"11px"},A.style);A.border=0;A.setAttribute("border","0");A.setAttribute("cellpadding","2");A.setAttribute("cellspacing","0");var I=A.insertRow(-1);cp({background:"#aac",borderBottom:"1px solid #444"},I.style);var H=I.insertCell(-1);H.setAttribute("colspan","2");H.colSpan="2";cp({fontWeight:"bold",fontSize:"13px",textAlign:"center"},H.style);H.appendChild(J.createTextNode("Mibbit help"));var D={"help":"Display this help","clear":"Clear the chat output in this channel","query nick [msg]":"Open a PM to a user, with an optional message","ignore nick":"Ignore the user in this channel","unignore nick":"Unignore the user in this channel","ulshow":"Show the user list","ulhide":"Hide the user list","showurl url":"Show a url/media next to the chat","pastebin":"Show the pastebin","upload":"Show the file uploader","server addr [nick]":"Connect to another server"};for(var B in D){if(D.hasOwnProperty(B)&&D.hasOwnProperty(B)){var F=A.insertRow(-1);var E=F.insertCell(-1);E.setAttribute("valign","top");E.appendChild(J.createTextNode("/"+B));E.style.color="green";E.style.paddingRight="2px";var K=F.insertCell(-1);K.setAttribute("valign","top");K.appendChild(J.createTextNode(D[B]));K.style.color="#444"}}var C=J.createElement("div");C.style.border="none";C.style.padding="5px";C.appendChild(A);G.appendChild(C)}function WhoisRenderer(C,B,A){return function(Y){Y.className="whoisdiv";Y.setAttribute("valign","top");var g=Y.ownerDocument;var F=g.createElement("table");F.border=0;F.setAttribute("border","0");F.setAttribute("cellpadding","0");F.setAttribute("cellspacing","0");cp({fontSize:B.chatFontSize+"px",width:"100%",background:"#bbb",border:"1px solid #222"},F.style);var E=F.insertRow(-1);E.style.borderBottom="1px solid #222";var O=E.insertCell(-1);O.colSpan="2";cp({fontWeight:"bold",fontSize:"17px",color:"#6cb12a",padding:"2px",background:"url(/gfx/bottom-bg.png)"},O.style);var V=g.createElement("img");V.style.marginRight="4px";setPngSrc(V,M_S+"/icons/magnifier.png",16,16);O.appendChild(V);O.appendChild(g.createTextNode("Whois "+C.nick+"?"));var c=F.insertRow(-1);var D=c.insertCell(-1);D.setAttribute("valign","top");D.style.borderRight="1px solid #222";D.style.width="64px";var h=g.createElement("img");h.style.margin="4px";setPngSrc(h,M_S+"/icons/user"+(C.mibbituser?"_green":"")+".png",64,64);D.appendChild(h);var Z=c.insertCell(-1);Z.setAttribute("valign","top");var W=g.createElement("table");Z.appendChild(W);var b={"nick":"Nickname","user":"Username","host":"Hostname","realip":"IP","realhost":"Host","idd":"Identified","realname":"Real name","away":"Away message","server":"Server","ssl":"SSL","modes":"Modes","help":"Help","operator":"Operator","serverinfo":"Server info","idle":"Idle time","channels":"Channels","client":"IRC Client"};for(var U in b){if(b.hasOwnProperty(U)&&C.hasOwnProperty(U)){var X=b[U];var H=W.insertRow(-1);var M=H.insertCell(-1);var G=H.insertCell(-1);M.setAttribute("valign","top");M.style.whiteSpace="nowrap";G.setAttribute("valign","top");M.appendChild(g.createTextNode(X+":"));M.style.color="#464";M.style.textAlign="right";M.style.paddingRight="2px";A.reset();A.addData(C[U]);A.flush(G)}}if(C.mibbituser){O.colSpan="3";Z.style.borderRight="1px solid #222";Z.style.width="45%";var M=c.insertCell(-1);M.setAttribute("valign","top");var R=g.createElement("table");M.appendChild(R);function f(m,l){var n=R.insertRow(-1);var j=n.insertCell(-1);var e=n.insertCell(-1);j.setAttribute("valign","top");j.appendChild(g.createTextNode(m+":"));j.style.color="#464";j.style.textAlign="right";j.style.paddingRight="2px";j.style.whiteSpace="nowrap";e.setAttribute("valign","top");e.style.color="#000";e.appendChild(g.createTextNode(l))}function Q(m,l){var n=R.insertRow(-1);var j=n.insertCell(-1);var e=n.insertCell(-1);j.setAttribute("valign","top");j.appendChild(g.createTextNode(m+":"));j.style.color="#464";j.style.textAlign="right";j.style.paddingRight="2px";j.style.whiteSpace="nowrap";e.setAttribute("valign","top");e.style.color="#000";var o=g.createElement("a");o.href=l;o.target="_blank";o.style.color="blue";o.appendChild(g.createTextNode(l));e.appendChild(o)}if(C.mibbitusername){f("Mibbit username",C.mibbitusername)}f("On Mibbit for",C.onlinetime);if(C.cc){f("Country:",C.cc)}if(C.ct&&C.tz){function L(e){return("00"+e).substr(-2)}var S=new Date(parseInt(C.ct));var K=L(S.getUTCHours())+":"+L(S.getUTCMinutes())+":"+L(S.getUTCSeconds());var J="+";if(C.tz<0){J="-";C.tz=-C.tz}var P=L(Math.floor(C.tz/60));var N=L(C.tz-(60*P));f("Local time:",K+" UTC"+J+P+N)}if(C.embed){f("Mibbit client","Widget")}if(C.premium){f("Premium","Yes")}if(C.profile){var T={"sex":"Sex","age":"Age","location":"Location","homepage":"Web site"};var I=JSON.parse(C.profile);for(var U in T){if(T.hasOwnProperty(U)&&I.hasOwnProperty(U)){if(U=="homepage"){Q(T[U],I[U])}else{f(T[U],I[U])}}}if(I.avatar){h.src=I.avatar}}}var d=g.createElement("div");d.style.border="none";d.style.padding="5px";d.appendChild(F);Y.appendChild(d)}}function GlobalMessageRenderer(B,A){return function(H){H.className="whoisdiv";H.setAttribute("valign","top");cp({overflow:"hidden",fontFamily:"Arial, Helvetica, sans-serif",paddingBottom:"1px",paddingTop:"1px",paddingLeft:"3px",fontSize:"13px",borderTop:"1px solid #c8c8ff"},H.style);var K=H.ownerDocument;var C=K.createElement("table");cp({border:"1px solid #222",background:"#bbb",width:"100%"},C.style);C.border=0;C.setAttribute("border","0");C.setAttribute("cellpadding","0");C.setAttribute("cellspacing","0");var J=C.insertRow(-1);J.style.borderBottom="1px solid #222";var I=J.insertCell(-1);cp({fontWeight:"bold",fontSize:"17px",color:"#ff0",padding:"2px",background:"url(/gfx/bottom-bg.png)"},I.style);var F=K.createElement("img");F.style.marginRight="4px";setPngSrc(F,M_S+"/icons/exclamation.png",16,16);I.appendChild(F);I.appendChild(K.createTextNode("Global message from Mibbit"));var G=K.createElement("span");G.style.fontSize="13px";G.style.color="#ddd";G.appendChild(K.createTextNode(" ("+(new Date()).toString()+")"));I.appendChild(G);var E=C.insertRow(-1);var L=E.insertCell(-1);L.style.padding="4px";L.style.fontSize="15px";A.reset();A.addData(B);A.flush(L);var D=K.createElement("div");D.style.border="none";D.style.padding="5px";D.appendChild(C);H.appendChild(D)}}function ChannelListRenderer(B,A){return function(H){H.style.overflow="hidden";H.style.fontFamily="Arial, Helvetica, sans-serif";H.style.paddingBottom="1px";H.style.paddingTop="1px";H.style.paddingLeft="3px";H.style.fontSize="13px";H.style.borderTop="1px solid #c8c8ff";H.setAttribute("valign","top");var K=H.ownerDocument;var C=K.createElement("table");C.border=0;C.style.borderCollapse="collapse";C.setAttribute("border","0");C.setAttribute("cellpadding","2");C.setAttribute("cellspacing","0");C.style.padding="2px";C.style.border="1px solid #888";C.style.background="#cce";C.style.fontSize="11px";C.style.width="100%";var J=C.insertRow(-1);J.style.background="#aac";J.style.borderBottom="1px solid #444";var I=J.insertCell(-1);I.setAttribute("colspan","3");I.colSpan="3";I.style.fontWeight="bold";I.style.fontSize="13px";I.style.textAlign="center";var L="Channel List";if(B.query){L+=" ("+B.query+")"}I.appendChild(K.createTextNode(L));for(var D=0;D<B.channels.length;D++){var G=C.insertRow(-1);var F=G.insertCell(-1);var N=G.insertCell(-1);var M=G.insertCell(-1);if(D!=0){F.style.borderTop="1px solid #888";N.style.borderTop="1px solid #888";M.style.borderTop="1px solid #888"}F.setAttribute("valign","top");N.setAttribute("valign","top");M.setAttribute("valign","top");A.reset();A.addData(B.channels[D].name);A.flush(F);F.style.paddingRight="2px";N.appendChild(K.createTextNode(B.channels[D].users));N.style.color="#444";A.reset();A.addData(B.channels[D].topic);A.flush(M)}var E=K.createElement("div");E.style.border="none";E.style.padding="5px";E.appendChild(C);H.appendChild(E)}}function BanListRenderer(C,B,A){return function(I){try{cp({overflow:"hidden",fontFamily:B.chatFontFamily,paddingBottom:(B.chatPaddingBottom+"px"),paddingTop:(B.chatPaddingTop+"px"),paddingLeft:"3px",fontSize:(B.chatFontSize+"px"),color:B.colorBan,background:B.chatBackground},I.style);if(B.chatBackgroundLines!=""){I.style.borderTop="1px solid "+B.chatBackgroundLines}I.setAttribute("valign","top");var H=I.ownerDocument;if(A){var F=H.createElement("img");setPngSrc(F,"/gfx/close-win-red.png",12,12);F.style.marginRight="4px";F.border=0;F.title="Remove ban";F.style.cursor="pointer";F.onclick=function(K){return function(){A(K);return false}}(C.mask);I.appendChild(F)}var J=H.createElement("span");J.appendChild(H.createTextNode(C.mask+" "));I.appendChild(J);var G=H.createElement("span");G.style.color="#888";G.appendChild(H.createTextNode(C.who+" "));I.appendChild(G);var D=new Date();D.setTime(C.ctime*1000);var E=H.createElement("span");E.style.color="#9c9";E.appendChild(H.createTextNode("("+D+") "));I.appendChild(E)}catch(I){if(DEBUG){log.log("BanListRenderer",I,DebugLevel.WARNING)}}}}function UserPrefs(){this.reset()}UserPrefs.settingsUserList=["userListColorNormal","userListColorTyping","userListColorInactive","userListMenuColor","userListMenuBackground","userListMenuBackgroundHover","userGroupColor","userGroupBackground","userListHover","ulistPaneBorder","ulistPaneBackground","userListSelected","userListWidth","userListPadding","userListGroups","userListSort","userListFontSize","userListFontFamily","userListMenuFontSize","userListMenuFontFamily","userGroupFontSize","userGroupFontFamily","userListMenuAutoCloseTime","doubleClickTime","doubleClickToPM","userListBoldOnChat","userListChattingTime","userListShowIcons","userListIconHeight","userListIconWidth","userListShowPrefixChars","userListModeIconHeight","userListModeIconWidth","userListShowSingleMode","userListShowModesLeft","userListModeSpacing","iconModeOwner","iconModeAdmin","iconModeOp","iconModeHalfop","iconModeVoice","ulicon_user","ulicon_mibbituser","ulicon_ignored","ulicon_ipod","ulicon_iphone","ulicon_wii","userListIconAlign","userListModeIconAlign","ulistPaneRounding"];UserPrefs.settingsChatInput=["chatInputBarBorder","chatInputBarBackground","chatInputColor","chatInputFontFamily","chatInputFontSize","chatInputBorder","chatInputBackground","chatInputSpacing","chatInputPadding","needSendButton","sendButtonBorder","sendButtonBackground","sendButtonColor","showInputOptions","colorInMenuSep","colorInMenu","colorInMenuActive","colorInLinks","colorInText","ioSmilies","ioColors","ioTranslation","ioPastebin","ioUpload","ioMinify","chatInputMenuFontFamily","chatInputMenuFontSize","chatInputRounding"];UserPrefs.settingsChatOutput=["chatOutputShowTimes","timeBorderRight","timeBackground","formatTime","timeFontFamily","timeFontSize","timeColor","chatOutputTimeWidth","formatDate","chatOutputShowNicks","nickBorderRight","nickBackground","chatOutputNickLeft","nickFontFamily","nickFontSize","nickColor","chatOutputNickWidth","chatOutputNickRight","nickColorMe","nickColorGuest","nickVerticalAlign","chatBackground","chatPaneBorder","chatPaneBackground","chatBackgroundHighlight","chatFontFamily","chatFontSize","chatPaddingTop","chatPaddingBottom","chatBackgroundLines","chatOutputBackground","chatOutputRTL","chatPaneRounding"];UserPrefs.settingsChatWindow=["infobarFontFamily","infobarFontSize","infobarPadding","infobarColor","infobarBackground","infobarBorder","infobarColorHighlight","infobarBackgroundHighlight","infobarBorderHighlight","cgmMargins","extraContentPosition","extraContentWidth","chatOutputMaxLines","showChannelUsers","showMarkers","noUListInChannels","tabColorServer","tabColorChannel","tabColorPM","tabBColorServer","tabBColorChannel","tabBColorPM"];UserPrefs.settingsSmileys=["iconSmileysBase","iconSmileysHeight","iconSmileysWidth","iconSmileys"];UserPrefs.settingsChatData=["colorChat","colorChatMe","colorEmote","colorEmoteMe","nickHighlight","nickHighlightMe","colorChatRecent","colorEmoteRecent","colorJoin","colorPart","colorBack","colorAway","colorKick","colorInvite","colorTopic","colorTopicWho","colorChangeNick","colorSystem","colorNotice","colorBan","colorUserMode","colorLinks","colorIRCLinks","colorChannels","parseSmilies","sizeSmiliesToText","parseChannels","parseLinks","parseNicks","parseColor","parseSimple","openLinksInExtra","parseReplaceImages","parseReplaceImagesWidth","parseReplaceImagesHeight","parseYouTubes","parseJustinTV","parseGoogleMaps","showJoinsParts","showAwaysBacks","showJoinInfo","showPartInfo","showBans","showUserModes","showMOTD","showRecentChat","parseTex"];UserPrefs.prototype.reset=function(){this.userListColorNormal="#008800";this.userListColorTyping="#ff0000";this.userListColorInactive="#66cc66";this.userListMenuColor="#444444";this.userListMenuBackground="#cad69f";this.userListMenuBackgroundHover="#e6e68f";this.userGroupColor="#eee";this.userGroupBackground="#444";this.userListHover="#d8d8d8";this.ulistPaneBorder="#51661c";this.ulistPaneBackground="#ffffff";this.userListSelected="#e4eace";this.userListWidth=140;this.userListPadding=0;this.userListGroups=[{def:"chatting",title:"Chatting",hideOnEmpty:true,startHidden:false},{def:"!chatting",title:"Idlers",hideOnEmpty:true,startHidden:true}];this.userListSort="chatting,owner,admin,op,halfop,voice,active";this.userListFontSize=13;this.userListFontFamily="Arial,Helvetica,sans-serif";this.userListMenuFontSize=11;this.userListMenuFontFamily="Arial,Helvetica,sans-serif";this.userGroupFontSize=13;this.userGroupFontFamily="Arial,Helvetica,sans-serif";this.userListMenuAutoCloseTime=3000;this.doubleClickTime=400;this.doubleClickToPM=true;this.userListBoldOnChat=true;this.userListChattingTime=600;this.userListShowIcons=true;this.userListIconHeight=16;this.userListIconWidth=16;this.userListShowPrefixChars=false;this.userListModeIconHeight=16;this.userListModeIconWidth=16;this.userListShowSingleMode=false;this.userListShowModesLeft=false;this.userListModeSpacing=2;this.iconModeOwner="/icons/mode_owner.png";this.iconModeAdmin="/icons/mode_admin.png";this.iconModeOp="/icons/mode_op.png";this.iconModeHalfop="/icons/mode_halfop.png";this.iconModeVoice="/icons/mode_voice.png";this.ulicon_user="/icons/user.png";this.ulicon_mibbituser="/icons/user_green.png";this.ulicon_ignored="/icons/user_gray.png";this.ulicon_ipod="/icons/user_ipod.png";this.ulicon_iphone="/icons/user_iphone.png";this.ulicon_wii="/icons/user_wii.png";this.userListIconAlign="bottom";this.userListModeIconAlign="bottom";this.ulistPaneRounding=0;this.chatInputBarBorder="#51661c";this.chatInputBarBackground="#cad69f";this.chatInputColor="#000000";this.chatInputFontFamily="Arial,Helvetica,sans-serif";this.chatInputFontSize=15;this.chatInputBorder="#cad69f";this.chatInputBackground="#eeeeee";this.chatInputSpacing=2;this.chatInputPadding=2;this.needSendButton=false;this.sendButtonBorder="#444488";this.sendButtonBackground="#ffffff";this.sendButtonColor="#000";this.showInputOptions=true;this.colorInMenuSep="#666666";this.colorInMenu="#444444";this.colorInMenuActive="#ff0000";this.colorInLinks="#0000ff";this.colorInText="#000000";this.ioSmilies=true;this.ioColors=true;this.ioTranslation=true;this.ioPastebin=true;this.ioUpload=true;this.ioMinify=true;this.chatInputMenuFontFamily="Arial,Helvetica,sans-serif";this.chatInputMenuFontSize=11;this.chatInputRounding=0;this.chatOutputShowTimes=true;this.timeBorderRight="#888888";this.timeBackground="#e4eace";this.formatTime="%H:%M";this.timeFontFamily="Arial,Helvetica,sans-serif";this.timeFontSize=11;this.timeColor="#444444";this.chatOutputTimeWidth=30;this.formatDate="%a";this.chatOutputShowNicks=true;this.nickBorderRight="#888888";this.nickBackground="#cad69f";this.chatOutputNickLeft="<";this.nickFontFamily="Arial,Helvetica,sans-serif";this.nickFontSize=11;this.nickColor="#0000ff";this.chatOutputNickWidth=110;this.chatOutputNickRight=">: ";this.nickColorMe="#224422";this.nickColorGuest="#008800";this.nickVerticalAlign="middle";this.chatBackground="#ffffff";this.chatPaneBorder="#51661c";this.chatPaneBackground="#ffffff";this.chatBackgroundHighlight="#ddeedd";this.chatFontFamily="Arial,Helvetica,sans-serif";this.chatFontSize=13;this.chatPaddingTop=1;this.chatPaddingBottom=1;this.chatBackgroundLines="#c8c8ff";this.chatOutputBackground="transparent";this.chatOutputRTL=false;this.chatPaneRounding=0;this.infobarFontFamily="Arial,Helvetica,sans-serif";this.infobarFontSize=15;this.infobarPadding=3;this.infobarColor="#000";this.infobarBackground="transparent";this.infobarBorder="";this.infobarColorHighlight="#444";this.infobarBackgroundHighlight="#ccc";this.infobarBorderHighlight="#444";this.cgmMargins=3;this.extraContentPosition="middle";this.extraContentWidth=400;this.chatOutputMaxLines=250;this.showChannelUsers=true;this.showMarkers=true;this.noUListInChannels=false;this.tabColorServer="#6cb12a";this.tabColorChannel="#e6f3ca";this.tabColorPM="#8c8c8c";this.tabBColorServer="#c0ffc0";this.tabBColorChannel="#cccccc";this.tabBColorPM="#cccccc";this.iconSmileysBase="/smileys/";this.iconSmileysHeight=19;this.iconSmileysWidth=19;this.iconSmileys=[{code:":)",src:"yel02.png"},{code:":-)",src:"yel02.png"},{code:":(",src:"yel36.png"},{code:":-(",src:"yel36.png"},{code:":D",src:"yel06.png"},{code:":-D",src:"yel06.png"},{code:":s",src:"yel07.png"},{code:":-s",src:"yel07.png"},{code:":/",src:"yel22.png"},{code:":-/",src:"yel22.png"},{code:":P",src:"yel40.png"},{code:":-P",src:"yel40.png"},{code:":p",src:"yel40.png"},{code:":-p",src:"yel40.png"},{code:":O",src:"yel54.png"},{code:":-O",src:"yel54.png"},{code:":o",src:"yel54.png"},{code:":-o",src:"yel54.png"},{code:";)",src:"yel08.png"},{code:";-)",src:"yel08.png"}];this.colorChat="#000000";this.colorChatMe="#000000";this.colorEmote="#cc4444";this.colorEmoteMe="#cc4444";this.nickHighlight="#668866";this.nickHighlightMe="#44aa44";this.colorChatRecent="#888888";this.colorEmoteRecent="#ee8888";this.colorJoin="#008800";this.colorPart="#880000";this.colorBack="#66cc66";this.colorAway="#cc6666";this.colorKick="#880000";this.colorInvite="#6666cc";this.colorTopic="#000088";this.colorTopicWho="#008888";this.colorChangeNick="#888800";this.colorSystem="#880000";this.colorNotice="#880000";this.colorBan="#2222cc";this.colorUserMode="#666622";this.colorLinks="#0000ff";this.colorIRCLinks="#ff0000";this.colorChannels="#008800";this.parseSmilies=true;this.sizeSmiliesToText=false;this.parseChannels=true;this.parseLinks=true;this.parseNicks=true;this.parseColor=true;this.parseSimple=true;this.parseTex=true;this.openLinksInExtra=false;this.parseReplaceImages=true;this.parseReplaceImagesWidth=32;this.parseReplaceImagesHeight=32;this.parseYouTubes=true;this.parseJustinTV=true;this.parseGoogleMaps=true;this.showJoinsParts=true;this.showAwaysBacks=true;this.showJoinInfo=false;this.showPartInfo=false;this.showBans=true;this.showUserModes=true;this.showMOTD=true;this.showRecentChat=true;this.tabColorGeneral="#bbd18a";this.tabColorYServer="#c0c0f3";this.tabBColorGeneral="#c0ffc0";this.tabBColorYServer="#c0c0f3";this.tabBackgroundColor="#000000";this.tabTextColor="#000000";this.tabTextColorInactive="#444444";this.tabTextColorActivityMe="#cc3333";this.tabTextColorActivity="#3333cc";this.tabTextColorArrows="#eeeeee";this.tabFontFamily="Arial,Helvetica,sans-serif";this.tabSpacing=4;this.tabPadding=3;this.tabFontSize=11;this.colorLinksWait="#aaaacc";this.useTabList=false;this.tabListWidth=160;this.ircNickClick=false;this.logPMs=false;this.logChannels=false;this.allowIncommingPMs=true;this.confirmServerClose=true;this.confirmUnload=true;this.autoAway=7200;this.autoAwayMessage="Auto away";this.autoBack=true;this.focusNewJoins=true;this.blurPMs=true;this.windowAlertPeriod=500;this.windowAlertMaxFlashes=3;this.noticesToActiveTab=true;this.errorsToActiveTab=true;this.language="en";this.inputHistorySize=250;this.allowChatRemoval=true;this.adScheme="mibbit";this.defaultCharset="UTF-8";this.showChannelTabUsers=true;this.tabIndividualCloses=false;this.autoconnects=[];this.aliases=[{match:"/j",command:"/join $1-"},{match:"/cs",command:"/msg ChanServ $1-"},{match:"/ns",command:"/msg NickServ $1-"},{match:"/ms",command:"/msg MemoServ $1-"},{match:"/os",command:"/msg OperServ $1-"},{match:"/bs",command:"/msg BotServ $1-"},{match:"/voice",command:"/mode # +v $1"},{match:"/unvoice",command:"/mode # -v $1"},{match:"/devoice",command:"/mode # -v $1"},{match:"/ban",command:"/mode # +b $1"},{match:"/unban",command:"/mode # -b $1"},{match:"/deban",command:"/mode # -b $1"},{match:"/op",command:"/mode # +o $1"},{match:"/unop",command:"/mode # -o $1"},{match:"/deop",command:"/mode # -o $1"},{match:"/halfop",command:"/mode # +h $1"},{match:"/unhalfop",command:"/mode # -h $1"},{match:"/dehalfop",command:"/mode # -h $1"},{match:"/admin",command:"/mode # +a $1"},{match:"/unadmin",command:"/mode # -a $1"},{match:"/deadmin",command:"/mode # -a $1"},{match:"/owner",command:"/mode # +q $1"},{match:"/unowner",command:"/mode # -q $1"},{match:"/deowner",command:"/mode # -q $1"}];this.filters=[{reg:"\\bmibbiturl\\b",replacement:"http://www.mibbit.com/chat/",replacein:true,replaceout:true,block:false}];this.usermenus=[{title:"PM",command:"/query $nick"},{title:"Whois",command:"/whois $nick"}];this.sounds={newpm:{sound:"/sounds/ribbit.mp3",enabled:false},ircdisconnect:{sound:"/sounds/beep1.mp3",enabled:false},mentionednick:{sound:"/sounds/beep2.mp3",enabled:false},newmsg:{sound:"/sounds/msg.wav",enabled:false},userjoin:{sound:"/sounds/join.wav",enabled:false},userpart:{sound:"/sounds/part.wav",enabled:false}}};UserPrefs.prototype.widget=function(){this.chatOutputShowTimes=false;this.showJoinsParts=false;this.showAwaysBacks=false;this.sizeSmiliesToText=true;this.chatOutputShowNicks=false;this.userListWidth=120;this.cgmMargins=2;this.tabSpacing=2;this.userListShowSingleMode=true;this.userListShowIcons=false;this.userListPadding=1;this.parseYouTubes=false;this.parseJustinTV=false;this.parseGoogleMaps=false;this.userListGroups=[{def:"",title:"",hideOnEmpty:true,startHidden:false}]};UserPrefs.prototype.set=function(B,A){if(this.hasOwnProperty(B)&&B.toLowerCase()!="autoconnects"){var C=typeof this[B];if(C=="number"){this[B]=parseInt(A)}else{if(C=="boolean"){this[B]=!!A}else{this[B]=A}}this.save();return B+" SET"}return"Unknown preference ("+B+")"};UserPrefs.prototype.removeAuto=function(A){this.autoconnects.splice(A,1)};UserPrefs.prototype.addAuto=function(A){this.autoconnects.push(A)};UserPrefs.prototype.cmpAO=function(B,A){if(B.length!=A.length){return false}for(var C=0;C<B.length;C++){for(var D in B[C]){if(B[C].hasOwnProperty(D)&&A[C].hasOwnProperty(D)){if(B[C][D]!==A[C][D]){return false}}}}return true};UserPrefs.prototype.save=function(C){if(DEBUG){log.log("UserPrefs","Saving prefs ("+JSON.stringify(this)+")")}var D={};for(a in DEFAULT_PREFS){if(DEFAULT_PREFS.hasOwnProperty(a)){if(a=="autoconnects"){if(this.autoconnects.length>0){D[a]=this[a]}}else{if(a=="iconSmileys"||a=="aliases"||a=="usermenus"||a=="filters"||a=="userListGroups"){if(!this.cmpAO(this[a],DEFAULT_PREFS[a])){D[a]=this[a]}}else{if(a=="sounds"){var B=false;for(var A in this.sounds){if(this.sounds.hasOwnProperty(A)){if(this.sounds[A].enabled!=DEFAULT_PREFS.sounds[A].enabled||this.sounds[A].sound!=DEFAULT_PREFS.sounds[A].sound){B=true;break}}}if(B){D[a]=this[a]}}else{if(DEFAULT_PREFS[a]!=this[a]){D[a]=this[a]}}}}}}if(DEBUG){log.log("UserPrefs","Saving diff ("+JSON.stringify(D)+")")}login.savePrefs(JSON.stringify(D));if(!C){this.tellListeners()}};UserPrefs.prototype.load=function(F,E){try{var D=JSON.parse(F);this.autoconnects=[];if(DEBUG){log.log("UserPrefs","Loading prefs ("+F+")",DebugLevel.INFO)}for(var B in D){var A=D[B];if(B=="autoconnects"){this.autoconnects=A;if(DEBUG){log.log("UserPrefs","Loading autos ("+this.autoconnects+") "+this.autoconnects.length,DebugLevel.INFO)}}else{if(B=="sounds"){cp(A,this[B])}else{if(this.hasOwnProperty(B)){if(A=="true"||A=="false"){A=(A=="true"?true:false)}this[B]=A}}}}}catch(C){if(DEBUG){log.log("UserPrefs",C,DebugLevel.WARNING)}}if(!E){this.tellListeners()}};UserPrefs.prototype.loadPrefs=function(A,B){for(var C=0;C<B.length;C++){if(A.hasOwnProperty(B[C])){this[B[C]]=A[B[C]]}else{this[B[C]]=DEFAULT_PREFS[B[C]]}}};UserPrefs.prototype.listeners=[];UserPrefs.prototype.addListener=function(A){this.listeners.push(A)};UserPrefs.prototype.tellListeners=function(){if(DEBUG){log.log("UserPrefs","Telling listeners...",DebugLevel.INFO)}for(var A=0;A<this.listeners.length;A++){try{this.listeners[A]()}catch(B){if(DEBUG){log.log("UserPrefs",B,DebugLevel.WARNING)}}}};var DEFAULT_PREFS=new UserPrefs();function CommsSend(B,A){this.URL=B;this.handlers=A;this.onerror=function(C){};this.xhr=CommsSend.createXHR();this.serverSendStatus=null;this.serverSendPackets=0;this.serverSendPacketData=0;this.serverSendRtime=null;this.serverSendTimer=null;this.sendQueue=[];this.retryTimer=null;this.seqno_send=0;this.totalSends=0;this.totalSendsSucceeded=0;this.totalSendsTime=0;this.totalSentPackets=0;this.totalSentBytes=0}CommsSend.BATCH_TIME=200;CommsSend.SEND_RETRY=5000;CommsSend.TIMEOUT_TIME=2*60*1000;CommsSend.MAX_POST_LEN=64000;CommsSend.createXHR=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(A){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){}}}}alert("Giving up :( Cannot create an XMLHTTP instance");return false};CommsSend.setHeaders=function(B){if(CommsSend.FULL_HEADERS){return }function A(D,C){try{B.setRequestHeader(D,C)}catch(E){}}A("User-Agent",null);A("Accept",null);A("Accept-Language",null);A("Content-Type","M;");A("Cookie",null);A("Connection","keep-alive");A("Keep-Alive",null)};CommsSend.prototype.sendServer=function(C){var B=JSON.stringify(C)+"\n";B='{"seq":'+this.seqno_send+","+B.substring(1,B.length);this.seqno_send++;var A=encodeURIComponent(B).replace(/%../g,"x").length;if(A>CommsSend.MAX_POST_LEN){this.onerror("That packet will never get through! Too big. (MAX_POST_LEN="+CommsSend.MAX_POST_LEN+")");return }this.sendQueue.push({data:B,size:A,stime:(new Date()).getTime()});if(this.serverSendStatus||this.retryTimer){return }this.retry(CommsSend.BATCH_TIME)};CommsSend.prototype.flushSend=function(){if(this.serverSendStatus||this.sendQueue.length===0){return }try{this.serverSendStatus="Sending...";this.xhr.abort();this.xhr.onreadystatechange=function(D){return function(){D.xhrChange()}}(this);try{this.xhr.onerror=function(D){return function(){D.xhrError()}}(this)}catch(C){}this.xhr.open("POST",this.URL+"-s"+((this.sessionid=="")?"":("-"+this.sessionid)),true);CommsSend.setHeaders(this.xhr);this.serverSendPacketData="";this.serverSendPackets=0;var B=0;for(var A=0;A<this.sendQueue.length;A++){if((B+this.sendQueue[A].size)>CommsSend.MAX_POST_LEN){break}this.serverSendPacketData+=this.sendQueue[A].data;this.serverSendPackets++;B+=this.sendQueue[A].size}this.onerror("Sending "+this.serverSendPackets+" packets... Length="+this.serverSendPacketData.length+" Size="+B);this.xhr.send(this.serverSendPacketData);this.serverSendRtime=(new Date()).getTime();this.serverSendTimer=window.setTimeout(function(D){return function(){D.onerror("Timer: retrying...");D.retry(CommsSend.SEND_RETRY)}}(this),CommsSend.TIMEOUT_TIME);this.totalSends++}catch(C){this.onerror("flushSend error: "+C);this.retry(CommsSend.SEND_RETRY)}};CommsSend.prototype.retry=function(A){this.onerror("Retry("+A+")");if(this.retryTimer){window.clearTimeout(this.retryTimer)}if(this.serverSendTimer){window.clearTimeout(this.serverSendTimer);this.serverSendTimer=null}if(this.xhr){try{this.xhr.abort()}catch(B){}}this.xhr=CommsSend.createXHR();this.serverSendStatus=null;this.retryTimer=window.setTimeout(function(C){return function(){C.retryTimer=null;C.flushSend()}}(this),A)};CommsSend.prototype.xhrError=function(){this.onerror("xhrError was called!");this.retry(CommsSend.SEND_RETRY)};CommsSend.prototype.xhrChange=function(){this.onerror("xhrChange...");try{if(this.xhr.readyState==4){if(this.xhr.status==200){try{if(this.handlers["psh"]){this.handlers["psh"](this.serverSendPackets)}}catch(C){}this.totalSentPackets+=this.serverSendPackets;for(var D=0;D<this.serverSendPackets;D++){this.sendQueue.shift()}this.serverSendPackets=0;window.clearTimeout(this.serverSendTimer);this.serverSendTimer=null;var B=(new Date()).getTime()-this.serverSendRtime;var A=this.xhr.responseText;this.handlers["recv"](A);this.totalSendsSucceeded++;this.totalSendsTime+=B;this.totalSentBytes+=this.serverSendPacketData.length}else{throw new Error("Server status "+this.xhr.status)}this.serverSendStatus=null;this.flushSend()}}catch(C){this.onerror("xhrChange Exception "+C);this.retry(CommsSend.SEND_RETRY)}};function CommsRecv(B,A){this.URL=B;this.sessionid="";this.startedTime=(new Date()).getTime();this.onerror=function(C){};this.handlers=A;this.channelHandlers=[];this.pendingPackets=[];this.xhr=CommsRecv.createXHR();this.xhrConnected=false;this.serverRecvStatus=null;this.serverRecvTimer=null;this.serverRecvRtime=null;this.recvQueue=[];this.seqno_recv=0;this.timeBlocked=null;this.sessionChanges=0;this.retryTimer=null;this.running=false;this.online=false;this.totalRequests=0;this.totalRequestsSucceeded=0;this.totalRequestsTime=0;this.totalRecvPackets=0;this.totalRecvBytes=0}CommsRecv.WAIT_TIME=10;CommsRecv.RECV_RETRY=5*1000;CommsRecv.TIMEOUT_TIME=150*1000;CommsRecv.MAX_TIME_BLOCKED=10*1000;CommsRecv.MAX_PACKETS_PROCESS=10;CommsRecv.PROCESS_PACKETS_DELAY=50;CommsRecv.prototype.reset=function(){this.sessionid=""};CommsRecv.prototype.stop=function(){this.stoppedTime=(new Date()).getTime();this.running=false;try{for(var A in this.channelHandlers){if(this.channelHandlers.hasOwnProperty(A)&&this.channelHandlers[A].close){this.channelHandlers[A].close()}}if(this.serverRecvStatus){this.xhr.abort()}var C=CommsRecv.createXHR();C.open("POST",this.URL+"-s"+((this.sessionid=="")?"":("-"+this.sessionid)),false);C.send('{"cmd":"shutdown"}\n')}catch(B){this.onerror("Shutdown failed "+B)}};CommsRecv.prototype.setOnline=function(C){if(C==this.online){return }for(var A in this.channelHandlers){if(this.channelHandlers.hasOwnProperty(A)){try{this.channelHandlers[A][C?"online":"offline"]()}catch(B){}}}this.online=C;try{this.handlers["ooh"](C)}catch(B){}};CommsRecv.createXHR=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(A){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){}}}}alert("Giving up :( Cannot create an XMLHTTP instance");return false};CommsRecv.prototype.start=function(){this.onerror("Starting...");this.running=true;this.sendRequest()};CommsRecv.prototype.pause=function(){this.onerror("Pausing...");this.running=false};CommsRecv.prototype.isRunning=function(){return this.running};CommsRecv.prototype.sendRequest=function(){if(this.sessionChanges>5){this.onerror("Session changes not sticking!");return }if(this.serverRecvStatus){return }this.onerror("Sending new request...");this.xhr=CommsRecv.createXHR();try{this.serverRecvStatus="Requesting...";this.xhrConnected=false;this.xhr.onreadystatechange=function(B){return function(){B.xhrChange()}}(this);try{this.xhr.onerror=function(B){return function(){B.xhrError()}}(this)}catch(A){}this.xhr.open("POST",this.URL+"-r"+((this.sessionid=="")?"":("-"+this.sessionid)),true);CommsSend.setHeaders(this.xhr);this.xhr.send("{}");this.serverRecvRtime=(new Date()).getTime();this.serverRecvTimer=window.setTimeout(function(B){return function(){B.onerror("Recv timed out");B.setOnline(false);B.retry()}}(this),CommsRecv.TIMEOUT_TIME);this.totalRequests++}catch(A){this.onerror("Exception when sending request: "+A);this.setOnline(false);this.retry()}};CommsRecv.prototype.retry=function(){if(this.retryTimer){window.clearTimeout(this.retryTimer)}if(this.serverRecvTimer){window.clearTimeout(this.serverRecvTimer);this.serverRecvTimer=null}this.serverRecvStatus=null;if(this.running){if(this.xhr){try{this.xhr.abort()}catch(A){}}this.xhr=CommsRecv.createXHR();this.retryTimer=window.setTimeout(function(B){return function(){B.retryTimer=null;B.sendRequest()}}(this),CommsRecv.RECV_RETRY)}};CommsRecv.prototype.xhrError=function(){this.onerror("xhrError was called!");this.setOnline(false);this.retry()};CommsRecv.prototype.xhrChange=function(){try{this.onerror("xhrChange "+this.xhr.readyState);if(this.xhr.readyState==4){window.clearTimeout(this.serverRecvTimer);this.serverRecvTimer=null;this.onerror("xhrChange status="+this.xhr.status);if(this.xhr.status==200){this.serverRecvStatus="Parsing response...";this.totalRequestsSucceeded++;var B=(new Date()).getTime()-this.serverRecvRtime;this.totalRequestsTime+=B;var A=this.xhr.responseText;var C=(this.sessionID!=="");try{this.parseResponse(A)}catch(E){}var F=(this.sessionID!=="");if(!C&&!F){this.onerror("Could not get session ID!");this.stop()}this.setOnline(true)}else{throw new Error("Status "+this.xhr.status)}this.serverRecvStatus=null;if(this.running){window.setTimeout(function(G){return function(){G.sendRequest()}}(this),CommsRecv.WAIT_TIME)}}else{if(this.xhr.readyState==1){this.xhrConnected=true}}}catch(E){var D=(new Date()).getTime()-this.serverRecvRtime;this.onerror("xhrChange "+E+" "+this.xhrConnected+" "+D);if(!this.xhrConnected||D<(5*1000)){this.setOnline(false)}this.retry()}};CommsRecv.prototype.addChannelHandler=function(A,B){this.channelHandlers[A]=B;if((typeof this.pendingPackets[A])!="undefined"){while(this.pendingPackets[A].length>0){B.recv(this.pendingPackets[A].shift())}delete this.pendingPackets[A]}};CommsRecv.prototype.removeChannelHandler=function(A){if(!this.channelHandlers[A]){return false}if(this.channelHandlers[A].close){this.channelHandlers[A].close()}delete this.channelHandlers[A];delete this.pendingPackets[A];return true};CommsRecv.prototype.parseResponse=function(response){if(!this.running){return }if(response){var lines=response.split("\n");this.totalRecvBytes+=response.length;for(var i=0;i<lines.length;i++){if(lines[i]!==""){this.totalRecvPackets++;var o;try{o=eval("("+lines[i]+")")}catch(e){this.onerror("parseResponse "+e+" "+lines[i])}if(o){this.recvQueue.push(o)}}}}this.processPackets()};CommsRecv.prototype.processPackets=function(){var E=0;while(this.recvQueue.length>0){if(E>CommsRecv.MAX_PACKETS_PROCESS){window.setTimeout(function(G){return function(){G.processPackets()}}(this),CommsRecv.PROCESS_PACKETS_DELAY);return }if(this.recvQueue[0].seq!=this.seqno_recv){this.recvQueue.sort(function(H,G){return H.seq-G.seq});while(this.recvQueue.length>0&&!this.recvQueue[0].sessionid&&this.recvQueue[0].seq<this.seqno_recv){this.onerror("Packet discarded:"+this.seqno_recv+" : "+this.recvQueue[0].seq);this.recvQueue.shift()}if(this.recvQueue.length==0){break}}if(this.timeBlocked&&((new Date()).getTime()-this.timeBlocked)>CommsRecv.MAX_TIME_BLOCKED){this.timeBlocked=null;this.onerror("Blocked timeout, packet loss:"+this.seqno_recv+" : "+this.recvQueue[0].seq)}else{var B=this.recvQueue[0];if(!B.sessionid&&B.seq!=this.seqno_recv){this.onerror("Waiting for packet no: "+this.seqno_recv);this.timeBlocked=(new Date()).getTime();break}}var D=this.recvQueue.shift();E++;this.seqno_recv=D.seq+1;try{if(D.sessionid){this.sessionChanges++;this.sessionid=D.sessionid;try{this.handlers["ssh"](this.sessionid)}catch(C){this.onerror("ProcessPackets.ssh "+C)}}else{this.sessionChanges=0}if(D.allchannels=="true"){for(var A in this.channelHandlers){if(this.channelHandlers.hasOwnProperty(A)){this.channelHandlers[A].recv(D)}}}else{if(D.channel){if(D.cmd=="close"){this.removeChannelHandler(D.channel)}else{if(this.channelHandlers[D.channel]){try{this.channelHandlers[D.channel].recv(D)}catch(C){}}else{var F=false;if(!this.pendingPackets[D.channel]){F=true;this.pendingPackets[D.channel]=[]}this.pendingPackets[D.channel].push(D);if(F){if(!this.handlers["nch"](D.channel,D)){delete this.pendingPackets[D.channel]}}}}}else{try{this.handlers["gph"](D)}catch(C){this.onerror("ProcessPackets.gph "+C)}}}}catch(C){this.onerror("ProcessPackets "+C+" "+D)}}};function IRCClient(){this.embeddedChannel=null;this.embeddedServer=null;this.EMBED_SHOW_NOTICES=true;this.premium=false;this.blurredChannels={};this.ignoredChannels={};this.servers={};this.channels={};this.embedChannel=function(B,D){try{var A="IRCClient:"+B+":"+D;if(DEBUG){log.log("embedChannel",A,DebugLevel.INFO)}var J=new ChatServer(null,"IRCClient:"+B,this,defaultPrefs);J.isEmbed=true;this.servers["IRCClient:"+B]=J;var F=document.getElementById("chats");var G=document.createElement("div");F.appendChild(G);fulltitle=D+" (channel)";var I=!(D.substring(0,1)=="#"||D.substring(0,1)=="&"||D.substring(0,1)=="!");var C=new ChatChannel(A,G,D,"IRCClient:"+B,J,I,defaultPrefs);C.cgm.mHandler.SHOWLOGMESSAGES=false;C.cgm.mHandler.SHOW_NOTICES=this.EMBED_SHOW_NOTICES;J.cgm=C.cgm;this.channels[A]=C;J.channels[A]=C;var H=I?{background:defaultPrefs.tabColorPM,border:defaultPrefs.tabBColorPM}:{background:defaultPrefs.tabColorChannel,border:defaultPrefs.tabBColorChannel};var E=tabs.addTab(A,G,D,fulltitle,function(K){return function(M,L){C.cgm.activecb(L)}}(this),null,H,false,false);if(defaultPrefs.focusNewJoins){this.channels[A].cgm.activecb(true)}this.channels[A].tab=E;rcomms.addChannelHandler(A,this.channels[A]);rcomms.addChannelHandler("IRCClient:"+B,J)}catch(F){if(DEBUG){log.log("embedChannel","Exception "+F,DebugLevel.WARNING)}}};this.recv=function(I){if(DEBUG){log.log("IRCClient.recv","p.cmd="+I.cmd,DebugLevel.FINE)}try{if(I.cmd=="connected"){if(alerts){alerts.notify({cmd:"connected"})}if(!this.premium&&!InfoBar.googlead){var F=document.body.clientWidth-((defaultPrefs.cgmMargins*3)+2+defaultPrefs.userListWidth);InfoBar.createGoogle(F,defaultPrefs)}InfoBar.setGoogleVisibility(true);var G="IRCClient:"+I.name;if(this.embeddedServer&&this.embeddedServer.toLowerCase()==I.name.toLowerCase()){this.embedChannel(I.name,this.embeddedChannel)}else{if(this.servers[G]){}else{var C=true;if(ISWIDGET){C=false}var P=document.getElementById("chats");var Q=document.createElement("div");Q.style.display=(C?"none":"block");P.appendChild(Q);var K=new ChatServer(Q,G,this,defaultPrefs);this.servers[G]=K;var N=I.name;if(I.network){N=I.network}var E=tabs.addTab(G,Q,N,"IRC server "+I.name,function(S){return function(U,T){K.cgm.activecb(T)}}(this),function(S){return function(){if(!K.connected||!defaultPrefs.confirmServerClose){S.reqDisconnectServer(I.name)}else{S.confirmCloseServer(I.name)}}}(this),{background:defaultPrefs.tabColorServer,border:defaultPrefs.tabBColorServer},C,true);this.servers[G].tab=E;rcomms.addChannelHandler(G,this.servers[G])}}}else{if(I.cmd=="confailed"){if(I.name!=""){this.showConnectFailed(I.name,I.reason)}}else{if(I.cmd=="blacklisted"){if(DEBUG){log.log("IRCClient.recv","BLACKLISTED",DebugLevel.WARNING)}this.handleBlacklisted()}else{if(I.cmd=="checkconnect"){if(DEBUG){log.log("IRCClient.recv","checkconnect "+I.allowed,DebugLevel.FINE)}this.handleCheckConnect(I.allowed)}else{if(I.cmd=="disconnected"){if(alerts){alerts.notify({cmd:"disconnected"})}InfoBar.setGoogleVisibility(false);if(DEBUG){log.log("IRCClient.recv",I,DebugLevel.FINE)}if(!I.force){this.showDisconnected(I.name,I.reason)}var B="IRCClient:"+I.name;if(this.servers[B]){rcomms.removeChannelHandler(B);this.servers[B].closed(!!I.reason&&!I.force);delete this.servers[B]}Sounds.alert("ircdisconnect")}else{if(I.cmd=="keyaccept"){tabs.removeLogo();Uploader.FILE_LIMIT=8;this.premium=true}else{if(I.cmd=="searchresults"){if(DEBUG){log.log("searchresults",I.queryID,DebugLevel.INFO)}if(currentQueries[I.queryID]){currentQueries[I.queryID].processResults(I)}else{var P=document.getElementById("chats");var A=document.createElement("div");var O=setupNewTab(A);var M=new SearchResults(A,I.queryID,I.keywords,I.serverName);currentQueries[I.queryID]=M;P.appendChild(A);tabs.addTab(".XX"+I.queryID,A,((typeof I.serverName!="undefined")?I.serverName:"")+"? '"+I.keywords+"'","Search for '"+I.keywords+"'",null,function(S){return function(){if(O!=null){O()}delete currentQueries[S];return true}}(I.queryID),{background:"bbd18a",border:"#c0ffc0"},false,true);currentQueries[I.queryID].processResults(I)}}else{if(I.cmd=="sysmsg"){if(DEBUG){log.log("server",I.data,DebugLevel.INFO)}}else{if(I.cmd=="status"){var J="";if(I.connections||I.pending){J="IRC: "}if(I.connections){J+=I.connections+" connection";if(I.connections>1){J+="s"}if(I.pending){J+=", "}}if(I.pending){J+=I.pending+" in progress."}setClientStatus(J);if(DEBUG){log.log("server","Status: "+I.pending+" "+I.connections,DebugLevel.INFO)}}else{if(I.cmd=="linkinfo"){if(DEBUG){log.log("IRCClient.recv","Link info: "+I,DebugLevel.INFO)}var R=document.getElementById(I.linkid);var D=document.getElementById(I.linkid+"_i");if(R&&D){var H="";if(I.followed){H=I.followed}else{for(var L in I.idata){if(I.idata.hasOwnProperty(L)&&L!="thumb"){H=H+L.toUpperCase()+": "+I.idata[L]+" \n"}}}R.title=H;R.style.color=defaultPrefs.colorLinks;D.title=H;if(I.idata.thumb){R.src=I.idata.thumb}}else{if(DEBUG){log.log("IRCClient.recv","Link not found :/ "+I.linkid,DebugLevel.WARNING)}}}else{if(DEBUG){log.log("IRCClient.recv",I,DebugLevel.FINE)}}}}}}}}}}}}catch(P){if(DEBUG){log.log("IRCClient.recv","exception "+I+":"+P,DebugLevel.WARNING)}}};this.notifyServersDisconnect=function(){if(DEBUG){log.log("IRCClient.notifyServersDisconnect","notifyServersDisconnect",DebugLevel.INFO)}Sounds.alert("ircdisconnect");try{for(rname in this.servers){if(this.servers.hasOwnProperty(rname)){this.servers[rname].disconnected()}}}catch(A){if(DEBUG){log.log("IRCClient.notifyServersDisconnect","exception ",DebugLevel.WARNING)}}};this.notifyServersDisconnectClear=function(){Sounds.alert("ircdisconnect");for(rname in this.servers){if(this.servers.hasOwnProperty(rname)){this.servers[rname].closed(false)}}this.servers={}};this.globalID=0;this.sendGlobal=function(B){var C="GLOB"+this.globalID;this.globalID++;var A=function(D){return function(){for(rname in D.servers){if(D.servers.hasOwnProperty(rname)){D.servers[rname].removeGlobal(C)}}}}(this);for(rname in this.servers){if(this.servers.hasOwnProperty(rname)){this.servers[rname].showGlobal(C,B,A)}}};this.sendAll=function(A){for(rname in this.servers){if(this.servers.hasOwnProperty(rname)){this.servers[rname].sendChannels(A);if(!this.servers[rname].isEmbed){this.servers[rname].recv(A)}}}};this.closedChannel=function(A){if(DEBUG){log.log("closedchannel","Added ignore for : "+A,DebugLevel.INFO)}this.ignoredChannels[A]=true};this.confirmClosedChannel=function(A){if(DEBUG){log.log("closedchannel","Removed ignore for : "+A,DebugLevel.INFO)}delete this.ignoredChannels[A]};this.prefsUpdated=function(){if(DEBUG){log.log("IRCClient.prefsUpdated","prefsUpdated",DebugLevel.INFO)}for(var A in this.channels){if(this.channels.hasOwnProperty(A)){this.channels[A].prefsUpdated();var B=this.channels[A].ispm;this.channels[A].tab.newSettings({background:(B?defaultPrefs.tabColorPM:defaultPrefs.tabColorChannel),border:(B?defaultPrefs.tabBColorPM:defaultPrefs.tabBColorChannel)})}}for(var A in this.servers){if(this.servers.hasOwnProperty(A)){this.servers[A].prefsUpdated();this.servers[A].tab.newSettings({background:defaultPrefs.tabColorServer,border:defaultPrefs.tabBColorServer})}}}}IRCClient.prototype.reqDisconnectServer=function(B){var C="IRCClient:"+B;if(this.servers[C].connected){var A={channel:"IRCClient",cmd:"disconnect"};A.data=B;scomms.sendServer(A)}else{if(this.servers[C]){this.servers[C].closed(false);delete this.servers[C]}}};IRCClient.prototype.getHints=function(){var B={};for(var E in this.channels){if(this.channels.hasOwnProperty(E)&&!this.channels[E].ispm){var A=E.split(/\W/g);for(var C=0;C<A.length;C++){if(A[C]!=""&&A[C]!="IRCClient"){B[A[C]]=1}}}}var D="";if(Math.random()>0.8){D="chat"}if(Math.random()>0.8){D="webchat"}for(var E in B){if(B.hasOwnProperty(E)){if(Math.random()>0.8){if(D!=""){D+=","}D+=E}else{if(Math.random()>0.8){if(D!=""){D=","+D}D=E+D}}}}return D};IRCClient.prototype.handleCheckConnect=function(A){};IRCClient.prototype.handleBlacklisted=function(){alert("Your IP address is listed in a blacklist. You may have a virus, trojan or be running an open proxy.\nYou will now be redirected to dronebl.org for more information.");window.location="http://dronebl.org/lookup"};IRCClient.prototype.confirmCloseServer=function(A){if(window.confirm("Are you sure you want to disconnect from "+A+"?")){this.reqDisconnectServer(A)}};IRCClient.prototype.showConnectFailed=function(B,A){if(A){alert(B+": "+A)}};IRCClient.prototype.showDisconnected=function(B,A){if(A){alert(B+": "+A)}};IRCClient.prototype.connectServer=function(H,A,I,F,B,J,D,E){try{var C={channel:"IRCClient",cmd:"connect"};if(H.substring(0,1)=="!"){C.proxied=true;H=H.substring(1,H.length);if(!commsHandler){JavaComms.loadApplet()}}C.data=H;C.nick=A;C.pass=I;C.authmethod=D;if(!F&&F!=""){F=""}C.joinchannels=F;if(E){C.charset=E}if(J){C.forced=true}if(B){C.authkey=B}if(DEBUG){log.log("connect",C,DebugLevel.INFO)}scomms.sendServer(C)}catch(G){if(DEBUG){log.log("irc.connectServer","exception "+G,DebugLevel.WARNING)}}};IRCClient.prototype.newCHandler=function(A,I){try{if(I.cmd=="typing"){return false}if(this.channels[A]){return false}for(ii in rcomms.channelHandlers){if(rcomms.channelHandlers.hasOwnProperty(ii)){if(ii.toLowerCase()==A.toLowerCase()){rcomms.channelHandlers[ii].recv(I);return false}}}if(this.ignoredChannels[A]){if(DEBUG){log.log("newCHandler","Ignored : "+A,DebugLevel.INFO)}return false}if(I.cmd=="part"){return false}if(I.cmd=="infobar"){return false}var E=!!this.blurredChannels[A];var J=(I.channeltype=="pm");if(J&&!defaultPrefs.allowIncommingPMs){if(DEBUG){log.log("newCHandler","Ignored PM : "+A,DebugLevel.INFO)}return false}if(J&&defaultPrefs.blurPMs){E=true}if(!J&&!defaultPrefs.focusNewJoins){E=true}if(J&&I.userInitiated){E=false}var G=document.getElementById("chats");var H=document.createElement("div");if(E){H.style.display="none"}G.appendChild(H);if(!E){tabs.closeAll()}if(I.channeltype=="log"){}else{fulltitle=J?(A+"(pm)"):(A+" (channel)");var K=A;var F=A.indexOf(":",10);if(F){K=K.substring(0,F)}var B=this.servers[K];var C=new ChatChannel(A,H,I.localchannel,K,B,J,defaultPrefs);this.channels[A]=C;B.channels[A]=C;var D=tabs.addTab(A,H,I.localchannel,fulltitle,function(L){return function(N,M){C.cgm.activecb(M)}}(this),function(L){return function(M){if(L.channels[M]){L.channels[M].part()}return true}}(this),{background:(J?defaultPrefs.tabColorPM:defaultPrefs.tabColorChannel),border:(J?defaultPrefs.tabBColorPM:defaultPrefs.tabBColorChannel)},E,true);if(J||defaultPrefs.focusNewJoins){if(!E){this.channels[A].cgm.activecb(true)}}this.channels[A].tab=D;if(E){D.active()}rcomms.addChannelHandler(A,this.channels[A]);if(J){Sounds.alert("newpm")}}}catch(G){if(DEBUG){log.log("newCHandler","Exception "+G,DebugLevel.WARNING)}}return true};IRCClient.prototype.processServerCmd=function(D){var A=D.split(" ");try{var C={channel:"IRCClient",cmd:"connect"};C.data=A[0];C.nick=getRandomNick();if(myuser){C.nick=myuser}if(A[1]){C.nick=A[1]}C.pass="";C.authmethod="";C.joinchannels="";if(DEBUG){log.log("connect","to "+C.data+" nick="+C.nick+" pass="+C.pass+" authmethod="+C.authmethod,DebugLevel.INFO)}scomms.sendServer(C)}catch(B){if(DEBUG){log.log("irc.connectServer","exception "+B,DebugLevel.WARNING)}}};IRCClient.prototype.parseURL=function(A){var F={};var K=false;var G=false;if(A.search(/^(ircs?:\/\/)$/i)!=-1){return null}F.ssl=(A.search(/^(ircs:)/i)!=-1);F.port=F.ssl?9999:6667;var J=A.match(/^ircs?:\/\/([^\/\s]+)?(\/[^\s]*)?$/i);if(!J||!J[1]){return null}var M=J[1];var B="";if(typeof J[2]!="undefined"){B=J[2]}J=M.match(/^([^\:]+)(\:\+?\d+)?$/);if(!J){return null}F.host=J[1].toLowerCase();if(typeof J[2]!="undefined"){K=true;F.port=J[2].substr(1);if(F.port.substring(0,1)=="+"){F.port=F.port.substr(1);F.ssl=true}}else{if(F.host.indexOf(".")!=-1){K=true}}if(!K){var H=IRCClient.IRCNetworks[F.host.toLowerCase()];if(!H){return null}if(F.ssl&&H.serverssl){F.host=H.serverssl.host;F.port=H.serverssl.port}else{if(!F.ssl&&H.server){F.host=H.server.host;F.port=H.server.port}else{return null}}}if(B){J=B.match(/^\/([^\?\s\/,]*)?\/?(,[^\?]*)?(\?.*)?$/);if(!J){return null}if(typeof J[1]!="undefined"){F.target=decodeURIComponent(J[1])}else{F.target=""}if(F.target.search(/[\x07,\s]/)!=-1){return null}if(typeof J[2]!="undefined"){var E=J[2].toLowerCase().split(",");while(E.length){var C=E.pop();if(C==""){continue}if(C=="isnick"){G=true}else{if(C=="isserver"){F.isServer=true}else{if(C=="needpass"){F.needPass=true}else{if(C=="needkey"){if(!G){F.needKey=true}}else{}}}}}}if(!G&&"#&+".indexOf(F.target.substring(0,1))==-1){F.target="#"+F.target}if(typeof J[3]!="undefined"){var I=J[3].substr(1).split("&");while(I.length){var L=I.pop().split("=");var D=L[0].toLowerCase();if(D=="msg"){F.msg=decodeURIComponent(L[1])}else{if(D=="pass"){F.needPass=true;F.pass=decodeURIComponent(L[1])}else{if(D=="key"){if(!G){F.needKey=true;F.key=decodeURIComponent(L[1])}}else{if(D=="charset"){F.charset=decodeURIComponent(L[1])}}}}}}}return F};IRCClient.IRCNetworks={mibbit:{server:{host:"irc.mibbit.com",port:6667},serverssl:{host:"irc.mibbit.com",port:6697}},moznet:{server:{host:"irc.mozilla.org",port:6667},serverssl:{host:"irc.mozilla.org",port:6697}},hybridnet:{server:{host:"irc.ssc.net",port:6667}},slashnet:{server:{host:"irc.slashnet.org",port:6667}},dalnet:{server:{host:"irc.dal.net",port:6667}},undernet:{server:{host:"irc.undernet.org",port:6667}},webbnet:{server:{host:"irc.webbnet.info",port:6667}},quakenet:{server:{host:"irc.quakenet.org",port:6667}},ircnet:{server:{host:"irc.open-ircnet.net",port:6667}},freenode:{server:{host:"irc.freenode.net",port:6667}},serenia:{serverssl:{host:"irc.serenia.net",port:9999}},efnet:{server:{host:"irc.prison.net",port:6667}},hispano:{server:{host:"irc.irc-hispano.org",port:6667}}};IRCClient.SupportedCharsets=["UTF-8","Big5","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-13","ISO-8859-15","windows-1250","windows-1251","windows-1252","windows-1253","windows-1254","windows-1255","windows-1256","windows-1257","windows-1258"];function Aliases(){this.aliases=[]}Aliases.prototype.clear=function(){this.aliases=[]};Aliases.prototype.load=function(A){this.aliases=[];for(var B=0;B<A.length;B++){this.aliases.push(new Alias(A[B]))}};Aliases.prototype.match=function(B,G,D,A,C){try{for(var E=0;E<this.aliases.length;E++){if(this.aliases[E].exec(B,G,D,C)){return }}}catch(F){if(DEBUG){log.log("aliases","Issue running match "+F,DebugLevel.INFO)}}if(A){A()}};Aliases.prototype.prompt=function(B,A){if(A){A("")}};function Alias(A){this.aliasname=A.match;this.commands=A.command.split(/\s\|\s/)}Alias.prototype.handleSpace=function(B,A,C){if(B==""){return C}return B+(A?" ":"")+C};Alias.prototype.execCommand=function(B,I,J,Q,A,P,E){for(var S=P;S<this.commands.length;S++){var O=this.commands[S].split(/\s/);var N=A;var G=true;A="";for(var F=E;F<O.length;F++){var D=O[F];if(F==0&&D.toLowerCase()=="/say"){}else{if(D.match(/^\#?\$?\$\d+$/)){var L=D.match(/^\#?\$?\$(\d+)$/)[1];if(L>I.length||L<1){if(D.match(/^\#?\$\$/)){N="";break}return false}N=this.handleSpace(N,G,(D.substring(0,1)=="#"?"#":"")+I[L-1]);G=true}else{if(D.match(/^\$\d+\-\d+$/)){var K=D.match(/^\$(\d+)\-(\d+)$/);var L=K[1];var M=K[2];if(L>I.length||M>I.length||M<L||L<1||M<1){return false}for(var H=L;H<=M;H++){N=this.handleSpace(N,G,I[H-1]);G=true}}else{if(D.match(/^\$\d+\-$/)){var L=D.match(/^\$(\d+)\-$/)[1];if(L>I.length||L<1){return false}for(var H=L;H<=I.length;H++){N=this.handleSpace(N,G,I[H-1]);G=true}}else{if(D=="#"){N=this.handleSpace(N,G,B.channel);G=true}else{if(D.match(/^\$me([\.\,\!\?]?)/i)){var R=D.match(/^\$me([\.\,\!\?]?)/i);N=this.handleSpace(N,G,B.nick+R[1]);G=true}else{if(D=="$?"){var C=function(T){return function(U){N=T.handleSpace(N,G,U);T.execCommand(B,I,J,Q,N,S,F+1)}}(this);Aliases.prototype.prompt(this.aliasname,C);return true}else{if(D=="$+"){G=false}else{N=this.handleSpace(N,G,D);G=true}}}}}}}}}if(N!=""){J(N)}E=0}if(Q){Q()}return false};Alias.prototype.exec=function(D,C,A,B){var E=D.split(/\s/);if(this.aliasname&&E.length>0&&E[0].toLowerCase()==this.aliasname){E.shift();this.execCommand(C,E,A,B,"",0,0);return true}return false};function Filters(){this.filters=[]}Filters.prototype.load=function(C){this.filters=[];for(var B=0;B<C.length;B++){try{var A=new RegExp(C[B].reg,"g");this.filters.push({reg:C[B].reg,replacement:C[B].replacement,replacein:C[B].replacein,replaceout:C[B].replaceout,block:C[B].block})}catch(D){}}};Filters.prototype.apply=function(D,C){for(var B=0;B<this.filters.length;B++){if((C&&this.filters[B].replacein)||(!C&&this.filters[B].replaceout)){var A=new RegExp(this.filters[B].reg,"g");if(this.filters[B].block){if(A.test(D)){return false}}else{D=D.replace(A,this.filters[B].replacement)}}}return D};function ChatChannel(J,I,C,A,F,D,B,N){if(DEBUG){log.log("ChatChannel","ch="+J+", chan="+C+", sname="+A+", sobj="+F,DebugLevel.INFO)}this.uchannel=J;this.channel=C;this.serverName=A;this.server=F;this.ispm=D;this.connected=true;this.prefs=B;this.typing=false;this.isAdmin=false;this.translate=false;this.translateFromLanguage="";this.translateToLanguage="";this.formatter=new ChatFormatter();I.style.background=(D?this.prefs.tabColorPM:this.prefs.tabColorChannel);function K(P){return function(Q){if(P.tab){P.tab.active(Q)}if(alerts){alerts.alert(Q?DisplayStrings.get("AlertsMyName"):DisplayStrings.get("AlertsGeneral"))}}}function M(P){return function(Q){P.server.send({cmd:"text",chan:this.channel,data:"/join "+Q})}}function G(P){return function(Q){if(P.typing){if(Q==""||(Q.substring(0,1)=="/"&&Q.substring(0,2)!="//")){P.setTyping(false)}}else{if(Q!=""&&(Q.substring(0,1)!="/"||Q.substring(0,2)=="//")){P.setTyping(true)}}}}function O(P){return function(U,V){if(V.substring(0,8)=="usermenu"){var Q=parseInt(V.substring(8,V.length));if(P.prefs.usermenus[Q]){var T=P.prefs.usermenus[Q].command;T=T.replace(/\$nick/g,U);var S=P.cgm.mHandler.userDetails[U.toLowerCase()];if(S){if(S.user){T=T.replace(/\$user/g,S.user)}if(S.host){T=T.replace(/\$host/g,S.host)}}var W=new Alias({command:T,match:P.prefs.usermenus[Q].title});var X={channel:P.channel,nick:P.server.nickname};if(W.execCommand(X,[],function(){return function(Z){P.processInput(Z)}}(),function(){return function(){P.cgm.focus()}}(),"",0,0)){return }}}else{if(V=="banu"){var S=P.cgm.mHandler.userDetails[U.toLowerCase()];if(S&&S.user){P.server.send({cmd:"text",chan:P.channel,data:"/mode "+P.channel+" +b "+S.user+"@*"});P.server.send({cmd:"text",chan:P.channel,data:"/kick "+U})}}else{if(V=="banh"){var S=P.cgm.mHandler.userDetails[U.toLowerCase()];if(S&&S.host){P.server.send({cmd:"text",chan:P.channel,data:"/mode "+P.channel+" +b *@"+S.host});P.server.send({cmd:"text",chan:P.channel,data:"/kick "+U})}}else{if(V=="ignore"){P.cgm.setIgnoreUser(U,true)}else{if(V=="unignore"){P.cgm.setIgnoreUser(U,false)}else{if(V=="getoptions"){var R=[];for(var Q=0;Q<P.prefs.usermenus.length;Q++){var Y={id:"usermenu"+Q,desc:P.prefs.usermenus[Q].title};R.push(Y)}if(P.isAdmin){if(P.cgm.mHandler.userDetails[U.toLowerCase()]){var S=P.cgm.mHandler.userDetails[U.toLowerCase()];if(S.mibbituser=="true"){if(S.user!="Mibbit"){if(S.user){R.push({id:"banu",desc:"Ban "+S.user+"@*"})}}else{if(S.host){R.push({id:"banh",desc:"Ban *@"+S.host})}}}else{if(S.user){R.push({id:"banu",desc:"Ban "+S.user+"@*"})}if(S.host){R.push({id:"banh",desc:"Ban *@"+S.host})}}}}if(P.cgm.isIgnored(U)){R.push({id:"unignore",desc:DisplayStrings.get("UMenu_Unignore")})}else{R.push({id:"ignore",desc:DisplayStrings.get("UMenu_Ignore")})}return R}}}}}}P.cgm.focus()}}function L(P){return function(Q){P.formatter.fgcolor=Q}}function E(P){return function(){try{if(!P.connected){return false}P.processInput(P.cgm.getInput())}catch(Q){if(DEBUG){log.log("submit",Q,DebugLevel.WARNING)}}return false}}var H={};H.sendcb=E(this);H.typingcb=G(this);H.userclickcb=O(this);H.channelclickcb=M(this);H.activitycb=K(this);H.setColorcb=L(this);H.getLanguageMe=function(P){return function(){if(P.translate){return P.translateToLanguage}return null}}(this);H.setLanguageMe=function(P){return function(T,Q){try{if(T=="none"){P.translate=false;var R=P.cgm.wrapRenderer(DisplayStrings.get("TranslationSendNone"),{},P.prefs.colorSystem,null,false,P.cgm.renderer);P.cgm.output("translate",R)}else{P.translate=true;P.translateToLanguage=T;var R=P.cgm.wrapRenderer(DisplayStrings.get("TranslationSend")+Q,{},P.prefs.colorSystem,null,false,P.cgm.renderer);P.cgm.output("translate",R)}}catch(S){alert(S)}}}(this);H.sendPasteBin=function(P){return function(Q){if(Q!=""){scomms.sendServer({cmd:"paste",channel:"PasteBin",returnchannel:P.uchannel,data:Q})}}}(this);H.sendMinify=function(P){return function(Q){if(Q!=""){scomms.sendServer({cmd:"minify",channel:"LinkManager",returnchannel:P.uchannel,url:Q})}}}(this);H.unbancb=function(P){return function(Q){var R={cmd:"text",chan:P.channel};R.data="/mode "+P.channel+" -b "+Q;P.server.send(R);P.cgm.focus()}}(this);if(this.prefs.ircNickClick){H.nickclick=function(P){return function(Q){if(Q){if(P.cgm.richInputElement.hin.getPos()==0){P.cgm.richInputElement.insertText(Q+": ")}else{P.cgm.richInputElement.insertText(Q+" ")}P.cgm.focus()}}}(this)}this.cgm=new ChatGuiModule(I,!this.ispm,this.prefs,H,true,(D?this.prefs.tabColorPM:this.prefs.tabColorChannel));this.cgm.channel=this.uchannel;this.cgm.nick=this.server.nickname;if(this.ispm){this.cgm.infobar.showTopic("To log PMs, enable logging in [prefs]")}else{this.cgm.infobar.showTopic("You can get Mibbit to auto-connect to channels. Checkout [channels].")}this.cgm.richInputElement.setMaxLength(361);if(!this.ispm&&myHints){this.cgm.setHints(myHints)}if(!this.ispm&&this.prefs.noUListInChannels){this.cgm.setUListDisplay(false)}if(this.ispm){this.cgm.users[this.channel.toLowerCase()]=this.channel;this.cgm.users[this.cgm.nick.toLowerCase()]=this.cgm.nick;this.cgm.richInputElement.hin.addWord(this.channel);this.cgm.richInputElement.hin.addWord(this.cgm.nick)}}ChatChannel.prototype.processInput=function(O){if(O){var B=O.toLowerCase();var P=O;if(P.toLowerCase().substring(0,4)=="/me "){if(this.ispm||this.cgm.getMe()){var J=P.substring(4);J=myfilters.apply(J,false);if(J){if(this.translate){this.translateText(J,function(U){return function(V){U.sendEmote(V.error?J:V.translation,V.error?J:(J+" ("+V.translation+")"))}}(this));return false}else{this.sendEmote(J,J);return false}}}else{return false}}else{if(P.substring(0,2)=="//"||P.substring(0,1)!="/"){if(P.substring(0,2)=="//"){P=P.substring(1,O.length)}P=myfilters.apply(P,false);if(P&&(this.ispm||this.cgm.getMe())){if(this.translate){this.translateText(P,function(U){return function(V){U.sendChat(V.error?P:V.translation,V.error?P:(P+" ("+V.translation+")"))}}(this));return false}else{this.sendChat(P,P);return false}}else{return false}}}if(B.substring(0,7)=="/style "){O=O.substring(7,O.length);var S=O.split(" ");this.formatter.reset();for(var T=0;T<S.length;T++){if(S[T]=="bold"){this.formatter.bold=true}if(S[T]=="underline"){this.formatter.underline=true}var G=parseInt(S[T]);if(!isNaN(G)){if(this.formatter.fgcolor===null){this.formatter.fgcolor=G}else{this.formatter.bgcolor=G}}}}else{if(B=="/style"){this.formatter.reset()}else{if(B=="/redraw"){this.cgm.redraw()}else{if(B.substring(0,7)=="/umode "){var F="/mode "+this.cgm.nick+" "+O.substring(7,O.length);this.server.send({cmd:"text",chan:this.channel,data:F})}else{if(B.substring(0,7)=="/query "){var E=O.substring(7,O.length);var I=null;var Q=E.indexOf(" ");if(Q!=-1){I=E.substring(Q+1,E.length);E=E.substring(0,Q)}var N={channeltype:"pm",userInitiated:true};N.channel=this.serverName+":"+E.toLowerCase();N.localchannel=E;ircHandler.newCHandler(N.channel,N);if(I){var K=this.server.channels[N.channel];K.processInput(I)}}else{if(B.substring(0,8)=="/minify "){var H=O.substring(8,O.length);scomms.sendServer({channel:"LinkManager",cmd:"minify",url:H,returnchannel:this.uchannel})}else{if(B.substring(0,8)=="/server "){ircHandler.processServerCmd(O.substring(8,O.length))}else{if(B=="/debug"){showDebug()}else{if(B=="/ulshow"){this.cgm.setUListDisplay(true)}else{if(B=="/ulhide"){this.cgm.setUListDisplay(false)}else{if(B=="/help"){this.cgm.outputFull(helpRenderer)}else{if(PROCESS_LIST&&(B.substring(0,6)=="/list "||B=="/list")){if(B=="/list"){ircSearch(this.serverName,"")}else{ircSearch(this.serverName,O.substring(6,O.length))}var M={cmd:"text",chan:this.channel};M.data=O;this.server.send(M)}else{if(B.substring(0,8)=="/remove "){this.cgm.chatOutput.removeLines(O.substring(8,O.length));this.cgm.goToBottom()}else{if(B=="/clear"){this.cgm.clearOutput()}else{if(B.substring(0,9)=="/showurl "){var H=O.substring(9,O.length);this.cgm.openLink(H)}else{if(B.substring(0,8)=="/ignore "){var L=O.substring(8,O.length);this.cgm.setIgnoreUser(L,true)}else{if(B.substring(0,10)=="/unignore "){var L=O.substring(10,O.length);this.cgm.setIgnoreUser(L,false)}else{if(B=="/pastebin"){this.cgm.richInputElement.selectMenu("pastebin")}else{if(B=="/upload"){this.cgm.richInputElement.selectMenu("fileupload")}else{if(B.substring(0,6)=="/bbon "){var A=(new Date()).getTime();var C=O.substring(6,O.length);this.cgm.mHandler.bridgebots[C]=true;this.cgm.output("bb",this.cgm.wrapRenderer("Bridgebot on: "+C,{},this.prefs.colorNotice,null,false,this.cgm.renderer,A))}else{if(B.substring(0,7)=="/bboff "){var A=(new Date()).getTime();var C=O.substring(7,O.length);delete this.cgm.mHandler.bridgebots[C];this.cgm.output("bb",this.cgm.wrapRenderer("Bridgebot off: "+C,{},this.prefs.colorNotice,null,false,this.cgm.renderer,A))}else{if(B=="/hints"){var A=(new Date()).getTime();var R=myHints.getTopWords(20);for(var Q=0;Q<R.length;Q++){var J="Hint: "+R[Q];this.cgm.output("hints",this.cgm.wrapRenderer(J,{},this.prefs.colorNotice,null,false,this.cgm.renderer,A))}}else{var D={channel:this.channel,nick:this.server.nickname};myaliases.match(O,D,function(U){return function(V){U.processInput(V)}}(this),function(U){return function(){U.server.send({cmd:"text",chan:U.channel,data:O})}}(this),function(U){return function(){U.cgm.focus()}}(this));this.setTyping(false)}}}}}}}}}}}}}}}}}}}}}}}};ChatChannel.prototype.translateText=function(B,A){google.language.translate({text:B,type:"text"},this.translateFromLanguage,this.translateToLanguage,A)};ChatChannel.prototype.getLanguageCode=function(A){return google.language.Languages[A]};ChatChannel.prototype.sendEmote=function(B,A){this.cgm.processPacket({cmd:"emote",idd:true,emote:this.formatter.format(A),nick:this.cgm.nick});this.server.send({cmd:"text",chan:this.channel,data:"/me "+this.formatter.format(B)});this.setTyping(false)};ChatChannel.prototype.sendChat=function(B,A){this.cgm.processPacket({cmd:"msg",nick:this.cgm.nick,idd:true,msg:this.formatter.format(A)});if(B.substring(0,1)=="/"){B="/"+B}B=this.formatter.format(B);var C={cmd:"text",chan:this.channel,data:B};this.server.send(C);this.setTyping(false)};ChatChannel.prototype.setTyping=function(A){if(this.server.connected&&(this.ispm||this.cgm.getMe())){scomms.sendServer({cmd:"typing",channel:this.uchannel,typing:A});this.cgm.setMyTyping(A)}this.typing=A};ChatChannel.prototype.remove=function(A){this.connected=false;this.cgm.close();rcomms.removeChannelHandler(this.uchannel);this.server.removeChannel(this.uchannel);if(A){if(this.tab){tabs.deadTab(this.tab.id)}}else{if(this.tab){tabs.removeTab(this.tab.id)}}};ChatChannel.prototype.disconnected=function(){this.cgm.disconnected()};ChatChannel.prototype.part=function(){if(!this.ispm&&this.cgm.getMe()){this.server.send({cmd:"text",chan:this.channel,data:"/part "+this.channel});this.server.partChannel(this.uchannel)}this.remove(false)};ChatChannel.prototype.recv=function(D){if(!this.connected){return }try{this.cgm.processPacket(D);if((D.nick==this.cgm.nick&&(D.cmd=="usermode"||D.cmd=="join"))||D.cmd=="nicklist"){var A=this.cgm.getMe();if(A){this.isAdmin=(A.mode.owner||A.mode.admin||A.mode.op)}}if(D.cmd=="changenick"&&D.nick.toLowerCase()==this.channel.toLowerCase()){var B=this.serverName+":"+D.newnick.toLowerCase();if(tabs.existsTab(B)){tabs.deadTab(B)}if(this.tab){tabs.moveTab(this.uchannel,B);this.tab.setTitle(D.newnick.toLowerCase())}delete this.cgm.users[this.channel.toLowerCase()];rcomms.removeChannelHandler(this.uchannel);this.channel=D.newnick.toLowerCase();this.uchannel=B;this.cgm.channel=this.uchannel;rcomms.addChannelHandler(this.uchannel,this);this.cgm.users[this.channel.toLowerCase()]=this.channel}if(this.prefs.showChannelTabUsers&&this.cgm.userList){var E=this.cgm.userList.size();this.tab.setTitle(this.channel+" ("+E+")")}}catch(C){if(DEBUG){log.log("recv",C+"( "+D+" )",DebugLevel.WARNING)}}};ChatChannel.prototype.prefsUpdated=function(){if(DEBUG){log.log("ChatChannel","prefsUpdated",DebugLevel.INFO)}this.cgm.createRenderer();this.cgm.redraw();this.cgm.container.style.background=(this.ispm?this.prefs.tabColorPM:this.prefs.tabColorChannel)};function ChatServer(H,D,B,A){this.channel=D;this.serverName=D;this.nickname="unknown";this.isAdmin=false;this.connected=true;this.ucid=1;this.prefs=A;this.tinyrenderer=new ParserNothing();this.renderer=new ParserChannels(function(I){return function(J){var K={cmd:"text"};K.chan=this.channel;K.data="/join "+J;I.send(K)}}(this),new ParserLinks(new ParserIRCColor(new ParserNothing()),this.prefs),this.prefs);this.ircclient=B;this.channels={};function G(I){return function(J){if(I.tab){I.tab.active(false)}if(alerts){alerts.alert("Server stuff !")}}}function F(I){return function(J){var K={cmd:"text"};K.chan=this.channel;K.data="/join "+J;I.send(K)}}function C(I){return function(){try{if(!I.connected){return false}I.processInput(I.cgm.getInput())}catch(J){if(DEBUG){log.log("IRCServerTab","onsubmit "+J,DebugLevel.WARNING)}}return false}}var E={};E.sendcb=C(this);E.channelclickcb=F(this);E.activitycb=G(this);if(H){H.style.background=this.prefs.tabColorServer;this.cgm=new ChatGuiModule(H,false,this.prefs,E,false,this.prefs.tabColorServer);this.cgm.infobar.showTopic("To get Mibbit to auto-identify you, go to [account]")}}ChatServer.prototype.processInput=function(C){if(C){var D=C.toLowerCase();var F=C;if(D.substring(0,7)=="/query "){var K=C.substring(7,C.length);var L=null;var G=K.indexOf(" ");if(G!=-1){L=K.substring(G+1,K.length);K=K.substring(0,G)}var E={channeltype:"pm",userInitiated:true};E.channel=this.serverName+":"+K.toLowerCase();E.localchannel=K;ircHandler.newCHandler(E.channel,E);if(L){var B=this.channels[E.channel];if(B){B.processInput(L)}}}else{if(D=="/debug"){showDebug()}else{if(D=="/help"){this.cgm.outputFull(helpRenderer)}else{if(D=="/clear"){this.cgm.clearOutput()}else{if(D=="/redraw"){this.cgm.redraw()}else{if(D.substring(0,7)=="/umode "){var I="/mode "+this.cgm.nick+" "+C.substring(7,C.length);this.server.send({cmd:"text",chan:this.channel,data:I})}else{if(D.substring(0,8)=="/server "){ircHandler.processServerCmd(C.substring(8,C.length))}else{if(PROCESS_LIST&&(D.substring(0,6)=="/list "||D=="/list")){if(D=="/list"){ircSearch(this.serverName,"")}else{ircSearch(this.serverName,C.substring(6,C.length))}var A={cmd:"text",chan:this.channel};A.data=C;this.send(A)}else{if(D.substring(0,9)=="/showurl "){var J=C.substring(9,C.length);this.cgm.openLink(J)}else{var H={channel:"",nick:this.nickname};myaliases.match(C,H,function(M){return function(N){M.processInput(N)}}(this),function(M){return function(){M.send({cmd:"text",chan:M.channel,data:C})}}(this))}}}}}}}}}}};ChatServer.prototype.close=function(){};ChatServer.prototype.send=function(A){A.channel=this.channel;scomms.sendServer(A)};ChatServer.prototype.recv=function(C){this.connected=true;try{var D=false;if(C.cmd=="channellist"||C.cmd=="whoisreply"||C.cmd=="whowas"||C.cmd=="who"||C.cmd=="invite"){D=this.sendToActive(C)}if(C.cmd=="whoisreply"){var A={cmd:"userdetails",nick:C.nick,user:C.user,host:C.host};this.sendChannels(A)}if(C.cmd=="notice"&&this.prefs.noticesToActiveTab){D=this.sendToActive(C)}if(C.cmd=="error"&&this.prefs.errorsToActiveTab){D=this.sendToActive(C)}if(C.cmd=="infobar"||C.cmd=="away"||C.cmd=="part"||C.cmd=="changenick"||C.cmd=="init"){if(C.cmd=="infobar"){this.cgm.processPacket(C)}this.sendChannels(C);D=true}if(C.cmd=="nickprompt"){this.getNewNick(C.reason,function(E){return function(G){if(G){var F={cmd:"text"};F.data="/nick "+G;E.send(F)}}}(this))}if(C.cmd=="changenick"){if(C.nick==this.nickname){this.newNick(C.newnick)}}else{if(C.cmd=="init"){this.newNick(C.nick)}else{if(C.cmd=="closedchannel"){if(DEBUG){log.log("closedchannel","cc cmd for : "+C.chan,DebugLevel.INFO)}this.ircclient.confirmClosedChannel(C.chan)}}}if(!D){this.cgm.processPacket(C)}}catch(B){if(DEBUG){log.log(this.channel+" (recv)",B+" ("+C+")",DebugLevel.WARNING)}}};ChatServer.prototype.newNick=function(A){this.nickname=A;this.cgm.nick=this.nickname};ChatServer.prototype.sendToActive=function(A){for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){if(this.channels[ch].tab.raised){this.channels[ch].recv(A);return true}}}return false};ChatServer.prototype.showGlobal=function(C,B,A){if(!this.embed){this.cgm.outputFullID(C,new GlobalMessageRenderer(B,this.cgm.whoisRenderer),A)}for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.channels[ch].cgm.outputFullID(C,new GlobalMessageRenderer(B,this.cgm.whoisRenderer),A)}}};ChatServer.prototype.removeGlobal=function(A){if(!this.embed){this.cgm.chatOutput.removeLines(A)}for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.channels[ch].cgm.chatOutput.removeLines(A)}}};ChatServer.prototype.sendChannels=function(A){for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.channels[ch].recv(A)}}};ChatServer.prototype.removeChannel=function(A){if(DEBUG){log.log(this.channel,"Removing channel: "+A,DebugLevel.INFO)}delete this.channels[A];delete this.ircclient.channels[A]};ChatServer.prototype.partChannel=function(A){this.ircclient.closedChannel(A)};ChatServer.prototype.disconnected=function(){this.connected=false;this.cgm.disconnected();for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.channels[ch].disconnected()}}};ChatServer.prototype.closed=function(B){this.connected=false;rcomms.removeChannelHandler(this.channel);var A=(new Date()).getTime();this.cgm.output(this.cgm.wrapRenderer("- - - - Disconnected - - - -","red",null,false,this.renderer,A));this.cgm.close();if(B){if(this.tab){tabs.deadTab(this.channel)}}else{if(this.tab){tabs.removeTab(this.tab.id)}}for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.channels[ch].remove(false)}}for(ch in this.channels){if(this.channels.hasOwnProperty(ch)){this.removeChannel(ch)}}};ChatServer.prototype.prefsUpdated=function(){this.cgm.createRenderer();this.cgm.redraw();this.cgm.container.style.background=this.prefs.tabColorServer};ChatServer.prototype.getNewNick=function(B,A){var C=window.prompt("Please choose a new nickname ("+B+")");A(C)};function ChatFormatter(){this.bold=false;this.underline=false;this.fgcolor=null;this.bgcolor=null}ChatFormatter.prototype.reset=function(){this.bold=false;this.underline=false;this.fgcolor=null;this.bgcolor=null};ChatFormatter.prototype.format=function(A){var C="";if(this.bold){C+="\u0002"}if(this.underline){C+="\u001f"}var E="";if(this.fgcolor!=null){E+=this.fgcolor}if(this.bgcolor!=null){E+=","+this.bgcolor}if(E!=""){C+="\u0003"+E}var D=C.substring(C.length-1,C.length);var B=A.substring(0,1);if(D>="0"&&D<="9"&&B>="0"&&B<="9"){C+=" "}C+=A;return C};function BlurredAlerts(C,B,D,A,E){this.prefs=A;this.window=C;this.gotfocus=false;this.focuscount=0;this.alertinprogress=false;this.flashcount=0;this.ftitle=B;this.btitle=D;this.notify=function(F){if(window!=window.parent&&window.parent.postMessage){window.parent.postMessage(JSON.stringify(F),"*")}};this.alert=function(G){if(this.prefs.windowAlertMaxFlashes==0){return false}if(this.alertinprogress){return false}if(this.gotfocus){return false}this.window.document.title="* "+G+" *";this.alertinprogress=true;this.flashcount=0;var F=true;var H=this.window.setInterval(function(I){return function(){if(I.gotfocus){I.window.document.title=I.ftitle;I.alertinprogress=false;I.window.clearInterval(H)}else{if(I.flashcount>I.prefs.windowAlertMaxFlashes){I.window.document.title="[ "+G+" ]";I.alertinprogress=false;I.window.clearInterval(H)}else{I.flashcount++;if(!F){I.window.document.title="* "+G+" *"}else{I.window.document.title=I.btitle}F=!F}}}}(this),this.prefs.windowAlertPeriod);return true};this.listenerID=0;this.attachListeners=function(I,F){var J=this.listenerID++;var G=function(K){return function(L){K.gotfocus=true;K.window.document.title=K.ftitle;return true}}(this);var H=function(K){return function(L){K.gotfocus=false;K.window.document.title=K.btitle;return true}}(this);if(I.addEventListener){I.addEventListener("focus",G,false);I.addEventListener("blur",H,false)}else{I.attachEvent("onfocus",G);I.attachEvent("onblur",H)}}}DebugLevel={FINE:"FINE",INFO:"INFO",WARNING:"WARNING"};DebugLevelColors={FINE:"#aaa",INFO:"#00f",WARNING:"#f00"};DebugOutput.MAX_LINES=500;DebugOutput.TIME_COLUMN_WIDTH="7%";DebugOutput.LEVEL_COLUMN_WIDTH="7%";DebugOutput.MODULE_COLUMN_WIDTH="12%";DebugOutput.MESSAGE_COLUMN_WIDTH="74%";function DebugOutput(A){this.container=A;this.document=A.ownerDocument;this.table=this.document.createElement("table");this.table.style.tableLayout="fixed";this.table.style.borderCollapse="collapse";this.table.setAttribute("cellpadding","0");this.table.setAttribute("cellspacing","0");this.table.setAttribute("border","0");this.table.setAttribute("width","100%");this.table.style.width="100%";this.table.style.height="100%";this.table.style.background="#fff";this.container.appendChild(this.table);this.defaultDebugLine={renderMessage:function(C,B){C.style.overflow="hidden";C.style.fontFamily="Arial, Helvetica, sans-serif";C.style.paddingBottom="1px";C.style.paddingTop="1px";C.style.paddingLeft="3px";C.style.fontSize="13px";C.style.borderTop="1px solid #c8c8ff";C.setAttribute("valign","top");if(B){C.appendChild(C.ownerDocument.createTextNode(B))}else{C.appendChild(C.ownerDocument.createTextNode(" "));C.style.height="1em"}},renderTime:function(C,B){C.style.overflow="hidden";C.style.paddingRight="3px";C.style.paddingLeft="1px";C.style.fontFamily="Arial, Helvetica, sans-serif";C.style.color="#888";C.style.fontSize="11px";C.style.borderRight="1px solid #888";C.style.borderTop="1px solid #c8c8ff";C.style.textAlign="right";if(B){C.appendChild(C.ownerDocument.createTextNode(B))}else{C.appendChild(C.ownerDocument.createTextNode(" "))}},renderLevel:function(C,B){C.style.overflow="hidden";C.style.paddingRight="3px";C.style.paddingLeft="1px";C.style.fontFamily="Arial, Helvetica, sans-serif";var D="black";if(DebugLevelColors[B]){C.style.color=DebugLevelColors[B]}C.style.fontSize="11px";C.style.borderRight="1px solid #888";C.style.borderTop="1px solid #c8c8ff";C.style.textAlign="right";if(B){C.appendChild(C.ownerDocument.createTextNode(B))}else{C.appendChild(C.ownerDocument.createTextNode(" "))}},renderModule:function(C,B){C.style.overflow="hidden";C.style.paddingRight="3px";C.style.paddingLeft="1px";C.style.fontFamily="Arial, Helvetica, sans-serif";C.style.color="green";C.style.fontSize="11px";C.style.borderRight="1px solid #888";C.style.borderTop="1px solid #c8c8ff";if(B){C.appendChild(C.ownerDocument.createTextNode(B))}else{C.appendChild(C.ownerDocument.createTextNode(" "))}}}}DebugOutput.prototype.addLine=function(F){var A=this.table.insertRow(-1);if(typeof (F)=="undefined"){F={}}var E=A.insertCell(-1);E.style.width=DebugOutput.TIME_COLUMN_WIDTH;this.defaultDebugLine.renderTime(E,F.time);var C=A.insertCell(-1);C.style.width=DebugOutput.LEVEL_COLUMN_WIDTH;this.defaultDebugLine.renderLevel(C,F.level);var D=A.insertCell(-1);D.style.width=DebugOutput.MODULE_COLUMN_WIDTH;this.defaultDebugLine.renderModule(D,F.module);var B=A.insertCell(-1);B.style.width=DebugOutput.MESSAGE_COLUMN_WIDTH;this.defaultDebugLine.renderMessage(B,F.message);while(this.table.rows.length>DebugOutput.MAX_LINES){this.table.deleteRow(0)}};function DebugLog(E){var I=E.ownerDocument;this.ucid=1;this.pendingLogs=new Array();var A=I.createElement("table");A.setAttribute("border","0");A.setAttribute("cellpadding","0");A.setAttribute("cellspacing","3");A.style.width="100%";var J=A.insertRow(-1);var B=J.insertCell(-1);var K=I.createElement("table");K.style.width="100%";var L=K.insertRow(-1);var H=L.insertCell(-1);H.style.width=DebugOutput.TIME_COLUMN_WIDTH;H.style.textAlign="center";H.style.color="#444";H.appendChild(I.createTextNode("Time"));var G=L.insertCell(-1);G.style.width=DebugOutput.LEVEL_COLUMN_WIDTH;G.style.textAlign="center";G.style.color="#444";G.appendChild(I.createTextNode("Level"));var F=L.insertCell(-1);F.style.width=DebugOutput.MODULE_COLUMN_WIDTH;F.style.textAlign="center";F.style.color="#444";F.appendChild(I.createTextNode("Module"));var D=L.insertCell(-1);D.style.width=DebugOutput.MESSAGE_COLUMN_WIDTH;D.style.textAlign="center";D.style.color="#444";D.appendChild(I.createTextNode("Message"));B.appendChild(K);E.appendChild(A);this.deb=I.createElement("div");this.deb.style.overflow="auto";this.deb.style.overflowX="hidden";this.deb.style.width="100%";this.deb.style.height="200px";E.appendChild(this.deb);this.activecb=function(N,M){if(!M){}else{this.goToBottom()}};this.log=function(Q,M,O){var N=new Date();var R="00"+N.getMinutes();R=R.substring(R.length-2,R.length);var P="00"+N.getSeconds();P=P.substring(P.length-2,P.length);var S={};S.module=Q;S.message=M;S.level=O;S.time=N.getHours()+":"+R+":"+P;this.pendingLogs.push(S);this.flush()};this.flush=function(){if(!this.logout){return }while(this.pendingLogs.length>0){this.logout.addLine(this.pendingLogs.shift())}this.goToBottom()};this.logout=new DebugOutput(this.deb);for(var C=0;C<30;C++){this.logout.addLine()}this.goToBottom();this.flush()}DebugLog.prototype.goToBottom=function(){this.deb.scrollTop=this.deb.scrollHeight};var UGCBASE_URL="http://up."+BASE_URL;var ISWIDGET=true;var DEBUG=false;var PROCESS_LIST=false;var myaliases;var myfilters;var scomms;var rcomms;var defaultPrefs;var mysession;var sessionSetTime;var tabs;var log;var alerts;var serverstatus="";var myHints;var ircHandler;var emb_server;var emb_channel;var emb_channelkey;var emb_nick;var emb_pass="";var emb_authMethod="nickserv";var emb_charset="UTF-8";var emb_authkey;var org_nick;var readyToConnect=false;var hasPrompted=false;function backspaceHandler(C){var A=C.target?C.target:C.srcElement;var B=A.tagName?A.tagName:A.nodeName;if(B.toLowerCase()!="input"&&B.toLowerCase()!="textarea"&&C.keyCode==8){return false}return true}function keypressHandler(A){if(!A){A=window.event}return backspaceHandler(A)}function keydownHandler(B){if(!B){B=window.event}if(B.altKey){try{if(B.keyCode==37){tabs.moveLeft()}else{if(B.keyCode==39){tabs.moveRight()}}}catch(A){}if(B.keyCode==37||B.keyCode==39){return false}}return backspaceHandler(B)}document.onkeydown=keydownHandler;document.onkeypress=keypressHandler;function promptNewNick(B,A,G,E){hasPrompted=true;if(E){document.getElementById("askpass").style.display="none";document.getElementById("askkey").style.display="none"}else{if(typeof getParameter("promptPass")!=="undefined"){document.getElementById("askpass").style.display="block"}if(typeof getParameter("promptChannelKey")!=="undefined"){document.getElementById("askkey").style.display="block"}}document.getElementById("chats").style.display="none";InfoBar.setGoogleVisibility(false);var D=document.getElementById("newnicktext");D.firstChild.nodeValue=B;var H=document.getElementById("nickprompt");H.style.display="block";if(G){var C=document.getElementById("newnick");C.value=G}var F=document.getElementById("newnickform");F.onsubmit=function(){return function(){try{H.style.display="none";document.getElementById("chats").style.display="block";InfoBar.setGoogleVisibility(true);A(document.getElementById("newnick").value,document.getElementById("newpass").value,document.getElementById("newkey").value)}catch(I){}return false}}()}function getref(){var B=document.referrer.toLowerCase();if(B.substring(0,25)=="http://widget.mibbit.com/"||B.substring(0,26)=="http://widget2.mibbit.com/"||B.substring(0,24)=="http://embed.mibbit.com/"){var A=getParameter("ref");if(A){return A}}return document.referrer}function init2(){InfoBar.enableGoogle=true;myHints=new Hints();myHints.feedContent("chat games internet gaming");if(BROWSER_IE6){ChatGuiModule.NEED_RESIZE_HANDLER=true}myaliases=new Aliases();myfilters=new Filters();document.getElementById("newpass").value="";var O=getParameter("customloading");var H=document.getElementById("connectspan");H.appendChild(document.createTextNode(O?O:"Connecting to server..."));var C=getParameter("customprompt");if(C){var T=document.getElementById("custprompt");while(T.firstChild){T.removeChild(T.firstChild)}T.appendChild(document.createTextNode(C))}emb_channel=getParameter("channel","");emb_server=getParameter("server","irc.mibbit.net");emb_nick=getParameter("nick",getRandomNick());var I=emb_nick;var J="0123456789";emb_nick="";for(var Q=0;Q<I.length;Q++){var L=I.charAt(Q);if(L=="?"){emb_nick+=(""+J.charAt(Math.floor(Math.random()*J.length)))}else{emb_nick+=L}}org_nick=emb_nick;emb_authkey=getParameter("authkey");emb_authMethod=getParameter("authmethod","nickserv");emb_charset=getParameter("charset","UTF-8");ChatGuiModule.FOOTER_HEIGHT=0;ChatGuiModule.HEADER_HEIGHT=20+2;ChatGuiModule.BASE_HEADER_HEIGHT=0;ChatServer.prototype.getNewNick=function(X,W){promptNewNick("Choose a nickname ("+X+")",W,emb_nick,true)};function F(W){var X=document.getElementById("connecting");X.innerHTML=W}IRCClient.prototype.showConnectFailed=function(X,W){InfoBar.setGoogleVisibility(false);F("Connection failed ("+W+")")};IRCClient.prototype.handleBlacklisted=function(){InfoBar.setGoogleVisibility(false);F("Your IP address is listed in a blacklist. You may have a virus, trojan or be running an open proxy. Please check http://dronebl.org for details")};IRCClient.prototype.handleCheckConnect=function(W){if(!W){scomms.sendServer({cmd:"clientlog",c:"CheckConnect",f:"CheckConnect",m:window.location.href});promptNewNick("Choose a nickname",function(X,Z,Y){emb_nick=X;emb_pass=Z;emb_channelkey=Y;rcomms.start();readyToConnect=true;ircHandler.connectServer(emb_server,emb_nick,emb_pass,emb_channelkey?(emb_channel+" "+emb_channelkey):emb_channel,emb_authkey,true,emb_authMethod,emb_charset)},org_nick)}};IRCClient.prototype.showDisconnected=function(X,W){document.getElementById("serror").innerHTML=W;promptNewNick("Choose a nickname",function(Y,b,Z){emb_nick=Y;emb_pass=b;emb_channelkey=Z;rcomms.start();readyToConnect=true;ircHandler.connectServer(emb_server,emb_nick,emb_pass,emb_channelkey?(emb_channel+" "+emb_channelkey):emb_channel,emb_authkey,true,emb_authMethod,emb_charset);document.getElementById("serror").innerHTML=""},org_nick)};ircHandler=new IRCClient();defaultPrefs=new UserPrefs();defaultPrefs.widget();myaliases.load(defaultPrefs.aliases);myfilters.load(defaultPrefs.filters);alerts=new BlurredAlerts(window,"Mibbit","[ Mibbit ]",defaultPrefs);alerts.attachListeners(window,"window");alerts.attachListeners(window.document,"doc");defaultPrefs.addListener(function(){tabs.redraw();tabs.setStyle(defaultPrefs.useTabList)});tabs=new TabGroup(document.getElementById("tabs"),defaultPrefs,true,2,20);tabs.addLogo();tabs.arrowDiv.style.paddingTop="2px";parsePrefs();var D=true;if(typeof getParameter("noServerTab")!=="undefined"){D=(getParameter("noServerTab")=="true"||getParameter("noServerTab")=="1")}if(D){if(emb_channel==""){F("No server tab, and no channel specified.");return }ircHandler.embeddedChannel=emb_channel;var R=ircHandler.embeddedChannel.indexOf(",");if(R!=-1){ircHandler.embeddedChannel=ircHandler.embeddedChannel.substr(0,R)}R=ircHandler.embeddedChannel.indexOf(" ");if(R!=-1){ircHandler.embeddedChannel=ircHandler.embeddedChannel.substr(0,R)}ircHandler.embeddedServer=emb_server;var S=ircHandler.embeddedServer.indexOf(":");if(S!=-1){ircHandler.embeddedServer=ircHandler.embeddedServer.substr(0,S)}}if(typeof getParameter("noServerNotices")!=="undefined"){ircHandler.EMBED_SHOW_NOTICES=!(getParameter("noServerNotices")=="true"||getParameter("noServerNotices")=="1")}if(typeof getParameter("noServerMotd")!=="undefined"){defaultPrefs.showMOTD=!(getParameter("noServerMotd")=="true"||getParameter("noServerMotd")=="1")}var B={"http://animetvonline.net/parceiros/chat/yugionline.htm":true,"b6e7eb73af60ab656ef2494833884bc1":true,"bfa9cc793e103ca867a58b8a01799130":true,"a36161039325081878395953ba30902c":true,"ef01da3196d1cc2411e65bd2265ec3f3":true,"a763aedd7ad7e562c7bb40d119e367aa":true,"77f6df023548527b7848e5fdca340526":true,"5bdd603b047fe1bb6cf02fb814d791df":true,"4ef20015d7babb47c3215bf832a1a4e8":true,"9fa951ffbe54e3c6e4d2b034070aa38b":true,"a61b704fb24ce99b5cc11d428ebb9bcb":true,"5b347af10430c945be19a92125505b3e":true,"444a6ea94b69b91f87c5b8b36f247fc4":true,"7128f682fa86585f7ca2de6b4c058753":true,"f628bb8d6c3fc2518b0f183cfb4b6bac":true};var P=["scenew\\.com"];for(var Q=0;Q<P.length;Q++){var N=new RegExp(P[Q],"g");if(N.test(getref())){InfoBar.setGoogleVisibility(false);F("This Mibbit widget has been blocked for abuse.");return }}if(getref()=="http://gb.wasteofpixels.com/tv/"&&emb_server.toLowerCase().indexOf("rizon.")!=-1){F("Connection refused");return }if(typeof getParameter("autoConnect")!=="undefined"&&typeof getParameter("settings")!=="undefined"){if(!B[getref()]&&!B[getParameter("settings")]){readyToConnect=(getParameter("autoConnect")=="true"||getParameter("autoConnect")=="1")}}if(typeof getParameter("promptPass")!=="undefined"){document.getElementById("askpass").style.display="block"}if(typeof getParameter("promptChannelKey")!=="undefined"){document.getElementById("askkey").style.display="block"}var G=function(W){var X=document.getElementById("tleft");var Y=document.getElementById("tright");X.style.color=W?"#33c":"#fff";Y.style.color=W?"#33c":"#fff"};if(typeof VERSION=="undefined"||getParameter("debug")){showDebug()}function A(W){scomms.sessionid=W;if(DEBUG){log.log("sessionSetHandler","mysession="+mysession+" s="+W,DebugLevel.INFO)}if(mysession){ircHandler.notifyServersDisconnectClear()}mysession=W;sessionSetTime=(new Date()).getTime();var Z=new Date();var Y=-Z.getTimezoneOffset();scomms.sendServer({cmd:"clientinfo",localtime:(Z.getTime()+(Y*60000)),tzoffset:Y});var X={channel:"IRCClient",cmd:"embed"};X.referrer=getref()?getref():"";if(typeof getParameter("settings")!=="undefined"){X.settings=getParameter("settings")}scomms.sendServer(X);var X={channel:"LoginManager",cmd:"guest"};X.version=(typeof VERSION=="undefined")?"dev":VERSION;X.uagent=navigator.userAgent;if(typeof getParameter("settings")!=="undefined"){X.settings=getParameter("settings")}scomms.sendServer(X);if(readyToConnect){ircHandler.connectServer(emb_server,emb_nick,emb_pass,emb_channelkey?(emb_channel+" "+emb_channelkey):emb_channel,emb_authkey,hasPrompted,emb_authMethod,emb_charset)}else{promptNewNick("Choose a nickname",function(b,d,c){emb_nick=b;emb_pass=d;emb_channelkey=c;ircHandler.connectServer(emb_server,emb_nick,emb_pass,emb_channelkey?(emb_channel+" "+emb_channelkey):emb_channel,emb_authkey,true,emb_authMethod,emb_charset)},org_nick)}}function E(X,W){if(DEBUG){log.log("newCHandler","New channel "+X+" ("+W+")",DebugLevel.INFO)}if(X.substring(0,10)=="IRCClient:"){return ircHandler.newCHandler(X,W)}return false}function K(W){if(DEBUG){log.log("ooHandler","oo="+W,DebugLevel.INFO)}}function M(W){if(DEBUG){log.log("globalCHandler","p.cmd="+W.cmd,DebugLevel.FINE)}if(W.cmd=="global"){ircHandler.sendAll(W)}}var V={"nch":E,"gph":M,"ooh":K,"ssh":A};rcomms=new CommsRecv("/j/mibbit",V);var S=function(W){return function(X){W.parseResponse(X)}}(rcomms);var U={"recv":S,"psh":null};scomms=new CommsSend("/j/mibbit",U);if(readyToConnect){rcomms.start()}else{promptNewNick("Choose a nickname",function(W,Y,X){emb_nick=W;emb_pass=Y;emb_channelkey=X;rcomms.start();readyToConnect=true},org_nick)}rcomms.addChannelHandler("LoginManager",{online:function(){},offline:function(){},recv:function(W){if(W.cmd=="settings"){defaultPrefs.reset();defaultPrefs.load(W.prefs);defaultPrefs.autoconnects=[];myaliases.load(defaultPrefs.aliases);myfilters.load(defaultPrefs.filters);parsePrefs()}}});rcomms.addChannelHandler("IRCClient",ircHandler)}function init(){var A=(getParameter("autoConnect")=="true"||getParameter("autoConnect")=="1");if(!A){init2()}else{var B=getParameter("delay",2);if(B<2){B=2}window.setTimeout(init2,B*1000)}}function shutdown(){rcomms.stop()}function showDebug(){var B=document.createElement("div");cp({border:"0",background:"#bbd18a",fontSize:"13px",width:"100%",position:"absolute",top:"22px",bottom:"0px",textAlign:"left",overflow:"auto",verticalAlign:"bottom",display:"none"},B.style);document.getElementById("chats").appendChild(B);log=new DebugLog(B);var A=tabs.addTab(".Log",B,"Log","Debug Log",function(D,C){log.activecb(D,C)},null,{background:"bbd18a",border:"#c0ffc0"},true,false);DEBUG=true}function getParameter(A,C){var B=window.location.search.substring(1);if(B.length>0){begin=B.toLowerCase().indexOf(A.toLowerCase()+"=");if(begin!=-1){begin+=A.length+1;end=B.indexOf("&",begin);return decodeURIComponent(B.substring(begin,end==-1?B.length:end))}}return C}function getRandomNick(){var B="abcdefghijklmnopqrstuvwxyz0123456789";var C="mib_";for(var A=0;A<6;A++){C+=B.charAt(Math.random()*B.length)}return C}function parsePrefs(){for(var A in defaultPrefs){if(A!="autoconnects"&&defaultPrefs.hasOwnProperty(A)){var C=typeof defaultPrefs[A];var B=A;if(typeof getParameter(B)!=="undefined"){if(C=="number"){defaultPrefs[A]=parseInt(getParameter(B))}else{if(C=="boolean"){defaultPrefs[A]=(getParameter(B)=="true"||getParameter(B)=="1")}else{defaultPrefs[A]=getParameter(B)}}}}}defaultPrefs.tellListeners()}function setClientStatus(A){}