var cbx={ver:882,lp:0};window.tbl=null;window.cbm=null;window.op=null;if(document.currentScript){var matches=document.currentScript.src.match(/_(.*)\.js/);matches&&1s_ml&&(this.value=this.value.substring(0,s_ml))});cbx.gsUser=cbx.getGSObject(s_id+":user");cbx.gsPrefs=cbx.getGSObject("_:prefs"); if(s_uo)cbx.gsUser.set("key",a.key.value),cbx.gsUser.set("nme",a.nme.value!=t1?a.nme.value:t1);else{b=cbx.gsUser.get("key");var c=cbx.gsUser.get("nme"),e=cbx.gsUser.get("eml");b&&(a.key.value=b);c&&(a.nme.value=c);a.eml&&e&&(a.eml.value=e)}!s_uo||""!=a.nme.value&&""!=a.key.value||(a.pst.value=t0);window.onbeforeunload=function(){};window.onfocus=function(){cbx.notifyParent("focus")};window.onblur=function(){cbx.notifyParent("blur")};s_sn&&(cbx.setSndVol(cbx.gsPrefs.get("sndVol")),window.setTimeout(function(){cbx.audio.setup(snuri)}, 1500));window.setTimeout(function(){cbx.rsz()},10);window.onresize=cbx.rsz;cbx.listenParent();try{var d=parent["cboxmain"+s_no];d&&d.ready&&window.cbmready(d,!0)}catch(f){}cbx.fp=0},cbmReadyWait=null; window.cbmready=function(a,b){var c=function(a){cbx.debug.log(a,"CBMREADY")};c("Called "+(b?"locally":"remotely")+": importing");(b=cbx.$frm)?(window.cbm=a,a.document.getElementById("mt")&&a.document.getElementById("mt").tBodies?window.tbl=a.document.getElementById("mt").tBodies[0]:c("Could not find message table"),!a.frld&&1*a.ftme>1*window.ctme&&(a.frld=!0,window.setTimeout(function(){document.location.reload(!0)},1E3)),cbx.lp=Math.max(cbx.lp,1*a.lpid),cbx.maxMsgs=s_mp,op=op||1*a.opid,s_on&&a.onu&& cbx.aonliners(1*a.onu),a.exp&&(b.pst.value=a.exp,b.pst.disabled="true",b.sub.disabled="true"),a.nme&&b.nme.value==t1&&(b.nme.value=a.nme),a.eml&&b.eml&&b.eml.value==t5&&(b.eml.value=a.eml),cbx.disableAutoScroll=!1,cbx.autoScroll(),a.onunload=function(){a=cbx.$body=null},cbx.upd_tms(),ar_reset(),delban(),cbx.$frm.key.value&&window.setTimeout(function(){cbx.xhr("getlvl",{json:1,n:cbx.$frm.nme.value,k:cbx.$frm.key.value},null,function(a,b){a&&(a=JSON.parse(a),cbx.updateUser(a))})},500),s_on&2&&cbx.addTypingHandler(b.pst, function(a){cbx.presMgr.sendPing(a?"typing":"idle")}),cbx.notifyParent("ready")):c("Race detected. Bailing.")};"undefined"===typeof JSON&&(window.JSON={parse:function(){},stringify:function(){}}); cbx.getGSObject=function(a,b){var c;try{var e=localStorage.getItem("cbx:"+a);if(e&&(c=JSON.parse(e))&&c.val)var d=c.val}catch(f){cbx.debug.log("[GS] get failed: "+f.name)}c||(c={});d||(d={});return{get:function(a){return d[a]},set:function(e,g){if(!d[e]||d[e]!==g||"object"===typeof g){d[e]=g;c.val=d;e=(new Date).getTime()/1E3|0;c.ctime?c.mtime=e:c.ctime=e;b&&(c.ttl=1*b);try{localStorage.setItem("cbx:"+a,JSON.stringify(c))}catch(h){cbx.debug.log("[GS] set failed: "+h.name)}}},toString:function(){return JSON.stringify(d)}}}; cbx.notifyParent=function(a,b){if(!window.postMessage)return!1;window.parent.postMessage(JSON.stringify({event:""+a,data:b,serial:s_no}),"*")}; cbx.listenParent=function(){window.onmessage=function(a){if(!a||!a.origin||null===a.origin.match(/\.cbox\.ws$/)&&null===a.origin.match(/cbox\.im$/))cbx.debug.log("Got wrong origin "+a.origin,"PARENT");else{var b={};try{b=JSON.parse(a.data)}catch(e){cbx.debug.log("Got bad JSON","PARENT")}a=b._call;var c=b.args;cbx.debug.log("Got call "+a,"PARENT");if("elemFromPoint"===a){c=document.elementFromPoint(c.x,c.y);if(null===c){cbx.notifyParent(a,null);return}cbx.notifyParent(a,c.tagName+" "+c.className)}"setStyle"=== a&&(cbx.setStyle(b.sel,b.prop,b.val),cbx.debug.log("GOT SETSTYLE FOR "+b.prop));"loadCSS"===a&&(c="./?"+s_rq+"&sec=css&i="+b.which,cbx.loadCSS(cbm,c),cbx.loadCSS(window,c),cbx.debug.log("GOT loadCSS FOR "+b.prop));"replaceCSS"===a&&(cbx.replaceCSS(b.cssText),cbx.debug.log("GOT replaceCSS"));"type"===a&&(a=cbx.$frm,a.pst.value==a.pst.x_placeholder&&(a.pst.value=""),a.pst.value=a.pst.value+" "+b.message,a.pst.focus())}}}; cbx.debug={loadTime:(new Date).getTime(),history:[],log:function(a,b){var c=cbx.debug;c.history.push({time:(((new Date).getTime()-cbx.debug.loadTime)/1E3).toFixed(3),msg:a,group:b?b:""});50Version: "+cbx.ver+" build "+cbx.build+" in "+document.compatMode+"
","Namespace: "+s_phost+"-"+s_id+"-"+s_tid+" ("+s_no+") "+("https:"==document.location.protocol?"HTTPS":"")+"
","User Agent: "+navigator.userAgent+"
","FP: "+cbx.fp+"
","Time: "+(new Date).getTime()+", scomp: "+cbx.unixTime()+ "
","Prefs: "+cbx.gsPrefs.toString()+"
","User: "+cbx.gsUser.toString()+"
","LP ID: "+cbx.lp+"
","Scroll lock: "+scrollFollow+"
","ARMGR state: "+cbx.arMgr.state+", upstream: "+cbx.arMgr.upstream+", wait: "+cbx.arMgr.backoff+"
","WS/FL/LP/RP state: "+wsconn.state+" / "+flconn.state+" / "+cbx.lpconn.state+" / "+cbx.repl.state+"
","Repl: client "+cbx.repl.clientID+"; slave of "+cbx.repl.masterID+"
","Presence: "+cbx.presMgr.state+ "
","--- Log ---
"],c;for(c in cbx.debug.history){var e=cbx.debug.history[c];b.push(e.time+" ["+e.group+"] "+e.msg+"
")}a.innerHTML=b.join("");a.scrollTop=a.scrollHeight},show:function(){if(cbm){var a=cbx.debugOverlay.getElem();a||(a=cbm.document.createElement("div"),a.id="cbx_debug_msg",a.style.color="#666",a.style.fontSize="12px",a.style.direction="ltr",a.style.fontFamily="monospace",a.style.wordWrap="break-word",a.style.background="#fff",a.style.padding="6px",a.style.top=a.style.left= a.style.right=a.style.bottom="0",a.style.overflow="auto",a.style.position="absolute");var b=document.getElementById("scrollmain");b||(b=cbm.document.body);s_sd?b.appendChild(a):b.insertBefore(a,b.firstChild)}},hide:function(){var a=cbx.debugOverlay.getElem();if(!a)return!1;cbm.document.body.removeChild(a);this.updTmr&&window.clearInterval(this.updTmr);this.updTmr=null},toggle:function(){cbx.debugOverlay.getElem()?this.hide():(this.show(),this.update())},autorefresh:function(){this.hide();this.show(); this.updTmr=window.setInterval(this.update,500);this.update()}};cbx.cmdHistory=[];cbx.cmdCursor=0; cbx.cmdExec=function(a){if("//"!==a.substring(0,2))return!1;var b=cbx.$frm;b.pst.onkeydown=function(a){a=a||window.event;"INPUT"!==b.pst.tagName||!cbx.cmdHistory.length||38!=a.keyCode&&40!=a.keyCode||(38==a.keyCode&&cbx.cmdCursor+1');a.document.close();a.document.title="TETRIS!";var b=a.document.getElementById("bdy"); a.onTetrisReady=function(c){c=new c(b);a.onresize=c.redraw;a.onblur=c.pause;a.onfocus=c.resume;c.start()};var c=a.document.createElement("script");c.src="//static.cbox.ws/jsc/tetris.js?1";b.appendChild(c)},wordsearch:function(a){a=a||"";var b=cbx.gsUser.get("nme")||"";window.open("http://www.cbox.ws/games/wordsearch/?name="+esc(b)+"#"+esc(a),"","width=750, height=600, resizable=yes")},help:function(){var a=[],b;for(b in c)a.push(b);add_priv_post("[HELP]",a.join(", "))},pm:function(a,b){if(a||b)return!0; set_status("Usage: //pm uid message
Or: //pm on|off")},colors:function(){cbx.colorPicker.toggle()},ignore:function(a){var b=cbx.gsUser.get("ignores")||[];a?-1"+e+"."),!0)}; cbx.loadCSS=function(a,b){var c=a.document.getElementsByTagName("head")[0];a=a.document.createElement("link");var e=c.getElementsByTagName("link"),d;for(d in e)"text/css"===e[d].type&&c.removeChild(e[d]);a.setAttribute("rel","stylesheet");a.setAttribute("type","text/css");a.setAttribute("href",b);c.appendChild(a);console.log("CSS LOADED");window.setTimeout(function(){cbx.rsz(!0)},50)}; cbx.replaceCSS=function(a){var b=function(b){for(var c=0;cd.href.indexOf("cbox")||(d.disabled=!0)}c=b.document.getElementById("__style");c||(d=b.document.getElementsByTagName("head")[0],c=b.document.createElement("style"),c.type="text/css",c.id="__style",d.appendChild(c));c.innerHTML=a};b(window);b(cbm);window.setTimeout(function(){cbx.rsz(!0)},50)}; cbx.setStyle=function(a,b,c){var e=[];if(a&&b){var d=new RegExp("^"+a+"$","ig");a=function(a){for(var g=0;gf.href.indexOf("cbox"))){if(f.cssRules&&f.cssRules.length){e=f.cssRules;break}if(f.rules&&f.rules.length){e=f.rules;break}}}for(g=0;g1*cbx.gsUser.get("lvl"))||window.setTimeout(function(){Blank.set(a)},2E3)}},d=0,f=0;fg.length)){var h=[];"<"==g.substring(0,1)&&(h=g.substring(1).split("="));0a-cbx.presMgr.ivalPing?cbx.debug.log("Suppressed - by a shared client.","PRES"):cbx.presMgr.sendPing())};window.setTimeout(function(){cbx.presMgr.state=2;cbx.debug.log("Starting", "PRES");a();window.setInterval(a,cbx.presMgr.ival)},8E3)}else cbx.debug.log("Not running - no configured use.","PRES")}}; cbx.arMgr={state:0,backoff:2E3,lpIval:null,tmr:null,upstream:null,setUpstream:function(){},run:function(){cbx.arMgr.state=1;var a=function(){cbx.arMgr.backoff=Math.min(36E4,Math.floor(cbx.arMgr.backoff*(1.5+Math.random())))},b=function(){cbx.arMgr.backoff=Math.floor(1E3*(1.5+Math.random()))},c=function(a){cbx.debug.log(a,"ARMGR")},e=function(a,b){c(cbx.arMgr.state+"->"+a+" "+b);a!=cbx.arMgr.state&&(cbx.arMgr.state=a)},d=function(a,b){null!==cbx.arMgr.tmr&&(window.clearTimeout(cbx.arMgr.tmr),cbx.arMgr.tmr= null);a&&(cbx.arMgr.tmr=window.setTimeout(function(){c("Timer fired");a()},b))},f=cbx.arMgr.setUpstream=function(a){cbx.arMgr.upstream!==a&&(cbx.arMgr.upstream=a,cbx.presMgr.sendPing())},g=function(){e(2,"Starting LP");cbx.lpconn.onstatechange=function(a){cbx.lpconn.id&&cbx.lpconn.hash&&(e(4,"LP connected"),f(cbx.lpconn.id+"_"+cbx.lpconn.hash))};cbx.lpStart();d(null)},h=!1,k=function(){e(2,"Attempting WS");a();d(h?k:m,1E4+cbx.arMgr.backoff);cbx.wsconn.onstatechange=function(){2===cbx.arMgr.state&& 4===cbx.wsconn.state?(e(4,"WS connected"),f(wsconn.id+"_"+wsconn.hash),b(),d(function(){h=!0;c("Locking WS")},3E4)):4===cbx.arMgr.state&&0==cbx.wsconn.state&&(e(0,"WS disconnected. Retrying in "+cbx.arMgr.backoff),cbx.wsconn.onstatechange=null,d(k,cbx.arMgr.backoff))};wsStart(window.wsuri)},m=function(){e(2,"Attempting FL");a();d(g,1E4+cbx.arMgr.backoff);cbx.flconn.onstatechange=function(){2===cbx.arMgr.state&&0==cbx.flconn.state?(e(0,"FL failed without connection. "),d(null),g()):2===cbx.arMgr.state&& 4===cbx.flconn.state?(e(4,"FL connected"),f(flconn.id+"_"+flconn.hash),b(),d(null)):4===cbx.arMgr.state&&0==cbx.flconn.state&&(e(0,"FL disconnected"),cbx.flconn.onstatechange=null,d(m,cbx.arMgr.backoff))};startFlashRelay()};(function(){e(1,"Attempting Repl");d(k,5E3);cbx.repl.onstatechange=function(){var a=4===cbx.arMgr.state||2===cbx.arMgr.state||0===cbx.arMgr.state;a&&4===cbx.repl.state?e(4,"Repl connected; have upstream"):1===cbx.arMgr.state&&4===cbx.repl.state?(e(3,"Repl connected"),d(null),cbx.repl.onmessage= function(a){cbx.rpcProcess(a)}):a&&4>cbx.repl.state?e(4,"Repl disconnected; have upstream"):3===cbx.arMgr.state&&4>cbx.repl.state&&(e(1,"Repl disconnected"),cbx.repl.onmessage=null,d(k,5E3))};cbx.repl.start(s_id+"_"+s_tid)})();window.setInterval(function(){var a=4===wsconn.state?wsconn:null;(a=4===flconn.state?flconn:a)&&cbx.repl.sendmessage(" "+b),cbx.lpconn.state=b,cbx.lpconn.onstatechange))cbx.lpconn.onstatechange(b)};cbx.lpconn.numRequests++;cbx.lpconn.tmeLastRequest=(new Date).getTime();var c=null;window.XDomainRequest?(c=new XDomainRequest,a("Using XDR")):c=new XMLHttpRequest;var e=!1,d=function(a){cbx.lpconn.curWait=1*Math.min(a,12E4)|0;window.setTimeout(function(){cbx.lpconn.enabled?cbx.lpLoop():b(0)}, cbx.lpconn.curWait)},f=function(f){if(!e){e=!0;cbx.lpconn.lastErr=null;var g=(new Date).getTime()-cbx.lpconn.tmeLastRequest;f=Math.max(0,4E3-g)+8E3*Math.random();var h=Math.max(8E3,cbx.lpconn.curWait)*(1.5+Math.random()),l=c.responseText;l?(g=flareUnescape(l)||"",cbx.rpcProcess(g,function(c,d){"hash"==c&&(2flconn.state||3",""":'"',"'":"'"};return a.replace(/(\\\\)|(&)|(<)|(>)|(")|(')/g,function(a){return b[a]})},wsconn={id:null,hash:null,pool:null,state:0,tmeAttempted:0,tmeOpened:0,tmeHalfEst:0,tmeCompleted:0,numAttempts:0,curAttempts:0,curBackoff:0,numCommands:0,numMessages:0,log:[],onstatechange:null,socket:null,tmr:null};cbx.wsconn=wsconn; var wsStart=function(a){var b=function(a){cbx.debug.log(a,"WS")},c=function(a){if(a!=wsconn.state&&(wsconn.state=a,wsconn.onstatechange))wsconn.onstatechange()},e=function(a,c){null!==wsconn.tmr&&(window.clearTimeout(wsconn.tmr),wsconn.tmr=null);a&&(wsconn.tmr=window.setTimeout(function(){b("Timer fired");a()},c))};try{wsconn.tmeAttempted=(new Date).getTime();wsconn.numAttempts++;wsconn.curAttempts++;b("OPENING "+a+s_flrqs);var d=function(){e(null);0wsconn.state||3a.scrollHeight-20?!0:!s_sd&&20>c?!0:!1};cbx.rszMargin=0;cbx.rszYMargin=0;cbx.rszH=0; cbx.rszW=0; cbx.rsz=function(a){var b=cbx.$frm,c=document.documentElement.clientWidth,e=document.documentElement.clientHeight;if(!e||!c)cbx.debug.log("Bailed","RSZ");else if(c!==cbx.rszW||e!==cbx.rszH||!0===a){document.documentElement.style.position="absolute";document.documentElement.style.height="100%";document.documentElement.style.width="100%";document.documentElement.style.overflow="hidden";document.documentElement.style.margin="0";document.documentElement.style.padding="0";document.body.style.padding="0"; document.body.style.margin="0";var d=document.getElementsByTagName("table");if(d.length){d[0].style.width="auto";d=document.getElementById("tblmid");var f=!1;document.dir&&"rtl"==document.dir&&(f=!0,d.style.direction="ltr");b.nme&&(b.nme.style.boxSizing="content-box",b.nme.style.MozBoxSizing="content-box",b.nme.style.webkitBoxSizing="content-box");b.eml&&(b.eml.style.boxSizing="content-box",b.eml.style.MozBoxSizing="content-box",b.eml.style.webkitBoxSizing="content-box");b.pst&&(b.pst.style.boxSizing= "content-box",b.pst.style.MozBoxSizing="content-box",b.pst.style.webkitBoxSizing="content-box");b.sub&&(b.sub.style.boxSizing="content-box",b.sub.style.MozBoxSizing="content-box",b.sub.style.webkitBoxSizing="content-box");var g=cbx.rszMargin,h=cbx.rszYMargin;cbx.rszH=e;cbx.rszW=c;cbx.debug.log("Dims "+c+","+e+" "+g+","+h,"RSZ");if(b.nme&&b.eml&&!s_fa){b.nme.style.width="0";b.eml.style.width="0";var k=b.eml.offsetLeft+b.eml.offsetWidth;b.nme.style.width=Math.max(Math.ceil(c/2-k/2-g/2),1)+"px";b.eml.style.width= Math.max(Math.floor(c/2-k/2-g/2),1)+"px"}else b.nme&&(b.nme.style.width="0",b.nme.style.width=c-g-b.nme.offsetWidth-b.nme.offsetLeft+"px"),b.eml&&(b.eml.style.width="0",b.eml.style.width=c-g-b.eml.offsetWidth-b.eml.offsetLeft+"px");s_fa?(b.pst.style.width="0",b.pst.style.width=c-g-b.pst.offsetWidth-b.pst.offsetLeft+"px"):(b.pst.style.width="0",b.pst.style.width=c-g-b.sub.offsetLeft-b.sub.offsetWidth+"px");1b&&(cbx.rszMargin=0),0>e&&(cbx.rszYMargin=0),window.setTimeout(function(){cbx.rsz(!0)},10))}}};window.cb_checkform=function(){var a=cbx.$frm;return a.pst.value&&a.pst.value!=a.pst.x_placeholder?s_uo?!0:a.nme.value&&a.nme.value!=a.nme.x_placeholder?a.eml?""!=a.eml.value&&a.eml.value!=a.eml.x_placeholder&&0>=a.eml.value.lastIndexOf(".")&&0>=a.eml.value.lastIndexOf("@")?(set_status(t6),a.eml.focus(),!1):!0:!0:(set_status(t2),a.nme.focus(),!1):(set_status(t4),a.pst.focus(),!1)}; window.pop=function(a,b,c,e){cbx.debug.log("Opening pop "+a+" at "+b+" x "+c);var d=window.open("./?"+s_rq+"&sec="+a,"cb"+s_id+a.substring(0,3),"width="+b+",height="+c+",toolbar=no,scrollbars="+e+",status=no,resizable=yes");window.setTimeout(function(){var a=screen.width,e=screen.height,h=screen.availLeft||0,k=screen.availTop||0;d.focus();window.setTimeout(function(){d.moveTo(h+a/2-b/2-100,k+e/2-c/2)},50);window.addEventListener&&window.addEventListener("unload",function(){d&&d.close()})},10)}; function esc(a){return encodeURIComponent(a)}cbx.unixTime=function(){var a=cbx.gsPrefs.get("timeDelta")||0;return Math.round((new Date).getTime()/1E3)+a}; cbx.xhr=function(a,b,c,e,d){var f=null,g=null;e=e||function(){};d=d||2E4;var h=function(a){var b=[],c;for(c in a)b.push(c+"="+esc(a[c]));return b.join("&")},k=["./?sec="+a,s_rq,"_v="+cbx.ver];(b=h(b))&&k.push(b);k=k.join("&");if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(n){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(q){}}if(!f)return!1;var m="-";f.onreadystatechange=function(){if(4==f.readyState){m=f.status;window.clearTimeout(g); var a=" ("+f.readyState+":"+m+")";if(0==f.status)return l(t14+"L-network"+a);if(200!=f.status)return l(t14+"R-server"+a);var b=f.responseText,c=b.substring(0,1);b=b.substring(1);if("1"!=c&&"0"!=c)return l(t14+"R-chksum"+a);if("0"==c)return l("R-"+b);e(b,null)}};f.onerror=function(a){l("L-connection")};var l=function(a){a=a||"L-timeout";window.clearTimeout(g);null!==f&&(f.onreadystatechange=function(){},f.abort(),f=null);e(null,a)};g=window.setTimeout(l,d);d=c?"POST":"GET";f.open(d,k,!0);f.setRequestHeader("Accept", "*/*");f.responseType="text";cbx.debug.log(d+" "+a,"XHR");c?(f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(h(c))):f.send();return!0};function set_status(a,b){add_post([b?-1:0,0,"","",0,"",a])}cbx.parseMsg=function(a){a=a.split("\t");0cbx.lp&&(cbx.lp=1*a[0]);add_post(a)&&(cbx.notifyParent("message",null),cbx.newMessageAsync())};cbx.newMessageTmr=null; cbx.newMessageAsync=function(){cbx.newMessageTmr||(s_sn&&cbx.audio.play(cbx.audioVol),cbx.newMessageTmr=window.setTimeout(function(){cbx.newMessageTmr=null},1E3))};var add_priv_post=function(a,b){var c=[-2];c[1]=cbx.unixTime();c[2]="";c[3]=a;c[4]=0;c[5]="";c[6]=b;c[8]=32;add_post(c);cbx.upd_tms()};window.op=0; function add_post(a){var b={id:a[0],unixtime:a[1],datestr:a[2],namehtml:a[3],userlevel:a[4],emlurlimg:a[5],msghtml:a[6],imgurl:a[7],bad_flags:a[8],uid:a[9],flaghtml:a[10]};b.isRedirected=!!(b.bad_flags&16);b.isPrivate=!!(b.bad_flags&32);b.isSticky=-1==b.id;b.isTemp=0==b.id;var c=function(a){cbx.debug.log(a,"MSG")},e=function(a){return(a=cbm.document.getElementById(a))?a.rowIndex:null};if(!(cbm&&tbl&&cbm.document&&cbm.document.body))return c("DOM not available; ignoring"),!1;if(!a||7>a.length)return c("Badly formed; ignoring"), !1;if(0=cbx.maxMsgs&&!b.isTemp&&!b.isSticky&&(tbl.deleteRow(s_sd?g:a-1-h),a--,op=tbl.rows[s_sd?g:a-1-h].id)}else f=tbl.insertRow(0);a=f.insertCell(-1);f.id=b.id;d=["msg","stxt"+e];b.uid&&d.push("u"+b.uid);b.userlevel&&d.push("g"+b.userlevel);b.isSticky&&d.push("Sticky");b.isTemp&&d.push("Temp");b.isPrivate&&d.push("Private");b.isRedirected&& d.push("Redirected");0'+a.msghtml+""),c.join("");if(s_av){var d=a.emlurlimg.substring(a.emlurlimg.length-4);if(a.imgurl)c.push('');else if(".gif"==d||".jpg"==d||".png"==d)c.push(''),a.emlurlimg=""}1"+a.datestr+""); a.emlurlimg&&c.push('');c.push(""+a.namehtml+"");a.emlurlimg&&c.push("");s_sf&&c.push(a.flaghtml);c.push(": ");c.push(a.msghtml);a.isPrivate&&c.push('
'+t15+"
"); a.isRedirected&&c.push('
'+t26+"
");return c.join("")}(b,e);a.className=d.join(" ");c("Inserted message "+b.id);cbx.autoScroll();cbm.document.getElementById("jsdiv")&&(b=cbm.document.getElementById("jsdiv"),c=b.innerHTML,c=c.replace(/&/g,"&"),eval(c),b.parentNode.removeChild(b),b=null);return!0}}var updTmsInt=null; cbx.upd_tms=function(){if(3!=s_dt)return!0;for(var a=cbx.unixTime(),b=t16,c=cbm.document.getElementsByTagName("div"),e=[2592E3,604800,86400,3600,60,1],d=0;df&&(f=0);60>f&&(f=5*Math.ceil(f/5));for(var g=0;6>g;g++){var h=0;if(1'],e=0,h=1;e"),c[h++]=' ',8===e%9&&(c[h++]="");c[h++]="";b.innerHTML=c.join("");cbm.document.body.appendChild(b);return b},c=function(){var d=b();d&&(d.style.display=e?"none":"block",e=!e,d.onclick=function(b){b.target&&"TD"==b.target.tagName&&(cbx.setInputMode("^#"+ a[9*b.target.parentElement.rowIndex+b.target.cellIndex]),c())})},e=!1;return{toggle:c}}();cbx.msgModeStr=""; cbx.setInputMode=function(a){var b=cbx.$frm;b.pst.value==b.pst.x_placeholder&&(b.pst.value="");"undefined"===typeof a&&(a="",b.pst.value.substring(0,cbx.msgModeStr.length)==cbx.msgModeStr&&(a=cbx.msgModeStr),b.pst.value="");if(b.pst.value.substring(0,a.length)!==a){var c=b.pst.value.substring(cbx.msgModeStr.length+(cbx.msgModeStr?1:0));b.pst.value=(a?a+" ":"")+c;cbx.msgModeStr=a}b.pst.focus();a=b.pst;"number"==typeof a.selectionStart?a.selectionStart=a.selectionEnd=a.value.length:"undefined"!=typeof a.createTextRange&& (a.focus(),a=a.createTextRange(),a.collapse(!1),a.select())};var lnkd=[]; cbx.delban=function(){var a=!1;if(tbl){cbx.debug.log("Delban called");var b=cbx.gsUser.get("lvl"),c=cbx.gsUser.get("lpid"),e=cbx.gsUser.get("uid");2mod channel · ');d.style.display="";d.onclick=function(){pop("modchan&n="+esc(cbx.$frm.nme.value)+ "&k="+esc(cbx.$frm.key.value),320,480,0);return!1}}else document.getElementById("btnModPop")&&(document.getElementById("btnModPop").style.display="none");d=tbl.rows.length;for(var f=function(a,b,c,d){var e=document.createElement("a");e.title=a;e.className=b;e.href="javascript:void(0)";e.innerHTML=c;e.onclick=d;return e},g=0;g|pic">|^)<(a|b)/i,'$1<$2')); var m=cbm.document.getElementById("mod_"+h.id);m&&(m.innerHTML="",function(d){var g=document.createDocumentFragment(),k=cbx.msgGetData(h.id);if((a||s_ld&&h.id==c&&h.id==cbx.lp&&1k.lvl&&4>k.lvl){var n=f(t18,"btnBan","[o]",function(){cbx.ban(d);return!1});n.onmouseover=function(){cbx.getip(d,n)};g.appendChild(n)}s_pm&&k&&k.uid&&e&&k.uid!==e&&(a||2=1*e&&1*tbl.rows[d].id<=1*a&&(tbl.rows[d].cells[0].innerHTML='
'+t22+"
",tbl.rows[d].cells[0].className+=" Deleted",tbl.rows[d]._deleted=!0,b++);return b}; cbx.proc_rpc_del=function(a){a=a.split(",");for(var b,c,e=0;ea[e].indexOf("_")?(b=parseInt(a[e]),isNaN(b)||cbx.del_proc(b)):(c=a[e].split("_"),b=parseInt(c[0]),c=parseInt(c[1]),isNaN(b)||isNaN(c)||cbx.del_proc(b,c))};var gips=[];cbx.getip=function(a,b){var c=cbx.$frm;gips[a]||(gips[a]=!0,cbx.xhr("getip",{n:c.nme.value,k:c.key.value,i:a},null,function(c,d){if(!c||d)return gips[a]=!1;b&&(b.title=t18+" (IP: "+c+")")}))}; window.togglesnd=function(){var a=cbx.audioVol;switch(a){case 0:a=100;break;case 20:a=0;break;default:a=20}cbx.setSndVol(a);cbx.audio.play(a)};cbx.setSndVol=function(a){var b=0,c="off",e=document.getElementById("sndctrl");"undefined"===typeof a&&(a=cbx.audioVol);cbx.audioVol=a;switch(a){case 20:b=16;c="min";break;case 100:b=32,c="max"}e.className="Vol_"+c;e.style.left=-1*b+"px";cbx.gsPrefs.set("sndVol",a)};var titleT=null; function titleflash(){if(0!=s_pp){var a=!1,b=0;parent.document.title="New message! - Cbox";titleT&&window.clearInterval(titleT);titleT=window.setInterval(function(){parent.document.title=a&&0==foc?"New message! - Cbox":"Cbox";a=a?!1:!0;(13'}window.document.getElementsByTagName("html");var e={name:a,id:a,src:b,quality:"high",allowScriptAccess:"always",bgcolor:"#ffffff",pluginspage:"http://www.macromedia.com/go/getflashplayer",title:"FL",type:"application/x-shockwave-flash",hasPriority:"true",width:1,height:1};var d={position:"absolute",width:"8px",height:"8px",bottom:"0px",left:"-10px",overflow:"hidden","z-index":"10000"};var f="",g;for(g in e)f+=g+'="'+ e[g]+'" ';var h="";for(g in d)h+=g+": "+d[g]+"; ";b=['',c("movie",b),c("AllowScriptAccess",e.allowScriptAccess),c("quality",e.quality),c("bgcolor",e.bgcolor),c("hasPriority",e.hasPriority),"",""].join("");e=document.getElementById("flash_"+a)||document.createElement("div"); e.id="flash_"+a;document.body.appendChild(e);e.innerHTML=b;return document[a]};cbx.audioVol=100; cbx.audio=function(){var a=function(a){cbx.debug.log(a,"AUDIO")};return{play:function(){a("Play called but not configured.")},setup:function(b){a("Setup called with "+b);var c=null,e=function(){window.soundManager={_externalInterfaceOK:function(d){a("SWF: ExternalInterface online! Version: "+d);window.setTimeout(function(){c._createSound("cbxsnd",1,!1)},100);window.setTimeout(function(){a("Flash: loading "+b+".mp3");c._load("cbxsnd",b+".mp3",!0,!1,!1)},500)},sounds:{cbxsnd:{_onload:function(b){b? (a("SWF: Loaded - configuring for play."),cbx.audio.play=function(b){a("Flash play called at volume "+b);c._setVolume("cbxsnd",b);c._start("cbxsnd",1,0,!1)}):a("SWF: Load failed - not switching play")},_onfinish:function(){a("SWF: Got onfinish")}}}};cbx.audio.play=function(b){a("Play waiting on flash")};a("Attempting to load Flash object...");var c=loadSWF("SMswf",window.smuri)};if(!("Audio"in window))return a("No Audio object found - fast fallback."),e(),!1;var d=null;c=new Audio;var f=function(){window.clearTimeout(h); c?(a("Ready: Canplaythrough duration "+c.duration+". Setting play() handler"),cbx.audio.play=function(b){c?d?a("Play ongoing."):0!=b&&(d=window.setTimeout(function(){a("Play timeout. Falling back.");e()},5E3),cbx.audio.playStart=(new Date).getTime(),c.volume=b/100,c.play()):a("Play fired by object destroyed")},c.removeEventListener("canplaythrough",f,!1)):a("Ready fired but object destroyed.")},g=".ogg";c.canPlayType&&c.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,"")||(g=".mp3");a("Audio object created; chose "+ g);var h=window.setTimeout(function(){a("Load timeout. Falling back.");c=null;e()},5E3);c.addEventListener("canplaythrough",f,!1);c.addEventListener("error",function(b){a("Got error. Falling back");window.clearTimeout(h);d&&(window.clearTimeout(d),d=null);c=null;e()},!1);c.addEventListener("timeupdate",function(a){c&&c.currentTime&&null!==d&&(window.clearTimeout(d),d=null)},!1);a("Setting source: "+b+g);c.setAttribute("src",b+g)}}}(); cbx.repl=function(){var a="repl:",b=0,c="xxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)}),e=function(a){if(a!==b&&(b=a,l.state=b,l.onstatechange))l.onstatechange()},d=0,f=function(){var f=(new Date).getTime(),g=null,h=null;try{g=localStorage.getItem(a+":master"),h=JSON.parse(g)}catch(p){}g=function(){try{localStorage.setItem(a+":master",JSON.stringify({id:c,tme:f,state:b}))}catch(p){}};l.masterID=null;h&&h.id?h.tmed.length||(a+=d, l.clientID=c,window.setTimeout(f,0),window.setInterval(f,3E3),window.addEventListener?(window.addEventListener("storage",m),window.addEventListener("unload",l.stop)):(window.document.attachEvent("onstorage",m),window.attachEvent("onunload",l.stop)))},stop:function(){if(4!==b){try{localStorage.removeItem(a+":master"),localStorage.removeItem(a+":buffer")}catch(n){}e(0)}},onmessage:function(){},sendmessage:function(d){if(4!==b){g++;try{localStorage.setItem(a+":buffer",JSON.stringify({msg:d,pos:c+g}))}catch(q){}}}, pump:m,state:null,onstatechange:function(){},clientID:null,masterID:null};return l}(); cbx.addTypingHandler=function(){return function(a,b){var c="IDLE",e=null,d=null,f=0,g=null,h=function(a){c!==a&&(c=a,null!==d&&(window.clearTimeout(d),d=null),a=(new Date).getTime()-f,d=window.setTimeout(function(){e!==c&&(b("TYPING"==c?!0:!1),e=c);f=(new Date).getTime()},"TYPING"==c?2500:1E3>a?1E3-a:0))},k=function(){null!==g&&(window.clearTimeout(g),g=null);2>a.value.length?h("IDLE"):(h("TYPING"),g=window.setTimeout(function(){h("IDLE")},1500))};a.addEventListener?a.addEventListener("keyup",k,!1): el.attachEvent&&a.attachEvent("onkeyup",k)}}(); var Blank=function(){try{var a=window.localStorage}catch(d){}var b="blank:",c=function(){window.location="about:blank";window.cbm&&(window.cbm.location="about:blank");window.onerror=null;throw Error("Blanked");},e=function(c){try{if(c){var d=JSON.stringify(c);a.setItem(b,d)}else a.removeItem(b)}catch(g){}};return{init:function(d){b+=d;d={};try{var f=a.getItem(b);f&&(d=JSON.parse(f))}catch(g){}1*d.expire>(new Date).getTime()?c():e(null)},set:function(a){0<1*a&&(a=Math.min(a,604800),e({expire:(new Date).getTime()+ 1E3*a}));c()}}}();window.delban=cbx.delban;window.updateUser=cbx.updateUser;window.aonliners=cbx.aonliners;init();