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

VERSION=2215;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",top:"0px",textAlign:"right"},this.ulinfo.style);this.ulinfodiv=this.doc.createElement("div");this.ulinfo.appendChild(this.ulinfodiv);I.appendChild(this.ulinfo);this.ulinfospan=this.doc.createElement("span");cp({color:(islight(K)?"#000":"#fff"),marginRight:"4px"},this.ulinfospan.style);this.ulinfodiv.appendChild(this.ulinfospan);this.menuoptions=this.doc.createElement("button");cp({border:"1px solid #888",background:"#ccc",padding:"1px",fontFamily:"sans-serif",fontSize:"13px",margin:"0px",borderRadius:"3px",MozBorderRadius:"3px",WebkitBorderRadius:"3px"},this.menuoptions.style);this.menuoptions.appendChild(this.doc.createTextNode("Options"));this.menuoptions.onclick=function(L){return function(){L.setOptionsDisplay(!L.optionsshowing)}}(this);this.ulinfodiv.appendChild(this.menuoptions);this.uldoptions=this.doc.createElement("div");cp({position:"absolute",right:"0px",overflow:"auto",overflowX:"hidden",textAlign:"left"},this.uldoptions.style);this.uldoptions.style.display="none";this.optionsshowing=false;I.appendChild(this.uldoptions)}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"))}}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(A&&this.optionsshowing){this.setOptionsDisplay(false)}if(this.userList){this.ulshowing=A;this.prevulshowing=A;this.layout();this.goToBottom()}};ChatGuiModule.prototype.setOptionsDisplay=function(C){if(this.pasteBin.showing()||(this.uploader&&this.uploader.showing())){return }if(C&&this.ulshowing){this.prevulshowing=true;this.ulshowing=false}if(!C&&!this.ulshowing&&this.prevulshowing){this.ulshowing=true}this.optionsshowing=C;if(this.optionsshowing){cp({border:"1px solid #f00",background:"#eee"},this.menuoptions.style);while(this.uldoptions.firstChild){this.uldoptions.removeChild(this.uldoptions.firstChild)}var A=function(D){return function(){D.setOptionsDisplay(false)}}(this);function B(G,E,D){var F=G.ownerDocument.createElement("div");cp({border:"1px solid #888",background:"#ccc",padding:"1px",margin:"2px",fontFamily:"sans-serif",cursor:"pointer",fontSize:"13px",borderRadius:"3px",MozBorderRadius:"3px",WebkitBorderRadius:"3px"},F.style);F.appendChild(G.ownerDocument.createTextNode(E));F.onmouseover=function(){cp({border:"1px solid #ccc",background:"#eee"},this.style)};F.onmouseout=function(){cp({border:"1px solid #888",background:"#ccc"},this.style)};F.onclick=function(){A();if(D){D()}};G.appendChild(F)}B(this.uldoptions,this.prevulshowing?"Hide userlist":"Show userlist",function(D){return function(){D.setUListDisplay(!D.prevulshowing)}}(this));if(this.cbacks.setupoptions){this.cbacks.setupoptions(function(D){return function(F,E){B(D,F,E)}}(this.uldoptions))}}else{cp({border:"1px solid #888",background:"#ccc"},this.menuoptions.style)}this.layout();this.goToBottom();this.focus()};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);this.ulinfodiv.style.padding=this.prefs.infobarPadding+"px";this.ulinfodiv.style.fontFamily=this.prefs.infobarFontFamily;this.ulinfodiv.style.fontSize=this.prefs.infobarFontSize+"px"}}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.optionsshowing){this.uldoptions.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||this.optionsshowing)?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.uldoptions){this.setMargins(this.uldoptions,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);if(this.uldoptions){this.uldoptions.style.display="none"}}else{if(this.optionsshowing){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.uldoptions.style);if(this.uld){this.uld.style.display="none"}}else{if(this.uld){this.uld.style.display="none"}if(this.uldoptions){this.uldoptions.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.optionsshowing)&&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"}if(this.optionsshowing){this.uldoptions.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.currentTopic="";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.currentTopic=K.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)};function ErrorLog(A){this.container=A;this.document=A.ownerDocument;this.showingElement=null;this.queuedAlerts=[];this.dim=document.createElement("div");cp({display:"none",position:"absolute",top:"0%",left:"0%",width:"100%",height:"100%",backgroundColor:"black",zIndex:"1001"},this.dim.style);cp({MozOpacity:"0.8",opacity:".80",filter:"alpha(opacity=80)"},this.dim.style);this.container.appendChild(this.dim);this.light=document.createElement("div");cp({display:"none",position:"absolute",top:"25%",left:"25%",width:"50%",height:"50%",padding:"4px",border:"12px solid #444",backgroundColor:"white"},this.light.style);cp({zIndex:"1002",overflow:"auto"},this.light.style);this.container.appendChild(this.light)}ErrorLog.prototype.alert=function(A,B,I,F){var E=document.createElement("div");cp({border:"1px solid #ccc",background:"#eee",margin:"2px",padding:"4px",fontSize:"15px",textAlign:"center",color:"#000",fontWeight:"bold"},E.style);E.appendChild(this.document.createTextNode(A));var C;if(B){if(I){E.appendChild(this.document.createElement("br"));var H=this.document.createElement("form");H.style.display="inline";H.onsubmit=function(L){return function(){try{B(C.value)}catch(M){if(DEBUG){log.log("ErrorLog","Issue "+M,DebugLevel.WARNING)}}L.dismiss();return false}}(this);E.appendChild(H);C=this.document.createElement("input");if(F){C.value=F}C.style.marginRight="4px";C.style.marginLeft="4px";cp({type:"text",size:24,className:"ainput"},C);H.appendChild(C);var K=this.document.createElement("div");cp({cursor:"pointer",textDecoration:"underline"},K.style);K.onclick=function(L){return function(){try{B(C.value)}catch(M){if(DEBUG){log.log("ErrorLog","Issue "+M,DebugLevel.WARNING)}}L.dismiss()}}(this);K.appendChild(this.document.createTextNode("OK"));E.appendChild(K)}else{E.appendChild(this.document.createElement("br"));var D=this.document.createElement("span");cp({cursor:"pointer",textDecoration:"underline"},D.style);D.onclick=function(L){return function(){B(false);L.dismiss()}}(this);D.appendChild(this.document.createTextNode("Cancel"));E.appendChild(D);E.appendChild(this.document.createTextNode(" | "));var K=this.document.createElement("span");cp({cursor:"pointer",textDecoration:"underline"},K.style);K.onclick=function(L){return function(){B(true);L.dismiss()}}(this);K.appendChild(this.document.createTextNode("Yes"));E.appendChild(K)}}function G(L){if(L){try{L.focus()}catch(M){}}}var J={msg:A,cb:B};if(I){J.isprompt=true}var J={element:E,closecb:function(){if(B){B(false)}},initcb:function(){G(C)}};this.queue(J)};ErrorLog.prototype.queue=function(A){if(this.showingElement==null){this.show(A)}else{this.queuedAlerts.push(A)}};ErrorLog.prototype.show=function(B){this.dim.style.display="block";this.light.style.display="block";var A=this.document.createElement("div");A.style.textAlign="right";this.light.appendChild(A);var C=this.document.createElement("img");setPngSrc(C,"/gfx/close-win-red.png",12,12);C.onclick=function(D){return function(){if(B.closecb){B.closecb()}D.dismiss()}}(this);C.style.margin="2px";C.title="Close window";A.appendChild(C);this.dim.onclick=C.onclick;this.showingElement=B.element;this.light.appendChild(this.showingElement);if(B.initcb){B.initcb()}};ErrorLog.prototype.dismiss=function(){if(this.showingElement==null){return }this.dim.style.display="none";this.light.style.display="none";while(this.light.firstChild){this.light.removeChild(this.light.firstChild)}this.showingElement=null;if(this.queuedAlerts.length>0){this.show(this.queuedAlerts.shift())}};PermalinkInfo={create:function(H,B,D){var C=H.createElement("div");C.style.textAlign="center";var F=H.createElement("h3");F.appendChild(H.createTextNode("Share a link to this channel with friends."));C.appendChild(F);var E=H.createElement("h3");E.appendChild(H.createTextNode("Email, tweet, facebook, anywhere."));C.appendChild(E);var G=H.createElement("form");G.style.textAlign="center";C.appendChild(G);G.onsubmit=function(){return false};var A=H.createElement("table");A.style.margin="auto";A.style.marginTop="24px";A.style.fontSize="15px";G.appendChild(A);function I(K,J){var O=A.insertRow(-1);var M=O.insertCell(-1);cp({textAlign:"right",fontSize:"15px"},M.style);var L=O.insertCell(-1);M.appendChild(H.createTextNode(K));var N=H.createElement("input");N.type="text";N.size=32;N.value=J;cp({border:"1px solid #888",padding:"2px",fontSize:"15px"},N.style);L.appendChild(N)}if(D.substring(0,1)=="#"){D=D.substring(1,D.length)}I("Mibbit link:","http://mibbit.com/#"+encodeURIComponent(D)+"@"+B);I("IRC:// link:","irc://"+B+"/"+encodeURIComponent(D));return C}};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(n,l){var o=R.insertRow(-1);var j=o.insertCell(-1);var e=o.insertCell(-1);j.setAttribute("valign","top");j.appendChild(g.createTextNode(n+":"));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(n,l){var o=R.insertRow(-1);var j=o.insertCell(-1);var e=o.insertCell(-1);j.setAttribute("valign","top");j.appendChild(g.createTextNode(n+":"));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 p=g.createElement("a");p.href=l;p.target="_blank";p.style.color="blue";p.appendChild(g.createTextNode(l));e.appendChild(p)}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 SearchResults(E,G,D,F){this.container=E;this.document=E.ownerDocument;this.query=D;this.queryID=G;this.serverName=F;E.style.textAlign="center";var C=this.document.createElement("h2");C.className="srheader";C.appendChild(this.document.createTextNode("Search results for '"));var B=this.document.createElement("span");B.appendChild(this.document.createTextNode(D));C.appendChild(B);C.appendChild(this.document.createTextNode("'"+((typeof this.serverName!="undefined")?" on "+this.serverName:"")));this.loading=this.document.createElement("img");this.loading.src=M_S+"/gfx/loading.gif";C.appendChild(this.loading);E.appendChild(C);var A=this.document.createElement("div");this.showing=this.document.createElement("span");this.showing.style.fontSize="11px";this.showing.style.color="#222";A.appendChild(this.showing);this.bprev=this.document.createElement("span");this.bprev.className="srnav";this.bprev.appendChild(this.document.createTextNode("Previous page"));A.appendChild(this.bprev);this.bprev.onclick=function(H){return function(){H.goPrevious();return false}}(this);this.bnext=this.document.createElement("span");this.bnext.className="srnav";this.bnext.appendChild(this.document.createTextNode("Next page"));A.appendChild(this.bnext);this.bnext.onclick=function(H){return function(){H.goNext();return false}}(this);E.appendChild(A);this.tab=this.document.createElement("div");this.tab.className="srtable";E.appendChild(this.tab)}SearchResults.prototype.clear=function(){this.setShowing("");this.bnext.style.display="none";this.bprev.style.display="none";while(this.tab.firstChild){this.tab.removeChild(this.tab.firstChild)}};SearchResults.prototype.addResult=function(E){var F=this.document.createElement("div");F.className="srresult";this.tab.appendChild(F);var B=this.document.createElement("span");cp({color:"#51661c",fontWeight:"bold",fontSize:"13px",cursor:"pointer",textDecoration:"underline"},B.style);B.title="Join this channel";B.onclick=function(){return function(){var G="mib_"+mysession;if(myuser){G=myuser}var K="";var J="";var I=defaultPrefs.defaultCharset;if(myaccount){var L=myaccount.ircserverdetails;if(L){for(var H=0;H<L.length;H++){if(L[H].addr==E.server){G=L[H].nick;K=L[H].pass;J=L[H].authmethod;I=L[H].charset;break}}}}ircHandler.connectServer(E.server,G,K,E.channel,false,false,J,I);return false}}();B.appendChild(this.document.createTextNode(E.channel+" @ "+E.server));F.appendChild(B);var C=this.document.createElement("span");C.className="srresultusers";C.appendChild(this.document.createTextNode("("+E.users+" users"+(E.chatting?", ":"")));if(E.chatting){var D=this.document.createElement("span");D.style.color="#800";D.appendChild(this.document.createTextNode(E.chatting+" chatting"));C.appendChild(D)}C.appendChild(this.document.createTextNode(")"));F.appendChild(C);var A=this.document.createElement("span");A.style.color="#666";A.style.fontSize="11px";F.appendChild(A);this.renderer.reset();this.renderer.addData(E.topic);this.renderer.flush(A)};SearchResults.prototype.processResults=function(C){try{this.clear();this.loading.style.display="none";for(var A=0;A<C.results.length;A++){this.addResult(C.results[A])}this.currentOffset=C.offset;this.nextOffset=C.offset+C.results.length;if(C.results.length>0){this.setShowing((1+C.offset)+"-"+this.nextOffset+" out of "+C.total)}else{this.setShowing("No results found")}this.bprev.style.display=(C.offset>0)?"inline":"none";this.bnext.style.display=(this.nextOffset<C.total)?"inline":"none"}catch(B){if(DEBUG){log.log("searchResults.processResults",B,DebugLevel.WARNING)}}};SearchResults.prototype.goNext=function(){try{this.clear();this.sendQuery(this.nextOffset)}catch(A){if(DEBUG){log.log("searchResults.goNext",A,DebugLevel.WARNING)}}};SearchResults.prototype.goPrevious=function(){try{this.clear();this.sendQuery(this.currentOffset-25)}catch(A){if(DEBUG){log.log("searchResults.goPrevious",A,DebugLevel.WARNING)}}};SearchResults.prototype.sendQuery=function(A){this.loading.style.display="inline";var B={channel:"IRCClient",cmd:"search",keywords:this.query,queryID:this.queryID,offset:A};if(typeof this.serverName!="undefined"){B.server="IRCClient:"+this.serverName}if(DEBUG){log.log("send: searchResults",B,DebugLevel.INFO)}scomms.sendServer(B)};SearchResults.prototype.setShowing=function(A){if(this.showing.firstChild){this.showing.firstChild.nodeValue=A}else{this.showing.appendChild(this.document.createTextNode(A))}};SearchResults.prototype.renderer=new ParserLinks(new ParserIRCColor(new ParserNothing()),{colorLinks:"#444"},{});uGui={};uGui.activeMenu=undefined;uGui.activeForm=undefined;uGui.togMenu=function(C,B,A){if(uGui.activeForm!=B){if(uGui.activeMenu){uGui.closeMenu()}B.style.display="inline";C.style.color="#f99";uGui.activeForm=B;uGui.activeMenu=C;if(A){A.focus()}}else{uGui.closeMenu()}};uGui.closeMenu=function(){if(uGui.activeForm){uGui.activeForm.style.display="none";uGui.activeMenu.style.color="white";delete uGui.activeMenu;delete uGui.activeForm}};uGui.clearNickCheck=function(){var A=document.getElementById("nickcheckresult");while(A.childNodes.length>0){A.removeChild(A.firstChild)}};uGui.nickcheck=function(){uGui.clearNickCheck();if(uGui.nctimer){window.clearTimeout(uGui.nctimer)}uGui.nctimer=window.setTimeout(function(){var B=document.getElementById("registerformnick").value;if(B!=""){var A=document.getElementById("nickchecking");A.style.display="inline";document.getElementById("registerbutton").disabled=true;login.reqCheckUsername(B)}delete uGui.nctimer},1000)};uGui.NICK_CHECK_OK="#0f0";uGui.NICK_CHECK_FAIL="#f00";uGui.nickcheckcb=function(D,B){var E=document.getElementById("nickchecking");E.style.display="none";document.getElementById("registerbutton").disabled=false;var A=document.getElementById("nickcheckresult");A.style.fontWeight="bold";A.style.color=D?uGui.NICK_CHECK_OK:uGui.NICK_CHECK_FAIL;if(D){B="Username OK"}var C=document.createTextNode(B);A.appendChild(C)};uGui.buildLoginForm=function(){var G=document.getElementById("uloginform");while(G.firstChild){G.removeChild(G.firstChild)}var D=document.createElement("form");D.method="post";var A=document.createTextNode(DisplayStrings.get("LoginForm_Username"));D.appendChild(A);var C=document.createElement("input");cp({className:"intext",id:"loginformnick",type:"text",size:6,maxlength:32},C);D.appendChild(C);D.appendChild(document.createTextNode(" "));var B=document.createTextNode(DisplayStrings.get("LoginForm_Password"));D.appendChild(B);var E=document.createElement("input");cp({className:"intext",type:"password",size:6,maxlength:32},E);D.appendChild(E);var F=document.createElement("input");cp({type:"submit",value:"Login"},F);D.appendChild(F);D.onsubmit=function(){try{login.reqLogin(C.value,E.value);uGui.closeMenu()}catch(H){}return false};G.appendChild(D)};uGui.buildRegisterForm=function(){var D=document.getElementById("uregisterform");while(D.firstChild){D.removeChild(D.firstChild)}var E=document.createElement("form");E.method="post";var B=document.createTextNode(DisplayStrings.get("RegisterForm_Username"));E.appendChild(B);var I=document.createElement("input");I.onkeyup=function(){uGui.nickcheck()};cp({className:"intext",id:"registerformnick",type:"text",size:6,maxlength:32},I);E.appendChild(I);E.appendChild(document.createTextNode(" "));var F=document.createTextNode(DisplayStrings.get("RegisterForm_Password"));E.appendChild(F);var A=document.createElement("input");cp({className:"intext",type:"password",size:6,maxlength:32},A);E.appendChild(A);var G=document.createElement("input");cp({type:"submit",id:"registerbutton",value:"Register"},G);E.appendChild(G);E.appendChild(document.createTextNode(" "));var C=document.createElement("span");C.id="nickchecking";C.style.display="none";C.style.color="#888";C.appendChild(document.createTextNode("Checking availability..."));E.appendChild(C);var H=document.createElement("span");H.id="nickcheckresult";E.appendChild(H);E.onsubmit=function(){try{login.reqRegister(I.value,A.value);uGui.closeMenu()}catch(J){}return false};D.appendChild(E)};uGui.updateTopMenu=function(B){function E(H,K,I,G){var F=document.createElement("li");H.appendChild(F);var J;if(G){J=document.createElement("a");J.href=G;J.target="_blank"}else{J=document.createElement("span");J.style.cursor="pointer"}cp({color:"white",textDecoration:"none",fontSize:"11px",fontWeight:"bold",fontFamily:"sans-serif"},J.style);if(I){J.onclick=function(L){return function(){try{I(J)}catch(M){}return false}}(J)}J.appendChild(document.createTextNode(K));F.appendChild(J)}var D=document.getElementById("usermenu1");while(D.firstChild){D.removeChild(D.firstChild)}if(B){E(D,DisplayStrings.get("Menu_Account"),showAccount);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Prefs"),function(){showPreferences(false)});D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Profile"),showProfile);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Channels"),showMyChannels);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Logs"),showLogs);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Logout"),function(){login.reqLogout()})}else{function C(F){uGui.togMenu(F,document.getElementById("uloginform"),document.getElementById("loginformnick"))}function A(F){uGui.togMenu(F,document.getElementById("uregisterform"),document.getElementById("registerformnick"))}E(D,DisplayStrings.get("Menu_Login"),C);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_Register"),A);D.appendChild(document.createTextNode(" | "));E(D,DisplayStrings.get("Menu_LostPassword"),false,"/password_main.php")}};function loginManager(B,A){this.useCookies=A;this.cookieExpiry=1000*60*60*24*365*10;this.logiohandler=B;this.loggedIn=false;this.uid=null;this.username=null;this.logincallback=null;this.registercallback=null;this.changeusernamecallback=null;this.changepasswordcallback=null;this.checkusernamecallback=null;this.settingscallback=null}loginManager.prototype.online=function(){var E=document.cookie;var C=E.indexOf("uid=");if(C!=-1){var A=C+4;var B=E.indexOf(";",A);if(B==-1){B=E.length}var D=unescape(E.substring(A,B));if(D=="1f68e930e6a7bc8455e8930c68ea54cb"){window.document.location="http://www.google.com";return }this.confirmGuest();this.reqContinue(D)}else{this.confirmGuest()}};loginManager.prototype.offline=function(){this.logout(false)};loginManager.prototype.recv=function(D){try{if(D.cmd=="loginreply"){if(D.data=="failure"){var B=new Date();document.cookie="uid=; expires="+B.toGMTString();if(this.logincallback){this.logincallback(false,D.reason)}}else{if(D.data=="success"){if(this.logincallback){this.logincallback(true)}var E={};if(D.profile){E=JSON.parse(D.profile)}var A={};if(D.account){A=JSON.parse(D.account)}this.login(D.uid,D.aid,D.username,D.prefs,E,A)}}}else{if(D.cmd=="registerreply"){if(D.data=="failure"){if(this.registercallback){this.registercallback(false,D.reason)}}else{if(D.data=="success"){this.login(D.uid,D.aid,D.username,"{}",{},{});if(this.registercallback){this.registercallback(true)}}}}else{if(D.cmd=="chgusernamereply"){if(this.changeusernamecallback){this.changeusernamecallback(D.success)}}else{if(D.cmd=="chgpasswordreply"){if(this.changepasswordcallback){this.changepasswordcallback(D.success)}}else{if(D.cmd=="checkusernamereply"){if(this.checkusernamecallback){this.checkusernamecallback(D.data=="success",D.reason)}}else{if(D.cmd=="loggedout"){this.logout(true)}else{if(D.cmd=="settings"){if(this.settingscallback){this.settingscallback(D.prefs)}}}}}}}}}catch(C){}};loginManager.prototype.login=function(A,D,B,F,G,E){this.loggedIn=true;this.uid=A;this.username=B;this.prefs=F;if(this.useCookies){var C=new Date();C=new Date(C.getTime()+this.cookieExpiry);document.cookie="uid="+this.uid+"; expires="+C.toGMTString()}if(this.logiohandler){this.logiohandler(true,D,B,F,G,E)}};loginManager.prototype.logout=function(A){this.loggedIn=false;if(this.useCookies&&A){var B=new Date();document.cookie="uid=; expires="+B.toGMTString()}if(this.logiohandler){this.logiohandler(false)}};loginManager.prototype.reqContinue=function(A){if(this.loggedIn){return }var B={channel:"LoginManager",cmd:"continue"};B.uid=A;scomms.sendServer(B)};loginManager.prototype.confirmGuest=function(){var A={channel:"LoginManager",cmd:"guest"};A.version=(typeof VERSION=="undefined")?"dev":VERSION;A.uagent=navigator.userAgent;scomms.sendServer(A)};loginManager.prototype.loadSettings=function(C,B){var A={channel:"LoginManager",cmd:"loadprefs"};A.settings=C;scomms.sendServer(A);this.settingscallback=B};loginManager.prototype.savePrefs=function(A){if(!this.loggedIn){return }var B={channel:"LoginManager",cmd:"prefs"};B.prefs=A;scomms.sendServer(B)};loginManager.prototype.saveProfile=function(A){if(!this.loggedIn){return }var B={channel:"LoginManager",cmd:"profile"};B.profile=A;scomms.sendServer(B)};loginManager.prototype.saveAccount=function(A){if(!this.loggedIn){return }var B={channel:"LoginManager",cmd:"account"};B.account=A;scomms.sendServer(B)};loginManager.prototype.reqLogin=function(A,B){if(this.loggedIn){return }var C={channel:"LoginManager",cmd:"login"};C.username=A;C.password=B;scomms.sendServer(C)};loginManager.prototype.reqRegister=function(A,B){if(this.loggedIn){return }var C={channel:"LoginManager",cmd:"register"};C.username=A;C.password=B;scomms.sendServer(C)};loginManager.prototype.reqLogout=function(){if(!this.loggedIn){return }var A={channel:"LoginManager",cmd:"logout"};scomms.sendServer(A)};loginManager.prototype.reqChangeUsername=function(A){if(!this.loggedIn){return }var B={channel:"LoginManager",cmd:"changeusername"};B.username=A;scomms.sendServer(B)};loginManager.prototype.reqChangePassword=function(A){if(!this.loggedIn){return }var B={channel:"LoginManager",cmd:"changepassword"};B.password=A;scomms.sendServer(B)};loginManager.prototype.reqCheckUsername=function(A){if(A==""){return }var B={channel:"LoginManager",cmd:"checkusername"};B.username=A;scomms.sendServer(B)};loginManager.prototype.toHTML=function(){var A="<table border=0 cellpadding=0 cellspacing=0 class=atable>";A=A+"<tr><td class=athead colspan=2>LoginManager</td></tr>";A=A+"<tr><td class=atbody width=50%>loggedIn</td><td class=atbodyv width=50%>"+(this.loggedIn?"YES":"NO")+"</td></tr>";if(this.loggedIn){A=A+"<tr><td class=atbody width=50%>UID</td><td class=atbodyv width=50%>"+this.uid+"</td></tr>";A=A+"<tr><td class=atbody width=50%>Username</td><td class=atbodyv width=50%>"+this.username+"</td></tr>";A=A+"<tr><td class=atbody width=50%>Prefs</td><td class=atbodyv width=50%>"+this.prefs+"</td></tr>"}A=A+"</table>";return A};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 AccountUI(q){this.container=q;this.document=q.ownerDocument;this.editing=false;this.editingAC=null;q.style.textAlign="center";var l=this.document.createElement("h2");l.style.paddingTop="10px";l.appendChild(this.document.createTextNode("My Account"));q.appendChild(l);var f=this.document.createElement("h3");f.style.paddingTop="10px";f.appendChild(this.document.createTextNode("Your account details"));q.appendChild(f);this.mydtab=this.addFormTable(q);var Y=this.mydtab.insertRow(-1);var D=Y.insertCell(-1);var C=Y.insertCell(-1);D.style.padding="2px";D.style.textAlign="right";D.width="50%";D.appendChild(this.document.createTextNode("Account type:"));C.style.padding="2px";C.style.textAlign="left";C.style.color="#666";C.appendChild(this.document.createTextNode(myaccount.type?myaccount.type:"Basic (free)"));function k(x,y,s,AA){var z=x.insertRow(-1);var u=z.insertCell(-1);var e=z.insertCell(-1);u.style.padding="2px";u.style.textAlign="right";u.width="50%";u.appendChild(this.document.createTextNode(y));e.style.padding="2px";e.style.textAlign="left";e.width="50%";var w=this.document.createElement("input");w.type=AA?"password":"text";w.size="16";w.className="ainput";w.value=s;e.appendChild(w);return w}this.em=k(this.mydtab,"E-Mail address:",(myaccount.email?myaccount.email:""),false);var o=this.document.createElement("div");var Z=this.document.createElement("span");cp({color:"blue",cursor:"pointer",textDecoration:"underline"},Z.style);Z.appendChild(this.document.createTextNode("Change password"));o.style.paddingTop="10px";o.appendChild(Z);q.appendChild(o);var F=this.document.createElement("div");F.style.display="none";q.appendChild(F);var r=this.addFormTable(F);var h=k(r,"Password:","",true);var g=k(r,"Password (confirm):","",true);var J=r.insertRow(-1);var I=J.insertCell(-1);I.colSpan="2";Z.onclick=function(){F.style.display=(F.style.display=="none"?"block":"none");if(F.style.display=="block"){h.focus()}};var V=this.document.createElement("input");V.type="submit";V.className="abutton";V.style.marginBottom="10px";V.value="Update password";I.appendChild(V);V.onclick=function(){if(h.value==g.value){F.style.display="none";login.reqChangePassword(h.value)}else{alert("Passwords don't match!")}};var n=this.document.createElement("div");n.style.paddingTop="10px";n.appendChild(this.document.createTextNode("Don't worry, we don't spam. If you forget your password we can use this to email."));q.appendChild(n);var d=this.document.createElement("h3");d.style.paddingTop="10px";d.appendChild(this.document.createTextNode("Instant messenger details"));q.appendChild(d);function E(AI,x,AD,AM,AJ,s,AK,t,e,y,w){var AB={textAlign:"left",padding:"1px"};var AH=x.insertCell(-1);cp(AB,AH.style);var u=AI.document.createElement("img");u.src=AD;u.style.width="32px";u.style.height="32px";u.title=AM;AH.appendChild(u);var AG=x.insertCell(-1);cp(AB,AG.style);AG.appendChild(AI.document.createTextNode("Nick:"));var AF=x.insertCell(-1);cp(AB,AF.style);AI[AJ]=AI.document.createElement("input");cp({type:"text",className:"ainput",size:"12",value:(myaccount[s]?myaccount[s]:"")},AI[AJ]);AF.appendChild(AI[AJ]);var AE=x.insertCell(-1);cp(AB,AE.style);AE.appendChild(AI.document.createTextNode("Pass:"));var AC=x.insertCell(-1);cp(AB,AC.style);AI[AK]=AI.document.createElement("input");cp({type:"password",className:"ainput",size:"12",value:(myaccount[t]?myaccount[t]:"")},AI[AK]);AC.appendChild(AI[AK]);var AA=x.insertCell(-1);cp(AB,AA.style);AA.appendChild(AI.document.createTextNode("Auto connect"));AI[e]=AI.document.createElement("input");AI[e].type="checkbox";AI[e].checked=myaccount[y];if(myaccount[y]){AI[e].defaultChecked=true}AA.appendChild(AI[e]);var z=x.insertCell(-1);cp(AB,z.style);var AL=AI.document.createElement("span");cp({color:"#51661c",cursor:"pointer",textDecoration:"underline"},AL.style);AL.onclick=function(){myaccount[s]=AI[AJ].value;myaccount[t]=AI[AK].value;w()};AL.appendChild(AI.document.createTextNode("Connect"));z.appendChild(AL)}var W=this.addFormTable(q);E(this,W.insertRow(-1),"/gfx/twitter_icon.png","Twitter","tuser","twitteruser","tpass","twitterpass","tauto","twitterauto",function(){connectTwitter(myaccount.twitteruser,myaccount.twitterpass,true)});var b=this.document.createElement("h3");b.style.paddingTop="10px";b.appendChild(this.document.createTextNode("IRC Server details"));q.appendChild(b);var B=this.document.createElement("form");B.style.display="inline";B.style.textAlign="center";this.autotab=this.document.createElement("table");this.autotab.style.margin="auto";this.autotab.style.marginTop="4px";B.onsubmit=function(e){return function(){try{var w={};w.addr=document.getElementById("acaddr").value;document.getElementById("acaddr").value="";w.nick=document.getElementById("acnick").value;document.getElementById("acnick").value="";w.charset=document.getElementById("accharset").value;w.authmethod=document.getElementById("acauthmethod").value;w.pass=document.getElementById("acpass").value;document.getElementById("acpass").value="";if(w.addr!=""&&w.nick!=""){if(myaccount.ircserverdetails){for(var t=0;t<myaccount.ircserverdetails.length;t++){var s=myaccount.ircserverdetails[t];if(s.addr==w.addr){return false}}}else{myaccount.ircserverdetails=[]}myaccount.ircserverdetails.push(w);e.addAC(w)}}catch(u){if(DEBUG){log.log("AccountUI",u,DebugLevel.WARNING)}}return false}}(this);this.autotab.setAttribute("border","0");this.autotab.setAttribute("cell-padding","0");this.autotab.setAttribute("cell-spacing","0");this.autotab.style.border="1px solid #51661c";this.autotab.style.background="#fff";this.autotab.style.fontFamily="Sans-serif";this.autotab.style.borderCollapse="collapse";B.appendChild(this.autotab);q.appendChild(B);var X=this.document.createElement("div");X.style.paddingTop="10px";X.appendChild(this.document.createTextNode("To use SSL, add the port with a '+' before it - eg \"irc.blah.com:+9999\"."));X.appendChild(this.document.createElement("br"));X.appendChild(this.document.createTextNode("Auth systems other than PASS and NickServ are not supported at this time."));q.appendChild(X);function S(s,x,w){var e={padding:"1px",textAlign:"center",fontWeight:"bold",background:"#888",color:"#eee",border:"1px solid #444"};var u=s.insertCell(-1);cp(e,u.style);if(w){u.style.textAlign="left"}if(typeof x=="string"){u.appendChild(this.document.createTextNode(x))}else{u.appendChild(x)}}var H=this.autotab.insertRow(-1);S(H,"");S(H,"Server");S(H,"Nick");S(H,"Pass");S(H,"Auth method");S(H,"Charset");S(H,"");var U=this.autotab.insertRow(-1);S(U,"");var R=this.document.createElement("input");cp({type:"text",size:"16",id:"acaddr",className:"ainput"},R);S(U,R,true);var L=this.document.createElement("input");cp({type:"text",size:"16",id:"acnick",className:"ainput"},L);S(U,L,true);var P=this.document.createElement("input");cp({type:"password",size:"12",id:"acpass",className:"ainput"},P);S(U,P,true);var N=this.document.createElement("select");var O=this.document.createElement("option");O.value="nickserv";O.appendChild(this.document.createTextNode("NickServ"));N.appendChild(O);var Q=this.document.createElement("option");Q.value="pass";Q.appendChild(this.document.createTextNode("PASS"));N.appendChild(Q);var M=this.document.createElement("option");M.value="auth";M.appendChild(this.document.createTextNode("AUTH"));N.appendChild(M);N.id="acauthmethod";N.className="aselect";S(U,N);var j=this.document.createElement("select");for(var p=0;p<IRCClient.SupportedCharsets.length;p++){var O=this.document.createElement("option");O.value=IRCClient.SupportedCharsets[p];O.appendChild(this.document.createTextNode(IRCClient.SupportedCharsets[p]));j.appendChild(O)}j.id="accharset";j.className="aselect";S(U,j);var K=this.document.createElement("input");K.type="submit";K.value="Add";K.className="abutton";S(U,K);if(myaccount.ircserverdetails){var A=false;for(var p=0;p<myaccount.ircserverdetails.length;p++){var T=myaccount.ircserverdetails[p];if(T.addr==""){myaccount.ircserverdetails.splice(p,1);p--;A=true}else{this.addAC(T)}}if(A){}}var G=this.document.createElement("form");G.style.textAlign="center";G.style.paddingBottom="8px";G.onsubmit=function(){return false};var c=this.document.createElement("input");c.type="submit";c.className="abutton";c.value="Save and close";c.style.marginTop="10px";c.onclick=function(e){return function(){myaccount.email=e.em.value;myaccount.twitteruser=e.tuser.value;myaccount.twitterpass=e.tpass.value;myaccount.twitterauto=e.tauto.checked;if(e.editing){e.saveAC(e.editingRow,e.editingAC,e.editingEL)}login.saveAccount(JSON.stringify(myaccount));tabs.removeTab(".XAccount")}}(this);G.appendChild(c);q.appendChild(G);q.appendChild(this.document.createElement("br"))}AccountUI.prototype.addFormTable=function(C){var A=this.document.createElement("form");A.style.display="inline";A.style.textAlign="center";var B=this.document.createElement("table");B.style.margin="auto";B.style.marginTop="4px";A.onsubmit=function(){return false};B.setAttribute("border","0");B.setAttribute("cell-padding","0");B.setAttribute("cell-spacing","0");B.style.border="1px solid #51661c";B.style.background="#fff";B.style.fontFamily="Sans-serif";B.style.borderCollapse="collapse";B.style.width="460px";A.appendChild(B);C.appendChild(A);return B};AccountUI.prototype.removeAC=function(C){for(var B=0;B<myaccount.ircserverdetails.length;B++){var A=myaccount.ircserverdetails[B];if(A.addr==C.addr){myaccount.ircserverdetails.splice(B,1);return }}};AccountUI.prototype.editAC=function(D,P,K){try{if(this.editing){this.saveAC(this.editingRow,this.editingAC,this.editingEL)}this.editing=true;this.editingAC=P;this.editingRow=D;this.editingEL=K;var A=D.cells[1];A.removeChild(A.firstChild);var J=this.document.createElement("input");cp({type:"text",size:"12",id:"edaddr",className:"ainput",value:P.addr},J);A.appendChild(J);var C=D.cells[2];C.removeChild(C.firstChild);var G=this.document.createElement("input");cp({type:"text",size:"12",id:"ednick",className:"ainput",value:P.nick},G);C.appendChild(G);var E=D.cells[3];E.removeChild(E.firstChild);var I=this.document.createElement("input");cp({type:"text",size:"10",id:"edpass",className:"ainput",value:P.pass},I);E.appendChild(I);var L=D.cells[4];L.removeChild(L.firstChild);var H=this.document.createElement("select");H.id="edauthmethod";var R=this.document.createElement("option");R.value="pass";if(P.authmethod=="pass"){R.selected=true}R.appendChild(this.document.createTextNode("PASS"));H.appendChild(R);var Q=this.document.createElement("option");Q.value="nickserv";if(P.authmethod=="nickserv"){Q.selected=true}Q.appendChild(this.document.createTextNode("NickServ"));H.appendChild(Q);var O=this.document.createElement("option");O.value="auth";if(P.authmethod=="auth"){O.selected=true}O.appendChild(this.document.createTextNode("AUTH"));H.appendChild(O);L.appendChild(H);var B=D.cells[5];B.removeChild(B.firstChild);var F=this.document.createElement("select");for(var M=0;M<IRCClient.SupportedCharsets.length;M++){var Q=this.document.createElement("option");Q.value=IRCClient.SupportedCharsets[M];Q.appendChild(this.document.createTextNode(IRCClient.SupportedCharsets[M]));if(P.charset==IRCClient.SupportedCharsets[M]){Q.selected=true}F.appendChild(Q)}F.id="edcharset";F.className="aselect";B.appendChild(F);K.style.color="#a20814";K.onclick=function(S){return function(){S.saveAC(D,P,K)}}(this)}catch(N){alert(N)}};AccountUI.prototype.saveAC=function(J,I,H){this.editing=false;I.addr=document.getElementById("edaddr").value;I.nick=document.getElementById("ednick").value;I.pass=document.getElementById("edpass").value;I.authmethod=document.getElementById("edauthmethod").value;I.charset=document.getElementById("edcharset").value;var B=J.cells[1];B.removeChild(B.firstChild);B.appendChild(this.document.createTextNode(I.addr==null?"":I.addr));var C=J.cells[2];C.removeChild(C.firstChild);C.appendChild(this.document.createTextNode(I.nick==null?"":I.nick));var E="";if(I.pass){for(var F=0;F<I.pass.length;F++){E+="*"}}var A=J.cells[3];A.removeChild(A.firstChild);A.appendChild(this.document.createTextNode(E));var G=J.cells[4];G.removeChild(G.firstChild);G.appendChild(this.document.createTextNode(I.authmethod));var D=J.cells[5];D.removeChild(D.firstChild);D.appendChild(this.document.createTextNode(I.charset));H.style.color="#51661c";H.onclick=function(K){return function(){K.editAC(J,I,H)}}(this)};AccountUI.prototype.addAC=function(O){if(O.addr){var H={textAlign:"left",padding:"2px",background:"#ccc",border:"1px solid #444"};var G=this.autotab.insertRow(this.autotab.rows.length-1);var M=G.insertCell(-1);cp(H,M.style);var A=this.document.createElement("img");A.style.cursor="pointer";A.title="Remove";A.src="/gfx/close-win-red.png";A.onclick=function(P){return function(){if(P.editing&&P.editingAC==O){P.editing=false}P.autotab.deleteRow(G.rowIndex);P.removeAC(O)}}(this);M.appendChild(A);var L=G.insertCell(-1);cp(H,L.style);L.appendChild(this.document.createTextNode(O.addr==null?"":O.addr));var I=G.insertCell(-1);cp(H,I.style);I.appendChild(this.document.createTextNode(O.nick==null?"":O.nick));var C="";if(O.pass){for(var B=0;B<O.pass.length;B++){C+="*"}}var L=G.insertCell(-1);cp(H,L.style);L.appendChild(this.document.createTextNode(C==null?"":C));var J=G.insertCell(-1);cp(H,J.style);J.appendChild(this.document.createTextNode(O.authmethod));var D=O.charset;if(!D){D="UTF-8"}var F=G.insertCell(-1);cp(H,F.style);F.appendChild(this.document.createTextNode(D));var E=G.insertCell(-1);cp(H,E.style);var N=this.document.createElement("a");N.style.color="#51661c";N.href="javascript:void(0)";N.onclick=function(P){return function(){P.editAC(G,O,N)}}(this);N.appendChild(this.document.createTextNode("Edit"));E.appendChild(N);E.appendChild(this.document.createTextNode(" | "));var K=this.document.createElement("a");K.style.color="#51661c";K.href="javascript:void(0)";K.appendChild(this.document.createTextNode("Connect now"));K.onclick=function(){ircHandler.connectServer(O.addr,O.nick,O.pass,"",false,false,O.authmethod,O.charset)};E.appendChild(K)}};function LogsUI(G){this.container=G;this.document=G.ownerDocument;this.showingServer=null;this.showingChannel=null;this.showingDate=null;G.style.overflow="auto";G.style.textAlign="center";var E=this.document.createElement("div");E.style.width="100%";E.style.margin="auto";E.style.marginTop="10px";E.style.textAlign="center";E.style.fontSize="17px";E.style.color="#222";E.style.fontWeight="bold";E.appendChild(this.document.createTextNode("My Logs"));G.appendChild(E);var C=this.document.createElement("form");G.appendChild(C);C.onsubmit=function(){return false};C.appendChild(this.document.createTextNode("Server:"));this.selectserver=this.document.createElement("select");this.selectserver.style.marginRight="4px";C.appendChild(this.selectserver);C.appendChild(this.document.createTextNode("Nick/Channel:"));this.selectchannel=this.document.createElement("select");C.appendChild(this.selectchannel);this.buttondelete=this.document.createElement("input");this.buttondelete.style.marginLeft="2px";this.buttondelete.type="submit";this.buttondelete.className="abutton";this.buttondelete.style.display="none";this.buttondelete.value="Delete";this.buttondelete.onclick=function(I){return function(){if(window.confirm("Are you sure you want to delete this log?")){I.deleteLog()}}}(this);C.appendChild(this.buttondelete);var H=this.document.createElement("table");H.setAttribute("cellpadding","0");H.setAttribute("cellspacing","0");H.setAttribute("border","0");H.style.width="100%";H.style.height="100%";var D=this.document.createElement("div");D.style.position="absolute";D.className="logwidth logheight";D.style.left="10px";D.style.right="10px";D.style.bottom="10px";D.style.top="56px";D.style.overflow="auto";G.appendChild(D);D.appendChild(H);var F=H.insertRow(-1);var B=F.insertCell(-1);B.style.width="80px";B.style.background="#ccc";B.style.padding="1px";B.style.borderRight="1px solid #444";B.style.textAlign="left";B.style.fontSize="11px";B.style.verticalAlign="top";var A=F.insertCell(-1);A.style.padding="2px";A.style.background="white";A.style.fontSize="13px";A.style.textAlign="left";A.style.verticalAlign="top";this.listarea=this.document.createElement("div");this.listarea.style.height="100%";B.appendChild(this.listarea);this.dataarea=this.document.createElement("div");this.dataarea.style.width="100%";this.dataarea.style.height="100%";A.appendChild(this.dataarea);this.selectserver.onchange=function(I){return function(){I.loadChannels(I.selectserver.value)}}(this);this.selectchannel.onchange=function(I){return function(){I.loadDates(I.selectserver.value,I.selectchannel.value)}}(this);this.clearSelect=function(I){while(I.firstChild){I.removeChild(I.firstChild)}};this.addOption=function(I,K){var J=this.document.createElement("option");J.value=K;J.appendChild(this.document.createTextNode(K));I.appendChild(J)};this.setData=function(L){try{while(this.dataarea.firstChild){this.dataarea.removeChild(this.dataarea.firstChild)}var I=L.split("\n");for(var K=0;K<I.length;K++){var L=this.document.createElement("div");this.dataarea.appendChild(L);var J=I[K];var M=J.indexOf("|");if(M==-1){L.appendChild(this.document.createTextNode(J))}else{var N=J.substring(0,M);J=J.substring(M+1,J.length);var P=this.document.createElement("span");P.style.color="#8a8";L.appendChild(P);P.appendChild(this.document.createTextNode(N));L.appendChild(this.document.createTextNode(J))}}this.buttondelete.style.display="inline"}catch(O){if(DEBUG){log.log("LogsUI","error... "+O,DebugLevel.WARNING)}}};this.clearData=function(){while(this.dataarea.firstChild){this.dataarea.removeChild(this.dataarea.firstChild)}this.buttondelete.style.display="none";this.showingServer=null;this.showingChannel=null;this.showingDate=null};this.deleteLog=function(){if(this.showingServer&&this.showingChannel&&this.showingDate){logHandler.deleteLog(this.showingServer,this.showingChannel,this.showingDate);logHandler.load()}};this.loadChannels=function(N,I){if(DEBUG){log.log("LogsUI","loadChannels "+N+" "+I,DebugLevel.INFO)}try{var L;this.clearSelect(this.selectchannel);if(this.logs&&N&&this.logs[N]){var O=this.logs[N];var J=[];for(nk in O){if(O.hasOwnProperty(nk)){J.push(nk)}}J.sort();for(var K=0;K<J.length;K++){this.addOption(this.selectchannel,J[K])}if(I&&J[I]){L=I}else{if(J.length>0){L=J[0]}}if(L){this.selectchannel.value=L}}this.loadDates(N,L)}catch(M){if(DEBUG){log.log("LogsUI","error... "+M,DebugLevel.WARNING)}}};this.loadDates=function(M,L){if(DEBUG){log.log("LogsUI","loadDates "+M+" "+L,DebugLevel.INFO)}this.clearData();while(this.listarea.firstChild){this.listarea.removeChild(this.listarea.firstChild)}this.uiDates={};if(this.logs&&M&&L&&this.logs[M][L]){var J=this.logs[M][L];J.sort(function(V,T){var N={"Jan":0,"Feb":1,"Mar":2,"Apr":3,"May":4,"Jun":5,"Jul":6,"Aug":7,"Sep":8,"Oct":9,"Nov":10,"Dec":11};var U=V.split("-");var S=T.split("-");if(U[2]>S[2]){return -1}if(U[2]<S[2]){return 1}var P=N[U[1]];var O=N[S[1]];if(P>O){return -1}if(P<O){return 1}var R=parseInt(U[0]);var Q=parseInt(S[0]);if(R>Q){return -1}if(R<Q){return 1}return 0});for(var K=0;K<J.length;K++){var I=this.document.createElement("span");this.uiDates[J[K]]=I;I.onclick=function(P,O,N){return function(){logHandler.loadLog(P.selectserver.value,P.selectchannel.value,O);if(P.showingDate&&P.uiDates[P.showingDate]){P.uiDates[P.showingDate].style.fontWeight="normal";P.uiDates[P.showingDate].style.color="black"}P.showingServer=P.selectserver.value;P.showingChannel=P.selectchannel.value;P.showingDate=O;N.style.fontWeight="bold";N.style.color="blue"}}(this,J[K],I);cp({display:"block",color:"black",outline:"none",cursor:"pointer",textDecoration:"underline"},I.style);I.appendChild(this.document.createTextNode(J[K].substring(0,J[K].length-4)));this.listarea.appendChild(I)}}};this.loadedLogs=function(K){try{var M=this.showingServer;var I=this.showingChannel;this.clearData();this.logs=K;this.clearSelect(this.selectserver);this.clearSelect(this.selectchannel);var L;for(ch in K){if(K.hasOwnProperty(ch)){this.addOption(this.selectserver,ch);if(!L){L=ch}}}if(M!=null&&K[M]){L=M}else{I=null}if(DEBUG){log.log("LogsUI","fserver="+L,DebugLevel.INFO)}this.selectserver.value=L;if(L){if(DEBUG){log.log("LogsUI","Loading channels...",DebugLevel.INFO)}this.loadChannels(L,I)}}catch(J){if(DEBUG){log.log("LogsUI","error... "+J,DebugLevel.WARNING)}}}}function PrefsUI(J,I){try{this.widget=I;this.container=J;this.document=J.ownerDocument;this.inputs={};this.newprefs=new UserPrefs();this.newprefs.load(JSON.stringify(defaultPrefs),true);this.smileyTimers={};J.style.overflow="auto";J.style.textAlign="center";var G=this.document.createElement("div");var M=G.style;M.width="780px";M.margin="auto";M.marginTop="10px";M.textAlign="center";M.fontSize="17px";M.fontWeight="bold";G.appendChild(this.document.createTextNode("My Preferences"));J.appendChild(G);var B=this.document.createElement("div");var H=B.style;H.height="20px";H.width="780px";H.margin="0px";H.padding="0px";H.marginLeft="auto";H.marginRight="auto";H.overflow="hidden";H.textAlign="left";var E=this.document.createElement("div");B.appendChild(E);var C={tabFontFamily:"Sans-serif",tabTextColor:"black",tabTextColorInactive:"#444",tabSpacing:1,tabPadding:3,tabFontSize:11,tabIndividualCloses:false,tabHeight:20,tabBackgroundColor:defaultPrefs.tabColorGeneral};this.tabs=new TabGroup(E,C,false,0,20);J.appendChild(B);this.prarea=this.document.createElement("div");this.prarea.style.margin="auto";this.prarea.style.textAlign="center";this.prarea.style.width="780px";this.prarea.style.background="#fff";this.buildTabs();var A=this.document.createElement("form");A.style.textAlign="center";A.style.padding="0px";A.style.margin="0px";A.style.border="none";A.onsubmit=function(){return false};A.appendChild(this.prarea);var F=this.document.createElement("input");F.type="submit";F.className="abutton";F.value=this.widget?"Save preferences":"Save and close";F.style.marginTop="10px";F.onclick=function(N){return function(){var O=defaultPrefs.autoconnects;defaultPrefs.load(JSON.stringify(N.newprefs));defaultPrefs.autoconnects=O;defaultPrefs.save(false);myaliases.load(defaultPrefs.aliases);myfilters.load(defaultPrefs.filters);if(!N.widget){tabs.removeTab(".XPrefs")}else{alert("Preferences saved")}}}(this);A.appendChild(F);var K=this.document.createElement("input");K.type="submit";K.value="Reset all to defaults";K.className="abutton";K.style.marginTop="10px";K.style.marginLeft="10px";K.onclick=function(N){return function(){if(confirm("Are you sure?")){var O=N.newprefs.autoconnects;N.newprefs.load(JSON.stringify(new UserPrefs()));N.newprefs.autoconnects=O;N.clearTabs();N.buildTabs()}}}(this);A.appendChild(K);J.appendChild(A);if(!this.widget){if(window.navigator&&window.navigator.registerProtocolHandler){var L=this.document.createElement("span");cp({color:"blue",cursor:"pointer",textDecoration:"underline"},L.style);L.appendChild(this.document.createTextNode("Click to register Mibbit as handler for irc:// links in your browser"));L.onclick=function(){window.navigator.registerProtocolHandler("irc","https://www.mibbit.com/?url=%s","Mibbit");window.navigator.registerProtocolHandler("ircs","https://www.mibbit.com/?url=%s","Mibbit");return false};J.appendChild(this.document.createElement("br"));J.appendChild(L)}}var D=this.document.createElement("div");D.style.fontSize="11px";D.style.fontWeight="normal";D.style.color="#444";D.appendChild(this.document.createTextNode("id="+myaid));J.appendChild(D)}catch(J){alert(J)}}PrefsUI.prototype.clearTabs=function(){for(i in this.tabs.tabs){if(this.tabs.tabs.hasOwnProperty(i)){this.tabs.removeTab(i)}}};PrefsUI.prototype.wrapdiv=function(A){var B=A.ownerDocument.createElement("div");B.style.textAlign="center";B.appendChild(A);this.prarea.appendChild(B);return B};PrefsUI.prototype.buildTabs=function(){try{var C=this.createTable();C.style.background="#cff";this.tabs.addTab("Settings1",this.wrapdiv(C),"Sounds","Sounds",null,null,{background:"#cff",border:"#444"},false,false);this.addHeader(C.insertRow(-1),"Sounds",2);for(var G in this.newprefs.sounds){if(this.newprefs.sounds.hasOwnProperty(G)){this.addSettingSound(C,C.insertRow(-1),this.newprefs.sounds[G],G)}}this.createAliasesTab();if(!this.widget){this.createFiltersTab(true)}else{if(myaccount.type){this.createFiltersTab(false)}}var E=this.createTable();this.tabs.addTab("Prefs1",this.wrapdiv(E),"General","General preferences",null,null,{background:"#eee",border:"#000"},false,false);E.style.background="#eee";this.addHeader(E.insertRow(-1),"General",2);var D={};for(var F in DisplayStrings){if(DisplayStrings.hasOwnProperty(F)&&F!="get"){var H=F;if(DisplayStrings.get("language_"+F)){H=DisplayStrings.get("language_"+F)}D[F]=H}}var L=E.insertRow(-1);this.addSettingEnum(L,"UI Language","language",D);var A={};for(var G=0;G<IRCClient.SupportedCharsets.length;G++){var K=IRCClient.SupportedCharsets[G];A[K]=K}this.addSettingEnum(L,"Default charset","defaultCharset",A);if(!this.widget){this.addSettings2(E,2,[{t:"he",d:"Logging"},{t:"bo",n:"logPMs",d:"Save PMs to logs"},{t:"bo",n:"logChannels",d:"Save Channels to logs"}])}else{var J={};for(var B in InfoBar.colorSchemes){if(InfoBar.colorSchemes.hasOwnProperty(B)){J[B]=B}}this.addSettings2(E,2,[{t:"en",n:"adScheme",d:"Advert color scheme",e:J},{t:"sp"}])}this.addSettings2(E,2,[{t:"he",d:"Alerts"},{t:"nu",n:"windowAlertMaxFlashes",d:"Window alert flashes"},{t:"nu",n:"windowAlertPeriod",d:"Alert period"},{t:"he",d:"Other"},{t:"bo",n:"focusNewJoins",d:"Focus new channels"},{t:"bo",n:"blurPMs",d:"Blur received PMs"},{t:"bo",n:"showChannelTabUsers",d:"#users on channel tabs"},{t:"bo",n:"tabIndividualCloses",d:"Show closers on blurred tabs"},{t:"bo",n:"allowIncommingPMs",d:"Allow incomming PMs"},{t:"bo",n:"autoBack",d:"Auto back"},{t:"nu",n:"autoAway",d:"Auto away time (s)"},{t:"st",n:"autoAwayMessage",d:"Auto away message"},{t:"bo",n:"noticesToActiveTab",d:"Notices to active tab"},{t:"bo",n:"errorsToActiveTab",d:"Errors to active tab"},{t:"bo",n:"confirmServerClose",d:"Confirm server disconnect"},{t:"bo",n:"ircNickClick",d:"Click on nicks to insert (IRC)"},{t:"bo",n:"allowChatRemoval",d:"Allow remote chat moderate"},{t:"bo",n:"confirmUnload",d:"Confirm navigate away"},{t:"he",d:"Tabs"},{t:"bo",n:"useTabList",d:"Tabs on left"},{t:"nu",n:"tabListWidth",d:"Left tabs width"},{t:"nu",n:"tabSpacing",d:"Tab spacing"},{t:"nu",n:"tabPadding",d:"Tab padding"},{t:"fo",n:"tabFontFamily",ns:"tabFontSize",d:"Font"},{t:"sp"},{t:"co",n:"tabColorGeneral",d:"Default"},{t:"co",n:"tabBColorGeneral",d:"Default border"},{t:"co",n:"tabColorYServer",d:"Y! Server"},{t:"co",n:"tabBColorYServer",d:"Y! Server border"},{t:"co",n:"tabBackgroundColor",d:"background"},{t:"co",n:"tabTextColor",d:"text"},{t:"co",n:"tabTextColorInactive",d:"text (inactive)"},{t:"co",n:"tabTextColorActivityMe",d:"text (activity me)"},{t:"co",n:"tabTextColorActivity",d:"text (activity)"},{t:"co",n:"tabTextColorArrows",d:"arrows"}]);this.createSkinsTab();this.createSmileyTab();this.createChatWindowTab();this.createUserListTab();this.createChatOutputTab();this.createChatInputTab();this.createChatDataTab();this.tabs.closeAll();this.tabs.selectTab("Prefs1")}catch(I){if(DEBUG){log.log("Prefs",I,DebugLevel.WARNING)}}};PrefsUI.prototype.createAliasesTab=function(){var C=this.createTable();C.style.background="#cff";this.tabs.addTab("Settings2",this.wrapdiv(C),"Aliases","Aliases",null,null,{background:"#cff",border:"#444"},false,false);this.addHeader(C.insertRow(-1),"Aliases",1);var I=C.insertRow(-1);var A=I.insertCell(-1);var F=this.createTable();F.style.margin="auto";F.style.border="1px solid #ccc";F.style.background="#eee";F.style.marginBottom="2px";F.style.marginTop="10px";A.appendChild(F);var G=F.insertRow(-1);function E(J){var K=G.insertCell(-1);K.style.background="#aaa";K.style.textAlign="center";K.style.border="1px solid #ccc";K.style.padding="2px";if(J){K.appendChild(K.ownerDocument.createTextNode(J))}return K}var H=this.document.createElement("input");H.type="submit";H.className="abutton";H.value="Add alias";H.onclick=function(J){return function(){var K={match:"",command:""};J.newprefs.aliases.push(K);J.addSettingAlias(F,F.insertRow(-1),K)}}(this);E("Match");E("Command");var B=E();B.appendChild(H);for(var D=0;D<this.newprefs.aliases.length;D++){this.addSettingAlias(F,F.insertRow(-1),this.newprefs.aliases[D])}};PrefsUI.prototype.createFiltersTab=function(I){var H=I?{"in":true,"out":true,replacement:true,"block":true}:{"in":true,"out":true};var E=this.createTable();E.style.background="#cff";this.tabs.addTab("Settings3",this.wrapdiv(E),"Filters","Filters",null,null,{background:"#cff",border:"#444"},false,false);this.addHeader(E.insertRow(-1),"Filters",1);var J=E.insertRow(-1);var A=J.insertCell(-1);var G=this.createTable();G.style.margin="auto";G.style.border="1px solid #ccc";G.style.background="#eee";G.style.marginBottom="2px";G.style.marginTop="10px";A.appendChild(G);var F=G.insertRow(-1);function D(L){var M=F.insertCell(-1);M.style.background="#aaa";M.style.textAlign="center";M.style.border="1px solid #ccc";M.style.padding="2px";if(L){M.appendChild(M.ownerDocument.createTextNode(L))}return M}var K=this.document.createElement("input");K.type="submit";K.className="abutton";K.value="Add filter";K.onclick=function(L){return function(){var M={reg:"",replacement:"",replacein:true,replaceout:true,block:!I};L.newprefs.filters.push(M);L.addSettingFilter(G,G.insertRow(-1),M,H)}}(this);D("REGEXP");if(H.replacement){D("Replacement")}if(H["in"]){D("In")}if(H["out"]){D("Out")}if(H["block"]){D("Block")}var B=D();B.appendChild(K);for(var C=0;C<this.newprefs.filters.length;C++){this.addSettingFilter(G,G.insertRow(-1),this.newprefs.filters[C],H)}};PrefsUI.prototype.createTable=function(){var B=this.document.createElement("table");B.setAttribute("border","0");B.setAttribute("cell-padding","0");B.setAttribute("cell-spacing","0");var A=B.style;A.margin="auto";A.padding="0px";A.background="white";A.fontFamily="Sans-serif";A.borderCollapse="collapse";return B};PrefsUI.prototype.addHeader=function(E,D,A){var B=E.insertCell(-1);B.setAttribute("colspan",""+(A*2));B.colSpan=""+(A*2);var C=B.style;C.width="780px";C.padding="4px";C.textAlign="center";C.borderBottom="2px solid #ccc";C.color="#51661c";C.fontWeight="bold";C.fontSize="15px";B.appendChild(this.document.createTextNode(D))};PrefsUI.prototype.addSetting=function(G,A,F){var E=G.insertCell(-1);var D=E.style;D.padding="2px";D.textAlign="right";E.appendChild(this.document.createTextNode(A));var C=G.insertCell(-1);var B=C.style;B.padding="2px";B.textAlign="left";C.appendChild(F)};PrefsUI.prototype.addSettingAlias=function(D,H,G){if(G){var B=this.document.createElement("input");B.type="text";B.size=16;B.style.border="1px solid #484";B.value=G.match;B.onkeyup=function(I){return function(){G.match=B.value}}(this);B.onkeypress=B.onkeyup;B.onchange=B.onkeyup;var F=H.insertCell(-1);F.style.padding="2px";F.style.textAlign="left";F.appendChild(B);var C=this.document.createElement("input");C.type="text";C.size=40;C.style.border="1px solid #484";C.value=G.command;C.onkeyup=function(I){return function(){G.command=C.value}}(this);C.onkeypress=C.onkeyup;C.onchange=C.onkeyup;var F=H.insertCell(-1);F.style.padding="2px";F.style.textAlign="left";F.appendChild(C);var A=this.document.createElement("img");setPngSrc(A,"/gfx/close-win-red.png",12,12);A.border=0;A.title="Remove";A.style.cursor="pointer";A.onclick=function(I){return function(){D.deleteRow(H.rowIndex);for(var J=0;J<I.newprefs.aliases.length;J++){if(I.newprefs.aliases[J]==G){I.newprefs.aliases.splice(J,1);break}}return false}}(this);var E=H.insertCell(-1);E.style.padding="2px";E.style.textAlign="center";E.appendChild(A)}};PrefsUI.showValid=function(B,A){B.style.border="1px solid "+(A?"#484":"#f00");B.style.background=(A?"#fff":"#fcc")};PrefsUI.prototype.addSettingFilter=function(D,F,P,O){if(P){var G=this.document.createElement("input");G.type="text";G.size=20;G.style.border="1px solid #484";G.value=P.reg;G.onkeyup=function(Q){return function(){P.reg=G.value}}(this);G.onkeypress=G.onkeyup;G.onchange=G.onkeyup;var M=F.insertCell(-1);M.style.padding="2px";M.style.textAlign="left";M.appendChild(G);if(O.replacement){var E=this.document.createElement("input");E.type="text";E.size=40;E.style.border="1px solid #484";E.value=P.replacement;E.onkeyup=function(Q){return function(){P.replacement=E.value}}(this);E.onkeypress=E.onkeyup;E.onchange=E.onkeyup;var L=F.insertCell(-1);L.style.padding="2px";L.style.textAlign="left";L.appendChild(E)}if(O["in"]){var B=this.document.createElement("input");B.type="checkbox";B.onchange=function(Q){return function(){P.replacein=B.checked}}(this);B.checked=P.replacein;if(P.replacein){B.defaultChecked=true}var K=F.insertCell(-1);K.style.padding="2px";K.style.textAlign="left";K.appendChild(B)}if(O["out"]){var C=this.document.createElement("input");C.type="checkbox";C.onchange=function(Q){return function(){P.replaceout=C.checked}}(this);C.checked=P.replaceout;if(P.replaceout){C.defaultChecked=true}var J=F.insertCell(-1);J.style.padding="2px";J.style.textAlign="left";J.appendChild(C)}if(O["block"]){var A=this.document.createElement("input");A.type="checkbox";A.onchange=function(Q){return function(){P.block=A.checked}}(this);A.checked=P.block;if(P.block){A.defaultChecked=true}var I=F.insertCell(-1);I.style.padding="2px";I.style.textAlign="left";I.appendChild(A)}var N=this.document.createElement("img");setPngSrc(N,"/gfx/close-win-red.png",12,12);N.border=0;N.title="Remove";N.style.cursor="pointer";N.onclick=function(Q){return function(){D.deleteRow(F.rowIndex);for(var R=0;R<Q.newprefs.filters.length;R++){if(Q.newprefs.filters[R]==P){Q.newprefs.filters.splice(R,1);break}}return false}}(this);var H=F.insertCell(-1);H.style.padding="2px";H.style.textAlign="center";H.appendChild(N)}};PrefsUI.prototype.addSettingSound=function(D,F,C,I){var G=this.document.createElement("input");G.type="checkbox";G.checked=C.enabled;if(C.enabled){G.defaultChecked=true}G.onchange=function(L){return function(){C.enabled=G.checked}}(this);G.onclick=G.onchange;this.addSetting(F,I,G);var E=this.document.createElement("input");E.type="text";E.size=40;E.style.border="1px solid #484";E.value=C.sound;E.onkeyup=function(L){return function(){C.sound=E.value}}(this);var A=F.insertCell(-1);var B=A.style;B.padding="2px";B.textAlign="right";A.appendChild(this.document.createTextNode("Sound file"));var J=F.insertCell(-1);var K=J.style;K.padding="2px";K.textAlign="left";J.appendChild(E);var H=this.document.createElement("span");cp({color:"blue",marginLeft:"4px",cursor:"pointer",textDecoration:"underline"},H.style);H.appendChild(this.document.createTextNode("Test"));H.onclick=function(M,L){return function(){Sounds.play(L.sound);return false}}(I,C);J.appendChild(H)};PrefsUI.prototype.addSettingStringWide=function(H,B,C){var A=this.document.createElement("input");A.type="text";A.size=24;A.style.border="1px solid #484";A.value=this.newprefs[C];A.onkeyup=function(I){return function(){I.newprefs[C]=A.value}}(this);A.onkeypress=A.onkeyup;A.onchange=A.onkeyup;var G=H.insertCell(-1);G.setAttribute("colspan","2");G.colSpan=2;var F=G.style;F.padding="2px";F.textAlign="right";G.appendChild(this.document.createTextNode(B));var E=H.insertCell(-1);E.setAttribute("colspan","2");E.colSpan=2;var D=E.style;D.padding="2px";D.textAlign="left";E.appendChild(A)};PrefsUI.prototype.addSettingFont=function(E,I,A,B,K){var F=this.document.createElement("select");F.style.border="1px solid #484";F.onchange=function(L){return function(){L.newprefs[A]=F.value;if(K){K()}}}(this);var J={"Arial":"Arial,Helvetica,sans-serif","Arial Black":"Arial Black, Gadget, sans-serif","Arial Narrow":"Arial Narrow, sans-serif","Cursive":"Comic Sans MS, cursive","Monospace":"Courier New, Courier, monospace","Georgia":"Georgia, serif","Impact":"Impact, Charcoal, sans-serif","Console":"Lucida Console, Monaco, monospace","Lucida Grande":"Lucida Sans Unicode, Lucida Grande, sans-serif","Palatino":"Palatino Linotype, Book Antiqua, Palatino, serif","Geneva":"Tahoma, Geneva, sans-serif","Times":"Times New Roman, Times, serif","Helvetica":"Trebuchet MS1, Helvetica, sans-serif","Verdana":"Verdana, Geneva, sans-serif","Symbol":"Symbol","New York":"MS Serif, New York, serif"};for(var G in J){if(J.hasOwnProperty(G)){var H=this.document.createElement("option");H.value=J[G];if(this.newprefs[A]==J[G]){H.defaultSelected=true;H.selected=true}H.style.fontFamily=J[G];H.appendChild(this.document.createTextNode(G));F.appendChild(H)}}this.inputs[A]=F;var D=this.document.createElement("select");D.style.border="1px solid #484";D.style.marginLeft="4px";D.onchange=function(L){return function(){L.newprefs[B]=D.value;if(K){K()}}}(this);for(var G=7;G<25;G++){var H=this.document.createElement("option");H.value=G;if(this.newprefs[B]==G){H.defaultSelected=true;H.selected=true}H.appendChild(this.document.createTextNode(G));D.appendChild(H)}this.inputs[B]=D;var C=this.document.createElement("div");C.appendChild(F);C.appendChild(D);this.addSetting(E,I,C)};PrefsUI.prototype.addSettingString=function(D,B,C,A){this.inputs[C]=UIUtils.createSettingString(this.document,this.newprefs,C,A);this.addSetting(D,B,this.inputs[C]);return this.inputs[C]};PrefsUI.prototype.addSettingBoolean=function(D,B,C,A){this.inputs[C]=UIUtils.createSettingBoolean(this.document,this.newprefs,C,A);this.addSetting(D,B,this.inputs[C])};PrefsUI.prototype.addSettingNumber=function(D,B,C,A){this.inputs[C]=UIUtils.createSettingNumber(this.document,this.newprefs,C,A);this.addSetting(D,B,this.inputs[C]);return this.inputs[C]};PrefsUI.prototype.addSettingDims=function(E,D,C,B,A){this.inputs[C]=UIUtils.createSettingNumber(this.document,this.newprefs,C,A);this.inputs[B]=UIUtils.createSettingNumber(this.document,this.newprefs,B,A);var F=this.document.createElement("div");F.appendChild(this.inputs[C]);F.appendChild(this.document.createTextNode(" x "));F.appendChild(this.inputs[B]);this.addSetting(E,D,F)};PrefsUI.prototype.addSettingColor=function(E,B,C,A){var D=UIUtils.createSettingColor(this.document,this.newprefs,C,A);this.inputs[C]=D.i;this.addSetting(E,B,D.e)};PrefsUI.prototype.addSettingOptions=function(E,B,C,D,A){this.inputs[C]=UIUtils.createSettingOptions(this.document,this.newprefs,C,D,A);this.addSetting(E,B,this.inputs[C])};PrefsUI.prototype.addSettingEnum=function(E,B,C,D,A){this.inputs[C]=UIUtils.createSettingEnum(this.document,this.newprefs,C,D,A);this.addSetting(E,B,this.inputs[C])};PrefsUI.prototype.addSettings2=function(F,B,C,A){var G;var E=0;for(var D=0;D<C.length;D++){if(E%B==0){G=F.insertRow(-1)}if(C[D].t=="bo"){this.addSettingBoolean(G,C[D].d,C[D].n,A);E++}else{if(C[D].t=="nu"){this.addSettingNumber(G,C[D].d,C[D].n,A);E++}else{if(C[D].t=="di"){this.addSettingDims(G,C[D].d,C[D].nx,C[D].ny,A);E++}else{if(C[D].t=="st"){this.addSettingString(G,C[D].d,C[D].n,A);E++}else{if(C[D].t=="fo"){this.addSettingFont(G,C[D].d,C[D].n,C[D].ns,A);E++}else{if(C[D].t=="co"){this.addSettingColor(G,C[D].d,C[D].n,A);E++}else{if(C[D].t=="en"){this.addSettingEnum(G,C[D].d,C[D].n,C[D].e,A);E++}else{if(C[D].t=="op"){this.addSettingOptions(G,C[D].d,C[D].n,C[D].e,A);E++}else{if(C[D].t=="sp"){G.insertCell(-1);G.insertCell(-1);E++}else{if(C[D].t=="he"){this.addHeader(G,C[D].d,B);E+=B}}}}}}}}}}}};PrefsUI.prototype.addSettings=function(C,A){for(var B=0;B<A.length;B++){if(A[B].t=="bo"){this.addSettingBoolean(C.insertRow(-1),A[B].d,A[B].n)}else{if(A[B].t=="nu"){this.addSettingNumber(C.insertRow(-1),A[B].d,A[B].n)}else{if(A[B].t=="st"){this.addSettingString(C.insertRow(-1),A[B].d,A[B].n)}else{if(A[B].t=="fo"){this.addSettingFont(C.insertRow(-1),A[B].d,A[B].n)}else{if(A[B].t=="co"){this.addSettingColor(C.insertRow(-1),A[B].d,A[B].n)}else{if(A[B].t=="he"){this.addHeader(C.insertRow(-1),A[B].d,1)}}}}}}}};function ProfileUI(F){this.container=F;this.document=F.ownerDocument;F.style.overflow="auto";F.style.textAlign="center";var B=this.document.createElement("h2");B.style.paddingTop="10px";B.appendChild(this.document.createTextNode("My Profile"));F.appendChild(B);var D=this.document.createElement("form");D.style.textAlign="center";D.style.display="inline";D.onsubmit=function(){return false};F.appendChild(D);var E=this.createTable();this.addHeader(E.insertRow(-1),"General");this.addSettingString(E.insertRow(-1),"Age","age");this.addSettingString(E.insertRow(-1),"Sex","sex");this.addSettingString(E.insertRow(-1),"Location","location");this.addSettingString(E.insertRow(-1),"Home page","homepage");this.addSettingString(E.insertRow(-1),"Pic URL","avatar");D.appendChild(E);var A=this.document.createElement("input");A.type="submit";A.value="Save and close";A.style.marginTop="10px";A.className="abutton";A.onclick=function(G){return function(){login.saveProfile(myprofile);tabs.removeTab(".XProfile")}}(this);D.appendChild(A);var C=this.document.createElement("div");C.style.paddingTop="10px";C.appendChild(this.document.createTextNode("This profile data is public and will be shown in a /whois."));F.appendChild(C)}ProfileUI.prototype.createTable=function(){var A=this.document.createElement("table");A.setAttribute("border","0");A.setAttribute("cell-padding","0");A.setAttribute("cell-spacing","0");cp({borderCollapse:"collapse",margin:"auto",fontFamily:"sans-serif",width:"480px",padding:"0px",background:"#888",border:"1px solid #444"},A.style);A.style.marginTop="4px";return A};ProfileUI.prototype.addHeader=function(C,B){var A=C.insertCell(-1);A.setAttribute("colspan","2");A.colSpan="2";cp({width:"480px",padding:"1px",textAlign:"center",background:"#888",color:"#eee",fontWeight:"bold",border:"1px solid #444"},A.style);A.appendChild(this.document.createTextNode(B))};ProfileUI.prototype.addSettingString=function(G,B,D){var C={textAlign:"left",padding:"2px",border:"1px solid #888",background:"#ccc"};var F=G.insertCell(-1);cp(C,F.style);F.style.textAlign="right";F.appendChild(this.document.createTextNode(B));var A=this.document.createElement("input");cp({type:"text",size:"24",value:(typeof myprofile[D]=="undefined")?"":myprofile[D]},A);A.onkeyup=function(H){return function(){myprofile[D]=A.value}}(this);var E=G.insertCell(-1);cp(C,E.style);E.appendChild(A)};function MyChannelsUI(U){this.container=U;this.document=U.ownerDocument;this.editing=false;this.editingAC=null;U.style.textAlign="center";var F=this.document.createElement("h2");F.style.paddingTop="10px";F.appendChild(this.document.createTextNode("My Channels"));U.appendChild(F);var Q=this.document.createElement("form");Q.style.display="inline";Q.style.textAlign="center";this.autotab=this.document.createElement("table");this.autotab.style.margin="auto";this.autotab.style.marginTop="16px";Q.onsubmit=function(Z){return function(){try{var c={};c.addr=document.getElementById("cacaddr").value;document.getElementById("cacaddr").value="";c.channels=document.getElementById("cacchannels").value;document.getElementById("cacchannels").value="";c.notauto=!document.getElementById("cacauto").checked;document.getElementById("cacauto").checked=true;if(c.addr!=""){defaultPrefs.addAuto(c);Z.addAC(c)}}catch(b){if(DEBUG){log.log("MyChannelsUI",b,DebugLevel.WARNING)}}return false}}(this);this.autotab.setAttribute("border","0");this.autotab.setAttribute("cell-padding","0");this.autotab.setAttribute("cell-spacing","0");this.autotab.style.border="1px solid #51661c";this.autotab.style.background="#fff";this.autotab.style.fontFamily="Sans-serif";this.autotab.style.borderCollapse="collapse";Q.appendChild(this.autotab);U.appendChild(Q);var M=this.document.createElement("div");M.style.paddingTop="10px";M.appendChild(this.document.createTextNode('To join several channels, separate them with a comma - eg "#foo,#bar".'));M.appendChild(this.document.createElement("br"));M.appendChild(this.document.createTextNode("To use SSL, add the port with a '+' before it - eg \"irc.blah.com:+9999\"."));M.appendChild(this.document.createElement("br"));M.appendChild(this.document.createTextNode("Please enter any login details for IRC servers in your [Account] page."));U.appendChild(M);var G={padding:"1px",textAlign:"center",fontWeight:"bold",background:"#888",color:"#eee",border:"1px solid #444"};var H=this.autotab.insertRow(-1);var T=H.insertCell(-1);cp(G,T.style);T.appendChild(this.document.createTextNode(""));var S=H.insertCell(-1);cp(G,S.style);S.appendChild(this.document.createTextNode("Server"));var O=H.insertCell(-1);cp(G,O.style);O.appendChild(this.document.createTextNode("Channels"));var N=H.insertCell(-1);cp(G,N.style);N.appendChild(this.document.createTextNode("Auto-Connect"));var L=H.insertCell(-1);cp(G,L.style);L.appendChild(this.document.createTextNode(""));var X=this.autotab.insertRow(-1);var E=X.insertCell(-1);cp(G,E.style);E.appendChild(this.document.createTextNode(""));var D=X.insertCell(-1);cp(G,D.style);D.style.textAlign="left";var P=this.document.createElement("input");cp({type:"text",size:"16",id:"cacaddr",className:"ainput"},P);D.appendChild(P);var C=X.insertCell(-1);cp(G,C.style);C.style.textAlign="left";var K=this.document.createElement("input");cp({type:"text",size:"18",id:"cacchannels",className:"ainput"},K);C.appendChild(K);var A=X.insertCell(-1);cp(G,A.style);var J=this.document.createElement("input");cp({type:"checkbox",id:"cacauto",checked:true},J);A.appendChild(J);var Y=X.insertCell(-1);cp(G,Y.style);var I=this.document.createElement("input");cp({type:"submit",value:"Add",className:"abutton"},I);Y.appendChild(I);for(var R=0;R<defaultPrefs.autoconnects.length;R++){var V=defaultPrefs.autoconnects[R];if(V.addr==""){defaultPrefs.autoconnects.splice(R,1);R--}else{this.addAC(V)}}var W=this.document.createElement("form");W.style.textAlign="center";W.style.paddingBottom="8px";W.onsubmit=function(){return false};var B=this.document.createElement("input");B.type="submit";B.value="Save and close";B.style.marginTop="10px";B.className="abutton";B.onclick=function(Z){return function(){try{if(Z.editing){Z.saveAC(Z.editingRow,Z.editingAC,Z.editingEL)}defaultPrefs.save(false);tabs.removeTab(".XChannels")}catch(b){alert(b)}}}(this);W.appendChild(B);U.appendChild(W)}MyChannelsUI.prototype.removeAC=function(C){for(var B=0;B<defaultPrefs.autoconnects.length;B++){var A=defaultPrefs.autoconnects[B];if(A.addr==C.addr&&A.channels==C.channels){defaultPrefs.removeAuto(B);return }}};MyChannelsUI.prototype.editAC=function(I,H,G){if(this.editing){this.saveAC(this.editingRow,this.editingAC,this.editingEL)}this.editing=true;this.editingAC=H;this.editingRow=I;this.editingEL=G;var A=I.cells[1];A.removeChild(A.firstChild);var E=this.document.createElement("input");cp({type:"text",size:"16",id:"cedaddr",className:"ainput",value:H.addr},E);A.appendChild(E);var B=I.cells[2];while(B.firstChild){B.removeChild(B.firstChild)}var D=this.document.createElement("input");cp({type:"text",size:"18",id:"cedchannels",className:"ainput",value:H.channels},D);B.appendChild(D);var F=I.cells[3];F.removeChild(F.firstChild);var C=this.document.createElement("input");cp({id:"cedauto",type:"checkbox",checked:(H.notauto==null?true:!H.notauto)},C);F.appendChild(C);G.style.color="#a20814";G.onclick=function(J){return function(){J.saveAC(I,H,G)}}(this)};MyChannelsUI.prototype.saveAC=function(H,D,E){this.editing=false;D.addr=document.getElementById("cedaddr").value;D.channels=document.getElementById("cedchannels").value;D.notauto=!document.getElementById("cedauto").checked;var G=H.cells[1];G.removeChild(G.firstChild);G.appendChild(this.document.createTextNode(D.addr==null?"":D.addr));var F=H.cells[2];while(F.firstChild){F.removeChild(F.firstChild)}if(D.channels!=null){var C=D.channels.split(",");for(var B=0;B<C.length;B++){F.appendChild(this.document.createTextNode(C[B]));F.appendChild(this.document.createElement("br"))}}var A=H.cells[3];A.removeChild(A.firstChild);A.appendChild(this.document.createTextNode(D.notauto==null?"Yes":(D.notauto?"No":"Yes")));E.style.color="#51661c";E.onclick=function(I){return function(){I.editAC(H,D,E)}}(this)};MyChannelsUI.prototype.addAC=function(M){if(M.addr){var G={textAlign:"left",padding:"2px",background:"#ccc",border:"1px solid #444"};var F=this.autotab.insertRow(this.autotab.rows.length-1);var K=F.insertCell(-1);K.vAlign="top";cp(G,K.style);var A=this.document.createElement("img");A.style.cursor="pointer";A.title="Remove";A.src="/gfx/close-win-red.png";A.onclick=function(N){return function(){if(N.editing&&N.editingAC==M){N.editing=false}N.autotab.deleteRow(F.rowIndex);N.removeAC(M)}}(this);K.appendChild(A);var J=F.insertCell(-1);J.vAlign="top";cp(G,J.style);J.appendChild(this.document.createTextNode(M.addr==null?"":M.addr));var H=F.insertCell(-1);H.vAlign="top";cp(G,H.style);if(M.channels!=null){var B=M.channels.split(",");for(var C=0;C<B.length;C++){H.appendChild(this.document.createTextNode(B[C]));H.appendChild(this.document.createElement("br"))}}var E=F.insertCell(-1);E.vAlign="top";cp(G,E.style);E.style.textAlign="center";E.appendChild(this.document.createTextNode(M.notauto==null?"Yes":(M.notauto?"No":"Yes")));var D=F.insertCell(-1);D.vAlign="top";cp(G,D.style);var L=this.document.createElement("a");L.style.color="#51661c";L.href="javascript:void(0)";L.onclick=function(N){return function(){N.editAC(F,M,L)}}(this);L.appendChild(this.document.createTextNode("Edit"));D.appendChild(L);D.appendChild(this.document.createTextNode(" | "));var I=this.document.createElement("a");I.style.color="#51661c";I.href="javascript:void(0)";I.appendChild(this.document.createTextNode("Connect now"));I.onclick=function(){var R="";var N="mib_"+mysession;if(myuser){N=myuser}var Q="";var P=defaultPrefs.defaultCharset;if(myaccount){var S=myaccount.ircserverdetails;if(S){for(var O=0;O<S.length;O++){if(S[O].addr==M.addr){N=S[O].nick;R=S[O].pass;Q=S[O].authmethod;P=S[O].charset;break}}}}ircHandler.connectServer(M.addr,N,R,M.channels,false,false,Q,P)};D.appendChild(I)}};function setupNewTab(A){A.style.background="#bbd18a";A.style.border="0";A.style.fontSize="13px";A.style.position="absolute";A.style.textAlign="left";A.style.overflow="auto";var C={left:0,right:0,top:ChatGuiModule.HEADER_HEIGHT,bottom:ChatGuiModule.FOOTER_HEIGHT};if(!ChatGuiModule.NEED_RESIZE_HANDLER&&defaultPrefs.useTabList){C.left=defaultPrefs.tabListWidth}A.style.top=C.top+"px";A.style.bottom=C.bottom+"px";A.style.left=C.left+"px";A.style.right=C.right+"px";if(ChatGuiModule.NEED_RESIZE_HANDLER){var D=function(E){return function(){var G=parseInt(E.style.left);var I=parseInt(E.style.right);E.style.width=(document.body.clientWidth-G-I)+"px";var H=parseInt(E.style.top);var F=parseInt(E.style.bottom);E.style.height=(document.body.clientHeight-H-F)+"px"}}(A);if(window.attachEvent){window.attachEvent("onresize",D)}else{window.addEventListener("resize",D,false)}window.setTimeout(D,100)}var B=function(){if(window.detachEvent){window.detachEvent("onresize",D)}else{window.removeEventListener("resize",D,false)}return true};return ChatGuiModule.NEED_RESIZE_HANDLER?B:null}function showUserTab(I,C,G,H,A,E){try{if(!login.loggedIn){return }if(tabs.selectTab(I)){return }var D=document.getElementById("chats");var B=document.createElement("div");var F=setupNewTab(B);if(A){B.style.display="none"}D.appendChild(B);if(!E){E={}}E.background=defaultPrefs.tabColorGeneral;E.border=defaultPrefs.tabBColorGeneral;B.style.background=defaultPrefs.tabColorGeneral;tabs.addTab(I,B,C,G,null,F,E,A,H);return B}catch(D){if(DEBUG){log.log("showUserTab","e="+D)}}}function showMyChannels(){var B=showUserTab(".XChannels","Channels","Channels",true,false);if(B){var A=new MyChannelsUI(B)}}function showPreferences(A){var C=showUserTab(".XPrefs","Prefs","Preferences",!A,A,{iconWidth:16,iconHeight:16,icon:"/icons/wrench.png"});if(C){var B=new PrefsUI(C,A)}}function showProfile(){var B=showUserTab(".XProfile","Profile","Profile",true,false,{iconWidth:16,iconHeight:16,icon:"/icons/user_green.png"});if(B){var A=new ProfileUI(B)}}function showPreview(){var B=showUserTab(".XPreview","Widget preview","Widget preview",false,true);if(B){var A=new PreviewUI(B)}}function showAccount(){var B=showUserTab(".XAccount","Account","Account",true,false);if(B){var A=new AccountUI(B)}}function showWidgetAccount(){var B=showUserTab(".XAccount","Account","Account",false,true);if(B){var A=new WidgetAccountUI(B)}}function showLogs(){var B=showUserTab(".XLogs","Logs","Logs",true,false);if(B){var A=new LogsUI(B)}logHandler.ui=A;logHandler.load()}function UIUtils(){}UIUtils.createTimedFunction=function(C,A){var B=null;return function(){if(B){window.clearTimeout(B);B=null}B=window.setTimeout(function(){C();B=null},A)}};UIUtils.createSettingBoolean=function(D,C,B,E){var A=D.createElement("input");A.type="checkbox";A.onchange=function(F){return function(){C[B]=A.checked;if(E){E()}}}();A.onclick=A.onchange;A.checked=C[B];if(C[B]){A.defaultChecked=true}return A};UIUtils.createSettingNumber=function(D,C,B,F){var E=null;var A=D.createElement("input");A.type="text";A.size=4;A.style.border="1px solid #484";A.value=C[B];A.onkeyup=UIUtils.createTimedFunction(function(){try{C[B]=parseInt(A.value)}catch(G){C[B]=0}UIUtils.showValid(A,isValidNumber(A.value));if(F){F()}},500);A.onkeypress=A.onkeyup;A.onchange=A.onkeyup;UIUtils.showValid(A,isValidNumber(A.value));return A};UIUtils.createSettingString=function(D,C,B,E){var A=D.createElement("input");A.type="text";A.size=16;A.style.border="1px solid #484";A.value=C[B];A.onkeyup=UIUtils.createTimedFunction(function(){C[B]=A.value;if(E){E()}},500);A.onkeypress=A.onkeyup;A.onchange=A.onkeyup;return A};UIUtils.createSettingColor=function(G,H,F,J){var B=H[F];var I=G.createElement("div");var A=G.createElement("input");A.type="text";A.size=8;A.style.border="1px solid #484";A.style.cssFloat="left";A.style.styleFloat="left";A.value=B;var E=new jscolor.color(A,{hash:true,adjust:false});if(B.substring(0,1)=="#"&&(B.length==4||B.length==7)){E.fromString(B.substring(1,B.length));A.style.background=B}A.value=B;var D=UIUtils.createTimedFunction(function(){H[F]=A.value;if(!(A.value.substring(0,1)=="#"&&(A.value.length==4||A.value.length==7))){A.style.background="#fff";A.style.color="#000"}if(J){J()}},500);E.oldExportColorFn=E.exportColor;E.exportColor=function(){return function(K){this.oldExportColorFn(K);D()}}();function C(K,M,L){if(K.addEventListener){return K.addEventListener(M,L,false)}else{if(K.attachEvent){return K.attachEvent("on"+M,L)}else{return false}}}C(A,"keyup",D);C(A,"keydown",D);C(A,"onchange",D);I.appendChild(A);return{i:A,e:I}};UIUtils.createSettingOptions=function(G,D,C,F,H){var B=G.createElement("select");B.style.border="1px solid #484";B.onchange=function(I){return function(){D[C]=F[B.value].value;if(H){H()}}}();for(var E in F){if(F.hasOwnProperty(E)){var A=G.createElement("option");A.value=E;if(cmpArray(D[C],F[E].value)){A.selected=true;A.defaultSelected=true}A.appendChild(G.createTextNode(F[E].title));B.appendChild(A)}}return B};UIUtils.createSettingEnum=function(F,G,E,A,H){var B=F.createElement("select");B.style.border="1px solid #484";B.onchange=function(J){return function(){G[E]=B.value;if(H){H()}}}();var I=[];for(var C in A){if(A.hasOwnProperty(C)){I.push(C)}}I.sort();for(var C=0;C<I.length;C++){var D=F.createElement("option");D.value=I[C];if(G[E]==I[C]){D.selected=true;D.defaultSelected=true}D.appendChild(F.createTextNode(A[I[C]]));B.appendChild(D)}return B};UIUtils.showValid=function(B,A){B.style.border="1px solid "+(A?"#484":"#f00");B.style.background=(A?"#fff":"#fcc")};PrefsUI.prototype.createChatWindowTab=function(){var A=this.createTable();this.tabs.addTab("XSettings0",this.wrapdiv(A),"Chat window","Chat window Options",null,null,{background:"#fff",border:"#444"},false,false);this.addSettings2(A,3,[{t:"he",d:"Topic bar"},{t:"fo",n:"infobarFontFamily",ns:"infobarFontSize",d:"Font"},{t:"nu",n:"infobarPadding",d:"Padding"},{t:"sp"},{t:"co",n:"infobarColor",d:"Color"},{t:"co",n:"infobarBackground",d:"Bground"},{t:"co",n:"infobarBorder",d:"Border"},{t:"co",n:"infobarColorHighlight",d:"Color hi"},{t:"co",n:"infobarBackgroundHighlight",d:"Bground hi"},{t:"co",n:"infobarBorderHighlight",d:"Border hi"},{t:"he",d:"General"},{t:"nu",n:"cgmMargins",d:"Margins"},{t:"en",n:"extraContentPosition",d:"Extra content position",e:{"left":"Left","middle":"Middle","right":"Right"}},{t:"nu",n:"extraContentWidth",d:"Extra content width"},{t:"nu",n:"chatOutputMaxLines",d:"Scrollback"},{t:"bo",n:"showChannelUsers",d:"Show # users"},{t:"bo",n:"showMarkers",d:"Show red markers"},{t:"bo",n:"noUListInChannels",d:"Hide channel user list"},{t:"sp"},{t:"sp"},{t:"he",d:"Tabs"},{t:"co",n:"tabColorServer",d:"IRC Server"},{t:"co",n:"tabColorChannel",d:"Channel"},{t:"co",n:"tabColorPM",d:"PM"},{t:"co",n:"tabBColorServer",d:"IRC Server border"},{t:"co",n:"tabBColorChannel",d:"Channel border"},{t:"co",n:"tabBColorPM",d:"PM border"}])};PrefsUI.prototype.createSkinsTab=function(){var S=this.createTable();S.style.background="#cfc";this.tabs.addTab("XSettings",this.wrapdiv(S),"Skins","Skins",null,null,{background:"#cfc",border:"#484"},false,false);this.addHeader(S.insertRow(-1),"Skins",7);var P=S.insertRow(-1);var H=P.insertCell(-1);H.setAttribute("valign","top");var K=this.document.createElement("div");H.appendChild(K);K.style.background="#eee";K.style.border="1px solid #ccc";K.style.textAlign="center";K.style.margin="8px";K.style.padding="2px";function R(V,U){var T=document.createElement("input");T.type="checkbox";T.defaultChecked=true;T.checked=true;T.style.margin="2px";V.appendChild(T);V.appendChild(document.createTextNode(U));V.appendChild(document.createElement("br"));return T}var B=document.createElement("div");B.style.textAlign="left";K.appendChild(B);var N=R(B,"Chat window");var O=R(B,"Chat output");var G=R(B,"Chat input");var I=R(B,"User list");var L=R(B,"Smileys");var A=R(B,"Chat data");K.appendChild(this.document.createTextNode("ID: "));var D=this.document.createElement("input");D.style.border="1px solid #484";D.type="text";D.size=8;K.appendChild(D);var Q=this.document.createElement("input");Q.type="submit";Q.className="abutton";Q.value="Load";Q.style.marginLeft="4px";Q.onclick=function(T){return function(){login.loadSettings(D.value,function(){return function(U){try{var W=JSON.parse(U);if(N.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsChatWindow)}if(G.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsChatInput)}if(O.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsChatOutput)}if(I.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsUserList)}if(L.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsSmileys)}if(A.checked){T.newprefs.loadPrefs(W,UserPrefs.settingsChatData)}T.clearTabs();T.buildTabs()}catch(V){}}}())}}(this);K.appendChild(Q);K.appendChild(this.document.createElement("br"));var E=this.document.createElement("input");E.type="submit";E.className="abutton";E.value="Load defaults";E.style.marginTop="8px";E.onclick=function(T){return function(){try{var V=DEFAULT_PREFS;if(N.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsChatWindow)}if(G.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsChatInput)}if(O.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsChatOutput)}if(I.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsUserList)}if(L.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsSmileys)}if(A.checked){T.newprefs.loadPrefs(V,UserPrefs.settingsChatData)}T.clearTabs();T.buildTabs()}catch(U){}}}(this);K.appendChild(E);var F=P.insertCell(-1);F.valign="top";F.style.textAlign="right";F.style.width="600px";var C=this.document.createElement("div");C.style.height="400px";C.style.overflow="auto";C.style.overflowX="hidden";C.style.textAlign="right";F.appendChild(C);var J=this.document.createElement("div");C.appendChild(J);function M(X,W){var V=this.document.createElement("div");V.style.margin="8px";V.style.background="#fff";V.style.padding="4px";V.style.border="1px solid #888";V.style.textAlign="center";V.style.cursor="pointer";V.onclick=function(){return function(){D.value=X}}();var U=this.document.createElement("div");U.style.color="#000";U.style.margin="2px";U.style.fontSize="17px";U.appendChild(this.document.createTextNode(W));var T=this.document.createElement("img");setPngSrc(T,"/skin_"+X+".png",480,266);V.appendChild(U);V.appendChild(T);J.appendChild(V)}M("2a73846cb682f44fd40961617f61de53","Clean grey");M("afb0301fc7354f04f0dffc8f5bda6ded","Ye olde paper");M("0b325e75d3ff2af4d2bfdbeffe482a96","Blue stars");M("f98c725889c6cca6410d4c70dc7bb5ec","Lovely Lilac");M("343fa2158c26529928b2b32c3d925d37","bg example")};PrefsUI.prototype.createSmileyTab=function(){var S=this.createTable();S.style.background="#fff";this.tabs.addTab("XSettings5",this.wrapdiv(S),"Smileys","Smileys",null,null,{background:"#fff",border:"#444"},false,false);this.addHeader(S.insertRow(-1),"Smileys",7);var Q=S.insertRow(-1);var G=Q.insertCell(-1);var L=this.document.createElement("div");G.appendChild(L);L.style.background="#eee";L.style.border="1px solid #ccc";L.style.textAlign="center";L.style.margin="8px";L.style.padding="2px";L.appendChild(this.document.createTextNode("Load a smiley set"));L.appendChild(this.document.createElement("br"));var B=this.document.createElement("select");B.style.border="1px solid #484";var D=[{name:"Default",iconSmileysBase:"/smileys/",iconSmileysHeight:19,iconSmileysWidth:19,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"}]},{name:"Rainbow",iconSmileysBase:"/smileys/rainbow/",iconSmileysHeight:15,iconSmileysWidth:15,iconSmileys:[{code:":)",src:"smile.gif"},{code:":-)",src:"smile.gif"},{code:":(",src:"sad.gif"},{code:":-(",src:"sad.gif"},{code:":D",src:"biggrin.gif"},{code:":-D",src:"biggrin.gif"},{code:":/",src:"rolleyes.gif"},{code:":-/",src:"rolleyes.gif"},{code:":P",src:"arf.gif"},{code:":-P",src:"arf.gif"},{code:":p",src:"arf.gif"},{code:":-p",src:"arf.gif"},{code:":O",src:"eek.gif"},{code:":-O",src:"eek.gif"},{code:":o",src:"eek.gif"},{code:":-o",src:"eek.gif"},{code:";)",src:"wink.gif"},{code:";-)",src:"wink.gif"}]},{name:"Modern",iconSmileysBase:"/smileys/modern/",iconSmileysHeight:15,iconSmileysWidth:15,iconSmileys:[{code:":)",src:"icon_smile.gif"},{code:":-)",src:"icon_smile.gif"},{code:":(",src:"icon_sad.gif"},{code:":-(",src:"icon_sad.gif"},{code:":D",src:"icon_biggrin.gif"},{code:":-D",src:"icon_biggrin.gif"},{code:":s",src:"icon_confused.gif"},{code:":-s",src:"icon_confused.gif"},{code:":/",src:"winky.gif"},{code:":-/",src:"winky.gif"},{code:":P",src:"icon_razz.gif"},{code:":-P",src:"icon_razz.gif"},{code:":p",src:"icon_razz.gif"},{code:":-p",src:"icon_razz.gif"},{code:":O",src:"icon_surprised.gif"},{code:":-O",src:"icon_surprised.gif"},{code:":o",src:"icon_surprised.gif"},{code:":-o",src:"icon_surprised.gif"},{code:";)",src:"icon_wink.gif"},{code:";-)",src:"icon_wink.gif"}]}];for(var P=0;P<D.length;P++){var J=this.document.createElement("option");J.value=D[P].name;J.appendChild(this.document.createTextNode(D[P].name));B.appendChild(J)}L.appendChild(B);L.appendChild(document.createElement("br"));var R=this.document.createElement("input");R.type="submit";R.className="abutton";R.value="Load";R.style.marginTop="4px";L.appendChild(R);var E=this.addSettingNumber(Q,"Width","iconSmileysWidth");var I=this.addSettingNumber(Q,"Height","iconSmileysHeight");var N=this.addSettingString(Q,"Base URL","iconSmileysBase");var K=S.insertRow(-1);var H=K.insertCell(-1);H.colSpan="7";H.style.textAlign="center";var A=this.createTable();A.style.margin="auto";A.style.border="1px solid #ccc";A.style.background="#eee";A.style.marginBottom="2px";H.appendChild(A);var O=A.insertRow(-1);function F(T){var U=O.insertCell(-1);U.style.background="#aaa";U.style.textAlign="center";U.style.border="1px solid #ccc";U.style.padding="2px";if(T){U.appendChild(U.ownerDocument.createTextNode(T))}return U}F("Code");F("URL");F("Preview");var C=this.document.createElement("input");C.type="submit";C.className="abutton";C.value="Add smiley";C.onclick=function(T){return function(){var U={code:"",src:""};T.newprefs.iconSmileys.unshift(U);T.addSettingSmiley(A,A.insertRow(1),U)}}(this);var M=F();M.appendChild(C);for(var P=0;P<this.newprefs.iconSmileys.length;P++){this.addSettingSmiley(A,A.insertRow(-1),this.newprefs.iconSmileys[P])}R.onclick=function(T){return function(){for(var U=0;U<D.length;U++){if(D[U].name==B.value){T.newprefs.iconSmileysBase=D[U].iconSmileysBase;T.newprefs.iconSmileysHeight=D[U].iconSmileysHeight;T.newprefs.iconSmileysWidth=D[U].iconSmileysWidth;E.value=T.newprefs.iconSmileysWidth;I.value=T.newprefs.iconSmileysHeight;N.value=T.newprefs.iconSmileysBase;T.newprefs.iconSmileys=D[U].iconSmileys;while(A.rows.length>1){A.deleteRow(A.rows.length-1)}for(var U=0;U<T.newprefs.iconSmileys.length;U++){T.addSettingSmiley(A,A.insertRow(-1),T.newprefs.iconSmileys[U])}}}}}(this)};PrefsUI.smileyID=0;PrefsUI.prototype.addSettingSmiley=function(C,F,D){if(D){var G=this.document.createElement("input");G.type="text";G.size=8;G.style.border="1px solid #484";G.value=D.code;G.onkeyup=function(M){return function(){D.code=G.value}}(this);G.onkeypress=G.onkeyup;G.onchange=G.onkeyup;var K=F.insertCell(-1);K.style.padding="2px";K.style.textAlign="left";K.appendChild(G);var A=this.document.createElement("img");A.style.marginLeft="4px";A.style.width="auto";A.style.height="auto";if(this.newprefs.iconSmileysWidth){A.style.width=this.newprefs.iconSmileysWidth+"px"}if(this.newprefs.iconSmileysHeight){A.style.height=this.newprefs.iconSmileysHeight+"px"}if(D.src){A.src=this.newprefs.iconSmileysBase+D.src}var B=PrefsUI.smileyID++;var E=this.document.createElement("input");E.type="text";E.size=24;E.style.border="1px solid #484";E.value=D.src;E.onkeyup=function(M){return function(){D.src=E.value;A.style.width="auto";A.style.height="auto";if(M.newprefs.iconSmileysWidth){A.style.width=M.newprefs.iconSmileysWidth+"px"}if(M.newprefs.iconSmileysHeight){A.style.height=M.newprefs.iconSmileysHeight+"px"}if(M.smileyTimers[B]){window.clearTimeout(M.smileyTimers[B]);delete M.smileyTimers[B]}M.smileyTimers[B]=window.setTimeout(function(N){return function(){if(D.src){N.src=M.newprefs.iconSmileysBase+D.src}delete M.smileyTimers[B]}}(A),5000)}}(this);E.onkeypress=E.onkeyup;E.onchange=E.onkeyup;var J=F.insertCell(-1);J.style.padding="2px";J.style.textAlign="left";J.appendChild(E);var I=F.insertCell(-1);I.style.padding="2px";I.style.textAlign="center";I.appendChild(A);var L=this.document.createElement("img");setPngSrc(L,"/gfx/close-win-red.png",12,12);L.border=0;L.title="Remove";L.style.cursor="pointer";L.onclick=function(M){return function(){C.deleteRow(F.rowIndex);for(var N=0;N<M.newprefs.iconSmileys.length;N++){if(M.newprefs.iconSmileys[N]==D){M.newprefs.iconSmileys.splice(N,1);break}}return false}}(this);var H=F.insertCell(-1);H.style.padding="2px";H.style.textAlign="center";H.appendChild(L)}};PrefsUI.prototype.createUserListTab=function(){var L=this.createTable();this.tabs.addTab("XSettings3",this.wrapdiv(L),"User list","User List Options",null,null,{background:"#fff",border:"#444"},false,false);var G=L.insertRow(-1);var D=G.insertCell(-1);var H=G.insertCell(-1);D.style.verticalAlign="top";H.style.background="#fff";H.style.verticalAlign="top";H.style.borderLeft="2px solid #ccc";H.style.padding="4px";var I=function(T){return function(Y,X){if(X=="getoptions"){var W=[];for(var V=0;V<T.newprefs.usermenus.length;V++){var U={id:"usermenu"+V,desc:T.newprefs.usermenus[V].title};W.push(U)}return W}}}(this);var K=this.document.createElement("div");K.style.textAlign="center";K.style.color="#f00";K.style.fontSize="17px";K.style.fontFamily="sans-serif";K.appendChild(this.document.createTextNode("Preview"));H.appendChild(K);var J=this.document.createElement("div");J.style.width=(this.newprefs.userListWidth-(2*this.newprefs.ulistPaneRounding))+"px";J.style.textAlign="left";J.style.overflow="auto";J.style.overflowX="hidden";H.appendChild(J);this.previewUL=new UserList(J,I,this.newprefs,true);this.previewUL.addUser({id:"kenneth",countrycode:"gb",timezone:60,localtime:"1253138176222",nick:"Kenneth",icon:{name:"user",title:""},desc:"King Kenneth",modes:{owner:true,admin:true,op:true,halfop:true,voice:true,active:true},idleTime:10});this.previewUL.addUser({id:"ermintrude",countrycode:"us",timezone:120,localtime:"1253132176222",nick:"ermintrude",icon:{name:"ignored",title:"Ignored"},desc:"ermintrude the forth",modes:{owner:false,admin:true,op:true,halfop:true,voice:true,active:true},idleTime:60});this.previewUL.addUser({id:"zarx",countrycode:"de",timezone:90,localtime:"1253126176222",nick:"zarx",icon:{name:"ipod",title:"iPod Mibbitian"},desc:"emporer zarx",modes:{owner:false,admin:false,op:true,halfop:false,voice:false,active:true},idleTime:120});this.previewUL.addUser({id:"wendoline",countrycode:"gb",timezone:-60,localtime:"1253145176222",nick:"wendoline",icon:{name:"mibbituser",title:"Mibbitian"},desc:"wendy leen",modes:{owner:false,admin:false,op:false,halfop:true,voice:false,active:true},idleTime:600});this.previewUL.addUser({id:"wallace",countrycode:"fr",timezone:-120,localtime:"1253158176222",nick:"wallace",icon:{name:"mibbituser",title:"Mibbitian"},desc:"wallace the good",modes:{owner:false,admin:false,op:false,halfop:false,voice:true,active:true},idleTime:1200});this.previewUL.addUser({id:"gromit",countrycode:"us",timezone:0,localtime:"1253178176222",nick:"gromit",icon:{name:"iphone",title:"iPhone Mibbitian"},desc:"eating a bone",modes:{owner:false,admin:false,op:false,halfop:true,voice:true,active:false},idleTime:2400});this.previewUL.addUser({id:"sprocket",countrycode:"es",timezone:0,localtime:"1253198176222",nick:"sprocket",icon:{name:"wii",title:"Wii Mibbitian"},desc:"zurk!",modes:{owner:false,admin:false,op:false,halfop:true,voice:false,active:true},idleTime:6000});this.previewUL.addUser({id:"shelly",countrycode:"gb",timezone:60,localtime:"1253108176222",nick:"shelly",icon:{name:"user",title:""},desc:"beachy",modes:{owner:false,admin:false,op:false,halfop:false,voice:false,active:true},idleTime:0});this.previewUL.setUserTyping("wallace",true);var M=function(T){return function(){T.inputs["userListIconAlign"].disabled=!T.newprefs.userListShowIcons;T.inputs["userListIconWidth"].disabled=!T.newprefs.userListShowIcons;T.inputs["userListIconHeight"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_user"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_ignored"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_mibbituser"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_ipod"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_iphone"].disabled=!T.newprefs.userListShowIcons;T.inputs["ulicon_wii"].disabled=!T.newprefs.userListShowIcons;if(T.newprefs.userListShowPrefixChars){T.inputs["userListModeIconAlign"].disabled=true;T.inputs["userListModeIconWidth"].disabled=true;T.inputs["userListModeIconHeight"].disabled=true;T.inputs["userListModeSpacing"].disabled=true}else{T.inputs["userListModeIconAlign"].disabled=false;T.inputs["userListModeIconWidth"].disabled=false;T.inputs["userListModeIconHeight"].disabled=false;T.inputs["userListModeSpacing"].disabled=false}T.inputs["doubleClickTime"].disabled=!T.newprefs.doubleClickToPM;if(!T.newprefs.userListShowPrefixChars&&T.newprefs.userListShowSingleMode){T.inputs["userListShowModesLeft"].disabled=false}else{T.inputs["userListShowModesLeft"].disabled=true}function U(W,V){T.newprefs[W]=V;T.inputs[W].value=V}if(T.newprefs.userListShowPrefixChars){if(T.newprefs.iconModeOwner.length>1){U("iconModeOwner","~")}if(T.newprefs.iconModeAdmin.length>1){U("iconModeAdmin","&")}if(T.newprefs.iconModeOp.length>1){U("iconModeOp","@")}if(T.newprefs.iconModeHalfop.length>1){U("iconModeHalfop","%")}if(T.newprefs.iconModeVoice.length>1){U("iconModeVoice","+")}}else{if(T.newprefs.iconModeOwner.length==1){U("iconModeOwner","/icons/mode_owner.png")}if(T.newprefs.iconModeAdmin.length==1){U("iconModeAdmin","/icons/mode_admin.png")}if(T.newprefs.iconModeOp.length==1){U("iconModeOp","/icons/mode_op.png")}if(T.newprefs.iconModeHalfop.length==1){U("iconModeHalfop","/icons/mode_halfop.png")}if(T.newprefs.iconModeVoice.length==1){U("iconModeVoice","/icons/mode_voice.png")}}J.style.width=(T.newprefs.userListWidth-(2*T.newprefs.ulistPaneRounding))+"px";T.previewUL.redraw()}}(this);var A=this.document.createElement("table");D.appendChild(A);var B=this.document.createElement("table");D.appendChild(B);var E=this.document.createElement("table");D.appendChild(E);this.addSettings2(A,3,[{t:"he",d:"Colors"},{t:"co",n:"userListColorNormal",d:"User (normal)"},{t:"co",n:"userListColorTyping",d:"User (typing)"},{t:"co",n:"userListColorInactive",d:"User (away)"},{t:"co",n:"userListMenuColor",d:"Menu color"},{t:"co",n:"userListMenuBackground",d:"Menu bground"},{t:"co",n:"userListMenuBackgroundHover",d:"Menu bground hover"},{t:"co",n:"userGroupColor",d:"Group color"},{t:"co",n:"userGroupBackground",d:"Group bground"},{t:"co",n:"userListHover",d:"Hover"},{t:"co",n:"ulistPaneBorder",d:"Border"},{t:"co",n:"ulistPaneBackground",d:"Bground"},{t:"co",n:"userListSelected",d:"Selected"}],M);this.addSettings2(B,2,[{t:"he",d:"User list"},{t:"nu",n:"userListWidth",d:"User list width"},{t:"nu",n:"userListPadding",d:"Padding"},{t:"nu",n:"ulistPaneRounding",d:"Rounding"},{t:"sp"},{t:"op",n:"userListGroups",d:"Groups",e:{none:{title:"None",value:[{def:"",title:"",hideOnEmpty:true,startHidden:false}]},chattersH:{title:"Chatters/Idlers closed",value:[{def:"chatting",title:"Chatting",hideOnEmpty:true,startHidden:false},{def:"!chatting",title:"Idlers",hideOnEmpty:true,startHidden:true}]},chatters:{title:"Chatters/Idlers",value:[{def:"chatting",title:"Chatting",hideOnEmpty:true,startHidden:false},{def:"!chatting",title:"Idlers",hideOnEmpty:true,startHidden:false}]},bymode:{title:"By mode",value:[{def:"owner",title:"Owner",hideOnEmpty:true,startHidden:false},{def:"!owner,admin",title:"Admin",hideOnEmpty:true,startHidden:false},{def:"!owner,!admin,op",title:"Op",hideOnEmpty:true,startHidden:false},{def:"!owner,!admin,!op,halfop",title:"Halfop",hideOnEmpty:true,startHidden:false},{def:"!owner,!admin,!op,!halfop,voice",title:"Voice",hideOnEmpty:true,startHidden:false},{def:"!owner,!admin,!op,!halfop,!voice",title:"Other",hideOnEmpty:true,startHidden:false}]}}},{t:"st",n:"userListSort",d:"Sort order"},{t:"fo",n:"userListFontFamily",ns:"userListFontSize",d:"Userlist"},{t:"fo",n:"userListMenuFontFamily",ns:"userListMenuFontSize",d:"Userlist Menu"},{t:"fo",n:"userGroupFontFamily",ns:"userGroupFontSize",d:"Userlist Group"},{t:"nu",n:"userListMenuAutoCloseTime",d:"Menu Auto close (ms)"},{t:"bo",n:"doubleClickToPM",d:"Double click to PM"},{t:"nu",n:"doubleClickTime",d:"Double click time(ms)"},{t:"bo",n:"userListBoldOnChat",d:"Bold recent chatters"},{t:"nu",n:"userListChattingTime",d:"Recent chat time (s)"},{t:"he",d:"User icons"},{t:"bo",n:"userListShowIcons",d:"Show icons"},{t:"di",nx:"userListIconWidth",ny:"userListIconHeight",d:"Icon size"},{t:"en",n:"userListIconAlign",d:"Align",e:{"top":"Top","middle":"Middle","bottom":"Bottom"}},{t:"sp"},{t:"st",n:"ulicon_user",d:"User"},{t:"st",n:"ulicon_ignored",d:"Ignored"},{t:"st",n:"ulicon_mibbituser",d:"Mibbitian"},{t:"st",n:"ulicon_ipod",d:"iPod Mibbitian"},{t:"st",n:"ulicon_iphone",d:"iPhone Mibbitian"},{t:"st",n:"ulicon_wii",d:"Wii Mibbitian"},{t:"he",d:"Mode icons"},{t:"bo",n:"userListShowPrefixChars",d:"Mode characters"},{t:"di",nx:"userListModeIconWidth",ny:"userListModeIconHeight",d:"Mode icons size"},{t:"bo",n:"userListShowSingleMode",d:"Best mode only"},{t:"bo",n:"userListShowModesLeft",d:"Mode icon on left"},{t:"nu",n:"userListModeSpacing",d:"Mode icons spacing"},{t:"en",n:"userListModeIconAlign",d:"Align",e:{"top":"Top","middle":"Middle","bottom":"Bottom"}},{t:"st",n:"iconModeOwner",d:"Owner"},{t:"st",n:"iconModeAdmin",d:"Admin"},{t:"st",n:"iconModeOp",d:"Op"},{t:"st",n:"iconModeHalfop",d:"Halfop"},{t:"st",n:"iconModeVoice",d:"Voice"},{t:"sp"}],M);this.addHeader(E.insertRow(-1),"User Menus",1);var S=E.insertRow(-1);var R=S.insertCell(-1);R.colSpan="2";R.style.textAlign="center";var Q=this.createTable();Q.style.margin="auto";Q.style.border="1px solid #ccc";Q.style.background="#eee";Q.style.marginBottom="2px";Q.style.marginTop="10px";R.appendChild(Q);var O=Q.insertRow(-1);function F(T){var U=O.insertCell(-1);U.style.background="#aaa";U.style.textAlign="center";U.style.border="1px solid #ccc";U.style.padding="2px";if(T){U.appendChild(U.ownerDocument.createTextNode(T))}return U}var C=this.document.createElement("input");C.type="submit";C.className="abutton";C.value="Add menu item";C.onclick=function(T){return function(){var U={title:"",command:""};T.newprefs.usermenus.push(U);T.addSettingMenu(Q,Q.insertRow(-1),U)}}(this);F("Title");F("Command");var N=F();N.appendChild(C);for(var P=0;P<this.newprefs.usermenus.length;P++){this.addSettingMenu(Q,Q.insertRow(-1),this.newprefs.usermenus[P])}M()};PrefsUI.prototype.addSettingMenu=function(D,H,G){if(G){var B=this.document.createElement("input");B.type="text";B.size=8;B.style.border="1px solid #484";B.value=G.title;B.onkeyup=function(I){return function(){G.title=B.value}}(this);B.onkeypress=B.onkeyup;B.onchange=B.onkeyup;var F=H.insertCell(-1);F.style.padding="2px";F.style.textAlign="left";F.appendChild(B);var C=this.document.createElement("input");C.type="text";C.size=32;C.style.border="1px solid #484";C.value=G.command;C.onkeyup=function(I){return function(){G.command=C.value}}(this);C.onkeypress=C.onkeyup;C.onchange=C.onkeyup;var F=H.insertCell(-1);F.style.padding="2px";F.style.textAlign="left";F.appendChild(C);var A=this.document.createElement("img");setPngSrc(A,"/gfx/close-win-red.png",12,12);A.border=0;A.title="Remove";A.style.cursor="pointer";A.onclick=function(I){return function(){D.deleteRow(H.rowIndex);for(var J=0;J<I.newprefs.usermenus.length;J++){if(I.newprefs.usermenus[J]==G){I.newprefs.usermenus.splice(J,1);break}}return false}}(this);var E=H.insertCell(-1);E.style.padding="2px";E.style.textAlign="center";E.appendChild(A)}};PrefsUI.prototype.createChatOutputTab=function(){var E=function(N){return function(){N.previewCOBottom()}}(this);var A=this.createTable();this.tabs.addTab("XSettings2",this.wrapdiv(A),"Chat output","Chat Output Options",E,null,{background:"#fff",border:"#444"},false,false);var I=A.insertRow(-1);var L=I.insertCell(-1);var F=A.insertRow(-1);var J=F.insertCell(-1);var M=this.document.createElement("table");L.appendChild(M);J.style.background="#fff";J.style.verticalAlign="top";J.style.textAlign="center";J.style.borderTop="2px solid #ccc";J.style.padding="4px";var C=this.document.createElement("div");C.style.textAlign="center";C.style.color="#f00";C.style.fontSize="17px";C.style.fontFamily="sans-serif";C.appendChild(this.document.createTextNode("Preview"));var H=this.document.createElement("div");H.style.margin="auto";H.style.width="740px";H.style.height="120px";H.style.textAlign="left";H.style.overflow="auto";H.style.overflowX="hidden";H.style.background="#000";H.className="iescrollfix2";cp({background:this.newprefs.chatPaneBackground,border:("1px solid "+this.newprefs.chatPaneBorder)},H.style);H.style.borderRadius=this.newprefs.chatPaneRounding+"px";H.style.MozBorderRadius=this.newprefs.chatPaneRounding+"px";H.style.WebkitBorderRadius=this.newprefs.chatPaneRounding+"px";H.style.padding=this.newprefs.chatPaneRounding+"px";H.style.width=(740-(this.newprefs.chatPaneRounding*2))+"px";H.style.height=(120-(this.newprefs.chatPaneRounding*2))+"px";J.appendChild(C);J.appendChild(H);var B=new ParserNothing();this.previewCO=new ChatOutput(H,this.newprefs,H);function K(Y,P,V,N,Q,U,T,S,O,X,W){var R=false;return{render:function(b){var Z=(W?W:((Q?P.nickColorMe:(U?P.nickColorGuest:(T?"#a20814":P.nickColor)))));Y.renderData(b,P,N,Z,R,P.colorChat,S,O,X)},renderNick:function(b){var Z=(W?W:((Q?P.nickColorMe:(U?P.nickColorGuest:(T?"#a20814":P.nickColor)))));Y.renderNick(b,P,N,Z,R)},renderTime:function(Z){Y.renderTime(Z,P,V)}}}this.ucid=0;for(var G=0;G<20;G++){this.previewCO.addLine(this.ucid++,K(this.previewCO,this.newprefs,false,"",false,false,false,B,""))}this.previewCO.addLine("mibbit",K(this.previewCO,this.newprefs,(new Date()).getTime()-48*60*60*1000,"mibbit",false,false,false,B,"Hey, you use mibbit?"));this.previewCO.addLine("you",K(this.previewCO,this.newprefs,(new Date()).getTime()-60*60*1000,"you",true,false,false,B,"Yeah is it any good? What do you think of it?"));this.previewCO.addLine("mibbit",K(this.previewCO,this.newprefs,(new Date()).getTime()-60*1000,"mibbit",false,false,false,B,"Yeah it's ok, it's getting there ;) Sorry, I'll tell you a bit more once I've demonstrated this long chatline for you... We need to have every eventuality tested eh!"));this.previewCO.addLine("guest",K(this.previewCO,this.newprefs,(new Date()).getTime(),"guest",false,true,false,B,"Hi I'm just a guest :/"));this.previewCOBottom=function(){return function(){H.scrollTop=H.scrollHeight}}();var D=function(N){return function(){N.inputs["timeBorderRight"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["timeBackground"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["formatTime"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["timeFontFamily"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["timeFontSize"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["timeColor"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["chatOutputTimeWidth"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["formatDate"].disabled=!N.newprefs.chatOutputShowTimes;N.inputs["nickBorderRight"].disabled=!N.newprefs.chatOutputShowNicks;N.inputs["nickBackground"].disabled=!N.newprefs.chatOutputShowNicks;N.inputs["chatOutputNickWidth"].disabled=!N.newprefs.chatOutputShowNicks;N.inputs["nickVerticalAlign"].disabled=!N.newprefs.chatOutputShowNicks;N.inputs["chatOutputNickLeft"].disabled=N.newprefs.chatOutputShowNicks;N.inputs["chatOutputNickRight"].disabled=N.newprefs.chatOutputShowNicks;cp({background:N.newprefs.chatPaneBackground,border:("1px solid "+N.newprefs.chatPaneBorder)},H.style);H.style.borderRadius=N.newprefs.chatPaneRounding+"px";H.style.MozBorderRadius=N.newprefs.chatPaneRounding+"px";H.style.WebkitBorderRadius=N.newprefs.chatPaneRounding+"px";H.style.padding=N.newprefs.chatPaneRounding+"px";H.style.width=(740-(N.newprefs.chatPaneRounding*2))+"px";H.style.height=(120-(N.newprefs.chatPaneRounding*2))+"px";N.previewCO.redraw();N.previewCOBottom()}}(this);this.addSettings2(M,4,[{t:"he",d:"Timestamps"},{t:"bo",n:"chatOutputShowTimes",d:"Time column"},{t:"co",n:"timeBorderRight",d:"Border"},{t:"co",n:"timeBackground",d:"bground"},{t:"st",n:"formatTime",d:"Format"},{t:"fo",n:"timeFontFamily",ns:"timeFontSize",d:"Font"},{t:"co",n:"timeColor",d:"Color"},{t:"nu",n:"chatOutputTimeWidth",d:"Width"},{t:"st",n:"formatDate",d:"Day format"},{t:"he",d:"Nicks"},{t:"bo",n:"chatOutputShowNicks",d:"Nick column"},{t:"co",n:"nickBorderRight",d:"Border"},{t:"co",n:"nickBackground",d:"bground"},{t:"st",n:"chatOutputNickLeft",d:"Short nick left"},{t:"fo",n:"nickFontFamily",ns:"nickFontSize",d:"Font"},{t:"co",n:"nickColor",d:"Color"},{t:"nu",n:"chatOutputNickWidth",d:"Width"},{t:"st",n:"chatOutputNickRight",d:"Short nick right"},{t:"co",n:"nickColorMe",d:"(me)"},{t:"co",n:"nickColorGuest",d:"(guest)"},{t:"en",n:"nickVerticalAlign",d:"Align",e:{"top":"Top","middle":"Middle","bottom":"Bottom"}},{t:"sp"},{t:"he",d:"Chat output"},{t:"fo",n:"chatFontFamily",ns:"chatFontSize",d:"Font"},{t:"nu",n:"chatPaddingTop",d:"Pad top"},{t:"nu",n:"chatPaddingBottom",d:"Pad bottom"},{t:"bo",n:"chatOutputRTL",d:"RTL"},{t:"co",n:"chatBackground",d:"Chat bg"},{t:"co",n:"chatOutputBackground",d:"Table bg"},{t:"co",n:"chatPaneBackground",d:"Pane bg"},{t:"co",n:"chatBackgroundHighlight",d:"Highlight"},{t:"co",n:"chatPaneBorder",d:"Border"},{t:"co",n:"chatBackgroundLines",d:"Lines"},{t:"nu",n:"chatPaneRounding",d:"Rounding"},{t:"sp"}],D);D()};PrefsUI.prototype.createChatInputTab=function(){var D=function(M){return function(){M.previewIE.redraw();M.previewIE.layout();M.sbwrapper.style.height=(M.previewIE.getHeight()-2)+"px"}}(this);var E=this.createTable();this.tabs.addTab("XSettings4",this.wrapdiv(E),"Chat input","Chat input Options",D,null,{background:"#fff",border:"#444"},false,false);var H=E.insertRow(-1);var K=H.insertCell(-1);var F=E.insertRow(-1);var I=F.insertCell(-1);var L=this.document.createElement("table");K.appendChild(L);I.style.background="#fff";I.style.verticalAlign="top";I.style.textAlign="center";I.style.borderTop="2px solid #ccc";I.style.padding="4px";var B=this.document.createElement("div");B.style.textAlign="center";B.style.color="#f00";B.style.fontSize="17px";B.style.fontFamily="sans-serif";B.appendChild(this.document.createTextNode("Preview"));this.coc=this.document.createElement("div");this.coc.style.margin="auto";this.coc.style.cssFloat="left";this.coc.style.styleFloat="left";this.coc.style.width="740px";this.coc.style.textAlign="left";this.coc.style.overflow="hidden";this.sbwrapper=this.document.createElement("div");this.sbwrapper.style.cssFloat="left";this.sbwrapper.style.styleFloat="left";this.sbwrapper.style.cursor="pointer";this.sbwrapper.appendChild(document.createTextNode(DisplayStrings.get("SendButton")));var A=this.document.createElement("div");A.style.width="740px";A.style.margin="auto";A.appendChild(this.coc);A.appendChild(this.sbwrapper);I.appendChild(B);I.appendChild(A);var G={};G.showPasteBin=function(){};G.showFileUpload=function(){};G.minify=function(){};G.getLanguageMe=function(){return"en"};G.setLanguageMe=function(){};G.setLanguageThem=function(){};var J=this.document.createElement("form");J.style.display="inline";J.setAttribute("accept-charset","UTF-8");J.onsubmit=function(){return false};this.previewIE=new RichInputElement(this.coc,this.newprefs,J,G,true);this.previewIE.insertText("The rain in Spain stays mainly on the plain!");var C=function(M){return function(){M.inputs["sendButtonBorder"].disabled=!M.newprefs.needSendButton;M.inputs["sendButtonBackground"].disabled=!M.newprefs.needSendButton;M.inputs["chatInputMenuFontFamily"].disabled=!M.newprefs.showInputOptions;M.inputs["colorInMenuSep"].disabled=!M.newprefs.showInputOptions;M.inputs["colorInMenu"].disabled=!M.newprefs.showInputOptions;M.inputs["colorInLinks"].disabled=!M.newprefs.showInputOptions;M.inputs["colorInText"].disabled=!M.newprefs.showInputOptions;M.inputs["ioSmilies"].disabled=!M.newprefs.showInputOptions;M.inputs["ioColors"].disabled=!M.newprefs.showInputOptions;M.inputs["ioTranslation"].disabled=!M.newprefs.showInputOptions;M.inputs["ioPastebin"].disabled=!M.newprefs.showInputOptions;M.inputs["ioUpload"].disabled=!M.newprefs.showInputOptions;M.inputs["ioMinify"].disabled=!M.newprefs.showInputOptions;if(M.newprefs.needSendButton){M.coc.style.width=(740-M.newprefs.userListWidth-M.newprefs.cgmMargins-4)+"px";M.sbwrapper.style.display="block"}else{M.coc.style.width="740px";M.sbwrapper.style.display="none"}M.previewIE.hasOptions=M.newprefs.showInputOptions;M.previewIE.redraw();M.previewIE.layout();M.sbwrapper.style.height=(M.previewIE.getHeight()-2)+"px";M.sbwrapper.style.width=M.newprefs.userListWidth+"px";M.sbwrapper.style.marginLeft=M.newprefs.cgmMargins+"px";M.sbwrapper.style.background=M.newprefs.sendButtonBackground;M.sbwrapper.style.border="1px solid "+M.newprefs.sendButtonBorder;M.sbwrapper.style.color=M.newprefs.sendButtonColor;M.sbwrapper.style.textAlign="center";M.sbwrapper.style.fontFamily=M.newprefs.chatInputFontFamily;M.sbwrapper.style.fontSize=M.newprefs.chatInputFontSize+"px"}}(this);this.addSettings2(L,4,[{t:"he",d:"Input bar"},{t:"co",n:"chatInputBarBorder",d:"Border"},{t:"co",n:"chatInputBarBackground",d:"Bground"},{t:"co",n:"chatInputColor",d:"Color"},{t:"fo",n:"chatInputFontFamily",ns:"chatInputFontSize",d:"Font"},{t:"co",n:"chatInputBorder",d:"In Border"},{t:"co",n:"chatInputBackground",d:"In Bground"},{t:"sp"},{t:"sp"},{t:"nu",n:"chatInputSpacing",d:"Spacing"},{t:"nu",n:"chatInputPadding",d:"Padding"},{t:"nu",n:"chatInputRounding",d:"Rounding"},{t:"sp"},{t:"bo",n:"needSendButton",d:"Send button"},{t:"co",n:"sendButtonBorder",d:"Send border"},{t:"co",n:"sendButtonBackground",d:"Send bground"},{t:"co",n:"sendButtonColor",d:"Send color"},{t:"he",d:"Input options"},{t:"bo",n:"showInputOptions",d:"Input options"},{t:"co",n:"colorInMenuSep",d:"Menu separator"},{t:"co",n:"colorInMenu",d:"Menu items"},{t:"co",n:"colorInMenuActive",d:"Menu active"},{t:"co",n:"colorInLinks",d:"Form links"},{t:"co",n:"colorInText",d:"Form text"},{t:"sp"},{t:"sp"},{t:"bo",n:"ioSmilies",d:"Smilies"},{t:"bo",n:"ioColors",d:"Colors"},{t:"bo",n:"ioTranslation",d:"Translation"},{t:"bo",n:"ioPastebin",d:"Pastebin"},{t:"bo",n:"ioUpload",d:"Upload"},{t:"bo",n:"ioMinify",d:"Minify url"},{t:"sp"},{t:"fo",n:"chatInputMenuFontFamily",ns:"chatInputMenuFontSize",d:"Font"}],C);C()};PrefsUI.prototype.createChatDataTab=function(){var E=this.createTable();E.style.background="#fff";this.tabs.addTab("ZZZSettings1",this.wrapdiv(E),"Chat data","Chat data",null,null,{background:"#fff",border:"#444"},false,false);var B=E.insertRow(-1);var D=B.insertCell(-1);var C=this.document.createElement("table");D.appendChild(C);var A=this.document.createElement("table");D.appendChild(A);this.addSettings2(C,4,[{t:"he",d:"Colors"},{t:"co",n:"colorChat",d:"Chat"},{t:"co",n:"colorChatMe",d:"Chat (me)"},{t:"co",n:"colorEmote",d:"Emote"},{t:"co",n:"colorEmoteMe",d:"Emote (me)"},{t:"co",n:"nickHighlight",d:"Nick highlight"},{t:"co",n:"nickHighlightMe",d:"Nick highlight (me)"},{t:"co",n:"colorChatRecent",d:"Chat (recent)"},{t:"co",n:"colorEmoteRecent",d:"Emote (recent)"},{t:"co",n:"colorJoin",d:"Join"},{t:"co",n:"colorPart",d:"Part"},{t:"co",n:"colorBack",d:"Back"},{t:"co",n:"colorAway",d:"Away"},{t:"co",n:"colorKick",d:"Kick"},{t:"co",n:"colorInvite",d:"Invite"},{t:"co",n:"colorTopic",d:"Topic"},{t:"co",n:"colorTopicWho",d:"Topic (who)"},{t:"co",n:"colorChangeNick",d:"Change nick"},{t:"co",n:"colorSystem",d:"Sys messages"},{t:"co",n:"colorNotice",d:"Notice"},{t:"co",n:"colorBan",d:"Ban"},{t:"co",n:"colorUserMode",d:"UserMode"},{t:"co",n:"colorLinks",d:"Links"},{t:"co",n:"colorIRCLinks",d:"IRC Links"},{t:"co",n:"colorChannels",d:"Channels"}]);this.addSettings2(A,4,[{t:"he",d:"Parsing chat data"},{t:"bo",n:"parseSmilies",d:"Show smilies"},{t:"bo",n:"sizeSmiliesToText",d:"Size smilies to text"},{t:"bo",n:"parseChannels",d:"Clickable channels"},{t:"bo",n:"parseLinks",d:"Clickable links"},{t:"bo",n:"parseNicks",d:"Highlight nicks"},{t:"bo",n:"parseColor",d:"mIRC colors"},{t:"bo",n:"parseSimple",d:"_u_ *b* /i/"},{t:"bo",n:"parseTex",d:"Latex"},{t:"bo",n:"parseReplaceImages",d:"Image thumbs"},{t:"di",nx:"parseReplaceImagesWidth",ny:"parseReplaceImagesHeight",d:"Thumb size"},{t:"sp"},{t:"bo",n:"openLinksInExtra",d:"Open links in extra"},{t:"he",d:"Embed content"},{t:"bo",n:"parseYouTubes",d:"youTube"},{t:"bo",n:"parseJustinTV",d:"justin.tv"},{t:"bo",n:"parseGoogleMaps",d:"googleMaps"},{t:"sp"},{t:"he",d:"What to show"},{t:"bo",n:"showJoinsParts",d:"Join and parts"},{t:"bo",n:"showAwaysBacks",d:"Away and backs"},{t:"bo",n:"showJoinInfo",d:"Extra join info"},{t:"bo",n:"showPartInfo",d:"Extra part info"},{t:"bo",n:"showBans",d:"Bans and unbans"},{t:"bo",n:"showUserModes",d:"User mode changes"},{t:"bo",n:"showMOTD",d:"MOTD"},{t:"bo",n:"showRecentChat",d:"Recent chat on join"}])};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 JavaComms(D,A,C,B){this.applet=D;this.appletloadtime=false;this.callback=A;this.callbackconnected=C;this.callbackclose=B;this.connections=[];this.inqueue=[]}JavaComms.loadApplet=function(){if(DEBUG){log.log("JavaComms","loadApplet",DebugLevel.INFO)}try{var A=document.body;var C=document.createElement("applet");C.setAttribute("name","MibbitApplet");C.setAttribute("code","Mibbit.class");C.setAttribute("archive","mibbit.jar");C.setAttribute("MAYSCRIPT",true);C.setAttribute("width",1);C.setAttribute("height",1);A.appendChild(C);this.appletloadtime=(new Date()).getTime();commsHandler=new JavaComms(C,function(F,E){var D=String(E);scomms.sendServer({channel:"comms",cmd:"recv",id:F,data:D})},function(D){scomms.sendServer({channel:"comms",cmd:"connected",id:D})},function(D){scomms.sendServer({channel:"comms",cmd:"disconnected",id:D})});rcomms.addChannelHandler("comms",commsHandler)}catch(B){if(DEBUG){log.log("loadApplet","Exception "+B,DebugLevel.WARNING)}}};JavaComms.prototype.recv=function(B){if(DEBUG){log.log("JavaComms","recv "+this.appletReady()+" | "+B,DebugLevel.INFO)}this.inqueue.push(B);if(this.appletReady()){this.flushq()}else{if(DEBUG){log.log("JavaComms.recv","Waiting for Applet to load",DebugLevel.WARNING)}var A=function(C){return function(){if(C.appletReady()){if(DEBUG){log.log("JavaComms.recv","APPLET LOADED (After wait)",DebugLevel.INFO)}C.flushq();window.clearInterval(C.watcher);delete C.watcher}else{if(DEBUG){log.log("JavaComms.recv","Waiting for Applet to load...",DebugLevel.INFO)}}var D=(new Date()).getTime()-C.appletloadtime;if(D>10*1000){if(DEBUG){log.log("JavaComms.recv","APPLET LOAD ***FAILED***",DebugLevel.WARNING)}window.clearInterval(C.watcher);delete C.watcher}}}(this);if(!this.watcher){this.watcher=window.setInterval(A,1000)}}};JavaComms.prototype.appletReady=function(){return((typeof this.applet!="undefined")&&(typeof this.applet.connect!="undefined"))};JavaComms.prototype.flushq=function(){if(!this.appletReady()){return }if(this.inqueue.length==0){return }var C=this.inqueue.shift();if(DEBUG){log.log("JavaComms.recv","p="+C,DebugLevel.FINE)}try{if(C.cmd=="connect"){if(DEBUG){log.log("JavaComms","Telling applet to connect "+C.addr+":"+C.port,DebugLevel.INFO)}var A=this.applet.connect(C.id,C.addr,C.port);if(!A){this.callbackclose(C.id)}else{this.callbackconnected(C.id);this.connections[C.id]=window.setInterval(function(D){return function(){var E=D.applet.recv(C.id);if(E=="*"){D.close(C.id)}else{if(E=="-"){}else{D.callback(C.id,E)}}}}(this),500)}}else{if(C.cmd=="disconnect"){if(DEBUG){log.log("JavaComms","Telling applet to disconnect "+C.id,DebugLevel.INFO)}this.close(C.id)}else{if(C.cmd=="send"){if(DEBUG){log.log("JavaComms","Telling applet to send data "+C.data,DebugLevel.INFO)}this.send(C.id,C.data)}}}}catch(B){if(DEBUG){log.log("JavaComms.recv","Exception "+B,DebugLevel.WARNING)}}};JavaComms.prototype.send=function(B,A){this.applet.send(B,A)};JavaComms.prototype.close=function(B){if(this.connections[B]){var A=this.applet.disconnect(B);window.clearInterval(this.connections[B]);delete this.connections[B];this.callbackclose(B)}};var twitterTab=null;function connectTwitter(A,B,E){if(twitterTab!=null){return }var C=document.getElementById("chats");var D=document.createElement("div");D.style.display="none";D.style.background=defaultPrefs.tabColorYServer;C.appendChild(D);twitterHandler=new TwitterClient(D,A,defaultPrefs);twitterTab=tabs.addTab("ATwitterClient",D,"Twitter","Twitter",function(F){return function(H,G){twitterHandler.cgm.activecb(G)}}(this),function(F){return function(){scomms.sendServer({channel:"Twitter",cmd:"disconnect"});rcomms.removeChannelHandler("Twitter");twitterTab=null;return true}}(this),{background:defaultPrefs.tabColorYServer,border:defaultPrefs.tabBColorYServer},true,true);twitterHandler.tab=twitterTab;rcomms.addChannelHandler("Twitter",twitterHandler);if(E){scomms.sendServer({channel:"Twitter",cmd:"connect",user:A,pass:B})}}function TwitterClient(F,B,A){this.ucid=1;this.prefs=A;this.tinyrenderer=new ParserNothing();this.nickname=B;this.renderer=new ParserLinks(new ParserIRCColor(new ParserNothing()),this.prefs);function E(G){return function(H){if(G.tab){G.tab.active(H)}if(alerts){alerts.alert("Twitter!")}}}function C(G){return function(){try{var H=G.cgm.getInput();if(H.substr(0,1)=="/"&&H.substr(0,2)!="//"){var I=(new Date()).getTime();G.cgm.output("twitter",G.cgm.wrapRenderer("Message not sent. Use // if you really mean it.",{},"red","Twitter",false,G.cgm.tinyRenderer,I))}else{if(H.substr(0,2)=="//"){H=H.substr(1,H.length)}var K={cmd:"msg"};K.channel="Twitter";K.msg=H;scomms.sendServer(K)}}catch(J){if(DEBUG){log.log("TwitterClient","onsubmit "+J,DebugLevel.WARNING)}}return false}}var D={};D.sendcb=C(this);D.activitycb=E(this);D.userclickcb=function(){};D.joinroom=function(){};D.listcategory=function(){};D.sendPasteBin=function(G){return function(H){if(H!=""){scomms.sendServer({cmd:"paste",channel:"PasteBin",returnchannel:"Twitter",data:H})}}}(this);D.sendMinify=function(G){return function(H){if(H!=""){scomms.sendServer({cmd:"minify",channel:"LinkManager",returnchannel:"Twitter",url:H})}}}(this);D.nickclick=function(G){return function(H){if(H){G.cgm.richInputElement.insertText("@"+H+" ");G.cgm.focus()}}}(this);if(F){this.cgm=new ChatGuiModule(F,false,this.prefs,D,true,this.prefs.tabColorYServer);this.cgm.nick=this.nickname;this.cgm.channel="Twitter";this.cgm.richInputElement.setMaxLength(140)}}TwitterClient.prototype.connect=function(){};TwitterClient.prototype.recv=function(A){if(A.cmd=="error"){errorlog.alert("Twitter: "+A.error);tabs.removeTab("ATwitterClient");rcomms.removeChannelHandler("Twitter");twitterTab=null}else{this.cgm.processPacket(A)}};TwitterClient.prototype.prefsUpdated=function(){this.cgm.createRenderer();this.cgm.layout()};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!=null&&I)?I:"");C.authmethod=D;if(!F||F==null){F=""}C.joinchannels=F;if(E){C.charset=E}if(J){C.forced=true}if(B){C.authkey=B}if(DEBUG){log.log("connect",JSON.stringify(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 LogHandler(){this.load=function(){if(DEBUG){log.log("LogHandler","Requesting log list")}var A={channel:"Logger",cmd:"listlogs"};scomms.sendServer(A)};this.recv=function(B){try{if(B.cmd=="loglist"){if(this.ui){this.ui.loadedLogs(B.logs)}}else{if(B.cmd=="logdata"){if(this.ui){this.ui.setData(B.data)}}}}catch(A){if(DEBUG){log.log("LogHandler","Error:"+A)}}};this.deleteLog=function(B,D,A){var C={channel:"Logger",cmd:"removelog"};C.server=B;C.nick=D;C.log=A;scomms.sendServer(C)};this.loadLog=function(B,D,A){var C={channel:"Logger",cmd:"getlog"};C.server=B;C.nick=D;C.log=A;scomms.sendServer(C)};this.close=function(){};this.online=function(){};this.offline=function(){}}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)}H.setupoptions=function(P){return function(Q){if(errorlog){var R=PermalinkInfo.create(P.cgm.doc,P.serverName.substring(10,P.serverName.length),P.channel);Q("Link to channel",function(){errorlog.queue({element:R})});if(P.isAdmin){Q("Set topic",function(){var S=function(T){if(T&&T!=P.cgm.mHandler.currentTopic){P.processInput("/topic "+T)}};errorlog.alert("Set topic for "+P.channel,S,true,P.cgm.mHandler.currentTopic)})}}}}(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(P){if(P){var B=P.toLowerCase();var Q=P;if(Q.toLowerCase().substring(0,4)=="/me "){if(this.ispm||this.cgm.getMe()){var K=Q.substring(4);K=myfilters.apply(K,false);if(K){if(this.translate){this.translateText(K,function(V){return function(W){V.sendEmote(W.error?K:W.translation,W.error?K:(K+" ("+W.translation+")"))}}(this));return false}else{this.sendEmote(K,K);return false}}}else{return false}}else{if(Q.substring(0,2)=="//"||Q.substring(0,1)!="/"){if(Q.substring(0,2)=="//"){Q=Q.substring(1,P.length)}Q=myfilters.apply(Q,false);if(Q&&(this.ispm||this.cgm.getMe())){if(this.translate){this.translateText(Q,function(V){return function(W){V.sendChat(W.error?Q:W.translation,W.error?Q:(Q+" ("+W.translation+")"))}}(this));return false}else{this.sendChat(Q,Q);return false}}else{return false}}}if(B.substring(0,7)=="/style "){P=P.substring(7,P.length);var T=P.split(" ");this.formatter.reset();for(var U=0;U<T.length;U++){if(T[U]=="bold"){this.formatter.bold=true}if(T[U]=="underline"){this.formatter.underline=true}var H=parseInt(T[U]);if(!isNaN(H)){if(this.formatter.fgcolor===null){this.formatter.fgcolor=H}else{this.formatter.bgcolor=H}}}}else{if(B=="/style"){this.formatter.reset()}else{if(B=="/redraw"){this.cgm.redraw()}else{if(errorlog&&!this.ispm&&B=="/permalink"){var G=PermalinkInfo.create(this.cgm.doc,this.serverName.substring(10,this.serverName.length),this.channel);if(errorlog){errorlog.queue({element:G})}}else{if(B.substring(0,7)=="/umode "){var F="/mode "+this.cgm.nick+" "+P.substring(7,P.length);this.server.send({cmd:"text",chan:this.channel,data:F})}else{if(B.substring(0,7)=="/query "){var E=P.substring(7,P.length);var J=null;var R=E.indexOf(" ");if(R!=-1){J=E.substring(R+1,E.length);E=E.substring(0,R)}var O={channeltype:"pm",userInitiated:true};O.channel=this.serverName+":"+E.toLowerCase();O.localchannel=E;ircHandler.newCHandler(O.channel,O);if(J){var L=this.server.channels[O.channel];L.processInput(J)}}else{if(B.substring(0,8)=="/minify "){var I=P.substring(8,P.length);scomms.sendServer({channel:"LinkManager",cmd:"minify",url:I,returnchannel:this.uchannel})}else{if(B.substring(0,8)=="/server "){ircHandler.processServerCmd(P.substring(8,P.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,P.substring(6,P.length))}var N={cmd:"text",chan:this.channel};N.data=P;this.server.send(N)}else{if(B.substring(0,8)=="/remove "){this.cgm.chatOutput.removeLines(P.substring(8,P.length));this.cgm.goToBottom()}else{if(B=="/clear"){this.cgm.clearOutput()}else{if(B.substring(0,9)=="/showurl "){var I=P.substring(9,P.length);this.cgm.openLink(I)}else{if(B.substring(0,8)=="/ignore "){var M=P.substring(8,P.length);this.cgm.setIgnoreUser(M,true)}else{if(B.substring(0,10)=="/unignore "){var M=P.substring(10,P.length);this.cgm.setIgnoreUser(M,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=P.substring(6,P.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=P.substring(7,P.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 S=myHints.getTopWords(20);for(var R=0;R<S.length;R++){var K="Hint: "+S[R];this.cgm.output("hints",this.cgm.wrapRenderer(K,{},this.prefs.colorNotice,null,false,this.cgm.renderer,A))}}else{var D={channel:this.channel,nick:this.server.nickname};myaliases.match(P,D,function(V){return function(W){V.processInput(W)}}(this),function(V){return function(){V.server.send({cmd:"text",chan:V.channel,data:P})}}(this),function(V){return function(){V.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 ChatIMChannel(K,J,D,A,G,E,B){if(DEBUG){log.log("ChatIMChannel","ch="+K+", chan="+D+", sname="+A+", sobj="+G,DebugLevel.INFO)}this.uchannel=K;this.channel=D;this.serverName=A;this.server=G;this.ispm=E;this.connected=true;this.prefs=B;this.typing=false;function L(N){return function(O){if(N.tab){N.tab.active(O)}if(alerts){alerts.alert(O?DisplayStrings.get("AlertsMyName"):DisplayStrings.get("AlertsGeneral"))}}}function H(N){return function(O){if(N.typing){if(O==""||(O.substring(0,1)=="/"&&O.substring(0,2)!="//")){N.setTyping(false)}}else{if(O!=""&&(O.substring(0,1)!="/"||O.substring(0,2)=="//")){N.setTyping(true)}}}}function M(N){return function(Q,P){if(P=="pm"){N.server.pmCallback(Q)}else{if(P=="getoptions"){var O=[{id:"pm",desc:DisplayStrings.get("UMenu_PM")}];return O}}}}function F(N){return function(){try{if(!N.connected){return false}var P=N.cgm.getInput();if(P){var R=P.toLowerCase();var T=P;if(T.toLowerCase().substring(0,4)=="/me "){var O=T.substring(4);N.sendEmote(O,O);return false}else{if(T.substring(0,2)=="//"||T.substring(0,1)!="/"){if(T.substring(0,2)=="//"){T=T.substring(1,P.length)}N.sendChat(T,T);return false}}if(R=="/clear"){N.cgm.clearOutput()}else{var S={cmd:"text"};S.chan=N.channel;S.data=P;N.server.send(S);N.setTyping(false)}}}catch(Q){if(DEBUG){log.log("submit",Q,DebugLevel.WARNING)}}return false}}var I={};I.sendcb=F(this);I.typingcb=H(this);I.userclickcb=M(this);I.activitycb=L(this);var C=!this.ispm;this.cgm=new ChatGuiModule(J,C,this.prefs,I,false,E?this.prefs.tabColorPM:this.prefs.tabColorChannel);this.cgm.parseAnsi=true;this.cgm.parseSimpleHTML=true;this.cgm.createRenderer();if(!this.ispm&&this.prefs.noUListInChannels){this.cgm.setUListDisplay(false)}this.cgm.nick=this.server.nickname;if(E){this.cgm.users[this.channel.toLowerCase()]=this.channel;this.cgm.users[this.cgm.nick.toLowerCase()]=this.cgm.nick}}ChatIMChannel.prototype.sendEmote=function(B,A){var C={cmd:"emote"};C.nick=this.cgm.nick;C.emote=A;this.cgm.processPacket(C);m="/me "+B;var D={cmd:"text"};D.chan=this.channel;D.data=m;this.server.send(D);this.setTyping(false)};ChatIMChannel.prototype.sendChat=function(B,A){var C={cmd:"msg"};C.nick=this.cgm.nick;C.msg=A;this.cgm.processPacket(C);if(B.substring(0,1)=="/"){B="/"+B}var D={cmd:"text"};D.chan=this.channel;D.data=B;this.server.send(D);this.setTyping(false)};ChatIMChannel.prototype.setTyping=function(A){if(!this.ispm){var B={cmd:"typing"};B.channel=this.uchannel;B.typing=A;scomms.sendServer(B);this.cgm.setMyTyping(A)}this.typing=A};ChatIMChannel.prototype.remove=function(A){this.connected=false;rcomms.removeChannelHandler(this.uchannel);this.cgm.close();this.server.removeChannel(this.uchannel);if(A){if(this.tab){tabs.deadTab(this.uchannel)}}else{if(this.tab){tabs.removeTab(this.tab.id)}}};ChatIMChannel.prototype.recv=function(D){if(!this.connected){return }try{this.cgm.processPacket(D);if(D.cmd=="kick"&&D.nick==this.cgm.nick){this.remove(true)}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(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;rcomms.addChannelHandler(this.uchannel,this);this.cgm.users[this.channel.toLowerCase()]=this.channel}}catch(C){if(DEBUG){log.log("recv",C+"( "+D+" )",DebugLevel.WARNING)}}};ChatIMChannel.prototype.prefsUpdated=function(){this.cgm.createRenderer();this.cgm.layout()};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.mibbit.com";var ISWIDGET=false;var defaultPrefs;var scomms;var rcomms;var login;var mysession;var myuser;var myprofile;var myaccount;var myaid;var myaliases;var myfilters;var sessionSetTime;var errorlog;var myHints;var logHandler;var ircHandler;var twitterHandler;var commsHandler;var DEBUG=false;var PROCESS_LIST=true;var googad;var tabs;var log;var alerts;var serverstatus="";var connectinfo;window.onerror=function(C,B,A){if(DEBUG&&log){log.log("onerror",C+" "+B+" :"+A,DebugLevel.WARNING)}};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()}else{if(B.keyCode==38){tabs.toggleStyle()}}}}catch(A){}if(B.keyCode==37||B.keyCode==39){return false}}return backspaceHandler(B)}document.onkeydown=keydownHandler;document.onkeypress=keypressHandler;function sessionSetHandler(A){scomms.sessionid=A;scomms.seqno_send=0;if(DEBUG){log.log("sessionSetHandler","mysession="+mysession+" s="+A,DebugLevel.INFO)}if(mysession){errorlog.alert("Connection to Mibbit was lost.");ircHandler.notifyServersDisconnect();tabs.removeTab("ATwitterClient");setClientStatus("")}mysession=A;sessionSetTime=(new Date()).getTime();var C=new Date();var B=-C.getTimezoneOffset();scomms.sendServer({cmd:"clientinfo",localtime:(C.getTime()+(B*60000)),tzoffset:B})}function ooHandler(B){if(DEBUG){log.log("ooHandler","oo="+B,DebugLevel.INFO)}var D=document.getElementById("connlogo");var C=document.getElementById("serverstatus");setPngSrc(D,(B?"/icons/online.png":"/icons/offline.png"),12,12);C.style.color=B?"#aaa":"#f99";var A=B?serverstatus:DisplayStrings.get("MibbitDisconnected");if(C.firstChild){C.firstChild.nodeValue=A}else{C.appendChild(document.createTextNode(A))}}function globalCHandler(C){try{if(DEBUG){log.log("globalCHandler",C,DebugLevel.INFO)}if(C.cmd=="serverstatus"){var A=document.getElementById("serverstatus");if(A.firstChild){A.firstChild.nodeValue=C.status}else{A.appendChild(document.createTextNode(C.status))}serverstatus=C.status}else{if(C.cmd=="global"){ircHandler.sendGlobal(C.msg)}}}catch(B){if(DEBUG){log.log("globalCHandler","Exception "+B,DebugLevel.WARNING)}}}function setClientStatus(A){var B=document.getElementById("clientstatus");if(B.firstChild){B.firstChild.nodeValue=A}else{B.appendChild(document.createTextNode(A))}}function newCHandler(B,A){if(DEBUG){log.log("newCHandler","New channel "+B+" ("+A+")",DebugLevel.INFO)}if(B.substring(0,10)=="IRCClient:"){return ircHandler.newCHandler(B,A)}if(B=="Twitter"){connectTwitter(myaccount.twitteruser,myaccount.twitterpass,false)}return false}function lioHandler(K,B,I,C,F,J){var E=document.getElementById("loginstatus");if(K){var D=DisplayStrings.get("MibbitLoggedIn")+I;if(E.firstChild){E.firstChild.nodeValue=D}else{E.appendChild(document.createTextNode(D))}var H=document.getElementById("f_nick1");if(H){H.value=I}var G=document.getElementById("f_nick2");if(G){G.value=I}myuser=I;myprofile=F;myaccount=J;myaid=B;if(DEBUG){log.log("lioHandler","prefs="+C,DebugLevel.FINE)}defaultPrefs.load(C);myaliases.load(defaultPrefs.aliases);myfilters.load(defaultPrefs.filters)}else{var A=getRandomNick();var H=document.getElementById("f_nick1");if(H){H.value=A}var G=document.getElementById("f_nick2");if(G){G.value=A}if(E.firstChild){E.removeChild(E.firstChild)}tabs.removeTab(".XAccount");tabs.removeTab(".XChannels");tabs.removeTab(".XPrefs");tabs.removeTab(".XLogs");tabs.removeTab(".XProfile");myuser=null;myprofile={};if(DEBUG){log.log("lioHandler","Logged out, reset defsultPrefs",DebugLevel.FINE)}defaultPrefs.reset();defaultPrefs.tellListeners()}uGui.updateTopMenu(K)}function init(){try{if(top.location!=location){alert("The official Mibbit website is at www.mibbit.com. Please update your links.");top.location.href=document.location.href}}catch(I){}if(BROWSER_IE6){ChatGuiModule.NEED_RESIZE_HANDLER=true}myHints=new Hints();errorlog=new ErrorLog(document.getElementById("errorlog"));IRCClient.prototype.showConnectFailed=function(Q,P){if(P){errorlog.alert(Q+": "+P)}};IRCClient.prototype.showDisconnected=function(R,P,Q){if(P){errorlog.alert(R+": "+P+(Q?("\r\n\r\n"+Q):""))}};IRCClient.prototype.confirmCloseServer=function(P){errorlog.alert("Are you sure you want to disconnect from "+P+"?",function(Q){if(Q){ircHandler.reqDisconnectServer(P)}})};ChatServer.prototype.getNewNick=function(Q,P){errorlog.alert("Please pick a new nick: ",function(R){if(R){P(R)}},true)};Aliases.prototype.prompt=function(Q,P){errorlog.alert("Alias "+Q+":",P,true)};var D=document.getElementById("mibbitlogo");D.title="Mibbit version ."+((typeof VERSION=="undefined")?"(dev)":VERSION);setPngSrc(D,"/gfx/top-logo-mibbit.png",150,77);D.style.display="inline";showIMForm();showSearchForm();showIRCConnect(document.getElementById("ircconnectform"),undefined,undefined,"f_nick1");myaliases=new Aliases();myfilters=new Filters();ircHandler=new IRCClient();defaultPrefs=new UserPrefs();myaliases.load(defaultPrefs.aliases);myfilters.load(defaultPrefs.filters);uGui.buildLoginForm();uGui.buildRegisterForm();uGui.updateTopMenu(false);try{if(navigator.userAgent.indexOf("Nintendo Wii")!=-1){defaultPrefs.needSendButton=true}}catch(I){}alerts=new BlurredAlerts(window,"Mibbit","[ Mibbit ]",defaultPrefs);alerts.attachListeners(window,"window");alerts.attachListeners(window.document,"doc");tabs=new TabGroup(document.getElementById("tabs"),defaultPrefs,true,6,20);defaultPrefs.addListener(function(){tabs.redraw();tabs.setStyle(defaultPrefs.useTabList);function P(S,R){var Q=tabs.tabs[S];if(Q){Q.content.style.background=defaultPrefs.tabColorGeneral;if(!R){R={}}R.background=defaultPrefs.tabColorGeneral;R.border=defaultPrefs.tabBColorGeneral;Q.newSettings(R)}}P("..Welcome",{icon:"/icons/house.png",iconWidth:16,iconHeight:16});P(".XChannels");P(".XPrefs",{iconWidth:16,iconHeight:16,icon:"/icons/wrench.png"});P(".XProfile",{iconWidth:16,iconHeight:16,icon:"/icons/user_green.png"});P(".XAccount");P(".XLogs");P(".Log")});defaultPrefs.addListener(function(){uGui.buildLoginForm();uGui.buildRegisterForm();uGui.updateTopMenu(myuser!=null)});defaultPrefs.addListener(function(){ircHandler.prefsUpdated()});ChatGuiModule.BASE_HEADER_HEIGHT=77+6;ChatGuiModule.HEADER_HEIGHT=ChatGuiModule.BASE_HEADER_HEIGHT+20+6;var I=document.getElementById("chats");if(typeof VERSION=="undefined"||getParameter("debug")!=null){showDebug()}var A=document.getElementById("welcome");var E=tabs.addTab("..Welcome",A,"Home","Mibbit home",null,setupNewTab(A),{background:"bbd18a",border:"#c0ffc0",icon:"/icons/house.png",iconWidth:16,iconHeight:16},false);tabs.closeAll();E.open();var B=getParameter("url");if(B){connectinfo=ircHandler.parseURL(B)}if(!connectinfo){if(getParameter("server")!=null){connectinfo={ssl:false,port:6667,host:getParameter("server")};var K=connectinfo.host.split(":");connectinfo.host=K[0];if(K[1]){connectinfo.port=K[1];if(connectinfo.port.substring(0,1)=="+"){connectinfo.ssl=true;connectinfo.port=connectinfo.port.substr(1)}}connectinfo.target=getParameter("channel");if(connectinfo.target==null){connectinfo.target=""}connectinfo.nick=getParameter("nick");connectinfo.pass=getParameter("pass");connectinfo.charset=getParameter("charset");connectinfo.needPass=getParameter("needPass");connectinfo.key=getParameter("key");connectinfo.needKey=getParameter("needKey")}var L=window.location.hash;if(L){connectinfo={ssl:false,port:6667,host:"irc.mibbit.net",target:L};var C=L.indexOf("@");if(C!=-1){connectinfo.host=L.substring(C+1,L.length);connectinfo.target=L.substring(0,C)}for(var N=0;N<ircnets.length;N++){if(connectinfo.host.toLowerCase()==ircnets[N].name.toLowerCase()){connectinfo.host=ircnets[N].addr;break}}var K=connectinfo.host.split(":");connectinfo.host=K[0];if(K[1]){connectinfo.port=K[1];if(connectinfo.port.substring(0,1)=="+"){connectinfo.ssl=true;connectinfo.port=connectinfo.port.substr(1)}}}}else{if(connectinfo.target&&"#&+".indexOf(connectinfo.target.substring(0,1))==-1){var H=document.getElementById("ircstargettype");while(H.firstChild){H.removeChild(H.firstChild)}H.appendChild(document.createTextNode("Target nick:"));document.getElementById("ircskeyopt").style.display="none"}}if(connectinfo){document.getElementById("connectspecific").style.display="block";var J=document.getElementById("connectspecific");var E=tabs.addTab(".Connect",J,"Connect","Connect",null,setupNewTab(J),{background:"bbd18a",border:"#c0ffc0"},false);showIRCConnect(document.getElementById("ircconnectform2"),connectinfo,function(){tabs.removeTab(".Connect")},"f_nick2");tabs.closeAll();E.open()}try{var G=10*60*1000;var O={"format":"468x60","ad_slot":"8432043256","hints":"irc,chat"};if(Math.random()>=0.5){O.ad_slot="3877739657";G=5*60*1000}googad=new google.ads.Ad("pub-8840091489419990","googa",O);window.setInterval(function(){var P=myHints.getTopWords(20);googad.refresh({"hints":P})},G)}catch(I){}var M={"nch":newCHandler,"gph":globalCHandler,"ooh":ooHandler,"ssh":sessionSetHandler};rcomms=new CommsRecv("/j/mibbit",M);var F=function(P){return function(Q){P.parseResponse(Q)}}(rcomms);var L={"recv":F,"psh":null};scomms=new CommsSend("/j/mibbit",L);login=new loginManager(lioHandler,true);rcomms.addChannelHandler("LoginManager",login);logHandler=new LogHandler();rcomms.addChannelHandler("Logger",logHandler);login.checkusernamecallback=uGui.nickcheckcb;rcomms.start();login.changepasswordcallback=function(P){errorlog.alert(P?"Your password has been changed successfuly":"Invalid password. Please make sure it is 4-16 characters")};login.logincallback=function(P,Q){if(DEBUG){log.log("loginCallback","s="+P+", msg="+Q)}if(!P){errorlog.alert("Invalid login: "+Q)}};login.registercallback=function(Q,T){if(DEBUG){log.log("registerCallback","s="+Q+", msg="+T)}if(!Q){errorlog.alert("Invalid registration: "+T)}if(Q){var S=showUserTab(".XAccount","My Account","My Account");if(S){var P=S.ownerDocument.createElement("div");cp({marginTop:"8px",marginBottom:"8px",fontSize:"15px",fontWeight:"bold",color:"#44c"},P.style);P.appendChild(S.ownerDocument.createTextNode("Welcome to Mibbit! Please take a moment to fill in some details."));P.appendChild(S.ownerDocument.createElement("br"));P.appendChild(S.ownerDocument.createTextNode("Or alternatively go back to what you were doing :)"));S.appendChild(P);var R=new AccountUI(S)}googtrack("registered")}};rcomms.addChannelHandler("IRCClient",ircHandler)}window.onbeforeunload=function(){if(defaultPrefs.confirmUnload){return"Any Chat Connections will be closed!"}};function shutdown(){rcomms.stop()}function showDebug(){var C=document.getElementById("chats");var B=document.createElement("div");B.style.display="none";C.appendChild(B);log=new DebugLog(B);var A=tabs.addTab(".Log",B,"Log","Debug Log",function(E,D){log.activecb(E,D)},setupNewTab(B),{background:"bbd18a",border:"#c0ffc0"},true,false);DEBUG=true}function getParameter(A){var B=window.location.search.substring(1);if(B.length>0){begin=B.indexOf(A+"=");if(begin!=-1){begin+=A.length+1;end=B.indexOf("&",begin);return decodeURIComponent(B.substring(begin,end==-1?B.length:end))}}return null}var queryID=0;var currentQueries={};function ircSearch(B,A){try{var D={channel:"IRCClient",cmd:"search"};D.server=B;D.keywords=A;D.queryID=queryID;D.offset=0;if(DEBUG){log.log("ircSearch","Search ["+queryID+"] "+B+" for '"+A+"'",DebugLevel.INFO)}scomms.sendServer(D);queryID++}catch(C){if(DEBUG){log.log("ircSearch","e="+C,DebugLevel.WARNING)}}}function searchChannels(){try{var A=document.getElementById("channelsearch").value;if(A!=""){var F={channel:"IRCClient",cmd:"search"};F.keywords=A;F.queryID=queryID;F.offset=0;if(DEBUG){log.log("searchChannels","Search ["+queryID+"] for '"+A+"'",DebugLevel.INFO)}scomms.sendServer(F);var E=document.getElementById("chats");var D=document.createElement("div");var C=setupNewTab(D);var B=new SearchResults(D,queryID,A);currentQueries[queryID]=B;E.appendChild(D);tabs.addTab(".XX"+queryID,D,"? '"+A+"'","Search for '"+A+"'",null,function(G){return function(){if(C!=null){C()}delete currentQueries[G];return true}}(queryID),{background:"bbd18a",border:"#c0ffc0"},false,true);queryID++}}catch(E){if(DEBUG){log.log("searchChannels","e="+E,DebugLevel.WARNING)}}}function getRandomNick(){var C="abcdefghijklmnopqrstuvwxyz0123456789";var D="mib_";for(var A=0;A<6;A++){var B=Math.random()*C.length;D+=C.charAt(B)}return D}function showIMForm(){var A=document.getElementById("imform");A.className="connectform";var B=document.createElement("table");B.setAttribute("cellpadding","0");B.setAttribute("cellspacing","0");B.setAttribute("border","0");cp({width:"100%",margin:"auto",fontFamily:"sans-serif",border:"1px solid #51661c",color:"#000",background:"#fff"},B.style);B.style.borderRadius="8px";B.style.MozBorderRadius="8px";B.style.WebkitBorderRadius="8px";B.style.padding="8px";A.appendChild(B);var W=B.insertRow(-1);var D=W.insertCell(-1);D.className="grouphead";var I=document.createElement("span");I.style.color="black";var O=document.createTextNode("Twitter");I.appendChild(O);D.appendChild(document.createTextNode("Login to IM [ "));D.appendChild(I);D.appendChild(document.createTextNode(" ]"));var V=B.insertRow(-1);var C=V.insertCell(-1);var U=document.createElement("form");C.appendChild(U);var E=document.createElement("table");E.setAttribute("border","0");E.setAttribute("cellpadding","2");E.setAttribute("cellspacing","2");E.style.width="100%";U.appendChild(E);var S=E.insertRow(-1);var L=S.insertCell(-1);var N={height:"46px",width:"46px",margin:"4px",padding:"2px"};N.borderRadius="4px";N.MozBorderRadius="4px";N.WebkitBorderRadius="4px";var M=document.createElement("img");cp(N,M.style);M.src="/gfx/twitter_icon_d.png";L.appendChild(M);var R="twitter";M.style.border="2px solid #824";M.onclick=function(){M.style.border="2px solid #824";R="twitter";O.nodeValue="Twitter"};M.onmouseover=function(){M.src="/gfx/twitter_icon.png"};M.onmouseout=function(){M.src="/gfx/twitter_icon_d.png"};var K=S.insertCell(-1);K.appendChild(document.createTextNode("User:"));var J=S.insertCell(-1);var P=document.createElement("input");cp({size:8,type:"text",className:"ainput",value:""},P);J.appendChild(P);var H=S.insertCell(-1);H.appendChild(document.createTextNode("Pass:"));var G=S.insertCell(-1);var Q=document.createElement("input");cp({size:8,type:"password",className:"ainput",value:""},Q);G.appendChild(Q);var F=S.insertCell(-1);var T=document.createElement("input");T.type="submit";T.className="abutton";T.value="Go";F.appendChild(T);U.onsubmit=function(){if(R=="twitter"){connectTwitter(P.value,Q.value,true)}return false}}function showSearchForm(){var G=document.getElementById("searchform");G.className="connectform";var C=document.createElement("table");C.setAttribute("cellpadding","0");C.setAttribute("cellspacing","0");C.setAttribute("border","0");cp({width:"100%",margin:"auto",fontFamily:"sans-serif",border:"1px solid #51661c",color:"#000",background:"#fff"},C.style);C.style.borderRadius="8px";C.style.MozBorderRadius="8px";C.style.WebkitBorderRadius="8px";C.style.padding="8px";G.appendChild(C);var H=C.insertRow(-1);var D=H.insertCell(-1);var F=document.createElement("div");D.appendChild(F);var E=document.createElement("a");E.href="/networks/";E.target="_blank";E.style.color="green";E.appendChild(document.createTextNode("Browse IRC Networks"));F.appendChild(E);var M=document.createElement("div");D.appendChild(M);M.id="findchannels";var I=document.createElement("input");I.size="14";I.type="text";I.className="ainput";I.id="channelsearch";var J=document.createElement("input");J.type="submit";J.className="abutton";J.id="searchbutton";J.value="Find channels";var L=document.createElement("form");L.onsubmit=function(){searchChannels();return false};L.appendChild(I);L.appendChild(document.createTextNode(" "));L.appendChild(J);M.appendChild(L);M.appendChild(document.createElement("br"));var B=document.createElement("span");B.className="egeg";var K=document.createElement("span");K.appendChild(document.createTextNode("Linux"));K.className="egegt";var A=document.createElement("span");A.appendChild(document.createTextNode("Music trivia"));A.className="egegt";B.appendChild(document.createTextNode('eg "'));B.appendChild(K);B.appendChild(document.createTextNode('" or "'));B.appendChild(A);B.appendChild(document.createTextNode('"'));M.appendChild(B)}function showIRCConnect(n,o,p,AI){var h=document.createElement("form");n.appendChild(h);var B=document.createElement("div");B.className="connectform";h.appendChild(B);var AC=document.createElement("table");AC.setAttribute("cellpadding","0");AC.setAttribute("cellspacing","0");AC.setAttribute("border","0");cp({width:"100%",margin:"auto",fontFamily:"sans-serif",border:"1px solid #51661c",color:"#000",background:"#fff"},AC.style);AC.style.borderRadius="8px";AC.style.MozBorderRadius="8px";AC.style.WebkitBorderRadius="8px";AC.style.padding="8px";B.appendChild(AC);var AA=AC.insertRow(-1);var T=AA.insertCell(-1);T.className="grouphead";T.appendChild(document.createTextNode("IRC: "));function C(AJ,AK){var AL=document.createElement("option");AL.value=AJ;AL.appendChild(document.createTextNode(AK));return AL}function g(AN,AK,AJ){var AL=(AK.style.display!="block");AK.style.display=AL?"block":"none";AN.className=AL?"optlink1":"optlink0";try{if(AL){if(AJ){AJ.focus()}}else{AN.blur()}}catch(AM){}return AL}var Z=false;var H=false;if(Z){var AF=document.createElement("div");AF.style.marginBottom="2px";var P=document.createElement("input");P.type="checkbox";P.defaultChecked=false;P.checked=false;P.style.marginRight="2px";AF.appendChild(P);AF.appendChild(document.createTextNode("Use "));var q=document.createElement("a");q.href="http://wiki.mibbit.com/index.php/Java_Applet_Helper";q.target="_blank";q.style.color="blue";q.appendChild(document.createTextNode("Java Applet helper"));AF.appendChild(q);AF.appendChild(document.createTextNode(" to connect from your IP"))}if(!o||!o.host){var k=document.createElement("select");T.appendChild(k);ircnets.sort(function(AK,AJ){if(AK.name=="Mibbit"){return -1}if(AJ.name=="Mibbit"){return 1}if(AK.name.toLowerCase()<AJ.name.toLowerCase()){return -1}if(AK.name.toLowerCase()>AJ.name.toLowerCase()){return 1}return 0});for(var AD=0;AD<ircnets.length;AD++){var e=ircnets[AD];var l=C(e.addr,e.name+(e.webirc?" [webirc]":""));k.appendChild(l)}}else{var AH=document.createElement("span");cp({color:"#444",fontSize:"13px"},AH.style);T.appendChild(AH);var s=(":"+(o.ssl?"+":"")+o.port);if(!o.ssl&&o.port==6667){s=""}AH.appendChild(document.createTextNode(o.host+s));H=true}var t=document.createElement("span");T.appendChild(document.createTextNode(" "));T.appendChild(t);t.style.fontSize="11px";t.style.color="#444";var z=AC.insertRow(-1);var R=z.insertCell(-1);var AB=document.createElement("table");AB.width="100%";AB.setAttribute("cellspacing","2");AB.setAttribute("border","0");AB.setAttribute("cellpadding","2");R.appendChild(AB);var AG=AB.insertRow(-1);var c=AG.insertCell(-1);c.colSpan="6";if(!o||!o.host){if(t.firstChild){t.appendChild(document.createTextNode(" | "))}var u=document.createElement("span");u.className="optlink0";u.appendChild(document.createTextNode("Server"));t.appendChild(u);var x=document.createElement("input");x.size="14";x.type="text";x.className="ainput";x.value="";var N=addOptionalForm(document.createTextNode("Server address:"),x,"Specify SSL with a '+' eg irc.mibbit.net:+6667");c.appendChild(N);u.onclick=function(){x.value="";k.disabled=g(u,N,x);return false};if(Z){N.appendChild(AF)}}var G=document.createElement("select");G.className="aselect";var E=document.createElement("option");E.value="nickserv";E.appendChild(document.createTextNode("NickServ"));G.appendChild(E);var y=document.createElement("option");y.value="pass";y.appendChild(document.createTextNode("Pass"));G.appendChild(y);var F=document.createElement("option");F.value="auth";F.appendChild(document.createTextNode("Auth"));G.appendChild(F);var D=document.createElement("input");D.size="14";D.type="password";D.className="ainput";D.value="";var K=addOptionalForm(G,D);c.appendChild(K);var F=document.createElement("span");F.className="optlink0";F.appendChild(document.createTextNode("Auth"));if(t.firstChild){t.appendChild(document.createTextNode(" | "))}t.appendChild(F);F.onclick=function(){g(F,K,D);return false};if(o&&o.pass){D.value=o.pass;g(F,K)}else{if(o&&o.needPass){g(F,K)}}var r=document.createElement("select");r.className="aselect";for(var AD=0;AD<IRCClient.SupportedCharsets.length;AD++){var s=IRCClient.SupportedCharsets[AD];r.appendChild(C(s,s))}var J=addOptionalForm(document.createTextNode("Charset:"),r);c.appendChild(J);var M=document.createElement("span");M.className="optlink0";M.onclick=function(){g(M,J,r);return false};M.appendChild(document.createTextNode("Charset"));if(t.firstChild){t.appendChild(document.createTextNode(" | "))}t.appendChild(M);if(o&&o.charset){r.value=o.charset;g(M,J)}if(o){var f=document.createElement("input");f.className="aselect";var I=addOptionalForm(document.createTextNode("Channel key:"),f);c.appendChild(I);var d=document.createElement("span");d.className="optlink0";d.onclick=function(){g(d,I,f);return false};d.appendChild(document.createTextNode("Key"));if(t.firstChild){t.appendChild(document.createTextNode(" | "))}t.appendChild(d);if(o&&o.key){f.value=o.key;g(d,I,f)}else{if(o&&o.needKey){g(d,I,f)}}}var AE=AB.insertRow(-1);var b=AE.insertCell(-1);b.width="46";var L=document.createElement("img");L.src="/gfx/irc_icon.png";L.width="46";L.height="45";b.appendChild(L);var Y=AE.insertCell(-1);Y.align="right";Y.width="40";Y.appendChild(document.createTextNode("Nick:"));var X=AE.insertCell(-1);var j=document.createElement("input");j.type="text";j.size="8";j.className="ainput";j.id=AI;j.value=getRandomNick();X.appendChild(j);if(o&&o.nick){j.value=o.nick}var W=AE.insertCell(-1);W.align="right";W.width="70";W.appendChild(document.createTextNode("Channel:"));var V=AE.insertCell(-1);if(!o||!o.target){var w=document.createElement("input");w.type="text";w.size="8";w.className="ainput";V.appendChild(w)}else{var Q=document.createElement("span");cp({color:"#888",fontWeight:"bold"},Q.style);Q.appendChild(document.createTextNode(o.target));V.appendChild(Q)}var S=AE.insertCell(-1);var A=document.createElement("input");A.type="submit";A.className="abutton";A.value="Go";S.appendChild(A);if(Z&&H){var O=AB.insertRow(-1);var U=O.insertCell(-1);U.colSpan="6";U.appendChild(AF)}h.onsubmit=function(){try{var AL,AJ;if(o&&o.host){AL=o.host+":"+(o.ssl?"+":"")+o.port;if(Z&&P.checked){AL="!"+AL}}else{if(x.value==""){AL=k.value}else{AL=x.value;if(Z&&P.checked){AL="!"+AL}}}if(o&&o.target){AJ=o.target}else{AJ=w.value}if(f&&f.value){AJ+=" "+f.value}if(DEBUG){log.log("irc.connect","Channel="+AJ,DebugLevel.INFO)}ircHandler.connectServer(AL,j.value,D.value,AJ,false,false,G.value,r.value)}catch(AK){if(DEBUG){log.log("irc.connect","exception "+AK,DebugLevel.WARNING)}}if(p){p()}return false}}function addOptionalForm(J,G,B){var H=document.createElement("div");H.className="optform";var C=document.createElement("table");H.appendChild(C);C.width="100%";C.setAttribute("cellspacing","2");C.setAttribute("border","0");C.setAttribute("cellpadding","0");var I=C.insertRow(-1);var E=I.insertCell(-1);E.align="right";E.width="50%";E.appendChild(J);var D=I.insertCell(-1);D.align="left";D.appendChild(G);if(B){var F=C.insertRow(-1);var K=F.insertCell(-1);K.colSpan="2";K.align="center";var A=document.createElement("span");A.className="formhelper";A.appendChild(document.createTextNode(B))}return H}