(function(a){function d(){this._nextId=0;this._inst=[];this._curInst=null;this._colorpickerShowing=false;this._colorPickerDiv=a('<div id="colorPickerDiv"></div>')}function e(){this._id=a.colorPicker._register(this);this._input=null;this._colorPickerDiv=a.colorPicker._colorPickerDiv;this._sampleSpan=null}a.extend(d.prototype,{markerClassName:"hasColorPicker",_register:function(a){var d=this._nextId++;this._inst[d]=a;return d},_getInst:function(a){return this._inst[a]||a},_doKeyDown:function(d){a.colorPicker._getInst(this._colId);
if(a.colorPicker._colorpickerShowing)switch(d.keyCode){case 9:a.colorPicker.hideColorPicker();break;case 27:a.colorPicker.hideColorPicker()}else d.keyCode==40&&a.colorPicker.showFor(this)},_resetSample:function(){var d=a.colorPicker._getInst(this._colId);d._sampleSpan.css("background-color",d._input.value);alert(d._input.value)},_hasClass:function(a,d){var e=a.attr("class");return e&&e.indexOf(d)>-1},showFor:function(d){d=d.jquery?d[0]:typeof d=="string"?a(d)[0]:d;d=d.nodeName&&d.nodeName.toLowerCase()==
"input"?d:this;if(a.colorPicker._lastInput!=d&&!a.colorPicker._colorpickerShowing){var e=a.colorPicker._getInst(d._colId);a.colorPicker.hideColorPicker();a.colorPicker._lastInput=d;if(!a.colorPicker._pos)a.colorPicker._pos=a.colorPicker._findPos(d),a.colorPicker._pos[1]+=d.offsetHeight;var k=false;a(d).parents().each(function(){k|=a(this).css("position")=="fixed"});k&&a.browser.opera&&(a.colorPicker._pos[0]-=document.documentElement.scrollLeft,a.colorPicker._pos[1]-=document.documentElement.scrollTop);
e._colorPickerDiv.css("position",a.blockUI?"static":k?"fixed":"absolute").css("left",a.colorPicker._pos[0]+"px").css("top",a.colorPicker._pos[1]+1+"px");e._colorPickerDiv.css("z-index","10000");a.colorPicker._pos=null;a.colorPicker._showColorPicker(e);return this}},_findPos:function(a){for(;a&&(a.type=="hidden"||a.nodeType!=1);)a=a.nextSibling;var d=curtop=0;if(a&&a.offsetParent){d=a.offsetLeft;for(curtop=a.offsetTop;a=a.offsetParent;){var e=d;d+=a.offsetLeft;d<0&&(d=e);curtop+=a.offsetTop}}return[d,
curtop]},_checkExternalClick:function(d){a.colorPicker._curInst&&(d=a(d.target),d.parents("#colorPickerDiv").length==0&&a.colorPicker._colorpickerShowing&&!a.blockUI&&d.text()!=a.colorPicker._curInst._colorPickerDiv.text()&&a.colorPicker.hideColorPicker())},hideColorPicker:function(){var d=this._curInst;if(d){if(this._colorpickerShowing)this._colorpickerShowing=false,this._lastInput=null,this._colorPickerDiv.css("position","absolute").css("left","0px").css("top","-1000px"),a.blockUI&&(a.unblockUI(),
a("body").append(this._colorPickerDiv)),this._curInst=null;d._input[0].value!=a.css(d._sampleSpan,"background-color")&&d._sampleSpan.css("background-color",d._input[0].value)}},_connectColorPicker:function(d,e){var k=a(d);if(!this._hasClass(k,this.markerClassName))a(k).attr("autocomplete","OFF"),e._input=a(k),e._sampleSpan=a('<span class="ColorPickerDivSample" style="background-color:'+e._input[0].value+";height:"+e._input[0].offsetHeight+';">&nbsp;</span>'),k.after(e._sampleSpan),e._sampleSpan.click(function(){k.focus()}),
k.focus(this.showFor),k.addClass(this.markerClassName).keydown(this._doKeyDown),k[0]._colId=e._id},_showColorPicker:function(a){a=this._getInst(a);this._updateColorPicker(a);a._colorPickerDiv.css("width",a._startTime!=null?"10em":"6em");a._colorPickerDiv.show("fast");a._input[0].type!="hidden"&&a._input[0].focus();this._curInst=a;this._colorpickerShowing=true},_updateColorPicker:function(d){d._colorPickerDiv.empty().append(d._generateColorPicker());d._input&&d._input[0].type!="hidden"&&(d._input[0].focus(),
a("td.color",d._timePickerDiv).unbind().mouseover(function(){d._sampleSpan.css("background-color",a.css(this,"background-color"))}).click(function(){d._setValue(this)}))}});a.extend(e.prototype,{_get:function(d){return this._settings[d]!=null?this._settings[d]:a.colorPicker._defaults[d]},_getValue:function(){return this._input&&this._input[0].type!="hidden"&&this._input[0].value!=""?this._input[0].value:null},_setValue:function(d){if(this._input&&this._input[0].type!="hidden"){if(typeof d!="string")this._input[0].value=
a.attr(d,"title");a(this._input[0]).change();this._sampleSpan.css("background-color",this._input[0].value)}a.colorPicker.hideColorPicker()},_generateColorPicker:function(){for(var a="#000000,#000033,#000066,#000099,#0000CC,#0000FF,#330000,#330033,#330066,#330099,#3300CC,#3300FF,#660000,#660033,#660066,#660099,#6600CC,#6600FF,#990000,#990033,#990066,#990099,#9900CC,#9900FF,#CC0000,#CC0033,#CC0066,#CC0099,#CC00CC,#CC00FF,#FF0000,#FF0033,#FF0066,#FF0099,#FF00CC,#FF00FF,#003300,#003333,#003366,#003399,#0033CC,#0033FF,#333300,#333333,#333366,#333399,#3333CC,#3333FF,#663300,#663333,#663366,#663399,#6633CC,#6633FF,#993300,#993333,#993366,#993399,#9933CC,#9933FF,#CC3300,#CC3333,#CC3366,#CC3399,#CC33CC,#CC33FF,#FF3300,#FF3333,#FF3366,#FF3399,#FF33CC,#FF33FF,#006600,#006633,#006666,#006699,#0066CC,#0066FF,#336600,#336633,#336666,#336699,#3366CC,#3366FF,#666600,#666633,#666666,#666699,#6666CC,#6666FF,#996600,#996633,#996666,#996699,#9966CC,#9966FF,#CC6600,#CC6633,#CC6666,#CC6699,#CC66CC,#CC66FF,#FF6600,#FF6633,#FF6666,#FF6699,#FF66CC,#FF66FF,#009900,#009933,#009966,#009999,#0099CC,#0099FF,#339900,#339933,#339966,#339999,#3399CC,#3399FF,#669900,#669933,#669966,#669999,#6699CC,#6699FF,#999900,#999933,#999966,#999999,#9999CC,#9999FF,#CC9900,#CC9933,#CC9966,#CC9999,#CC99CC,#CC99FF,#FF9900,#FF9933,#FF9966,#FF9999,#FF99CC,#FF99FF,#00CC00,#00CC33,#00CC66,#00CC99,#00CCCC,#00CCFF,#33CC00,#33CC33,#33CC66,#33CC99,#33CCCC,#33CCFF,#66CC00,#66CC33,#66CC66,#66CC99,#66CCCC,#66CCFF,#99CC00,#99CC33,#99CC66,#99CC99,#99CCCC,#99CCFF,#CCCC00,#CCCC33,#CCCC66,#CCCC99,#CCCCCC,#CCCCFF,#FFCC00,#FFCC33,#FFCC66,#FFCC99,#FFCCCC,#FFCCFF,#00FF00,#00FF33,#00FF66,#00FF99,#00FFCC,#00FFFF,#33FF00,#33FF33,#33FF66,#33FF99,#33FFCC,#33FFFF,#66FF00,#66FF33,#66FF66,#66FF99,#66FFCC,#66FFFF,#99FF00,#99FF33,#99FF66,#99FF99,#99FFCC,#99FFFF,#CCFF00,#CCFF33,#CCFF66,#CCFF99,#CCFFCC,#CCFFFF,#FFFF00,#FFFF33,#FFFF66,#FFFF99,#FFFFCC,#EEEEEE,#111111,#222222,#333333,#444444,#555555,#666666,#777777,#888888,#999999,#A5A5A5,#AAAAAA,#BBBBBB,#C3C3C3,#CCCCCC,#D2D2D2,#DDDDDD,#E1E1E1,#FFFFFF".split(","),
d=a.length,e="<table border='1px' cellspacing='0' cellpadding='0'>",l=0;l<d;l++)if(l%18==0&&(e+="<tr>"),e+='<td class="color" title="'+a[l]+'" style="background-color:'+a[l]+'"><label>&nbsp;&nbsp;&nbsp;</label></td>',l+1>=d||(l+1)%18==0)e+="</tr>";e+="</table>";return e}});a.fn.attachColorPicker=function(){return this.each(function(){if(this.nodeName.toLowerCase()=="input"){var d=new e;a.colorPicker._connectColorPicker(this,d)}})};a.fn.getValue=function(){var d=this.length>0?a.colorPicker._getInst(this[0]._colId):
null;return d?d._getValue():null};a.fn.setValue=function(d){var e=this.length>0?a.colorPicker._getInst(this[0]._colId):null;e&&e._setValue(d)};a(document).ready(function(){a.colorPicker=new d;a(document.body).append(a.colorPicker._colorPickerDiv).mousedown(a.colorPicker._checkExternalClick)})})(jQuery);var JSON;JSON||(JSON={});
(function(){function a(a){return a<10?"0"+a:a}function d(a){j.lastIndex=0;return j.test(a)?'"'+a.replace(j,function(a){var d=n[a];return typeof d==="string"?d:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function e(a,h){var j,m,n,q,p=k,t,s=h[a];s&&typeof s==="object"&&typeof s.toJSON==="function"&&(s=s.toJSON(a));typeof o==="function"&&(s=o.call(h,a,s));switch(typeof s){case "string":return d(s);case "number":return isFinite(s)?String(s):"null";case "boolean":case "null":return String(s);case "object":if(!s)return"null";
k+=l;t=[];if(Object.prototype.toString.apply(s)==="[object Array]"){q=s.length;for(j=0;j<q;j+=1)t[j]=e(j,s)||"null";n=t.length===0?"[]":k?"[\n"+k+t.join(",\n"+k)+"\n"+p+"]":"["+t.join(",")+"]";k=p;return n}if(o&&typeof o==="object"){q=o.length;for(j=0;j<q;j+=1)m=o[j],typeof m==="string"&&(n=e(m,s))&&t.push(d(m)+(k?": ":":")+n)}else for(m in s)Object.hasOwnProperty.call(s,m)&&(n=e(m,s))&&t.push(d(m)+(k?": ":":")+n);n=t.length===0?"{}":k?"{\n"+k+t.join(",\n"+k)+"\n"+p+"}":"{"+t.join(",")+"}";k=p;return n}}
if(typeof Date.prototype.toJSON!=="function")Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var h=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,j=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
k,l,n={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o;if(typeof JSON.stringify!=="function")JSON.stringify=function(a,d,h){var j;l=k="";if(typeof h==="number")for(j=0;j<h;j+=1)l+=" ";else typeof h==="string"&&(l=h);if((o=d)&&typeof d!=="function"&&(typeof d!=="object"||typeof d.length!=="number"))throw Error("JSON.stringify");return e("",{"":a})};if(typeof JSON.parse!=="function")JSON.parse=function(a,d){function e(a,h){var j,k,l=a[h];if(l&&typeof l==="object")for(j in l)Object.hasOwnProperty.call(l,
j)&&(k=e(l,j),k!==void 0?l[j]=k:delete l[j]);return d.call(a,h,l)}var j,a=String(a);h.lastIndex=0;h.test(a)&&(a=a.replace(h,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+a+")"),typeof d==="function"?e({"":j},""):j;throw new SyntaxError("JSON.parse");}})();var FlashDetect=new function(){var a=this;a.installed=false;a.raw="";a.major=-1;a.minor=-1;a.revision=-1;a.revisionStr="";var d=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(a){return e(a)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(a){var d="6,0,21";try{a.AllowScriptAccess="always",d=e(a)}catch(k){}return d}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(a){return e(a)}}],e=function(a){var d=-1;try{d=a.GetVariable("$version")}catch(e){}return d};a.majorAtLeast=
function(d){return a.major>=d};a.FlashDetect=function(){var e,j,k,l,n;if(navigator.plugins&&navigator.plugins.length>0){var o=navigator.mimeTypes;if(o&&o["application/x-shockwave-flash"]&&o["application/x-shockwave-flash"].enabledPlugin&&o["application/x-shockwave-flash"].enabledPlugin.description){e=o=o["application/x-shockwave-flash"].enabledPlugin.description;var o=e.split(/ +/),v=o[2].split(/\./),o=o[3];j=parseInt(v[0],10);k=parseInt(v[1],10);l=o;n=parseInt(o.replace(/[a-zA-Z]/g,""),10)||a.revision;
a.raw=e;a.major=j;a.minor=k;a.revisionStr=l;a.revision=n;a.installed=true}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){o=-1;for(v=0;v<d.length&&o==-1;v++){e=-1;try{e=new ActiveXObject(d[v].name)}catch(i){}if(typeof e=="object"&&(a.installed=true,o=d[v].version(e),o!=-1))e=o,l=e.split(","),j=parseInt(l[0].split(" ")[1],10),k=parseInt(l[1],10),n=parseInt(l[2],10),l=l[2],a.raw=e,a.major=j,a.minor=k,a.revision=n,a.revisionStr=l}}}()};FlashDetect.release="1.0.3";var go_hash=function(){function a(a,d){return a>>>d|a<<32-d}function d(a,d){var e=(a&65535)+(d&65535);return(a>>16)+(d>>16)+(e>>16)<<16|e&65535}var e=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,
666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];return{b64:function(h){for(var j="",k=-1,l,n;++k<h.length;)l=h.charCodeAt(k),n=k+1<h.length?h.charCodeAt(k+1):0,55296<=l&&l<=56319&&56320<=n&&n<=57343&&
(l=65536+((l&1023)<<10)+(n&1023),k++),l<=127?j+=String.fromCharCode(l):l<=2047?j+=String.fromCharCode(192|l>>>6&31,128|l&63):l<=65535?j+=String.fromCharCode(224|l>>>12&15,128|l>>>6&63,128|l&63):l<=2097151&&(j+=String.fromCharCode(240|l>>>18&7,128|l>>>12&63,128|l>>>6&63,128|l&63));h=Array(j.length>>2);for(k=0;k<h.length;k++)h[k]=0;for(k=0;k<j.length*8;k+=8)h[k>>5]|=(j.charCodeAt(k/8)&255)<<24-k%32;l=j.length*8;var j=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],
k=Array(64),o,v,i,y,m,z,q,p,t,s;h[l>>5]|=128<<24-l%32;h[(l+64>>9<<4)+15]=l;for(q=0;q<h.length;q+=16){l=j[0];n=j[1];o=j[2];v=j[3];i=j[4];y=j[5];m=j[6];z=j[7];for(p=0;p<64;p++)k[p]=p<16?h[p+q]:d(d(d(a(k[p-2],17)^a(k[p-2],19)^k[p-2]>>>10,k[p-7]),a(k[p-15],7)^a(k[p-15],18)^k[p-15]>>>3),k[p-16]),t=d(d(d(d(z,a(i,6)^a(i,11)^a(i,25)),i&y^~i&m),e[p]),k[p]),s=d(a(l,2)^a(l,13)^a(l,22),l&n^l&o^n&o),z=m,m=y,y=i,i=d(v,t),v=o,o=n,n=l,l=d(t,s);j[0]=d(l,j[0]);j[1]=d(n,j[1]);j[2]=d(o,j[2]);j[3]=d(v,j[3]);j[4]=d(i,
j[4]);j[5]=d(y,j[5]);j[6]=d(m,j[6]);j[7]=d(z,j[7])}h="";for(k=0;k<j.length*32;k+=8)h+=String.fromCharCode(j[k>>5]>>>24-k%32&255);j="";k=h.length;for(l=0;l<k;l+=3){n=h.charCodeAt(l)<<16|(l+1<k?h.charCodeAt(l+1)<<8:0)|(l+2<k?h.charCodeAt(l+2):0);for(o=0;o<4;o++)j+=l*8+o*6>h.length*8?"":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>>6*(3-o)&63)}return j}}}();var go_browserUtils=function(a){var d=document.getElementsByTagName("head")[0],e={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",
darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",
lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",
navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",
silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return{mn_id:0,createId:function(){return this.mn_id++},getBrowserWidth:function(){return a(window).width()},getBrowserHeight:function(){return a(window).height()},getCenterX:function(a){return this.getBrowserWidth()/
2-(a||0)/2},getCenterY:function(a){return this.getBrowserHeight()/2-(a||0)/2},getElementLeft:function(d){return a(d).offset().left},getElementTop:function(d){return a(d).offset().top},getElementHeight:function(d){return a(d).height()},getElementWidth:function(d){return a(d).width()},setElementOpacity:function(a,d){if(d<0||d>10)throw Error("Invalid opacity: "+d);a.style.filter="alpha(style=0,opacity:"+d*10+")";a.style.KHTMLOpacity=d/10;a.style.MozOpacity=d/10;a.style.opacity=d/10},getDocumentHead:function(){return d},
getMouseXY:function(a){var a=a||window.event,d={left:0,top:0};d.left=a.clientX+document.body.scrollLeft-document.body.clientLeft;d.top=a.clientY+document.body.scrollTop-document.body.clientTop;if(document.body.parentElement&&document.body.parentElement.clientLeft)a=document.body.parentElement,d.left+=a.scrollLeft-a.clientLeft,d.top+=a.scrollTop-a.clientTop;return d},stopProp:function(a){a=a||window.event;a.cancelBubble=true;a.returnValue=false;a.stopPropagation&&(a.stopPropagation(),a.preventDefault())},
getById:function(a,d){var e;if(a.id==d)return a;for(var l=0;l<a.childNodes.length;l++)if(e=a.childNodes[l].id==d?a.childNodes[l]:this.getById(a.childNodes[l],d))return e;return null},colorNameToHex:function(a){return e[a.toLowerCase().replace(/\s/g,"")]},isEventSupported:function(a){var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(e,l){var l=l||document.createElement(d[e]||"div"),e="on"+e,n=e in l;n||(l.setAttribute||(l=document.createElement("div")),
l.setAttribute&&l.removeAttribute&&(l.setAttribute(e,""),n=typeof l[e]=="function",typeof l[e]!="undefined"&&(l[e]=a),l.removeAttribute(e)));return n}}()}}(jQuery),go_queryString={getAll:function(){for(var a={},d=null,e=window.location.search.substring(1).split("&"),h=0;h<e.length;h++)d=e[h].split("="),a[d[0]]=d[1];return a},getValue:function(a){for(var d=null,e=window.location.search.substring(1).split("&"),h=0;h<e.length;h++)if(d=e[h].split("="),d[0]==a)return d[1];return null}};var go_arrayUtils={insert:function(a,d){this.contains(a,d)||a.push(d)},contains:function(a,d){for(var e=0;e<a.length;e++)if(d.equals&&d.equals(a[e])||d===a[e])return true;return false},valuesNotIn:function(a,d){for(var e=[],h=0;h<d.length;h++)this.contains(a,d[h])||e.push(d[h]);return e},union:function(a,d){for(var e=[],h=0;h<a.length;h++)this.contains(d,a[h])&&e.push(a[h]);return e},count:function(a,d){for(var e=0,h=0;h<a.length;h++)(d.equals&&d.equals(a[h])||d===a[h])&&e++;return e},countMoreThan:function(a,
d,e){for(var h=0,j=0;j<a.length;j++)if(d.equals&&d.equals(a[j])||d===a[j])if(h++,h>e)return true;return false}};function zTimer(){this.mn_handle=null;this.mb_enabled=false;this.Tick=new zEvent}zTimer.prototype.start=function(a,d){if(a<=0)throw Error("Timer started with "+a+" time.");if(this.mb_enabled==true)throw Error("Timer already active.");d==true&&this.Tick.fire();var e=this;this.mn_handle=setInterval(function(){e.Tick.fire()},a);this.mn_enabled=true};
zTimer.prototype.setTimeout=function(a){if(a<=0)throw Error("Timer started with "+a+" time.");if(this.mb_enabled==true)throw Error("Timer already active.");var d=this;this.mn_handle=setTimeout(function(){d.mb_enabled=false;d.Tick.fire()},a);this.mb_enabled=true};zTimer.prototype.stop=function(){this.mn_handle=clearInterval(this.mn_handle)};zTimer.prototype.destroy=function(){this.stop();this.Tick.destroy()};
function zCreepingTimer(a,d){this.mn_minInterval=a;this.mn_maxInterval=d;this.mn_interval=a;this.mn_handle=null;this.mb_enabled=false;this.Tick=new zEvent}zCreepingTimer.prototype.getInterval=function(){return this.mn_interval};zCreepingTimer.prototype.start=function(a){if(!this.mb_enabled)this.mb_enabled=true,this.setTimeout(a)};zCreepingTimer.prototype.resetInterval=function(a){this.mn_interval=a||this.mn_minInterval};
zCreepingTimer.prototype.setTimeout=function(a){if(this.mb_enabled){a&&this.Tick.fire({mn_interval:0});var d=this;this.mn_handle=setTimeout(function(){d.Tick.fire({mn_interval:d.mn_interval});d.setTimeout(false)},d.mn_interval);this.mn_interval<this.mn_maxInterval&&(this.mn_interval+=1E3)}};zCreepingTimer.prototype.stop=function(){this.mn_handle=clearTimeout(this.mn_handle);this.mb_enabled=false};zCreepingTimer.prototype.destroy=function(){this.stop();this.Tick.destroy()};function bindFunction(a,d){return function(){return a.apply(d,arguments)}}var EventDispatcher={events:[],mn_nextHandle:0};EventDispatcher.getNewEventHandle=function(){return EventDispatcher.mn_nextHandle++};EventDispatcher.addListener=function(a,d,e){var h=e!=null?bindFunction(d,e):d;this.events[a]==null&&(this.events[a]=[]);this.events[a].push({mf_action:d,mo_listener:e,mf_bound:h})};
EventDispatcher.removeListener=function(a,d,e){a=this.events[a];if(a!=null)for(var h=0;h<a.length;h++)if(a[h].mf_action==d&&a[h].mo_listener==e)a[h].mf_action=null,a[h].mo_listener=null,a[h].mf_bound=null,a.splice(h,1)};EventDispatcher.removeListener=function(a,d){var e=this.events[a];if(e!=null)for(var h=0;h<e.length;h++)if(e[h].mo_listener==d)e[h].mf_action=null,e[h].mo_listener=null,e[h].mf_bound=null,e.splice(h,1)};
EventDispatcher.fireEvent=function(a,d,e){a=this.events[a];if(a!=null)for(var h=0;h<a.length;h++)a[h].mf_bound(d,e)};EventDispatcher.destroyEvent=function(a){for(var d=this.events[a],e=0;e<d.length;e++)d[e].mo_listener=null,d[e].mf_action=null,d[e].mf_bound=null,d.splice(e,1);delete this.events[a]};function zEvent(){this.mn_handle=EventDispatcher.getNewEventHandle()}zEvent.prototype.fire=function(a,d){EventDispatcher.fireEvent(this.mn_handle,a,d)};
zEvent.prototype.subscribe=function(a,d){EventDispatcher.addListener(this.mn_handle,a,d)};zEvent.prototype.unsubscribe=function(a,d){EventDispatcher.removeListener(this.mn_handle,a,d)};zEvent.prototype.destroy=function(){EventDispatcher.destroyEvent(this.mn_handle)};var go_serialize={serialize:function(a){return JSON.stringify(a)},deserialize:function(a){try{return JSON.parse(a)}catch(d){return null}}};function zUserData(){typeof localStorage=="undefined"||go_defaults.mb_forceToUseCookies?(this.mo_store=go_cookies.create(),log("Using cookies.")):(this.mo_store=zLocalStorage.create(),log("Using local storage."))}zUserData.prototype={load:function(){this.mo_store.load()},setValue:function(a,d){this.mo_store.setValue(a,d)},getValue:function(a){return this.mo_store.getValue(a)},save:function(){this.mo_store.save()},kill:function(){this.mo_store.kill()}};
function zLocalStorage(){this.mo_data={};this.ms_name="data"}zLocalStorage.create=function(){return new zLocalStorage};zLocalStorage.prototype={load:function(){var a=go_serialize.deserialize(localStorage.getItem(this.ms_name));this.mo_data=a?a:{}},setValue:function(a,d){this.mo_data[a]=d},getValue:function(a){return this.mo_data[a]},save:function(){localStorage.setItem(this.ms_name,go_serialize.serialize(this.mo_data))},kill:function(){localStorage.clear();this.mo_data={}}};
var go_cookies=function(){function a(a,d,e){if(e){var l=new Date;l.setTime(l.getTime()+e*864E5);e="; expires="+l.toGMTString()}else e="";document.cookie=a+"="+d+e+"; path=/"}function d(a){a+="=";for(var d=document.cookie.split(";"),e=0;e<d.length;e++){for(var l=d[e];l.charAt(0)==" ";)l=l.substring(1,l.length);if(l.indexOf(a)==0)return l.substring(a.length,l.length)}return null}var e=function(){this.mo_data={}};e.prototype={mb_enabled:function(){var a=navigator.cookieEnabled?true:false;if(typeof navigator.cookieEnabled==
"undefined"&&!a)document.cookie="testcookie",a=document.cookie.indexOf("testcookie")!=-1?true:false;return a?true:false}(),test:function(){for(var a=0;a<1E3;a++)this.setValue("bob"+a,"weeee"+a);this.save();this.mo_data={};this.load();alert(this.getValue("bob999"));for(a=0;a<1E3;a++)if(this.getValue("bob"+a)!="weeee"+a){alert("Error at "+a);break}},load:function(){for(var a=0,e="",k=d(String(a));k;)e+=k,k=d(String(++a));this.mo_data=go_serialize.deserialize(unescape(e));if(!this.mo_data)this.mo_data=
{}},setValue:function(a,d){this.mo_data[a]=d},getValue:function(a){return this.mo_data[a]},save:function(d){for(var d=d||365,e=go_serialize.serialize(this.mo_data),e=escape(e),e=e.match(RegExp(".{1,4000}","g")),k=document.cookie,k=k.split(";"),l=0;l<k.length;l++){var n=k[l].split("=")[0];a(n,"",-1)}if(e.length>20)throw Error("Too many cookies!");for(k=0;k<e.length;k++)a(String(k),e[k],d)},kill:function(){this.mo_data={};this.save();this.load()}};e.create=function(){return new e};return e}();(function(){function a(a){for(var d={},a=a.split(","),e=0;e<a.length;e++)d[a[e]]=true;return d}var d=/^<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,e=/^<\/(\w+)[^>]*>/,h=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,j=a("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),k=a("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul"),
l=a("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),n=a("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),o=a("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),v=a("script,style"),i=this.HTMLParser=function(a,i){function z(a,d,e,p){if(k[d])for(;s.last()&&l[s.last()];)q("",s.last());n[d]&&s.last()==
d&&q("",d);(p=j[d]||!!p)||s.push(d);if(i.start){var H=[];e.replace(h,function(a,d,e,h,j){a=e?e:h?h:j?j:o[d]?d:"";H.push({name:d,value:a,escaped:a.replace(/(^|[^\\])"/g,'$1\\"')})});i.start&&i.start(d,H,p)}}function q(a,d){if(d)for(e=s.length-1;e>=0;e--){if(s[e]==d)break}else var e=0;if(e>=0){for(var h=s.length-1;h>=e;h--)i.end&&i.end(s[h]);s.length=e}}var p,t,s=[],A=a;for(s.last=function(){return this[this.length-1]};a;){t=true;if(!s.last()||!v[s.last()]){if(a.indexOf("<\!--")==0)p=a.indexOf("--\>"),
p>=0&&(i.comment&&i.comment(a.substring(4,p)),a=a.substring(p+3),t=false);else if(a.indexOf("</")==0){if(p=a.match(e))a=a.substring(p[0].length),p[0].replace(e,q),t=false}else if(a.indexOf("<")==0&&(p=a.match(d)))a=a.substring(p[0].length),p[0].replace(d,z),t=false;t&&(p=a.indexOf("<"),t=p<0?a:a.substring(0,p),a=p<0?"":a.substring(p),i.chars&&i.chars(t))}else a=a.replace(RegExp("(.*)</"+s.last()+"[^>]*>"),function(a,d){d=d.replace(/<\!--(.*?)--\>/g,"$1").replace(/<!\[CDATA\[(.*?)]]\>/g,"$1");i.chars&&
i.chars(d);return""}),q("",s.last());a==A&&(a=a.replace("<","&lt;"));A=a}q()};this.HTMLtoXML=function(a){var d="";i(a,{start:function(a,e,h){d+="<"+a;for(a=0;a<e.length;a++)d+=" "+e[a].name+'="'+e[a].escaped+'"';d+=(h?"/":"")+">"},end:function(a){d+="</"+a+">"},chars:function(a){d+=a},comment:function(a){d+="<\!--"+a+"--\>"}});return d};this.HTMLtoDOM=function(d,e){var h=a("html,head,body,title"),j={link:"head",base:"head"};e?e=e.ownerDocument||e.getOwnerDocument&&e.getOwnerDocument()||e:typeof DOMDocument!=
"undefined"?e=new DOMDocument:typeof document!="undefined"&&document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):typeof ActiveX!="undefined"&&(e=new ActiveXObject("Msxml.DOMDocument"));var k=[];!(e.documentElement||e.getDocumentElement&&e.getDocumentElement())&&e.createElement&&function(){var a=e.createElement("html"),d=e.createElement("head");d.appendChild(e.createElement("title"));a.appendChild(d);a.appendChild(e.createElement("body"));
e.appendChild(a)}();if(e.getElementsByTagName)for(var l in h)h[l]=e.getElementsByTagName(l)[0];var n=h.body;i(d,{start:function(a,d,i){if(h[a])n=h[a];else{var l=e.createElement(a),o;for(o in d)l.setAttribute(d[o].name,d[o].value);j[a]&&typeof h[j[a]]!="boolean"?h[j[a]].appendChild(l):n&&n.appendChild&&n.appendChild(l);i||(k.push(l),n=l)}},end:function(){k.length-=1;n=k[k.length-1]},chars:function(a){n.appendChild(e.createTextNode(a))},comment:function(){}});return e}})();function zHTMLParser(a){this.mn_linkDepth=0;this.mo_settings={mb_htmlEnabled:true,ms_imageTemplate:"Image: {fulltext}",ms_youtubeTemplate:"Youtube: {fulltext}",ms_mediaTemplate:"Media: {fulltext}",ms_linkTemplate:"Link: {fulltext}",ms_linkInLinkTemplate:"Link in Link: {fulltext}",ms_imageInLinkTemplate:"Image in Link: {fulltext}",ms_youtubeInLinkTemplate:"Youtube in Link: {fulltext}",ms_mediaInLinkTemplate:"Media in Link: {fulltext}",mb_goToRoomLinks:true,mb_pvtRoomLinks:true,mn_roomId:null};jQuery.extend(true,
this.mo_settings,a)}
zHTMLParser.prototype={objectify:function(a){var d={ms_tag:"root",mo_attributes:null,mo_children:[],mo_parent:null},e=d,a=this.handleYoutubeCode(a);HTMLParser(a,{start:function(a,d,k){e={ms_tag:a,mo_attributes:d,mo_children:null,mo_parent:e,mb_unary:k};a=="a"&&this.mn_linkDepth++;if(k){if(!e.mo_parent.mo_children)e.mo_parent.mo_children=[];e.mo_parent.mo_children.push(e);e=e.mo_parent}},end:function(a){a=="a"&&this.mn_linkDepth--;if(e.ms_tag==a){a=e.mo_parent;if(!a.mo_children)a.mo_children=[];a.mo_children.push(e);
e=a}},chars:function(a){if(a=a.replace(/&lt;undefined[^>]*(&gt;|>)/g,"")){if(!e.mo_children)e.mo_children=[];e.mo_children.push({ms_tag:"",ms_text:a})}},comment:function(){}});this.mn_linkDepth=0;return d},stringify:function(a){var d="",a=this.filterNodes(a);switch(a.ms_tag){case "root":break;case "":return this.parseText(a.ms_text);default:d+="<"+a.ms_tag;if(a.mo_attributes)for(var e=0;e<a.mo_attributes.length;e++)d+=" "+a.mo_attributes[e].name+'="'+a.mo_attributes[e].escaped+'"';a.mb_unary||(d+=
">")}if(a.mb_unary)d+="/>";else{a.ms_tag=="a"&&this.mn_linkDepth++;if(a.mo_children)for(e=0;e<a.mo_children.length;e++)d+=this.stringify(a.mo_children[e]);a.ms_tag=="a"&&this.mn_linkDepth--;a.ms_tag!="root"&&(d+="</"+a.ms_tag+">")}return d},filterNodes:function(a){switch(a.ms_tag){case "a":zHTMLParser.replaceAttribute(a,"target","_blank");if(zHTMLParser.getNodeAttribute(a,"rel")!="mogwai"){var d=zHTMLParser.getNodeAttribute(a,"href");zHTMLParser.replaceAttribute(a,"title",d)}break;case "span":zHTMLParser.getNodeAttribute(a,
"id")=="ani"&&(zHTMLParser.replaceAttribute(a,"id",""),zHTMLParser.replaceAttribute(a,"class","blink"));break;case "img":zHTMLParser.getNodeAttribute(a,"rel")!="mogwai"&&(a={ms_tag:"",ms_text:zHTMLParser.getNodeAttribute(a,"src")})}return a}};zHTMLParser.getNodeAttribute=function(a,d){for(var e=0;e<a.mo_attributes.length;e++)if(a.mo_attributes[e].name==d)return a.mo_attributes[e].escaped;return null};
zHTMLParser.replaceAttribute=function(a,d,e){for(var h=0;h<a.mo_attributes.length;h++)a.mo_attributes[h].name==d&&a.mo_attributes.splice(h,1);a.mo_attributes.push({name:d,escaped:e})};
zHTMLParser.prototype.parseText=function(a){for(var a=a.replace(/&#91;/g,"["),a=a.replace(/(?:\s|^)=(pvt\S+)(\s)?/g,' <div class="controlLink" title="Go to room $1..." onclick="go_app.openRoomLink(\'$1\');return false;">=$1</div>$2'),a=a.replace(/(?:\s|^)google\.(\S+)(\s)?/g,' <div class="controlLink" title="Google search &quot;$1&quot;" onclick="go_app.openSearch(\'google\',\'$1\');return false;">"google.$1"</div>$2'),a=a.replace(/(?:\s|^)whois\.(\S+)(\s)?/g,' <div class="controlLink" title="Whois info for &quot;$1&quot;..." onclick="go_app.openSearch(\'whois\',\'$1\');return false;">"whois.$1"</div>$2'),
a=a.replace(/(?:\s|^)wiki\.(\S+)(\s)?/g,' <div class="controlLink" title="Wikipedia info for &quot;$1&quot;..." onclick="go_app.openSearch(\'wiki\',\'$1\');return false;">"wiki.$1"</div>$2'),a=a.replace(/\[(.*)\]/g,go_parserUtils.replaceAsciiSpaces),a=a.split(" "),d=0;d<a.length;d++)a[d]=this.parseWord(a[d]);return a.join(" ")};
zHTMLParser.prototype.parseWord=function(a){return a=go_parserUtils.isURL(a)?go_parserUtils.isImgURL(a)?this.handleImgUrl(a):go_parserUtils.isMediaURL(a)?this.handleMediaUrl(a):this.handleLinkUrl(a):go_parserUtils.splitLongWord(a,go_defaults.mn_maxWordLength)};
zHTMLParser.prototype.handleYoutubeCode=function(a){var d=this;return a.replace(go_parserUtils.mr_tube,function(a,h,j,k,l,n){a={"{fulltext}":a,"{title}":k||h,"{id}":j,"{preview}":l,"{stars}":n};!a["{preview}"]&&a["{id}"]&&(a["{preview}"]="http://i.ytimg.com/vi/"+a["{id}"]+"/default.jpg");return zHTMLParser.mapReplace(d.mn_linkDepth?d.mo_settings.ms_youtubeInLinkTemplate:d.mo_settings.ms_youtubeTemplate,a)})};
zHTMLParser.mapReplace=function(a,d){return a.replace(/(\{\w+\})/g,function(a){return d[a]?d[a].replace(/"/g,"&#34;"):""})};zHTMLParser.prototype.handleImgUrl=function(a){if(a){var d=this;return a.replace(go_parserUtils.mr_img,function(a,h,j){h.indexOf("://")==-1&&(h="http://"+h);a={"{fulltext}":a,"{title}":(h.length>75?h.substr(0,75)+"...":h)+(j?" ["+j+"]":""),"{url}":h};return zHTMLParser.mapReplace(d.mn_linkDepth?d.mo_settings.ms_imageInLinkTemplate:d.mo_settings.ms_imageTemplate,a)})}};
zHTMLParser.prototype.handleMediaUrl=function(a){var d=this;return a.replace(go_parserUtils.mr_media,function(a,h){var j=h;j.indexOf("://")==-1&&(j="http://"+j);return(d.mn_linkDepth?d.mo_settings.ms_mediaInLinkTemplate:d.mo_settings.ms_mediaTemplate).replace(/({url})/g,j)})};
zHTMLParser.prototype.handleLinkUrl=function(a){var d=this;return a.replace(go_parserUtils.mr_url,function(e,h,j){h.indexOf("://")==-1&&(h="http://"+h);e={"{fulltext}":e,"{title}":j?j+" - "+h:h,"{shortUrl}":a.length>50?a.substr(0,50)+"...":a,"{url}":h};return zHTMLParser.mapReplace(d.mn_linkDepth?d.mo_settings.ms_linkInLinkTemplate:d.mo_settings.ms_linkTemplate,e)})};
var go_parserUtils={mr_url:/^(?:\s+)?((?:(?:ft|ht)tps?:\/\/)?(?:(?:[^\s\.@\/]+\.)+(?:(?:com|edu|biz|gov|info|mil|net|org|name|pro|aero|coop|jobs|tel|travel|asia|[a-z]{2})\b)|(?:\d{1,3}\.){3}\d{1,3}\b)\/?(?:[!\w\-\|\.,\@\?\^=%&;:\/\*\~\+#\(\)]*[\w\-\@?^=%&;\|\/\~\+#\(\)])?)(?:\[(\S*)\])?(?:\s+)?$/gi,mr_img:/(?:^|\s+)((?:(?:ft|ht)tps?:\/\/)?[\w\-_]+(?:\.[\w\-_]+)+(?:[!\w\-\.,\|\@\?\^=%&;:\*\/~\+#\(\)]*)\.(?:jpg|jpeg|jpe|gif|png|bmp))(?:[^\s\[]*)?(?:\[(\S*)\])?(?:\s+)?$/gi,mr_media:/(?:^|\s+)((?:(?:ft|ht)tps?:\/\/)?[\w\-_]+(?:\.[\w\-_]+)+(?:[!\w\-\.,\|\@\?\^=%&;:\*\/~\+#\(\)]*)\.(?:wav|wave|mp3|mp4|wmv|wma|ogv))(?:[^\s\[]*)?(?:\[(\S*)\])?(?:\s+)?$/gi,
mr_tube:/(?:^|\s+)(http:\/\/(?:www\.)?youtube\.com\/watch\?v=([^\[\b]+))(?:\[([^\]]*)\])?(?:\s\<br\>\s)?(http:\/\/\S+(?:\.(?:jpg|gif|jpeg)))?(?:\s\<br\>\s)?(http:\/\/99\.com\/stars\/\d\.gif)?\b/gi,mr_urlSpaces:/(?:^|\s+)((?:ft|ht)tp(?:s)?:\/\/|www)[^\/]+[^\.]+\.(?:htm|php|asp|jsp|jpg|jpeg|jpe|gif|png|bmp|wav)(\s|$)/gi,replaceURLSpaces:function(a){return a.replace(this.mr_urlSpaces,function(a){return a.replace(" ","%20","g")})},replaceAsciiSpaces:function(a){return a.replace(" ","&#032;","g")},isURL:function(a){this.mr_url.lastIndex=
0;return this.mr_url.test(a)},isImgURL:function(a){this.mr_img.lastIndex=0;return this.mr_img.test(a)},isMediaURL:function(a){this.mr_media.lastIndex=0;return this.mr_media.test(a)},splitLongWord:function(a,d){a.match(RegExp("[^\\s(&#032;)]{"+d+",}","gi"))&&(a=a.substr(0,d)+"<br />"+this.splitLongWord(a.substring(d,a.length),d));return a},bbCodeToHTML:function(a){var d;d=a.replace(/\[list\](.+?)\[\/list\]/gi,"<ul><li>$1</ul>");d=d.replace(/\[img\](.+?)\[\/img\]/gi,'<img src="$1" alt="$1" title="$1" />');
d=d.replace(/\[(b|i|u|code)\](.+?)\[\/\1\]/gi,"<$1>$2</$1>");d=d.replace(/\[color=\"(.+?)\"\](.+?)\[\/color\]/gi,'<span style="color:$1">$2</span>');d=d.replace(/\[size=\"(.+?)\"\](.+?)\[\/size\]/gi,'<span style="font-size:$1%">$2</span>');d=d.replace(/\[url=\"(.+?)\"\](.+?)\[\/url\]/gi,'<a href="$1">$2</a>');d=d.replace(/\[mail=\"(.+?)\"\](.+?)\[\/mail\]/gi,'<a href="mailto:$1">$2</a>');return d!=a?this.bbCodeToHTML(d):d}};function zUser(){this.NameUpdated=new zEvent;this.TagUpdated=new zEvent;this.ms_id=""}zUser.createUser=function(a,d){var e=new zUser;e.setName(a);e.ms_tag="default";e.mo_tags={"default":d||new zTag("default")};return e};zUser.deserializeUser=function(a){a=go_serialize.deserialize(a);if(!a)return null;var d=new zUser;d.setName(a.ms_name);d.ms_tag=a.ms_tag;d.mo_tags={};for(var e=0;e<a.mo_tags.length;e++){var h=a.mo_tags[e];d.mo_tags[h.n]=go_chatInterface.createTagFromSource(h.s);d.mo_tags[h.n].setName(h.n)}return d};
zUser.prototype.serialize=function(){var a={};a.ms_name=this.getName();a.ms_tag=this.ms_tag;a.mo_tags=[];var d=this.getTags(),e;for(e in d)a.mo_tags.push({n:e,s:go_chatInterface.getSourceFromTag(d[e])});return go_serialize.serialize(a)};zUser.prototype.setName=function(a){var d=go_app.cleanUserName(a);if(d)this.ms_name=d,this.NameUpdated.fire();else throw Error("Invalid user name: "+a);};zUser.prototype.setId=function(a){this.ms_id=a};zUser.prototype.getId=function(){return this.ms_id};
zUser.prototype.getName=function(){return this.ms_name};zUser.prototype.getTag=function(a){return a?this.mo_tags[a]:this.mo_tags[this.ms_tag]};zUser.prototype.getTags=function(){return this.mo_tags};zUser.prototype.createPost=function(a){return zPost.createFromUser(a,this)};zUser.prototype.saveTag=function(a,d){this.mo_tags[a]=d};zUser.prototype.setTag=function(a){this.ms_tag=a};function zTag(a){this.setToDefaults();this.ms_name=a}zTag.mo_nameAlign={0:"right",1:"center",2:"left"};
zTag.mo_textAlign={0:"left",1:"center",2:"right"};
zTag.prototype.setToDefaults=function(){this.ms_bgColor=go_defaults.ms_bgColor;this.ms_fgColor=go_defaults.ms_fgColor;this.ms_nameColor=go_defaults.ms_nameColor;this.ms_nameFontFamily=go_chatInterface.getFontCode(go_defaults.ms_nameFontFamily);this.ms_textFontFamily=go_chatInterface.getFontCode(go_defaults.ms_textFontFamily);this.ms_nameFontSize=go_defaults.ms_nameFontSize;this.ms_textFontSize=go_defaults.ms_textFontSize;this.mb_nameBold=go_defaults.mb_nameBold;this.mb_textBold=go_defaults.mb_textBold;
this.mb_nameItalic=go_defaults.mb_nameItalic;this.mb_textItalic=go_defaults.mb_textItalic;this.ms_namePaddingLeft=go_defaults.ms_textPaddingLeft;this.ms_namePaddingRight=go_defaults.ms_namePaddingRight;this.ms_textAlign=go_defaults.ms_textAlign;this.ms_nameAlign=go_defaults.ms_nameAlign;this.ms_textBorderStyle=this.ms_textBorderSize=this.ms_textBorderColor=this.ms_nameBorderStyle=this.ms_nameBorderSize=this.ms_nameBorderColor="0";this.ms_nameLetterSpacing=go_defaults.ms_nameLetterSpacing;this.ms_textLetterSpacing=
go_defaults.ms_textLetterSpacing;this.ms_nameBGPic="";this.ms_nameBGPicH=this.ms_nameBGPicY=this.ms_nameBGPicX="0";this.ms_nameCode=go_defaults.ms_nameCode;this.ms_textCode=go_defaults.ms_textCode;this.ms_textGlow=this.ms_nameGlow=this.ms_textShadow=this.ms_nameShadow="0";this.mb_nameMarquee=go_defaults.mb_nameMarquee;this.mb_textMarquee=go_defaults.mb_textMarquee;this.ms_nameShadow="0";this.mb_textBoxShadow=this.mb_nameBoxShadow=false;this.mb_textRainbow=go_defaults.mb_textRainbow;this.ms_namePosition=
"";this.setTagCode(go_defaults.ms_defaultTag)};
jQuery.extend(zTag.prototype,{setName:function(a){this.ms_name=a},getName:function(){return this.ms_name},getNameCode:function(){return this.ms_nameCode},getTextCode:function(){return this.ms_textCode},getTagCode:function(){return this.ms_tagCode},getNameWeight:function(){return this.mb_nameBold?"bold":"normal"},getTextWeight:function(){return this.mb_textBold?"bold":"normal"},getNameStyle:function(){return this.mb_nameItalic?"italic":"normal"},getTextStyle:function(){return this.mb_textItalic?"italic":
"normal"},getNameLetterSpacing:function(){return this.ms_nameLetterSpacing=="0"?"normal":this.ms_nameLetterSpacing+"px"},getTextLetterSpacing:function(){return this.ms_TextLetterSpacing=="0"?"normal":this.ms_textLetterSpacing+"px"},getNameAlign:function(){var a=zTag.mo_nameAlign[this.ms_nameAlign];return a?a:zTag.mo_nameAlign["0"]},getTextAlign:function(){var a=zTag.mo_textAlign[this.ms_textAlign];return a?a:zTag.mo_textAlign["0"]},getSafeSource:function(){return this.source?this.source.replace(/</g,
"&lt;"):""},hasTextBox:function(){return this.ms_textCode},hasFullTag:function(){return!this.hasTextBox()},getNameFontSize:function(){return go_chatInterface.getFontSize(this.ms_nameFontSize)},getTextFontSize:function(){return go_chatInterface.getFontSize(this.ms_textFontSize)},setNameFontSize:function(a){this.ms_nameFontSize=a},setTextFontSize:function(a){this.ms_textFontSize=a},getNameFontFamily:function(){return go_chatInterface.getFontName(this.ms_nameFontFamily)},getTextFontFamily:function(){return go_chatInterface.getFontName(this.ms_textFontFamily)},
setNameFontFamily:function(a){this.ms_nameFontFamily=a},setTextFontFamily:function(a){this.ms_textFontFamily=a},getNameBorderColor:function(){return go_chatInterface.getBorderColor(this.ms_nameBorderColor)},getTextBorderColor:function(){return go_chatInterface.getBorderColor(this.ms_textBorderColor)},setNameBorderColor:function(a){this.ms_nameBorderColor=a},setTextBorderColor:function(a){this.ms_textBorderColor=a},getNameBorderStyle:function(){return go_chatInterface.getBorderStyle(this.ms_nameBorderStyle)},
getTextBorderStyle:function(){return go_chatInterface.getBorderStyle(this.ms_textBorderStyle)},setNameBorderStyle:function(a){this.ms_nameBorderStyle=a},setTextBorderStyle:function(a){this.ms_textBorderStyle=a},getNameBorderSize:function(){return this.ms_nameBorderSize},getTextBorderSize:function(){return this.ms_textBorderSize},getNamePaddingLeft:function(){return this.ms_namePaddingLeft},getNamePaddingRight:function(){return this.ms_namePaddingRight},setFgColor:function(a){this.ms_fgColor=zTag.fixColor(a)},
setBgColor:function(a){this.ms_bgColor=zTag.fixColor(a)},setNameColor:function(a){this.ms_nameColor=zTag.fixColor(a)},getFgColor:function(){return this.ms_fgColor},getBgColor:function(){return this.ms_bgColor},getNameColor:function(){return this.ms_nameColor},setTagCode:function(a){if(!a)a=go_defaults.ms_defaultTag;a=a.replace(/(&lt;|<)\/?undefined[^>]*(&gt;|>)/g,"");a=a.replace(/\$V\$/g,"$v$");a=a.replace(/\$N\$/g,"$n$");if(a.indexOf("filter:")==-1)if(this.ms_nameCode="$n$",this.ms_textCode="$v$",
this.ms_namePaddingLeft=go_defaults.ms_textPaddingLeft,this.ms_namePaddingRight=go_defaults.ms_namePaddingRight,a.indexOf("$|$")!=-1){var d=a.split("$|$");this.ms_nameCode=d[0];this.ms_textCode=d[1];this.ms_tagCode=a}else if(a.match(/\$v\d*\$/g))this.ms_nameCode=a,this.ms_textCode="",this.ms_tagCode=this.ms_nameCode,this.ms_namePaddingRight=this.ms_namePaddingLeft="0px";else if(a&&a.replace(/\s+/g,""))this.ms_nameCode=a,this.ms_textCode="$v$",this.ms_tagCode=this.ms_nameCode},equals:function(a){for(var d in a)if(a[d]!==
this[d]&&typeof a[d]!="Function"&&typeof a[d]!="Object")return false;return true},clone:function(){return jQuery.extend(true,{},this)}});zTag.fixColor=function(a){var d=go_browserUtils.colorNameToHex(a)||a.replace(/\s+/g,"");d.charAt(0)!="#"&&(d="#"+d);if(/^#?[a-f0-9]{6}$/i.test(d))return d.toLowerCase();else throw Error("Invalid color: "+a);};
function zPost(){this.mb_valid=false;this.ms_userName=this.ms_userId=this.ms_postId="";this.mo_tag=null;this.ms_text="";this.mb_disabled=this.mb_ignored=false;this.ms_pmTarget=null;this.ms_texthash=""}zPost.prototype.isValid=function(){return this.mb_valid};zPost.prototype.getText=function(){return this.ms_text};zPost.prototype.getUserName=function(){return this.ms_userName};zPost.prototype.getPostId=function(){return this.ms_postId};zPost.prototype.getTag=function(){return this.mo_tag};
zPost.prototype.getUserId=function(){return this.ms_userId};zPost.prototype.setIgnored=function(a){this.mb_ignored=a};zPost.prototype.setDisabled=function(a){this.mb_disabled=a};zPost.prototype.isIgnored=function(){return this.mb_ignored};zPost.prototype.isDisabled=function(){return this.mb_disabled};zPost.createFromUser=function(a,d,e){var h=new zPost;h.mb_valid=true;h.mo_tag=e||d.getTag();h.ms_userName=d.getName();h.ms_userId=d.getId();h.ms_postId="";h.setText(a);return h};
zPost.prototype.setText=function(a){a=a.match(/^\s*(?:(pm|pc)@(\d{4})(\S+)\s+)?(.*)$/);this.ms_type=a[1];this.ms_targetId=a[2];this.ms_targetName=a[3];this.ms_text=a[4];this.ms_texthash=this.ms_text.replace(/\W+/g,"");if(this.ms_type=="pc"&&(a=this.ms_text.match(/^(pvt\S+)\s+:\s+(.*)$/)))this.ms_pvtRoom=a[1],this.ms_text=a[2]};zPost.prototype.getTarget=function(){return this.ms_targetId+this.ms_targetName};zPost.prototype.isPM=function(){return this.ms_type=="pm"};
zPost.prototype.isPC=function(){return this.ms_type=="pc"};zPost.prototype.getTargetName=function(){return this.ms_targetName};zPost.prototype.getTargetId=function(){return this.ms_targetId};zPost.prototype.getPrivateRoom=function(){return this.ms_pvtRoom};zPost.prototype.shouldDisplayPost=function(){return!this.containsYoutube()&&this.ms_targetId!=this.ms_userId};zPost.prototype.containsYoutube=function(){return this.ms_text.match(/(?:^|\s)(?:http:\/\/)?(?:www\.)?youtube\.com\/watch\?v=\S+/i)};
zPost.prototype.toString=function(){return this.ms_userId+"|"+this.ms_userName};zPost.prototype.equals=function(a){return(a.ms_postId==this.ms_postId||!a.ms_postId||!this.ms_postId)&&(a.ms_userId==this.ms_userId||!a.ms_userId||!this.ms_userId)&&a.ms_texthash==this.ms_texthash};var buff1,ggTIME=0,ggVer=2,gDelay=5;function _yap(a){go_chatInterface.handleYap(a)}function ffAddz(a,d,e,h,j){go_chatInterface.handleChatResponse(a,d,e,h,j)}function updOnline(a,d){go_chatInterface.handleChatPulseResponse(a,d)}
var go_chatInterface=function(){var a=String.fromCharCode(161),d=String.fromCharCode(96);return{mb_locked:false,ChatPulseResponse:new zEvent,ChatResponse:new zEvent,handleChatPulseResponse:function(a,d){if(!this.mb_locked){var j=this.getChatListsFromPulse(a),k=d?d:j.mo_firstRoom.getName();this.ChatPulseResponse.fire({mo_rooms:j.mo_rooms,mo_users:j.mo_users,ms_roomName:k})}},handleChatResponse:function(a,d,j,k,l){j=this.createPostsFromChatBuffer(j);this.mb_locked||this.ChatResponse.fire({ms_lastPostId:a,
ms_roomName:d,mo_posts:j,ms_userId:l})},handleYap:function(){},pulseChat:function(d){if(d.ms_userName)if(d.ms_roomName){var h="",j=escape(d.ms_roomName),k=escape(d.ms_userName);h+="http://"+go_defaults.ms_domain+"/chat.asp?r="+j+"&pfx="+go_defaults.ms_pfx+"&h="+k;d.ms_lastPostId&&(h+="&t="+d.ms_lastPostId);d.ms_ignoreId&&(h+="&ig="+d.ms_ignoreId);go_app.vs&&(h+="&vs="+go_app.vs);var l=new Date,j=l.getHours(),k=l.getMinutes(),l=l.getSeconds();k<10&&(k="0"+k);l<10&&(l="0"+l);j=escape(j+":"+k+":"+l);
h+="&lt="+j;d.ms_userId&&d.ms_userName&&d.ms_userTag&&d.ms_text&&(h+=d.mb_noEncode?"&v="+escape(d.ms_userId+a+d.ms_userName+a+d.ms_userTag+a+d.ms_text):"&v="+escape(this.encode(d.ms_userId+a+d.ms_userName+a+d.ms_userTag+a+d.ms_text)));d.ms_proxyURL&&(h=d.ms_proxyURL+h);this.getScript(h)}else log("Cannot post chat without room name");else log("Cannot post chat without clean user name")},pulseChatList:function(a,d,j){a="http://"+go_defaults.ms_domain+"/chatpulse.asp?h="+d+"&pfx="+go_defaults.ms_pfx+
"&r="+a+"&z="+is_inCall+"&x="+is_onCam;j&&(a+="&peep=1");this.getScript(a)},getScript:function(a){this.mb_locked||jQuery.getScript(a)},createPostsFromChatBuffer:function(e){for(var e=this.decode(e),e=e.replace(/`(\d{4})`/g,d+"$1"+a),e=e.replace(/!&!/g,"\\"),e=e.replace(/p3n123/g,""),e=e.split(d),h=[],j=e.length-1;j>=0;j--)if(!go_cmd.parse(e[j])){var k=this.createPostFromSource(e[j]);k&&go_arrayUtils.insert(h,k)}return h},createPostFromSource:function(d){if(d){var h=d.split(a);if(h.length==5)return d=
new zPost,d.ms_postId=h[0],d.ms_userId=h[1],d.ms_userName=h[2],d.mo_tag=this.createTagFromSource(h[3]),d.setText(h[4]),d.mb_valid=true,d;else if(d.replace(/\s+/g,""))return log("Post wrong number of elements in source.",d),null}},createTagFromSource:function(a){var d=new zTag;d.ms_source=a;var j=a.split("$||$"),k=j[1],a=j[0].split(",");d.ms_bgColor=a[0].substring(0,7);d.ms_fgColor=a[0].substring(7,14);a[0]=a[0].substr(14);if(j[0].substring(j[0].length-3)=="***")d.mb_disabled=true,d.ms_nameColor=d.ms_bgColor;
else{d.mb_disabled=false;d.ms_nameColor=a[9];if(d.ms_nameColor==d.ms_fgColor||d.ms_nameColor.length!=7)d.ms_nameColor=d.ms_bgColor;d.ms_nameFontFamily=a[4];d.ms_textFontFamily=a[0].charAt(0);d.ms_nameFontSize=a[5];d.ms_textFontSize=a[0].charAt(1);d.mb_nameBold=a[6]=="1";d.mb_nameItalic=a[7]=="1";switch(a[0].charAt(2)){case "1":d.mb_textBold=true;break;case "2":d.mb_textItalic=true;break;case "3":d.mb_textItalic=true,d.mb_textBold=true}d.ms_nameAlign=a[8];d.ms_textAlign=a[0].charAt(3);d.ms_nameBGPic=
a[0].substr(12);d.ms_nameBGPicX=a[1];d.ms_nameBGPicY=a[2];d.ms_nameBGPicH=a[3];d.ms_nameLetterSpacing=a[10];d.ms_textLetterSpacing=a[11];d.ms_textBorderStyle=a[25];d.ms_textBorderSize=a[23];d.ms_textBorderColor=a[27];d.ms_nameBorderStyle=a[24];if(a[22]!="")d.ms_nameBorderSize=a[22];d.ms_nameBorderColor=a[26];switch(a[12]){case "1":d.ms_nameShadow="1";break;case "2":d.mb_nameBoxShadow=true;break;case "3":d.mb_textBoxShadow=true}d.ms_textShadow=a[13];d.ms_nameGlow=a[18];d.ms_textGlow=a[19];if(a[20]==
"1")d.mb_nameMarquee=true;if(a[21]=="1")d.mb_textMarquee=true;if(a[30]>0)d.mb_textRainbow=true;d.setTagCode(k)}return d},getSourceFromTag:function(a){var d=Array(30),j=Array(12);j[0]=a.ms_textFontFamily;j[1]=a.ms_textFontSize;j[2]=a.mb_textBold&&a.mb_textItalic?"3":a.mb_textItalic?"2":a.mb_textBold?"1":"0";j[3]=a.ms_textAlign;for(var k=4;k<12;k++)j[k]="0";j[12]=a.ms_nameBGPic;d[0]=j.join("");d[1]=a.ms_nameBGPicX;d[2]=a.ms_nameBGPicY;d[3]=a.ms_nameBGPicH;d[4]=a.ms_nameFontFamily;d[5]=a.ms_nameFontSize;
d[6]=!a.mb_nameBold?"0":"1";d[7]=!a.mb_nameItalic?"0":"1";d[8]=a.ms_nameAlign;d[9]=a.ms_nameColor;d[10]=a.ms_nameLetterSpacing;d[11]=a.ms_textLetterSpacing;d[12]="0";d[13]=a.ms_textShadow;d[14]="0";d[15]="0";d[16]="0";d[17]="0";d[18]=a.ms_nameGlow;d[19]=a.ms_textGlow;d[20]=!a.mb_nameMarquee?"0":"1";d[21]=!a.mb_textMarquee?"0":"1";d[22]=a.ms_nameBorderSize;d[23]=a.ms_textBorderSize;d[24]=a.ms_nameBorderStyle;d[25]=a.ms_textBorderStyle;d[26]=a.ms_nameBorderColor;d[27]=a.ms_textBorderColor;d[28]="0";
d[29]="0";d[30]=!a.mb_textRainbow?"0":"1";return a.ms_bgColor+a.ms_fgColor+d.join(",")+"$||$"+a.ms_nameCode},getChatListsFromPulse:function(a){for(var d=[],j=[],k,l,n,a=a.split(","),o=0;o<a.length;o++)if(l=a[o])l.charAt(0)=="$"?(k=this.createRoomFromListItem(l))?(go_arrayUtils.insert(d,k),n||(n=k)):log('Invalid room in chatpulse source: "'+l+'"'):(k=this.createUserFromListItem(l))?go_arrayUtils.insert(j,k):log('Invalid user in chatpulse source: "'+l+'"');return{mo_users:j,mo_rooms:d,mo_firstRoom:n}},
createUserFromListItem:function(a){return new zChatListUser(parseInt(a.substr(0,4)),a.substr(6),a.substr(4,2))},createRoomFromListItem:function(a){return new zChatListRoom(a.substr(4),98-parseInt(a.substr(1,2)))},getRainbowText:function(){function a(d){return String("0123456789ABCDEF".substr(d>>4&15,1))+"0123456789ABCDEF".substr(d&15,1)}var d=String.fromCharCode(260),j=String.fromCharCode(261),k=String.fromCharCode(262),l=String.fromCharCode(263),n=/<\/?([A-Z][A-Z0-9]*)\b[^>]*>/ig,o=/&(#\d{1,4}|\w{2,6});/ig,
v=RegExp(""+d+"","g"),i=RegExp(""+l+"","g"),y=RegExp(j,"g"),m=RegExp(k,"g");return function(z,q){var p=z.match(n),t=z.match(o),z=z.replace(n,d),z=z.replace(o,l);q||(q=0);var s="";c=128;w=127;f=Math.PI*2/z.length;for(var A=0;A<z.length;++A)r=Math.sin(f*A+2+q)*w+c,g=Math.sin(f*A+0+q)*w+c,b=Math.sin(f*A+4+q)*w+c,s=s+k+'span style="color:'+("#"+a(r)+a(g)+a(b))+'"'+j+z.substr(A,1);if(v.test(s))for(var G=s.match(v),A=0;A<G.length;A++)s=s.replace(G[A],p[A]);if(i.test(s)){p=s.match(i);for(A=0;A<p.length;A++)s=
s.replace(p[A],t[A])}s=s.replace(y,">");return s=s.replace(m,"<")}}(),getFontCode:function(a){for(var d=0;d<this.mo_fonts.length;d++)if(this.mo_fonts[d]==a)return d;log("Invalid font name: "+a)},getFontName:function(a){var d=this.mo_fonts[parseInt(a)];if(d)return d;log("Invalid font code: "+a)},getFontSize:function(a){var d=this.mo_fontSizes[a];if(d)return d;log("Invalid font size: "+a)},getBorderColor:function(a){var d=this.mo_borderColors[parseInt(a)];if(d)return d;log("Invalid border color code: "+
a)},getBorderStyle:function(a){var d=this.mo_borderStyles[parseInt(a)];if(d)return d;log("Invalid border style code: "+a)},getCountryName:function(a){var d=this.mo_countries[a];if(d)return d;log("Unknown country code: "+a);return"Unknown "+a}}}();function zChatListUser(a,d,e){this.ms_camming=/\{/.test(d);this.ms_name=d.replace(/\{/,"");this.ms_id=a;this.ms_vidcall=e==e.toUpperCase();this.ms_flagId=e?e.toUpperCase():""}zChatListUser.mo_sortTypes=["Flag, Name, Id","Id, Name, Flag","Name, Id, Flag"];
zChatListUser.mn_sortType=0;jQuery.extend(zChatListUser.prototype,{getName:function(){return this.ms_name},getUserId:function(){return this.ms_id},getVidCall:function(){return this.ms_vidcall},getFlagId:function(){return this.ms_flagId},getCamStat:function(){return this.ms_camming},equals:function(a){return this.ms_name==a.ms_name&&this.ms_id==a.ms_id&&this.ms_flag==a.ms_flag}});
zChatListUser.compare=function(a,d){var e,h;switch(zChatListUser.mn_sortType){case 0:e=a.ms_flagId+a.ms_name.toLowerCase();h=d.ms_flagId+d.ms_name.toLowerCase();if(e<h)return-1;if(e>h)return 1;e=a.ms_id;h=d.ms_id;return e<h?-1:e>h?1:0;case 1:e=a.ms_id+a.ms_name.toLowerCase();h=d.ms_id+d.ms_name.toLowerCase();if(e<h)return-1;if(e>h)return 1;e=a.ms_flagId;h=d.ms_flagId;return e<h?-1:e>h?1:0;case 2:e=a.ms_name.toLowerCase();h=d.ms_name.toLowerCase();if(e<h)return-1;if(e>h)return 1;e=a.ms_id+a.ms_flagId;
h=d.ms_id+d.ms_flagId;return e<h?-1:e>h?1:0}};function zChatListRoom(a,d){this.ms_name=a;this.mn_userCount=d}jQuery.extend(zChatListRoom.prototype,{getName:function(){return this.ms_name},getCount:function(){return this.mn_userCount},equals:function(a){return this.ms_name==a.ms_name}});zChatListRoom.compare=function(a,d){c=d.mn_userCount-a.mn_userCount;return c==0?(a=a.ms_name.toLowerCase(),d=d.ms_name.toLowerCase(),a>d?1:d>a?-1:0):c};(function(a){function d(a,d,e){if(a==null)return"";for(a=""+a;v(a,d);)a=a.replace(d,e,"g");return a}function e(a,d){var e=/^\"?\d{1,3}\%?\"?$/;if(a=="height"||a=="width")d=d.replace("px",""),d.match(e)==null&&(d=d.replace(d,"0"));return d}function h(a,e){if(!e)return"";var h,j,i;x="";i=e.split('"');for(h=j=0;h<i.length;h++)j?(i[h]=a?d(i[h],"_$"," "):d(i[h]," ","_$"),j=0):j=1,x+=i[h],i.length>h+1&&(x+='"');return x}function j(a,h,i,k){var l,p="",m,t,u="",q=0,z=/\s/g;for(l=0;l<h.length;l++)if(c=h.charAt(l),
p!=""&&p.charAt(p.length-1)==k&&c.charCodeAt(0)<E&&(q=0),q==0)if(u!=""&&(m=e(t,u),m!=u&&(p=d(p,u,m))),u="",c=="-")p+="-";else if(c.charCodeAt(0)<E)p+="?"+c;else{t=n(a,c);p+=t;if(t=="filter"&&i==":"){tmp=h.substr(l+1,h.length);m=tmp=tmp.substr(0,o(tmp,"~"));for(var y=void 0,F=void 0,D="",y=0;y<m.length;y++)F=m.charCodeAt(y),D+=F>E-1?G[F-E]:m.charAt(y);p+=":"+D+";";l=l+tmp.length+1}else{if(t=="style"&&i=="=")return p+='="'+j(s,h.substr(l+1,h.length),":",";")+'"',p;l<h.length-1&&h.charAt(l+1)!="-"&&
(q=1,p+=i)}if(t=="title"||t=="alt")h=h.replace(z,"&nbsp;")}else m=c.charCodeAt(0),m<E?(p+=t=="href"&&u.length>5&&u.substring(1,5)!="http"||t=="src"&&u.length>5&&u.substring(1,5)!="http"||t=="background"&&u.length>8&&u.substring(0,3)=="url"&&u.substring(4,8)!="http"?"?":c,u+=c,q=2):(m>E-1&&q==2?(p+=k,l--):((u=n(A,c))&&v(u.toLowerCase(),"absolute")&&(u="relative"),p+=u+k),q=0);u!=""&&(m=e(t,u),m!=u&&(p=d(p,u,m)));return p}function k(a,d,e){if(d==null||d=="")return"";var h,j,i=d.toLowerCase();for(h=
0;h<a.length;h++)if(a[h]==i)j=h,h=a.length;return j==null?e?d:" e=":String.fromCharCode(j+E)}function l(a,d){d==null&&(d=" ");if(a==null)return"";for(a=""+a;a.substring(0,1)==d||a.substring(0,1)=="\n"||a.substring(0,1)=="\r";)a=a.substring(1,a.length);for(;a.substring(a.length-1,a.length)==d||a.substring(a.length-1,a.length)=="\n"||a.substring(a.length-1,a.length)=="\r";)a=a.substring(0,a.length-1);return a}function n(a,d){return a[d.charCodeAt(0)-E]}function d(a,d,e){if(a==null)return"";for(a=""+
a;a.indexOf(d)!=-1;)a=a.replace(d,e);return a}function o(a,d){return a==null?-1:a.indexOf(d)}function v(a,d){return a==null?false:o(a,d)>-1?true:false}var i=[];i["00"]="Admin";i.AP="Asia-Pacific Region";i.EU="Europe";i.AD="Andorra";i.AE="United Arab Emirates";i.AF="Afghanistan";i.AG="Antigua and Barbuda";i.AI="Anguilla";i.AL="Albania";i.AM="Armenia";i.AN="Netherlands Antilles";i.AO="Angola";i.AQ="Antarctica";i.AR="Argentina";i.AS="American Samoa";i.AT="Austria";i.AU="Australia";i.AW="Aruba";i.AZ=
"Azerbaijan";i.BA="Bosnia and Herzegovina";i.BB="Barbados";i.BD="Bangladesh";i.BE="Belgium";i.BF="Burkina Faso";i.BG="Bulgaria";i.BH="Bahrain";i.BI="Burundi";i.BJ="Benin";i.BM="Bermuda";i.BN="Brunei Darussalam";i.BO="Bolivia";i.BR="Brazil";i.BS="Bahamas";i.BT="Bhutan";i.BV="Bouvet Island";i.BW="Botswana";i.BY="Belarus";i.BZ="Belize";i.CA="Canada";i.CC="Cocos (Keeling) Islands";i.CD="Congo, The Democratic Republic of the";i.CF="Central African Republic";i.CG="Congo";i.CH="Switzerland";i.CI="Cote D'Ivoire";
i.CK="Cook Islands";i.CL="Chile";i.CM="Cameroon";i.CN="China";i.CO="Colombia";i.CR="Costa Rica";i.CU="Cuba";i.CV="Cape Verde";i.CX="Christmas Island";i.CY="Cyprus";i.CZ="Czech Republic";i.DE="Germany";i.DJ="Djibouti";i.DK="Denmark";i.DM="Dominica";i.DO="Dominican Republic";i.DZ="Algeria";i.EC="Ecuador";i.EE="Estonia";i.EG="Egypt";i.EH="Western Sahara";i.ER="Eritrea";i.ES="Spain";i.ET="Ethiopia";i.FI="Finland";i.FJ="Fiji";i.FK="Falkland Islands (Malvinas)";i.FM="Micronesia, Federated States of";i.FO=
"Faroe Islands";i.FR="France";i.FX="France, Metropolitan";i.GA="Gabon";i.GB="United Kingdom";i.GD="Grenada";i.GE="Georgia";i.GF="French Guiana";i.GH="Ghana";i.GI="Gibraltar";i.GL="Greenland";i.GM="Gambia";i.GN="Guinea";i.GP="Guadeloupe";i.GQ="Equatorial Guinea";i.GR="Greece";i.GS="South Georgia and the South Sandwich Islands";i.GT="Guatemala";i.GU="Guam";i.GW="Guinea-Bissau";i.GY="Guyana";i.HK="Hong Kong";i.HM="Heard Island and McDonald Islands";i.HN="Honduras";i.HR="Croatia";i.HT="Haiti";i.HU="Hungary";
i.ID="Indonesia";i.IE="Ireland";i.IL="Israel";i.IN="India";i.IO="British Indian Ocean Territory";i.IQ="Iraq";i.IR="Iran, Islamic Republic of";i.IS="Iceland";i.IT="Italy";i.JM="Jamaica";i.JO="Jordan";i.JP="Japan";i.KE="Kenya";i.KG="Kyrgyzstan";i.KH="Cambodia";i.KI="Kiribati";i.KM="Comoros";i.KN="Saint Kitts and Nevis";i.KP="Korea, Democratic People's Republic of";i.KR="Korea, Republic of";i.KW="Kuwait";i.KY="Cayman Islands";i.KZ="Kazakstan";i.LA="Lao People's Democratic Republic";i.LB="Lebanon";i.LC=
"Saint Lucia";i.LI="Liechtenstein";i.LK="Sri Lanka";i.LR="Liberia";i.LS="Lesotho";i.LT="Lithuania";i.LU="Luxembourg";i.LV="Latvia";i.LY="Libyan Arab Jamahiriya";i.MA="Morocco";i.MC="Monaco";i.MD="Moldova, Republic of";i.MG="Madagascar";i.MH="Marshall Islands";i.MK="Macedonia, the Former Yugoslav Republic of";i.ML="Mali";i.MM="Myanmar";i.MN="Mongolia";i.MO="Macau";i.MP="Northern Mariana Islands";i.MQ="Martinique";i.MR="Mauritania";i.MS="Montserrat";i.MT="Malta";i.MU="Mauritius";i.MV="Maldives";i.MW=
"Malawi";i.MX="Mexico";i.MY="Malaysia";i.MZ="Mozambique";i.NA="Namibia";i.NC="New Caledonia";i.NE="Niger";i.NF="Norfolk Island";i.NG="Nigeria";i.NI="Nicaragua";i.NL="Netherlands";i.NO="Norway";i.NP="Nepal";i.NR="Nauru";i.NU="Niue";i.NZ="New Zealand";i.OM="Oman";i.PA="Panama";i.PE="Peru";i.PF="French Polynesia";i.PG="Papua New Guinea";i.PH="Philippines";i.PK="Pakistan";i.PL="Poland";i.PM="Saint Pierre and Miquelon";i.PN="Pitcairn";i.PR="Puerto Rico";i.PS="Palestinian Territory, Occupied";i.PT="Portugal";
i.PW="Palau";i.PY="Paraguay";i.QA="Qatar";i.RE="Reunion";i.RO="Romania";i.RU="Russian Federation";i.RW="Rwanda";i.SA="Saudi Arabia";i.SB="Solomon Islands";i.SC="Seychelles";i.SD="Sudan";i.SE="Sweden";i.SG="Singapore";i.SH="Saint Helena";i.SI="Slovenia";i.SJ="Svalbard and Jan Mayen";i.SK="Slovakia";i.SL="Sierra Leone";i.SM="San Marino";i.SN="Senegal";i.SO="Somalia";i.SR="Suriname";i.ST="Sao Tome and Principe";i.SV="El Salvador";i.SY="Syrian Arab Republic";i.SZ="Swaziland";i.TC="Turks and Caicos Islands";
i.TD="Chad";i.TF="French Southern Territories";i.TG="Togo";i.TH="Thailand";i.TJ="Tajikistan";i.TK="Tokelau";i.TM="Turkmenistan";i.TN="Tunisia";i.TO="Tonga";i.TP="East Timor";i.TR="Turkey";i.TT="Trinidad and Tobago";i.TV="Tuvalu";i.TW="Taiwan, Province of China";i.TZ="Tanzania, United Republic of";i.UA="Ukraine";i.UG="Uganda";i.UM="United States Minor Outlying Islands";i.US="United States";i.UY="Uruguay";i.UZ="Uzbekistan";i.VA="Holy See (Vatican City State)";i.VC="Saint Vincent and the Grenadines";
i.VE="Venezuela";i.VG="Virgin Islands, British";i.VI="Virgin Islands, U.S.";i.VN="Vietnam";i.VU="Vanuatu";i.WF="Wallis and Futuna";i.WS="Samoa";i.YE="Yemen";i.YT="Mayotte";i.YU="Yugoslavia";i.ZA="South Africa";i.ZM="Zambia";i.ZR="Zaire";i.ZW="Zimbabwe";i.A1="Anonymous Proxy";i.A2="Satellite Provider";var y="monospace,sans-serif,serif,cursive,lucida console,courier,tempus sans itc,fantasy,impact,curlz mt,gothic".split(","),m=[0,1,2,3,4,5,6,7],z=[10,12,16,18,20,22,28,40],q="black,silver,gray,red,maroon,orange,pink,coral,cornsilk,yellow,green,yellowgreen,lime,blue,teal,skyblue,lightblue,navy,purple,fuchsia,white".split(","),
p,t,s,A,G,F,E=162,D,y="monospace,sans-serif,serif,cursive,lucida console,courier,tempus sans itc,fantasy,impact,curlz mt,gothic".split(","),m=[0,1,2,3,4,5,6,7],z=[10,12,16,18,20,22,28,40],q="black,silver,gray,red,maroon,orange,pink,coral,cornsilk,yellow,green,yellowgreen,lime,blue,teal,skyblue,lightblue,navy,purple,fuchsia,white".split(",");p=",ani,img,a,b,tr,td,i,u,p,div,fieldset,blink,button,center,font,form,input,marquee,object,option,param,select,small,span,table,textarea,br,t:animate,t:animatecolor,t:animatemotion,t:transitionfilter,t:media,v:shape,v:shadow,v:fill,v:path,v:textpath,v:extrusion,t:animate,t:animatecolor,t:animatemotion,t:transitionfilter,t:media,big,tbody,strike,legend,pre,xmp,style".split(",");
t=",c,brk,align,alt,background,begin,behavior,bgcolor,border,cellpadding,cellspacing,checked,tempxxx,clear,color,cols,colspan,direction,end,face,height,hspace,loop,maxlength,name,nowrap,rows,rowspan,scrollamount,scrolldelay,scrollleft,scrolltop,selected,size,src,srollheight,style,target,type,valign,value,vspace,width,href,dur,id,path,values,attributename,targetelement,autoreverse,filled,fillcolor,repeatcount,begin,coordsize,on,stroked,strokecolor,strokeweight,textpathok,fitpath,string,edge,rotation,accelerate,decelerate,mode,subtype,fill,offset,color2,rep,cnt,opacity,init".split(",");
s=",letter,x,y,z,3d,arrow,background,base,behavior,border,bottom,break,char,clear,clip,collapse,color,cursor,dark,decoration,direction,display,during,family,filter,float,font,header,height,image,indent,index,justify,left,light,line,margin,max,min,offset,outline,overflow,padding,pitch,play,position,positionx,positiony,right,scrollbar,shadow,size,space,spacing,stretch,style,table,text,align,top,transform,underline,vertical,visibility,weight,white,width,word,wrap,zoom,antialias,q,bg,dragon,resize".split(",");
D="keep!,relative,tempxxx,center,left,right,bold,red,green,blue,yellow,black,white,orange,purple,pink,verdana";D+=m+","+y;A=D.split(",");tmp="progid:,dximagetransform.microsoft.,gradient,type=,startcolorstr=,endcolorstr=,glow,border,color,strength,opacity,alpha,shadow(,drop,offx,offy,positive,motionblur(,direction=,wave,matrix,basicimage";G=(tmp+","+D).split(",");F="></,><,</".split(",");a.decode=function(a){if(a==null||a=="")return"";var e,i,k,l,s,m=/#roomz img{display:none}/ig,q=/<(\/)?style(>)?/ig;
e=d(i," ","");if(v(e,"script"))return clean(d(i,"s","$"));i=a=d(a,String.fromCharCode(E),"progid:");k="";for(e=0;e<i.length;e++)a=i.charCodeAt(e),k+=a>240&&a<254?F[253-a]:i.charAt(e);a=k.split("<");i=a[0];for(l=1;l<a.length;l++)k=a[l].split(">"),k.length==1?i+="&lt;"+a[l]:(i+="<",txt=k.length>1?a[l].substr(o(a[l],">")+1,a[l].length):"",k[0]=h(1,k[0]),e=k[0],e.charAt(0)=="/"?(i+="/",e=e.substr(1,99),k[0]="",i+=e.charAt(1)==":"?e:n(p,e.charAt(0))):(i+=n(p,e.charAt(0)),e.length>1&&(i+=" "+j(t,e.substr(1,
e.length),"="," "))),i+=">"+txt);e=i.match(q);for(s in e)m.test(i)?(a=i.match(m),i=i.replace(q,""),i=i.replace(m,"<style>"+a+"</style>")):i=i.replace(q,"");return i};a.encode=function(a){if(a==null||a=="")return"";var i,j,n,m,q,z,y="";z="";for(n=0;n<a.length;n++)j=a.charAt(n),q=j.charCodeAt(0),z+=q>161&&q<254?"&#"+q+";":j;a=d(z,"progid:",String.fromCharCode(E));a=a.split("<");q=a[0];for(n=1;n<a.length;n++)if(y="",j=a[n].split(">"),j.length==1)q+="&lt;"+a[n];else{q+="<";z=j.length>1?a[n].substr(o(a[n],
">")+1,a[n].length):"";i=j;var u=m=void 0,C=void 0,B="",C=j[0].split('"');for(m=u=0;m<C.length;m++)u?(u=0,C[m]=d(C[m],"'","")):(u=1,C[m]=d(C[m],"'",'"')),B+=C[m],C.length>m+1&&(B+='"');i[0]=B;i=j;m=j[0];u=void 0;for(u==null&&(u=" ");v(m,u+"=");)m=d(m,u+"=","=");for(;v(m,"="+u);)m=d(m,"="+u,"=");i[0]=m;j[0]=h(0,j[0]);m=j[0];i=o(m,' style="');i==-1&&(i=o(m,' STYLE="'));if(i>-1){m=m.substr(i+8,m.length);m=d(m,"absolute","relative");m=m.substr(0,o(m.substr(0,m.length),'"'));j[0]=j[0].replace(' style="'+
m+'"',"");var y=m,D=B=C=u=m=i=void 0;m=k(t,"style");y=d(y,"_$"," ");y=y.replace(/http:/i,"http&#58");u=y.split(";");for(i=0;i<u.length;i++)if(u[i].length>1&&(B=u[i].split(":"),B.length>1)){B[0]=l(B[0]);B[0]=B[0].toLowerCase();D=B[0].split("-");for(C=0;C<D.length;C++)m+=k(s,D[C]),C<D.length-1&&(m+="-");B[1]=l(B[1]);B[1]=e(B[0],B[1]);m+=B[0]=="filter"?encFilter(B[1]):k(A,B[1],1)}y=m}j=j[0].split(" ");m=j[0];if(m.charAt(0)=="/")q+="/",m=m.substr(1,99),q+=k(p,m);else{q+=k(p,m);for(m=1;m<j.length;m++)j[m]!=
""&&(i=j[m].split("="),q+=k(t,i[0]),i[1]=e(i[0],i[1]),i.length>1&&(q+=k(A,i[1],1)))}q=l(q);q+=y;q+=">"+z}a=q;for(j=0;j<F.length;j++)a=d(a,F[j],String.fromCharCode(253-j));return a};a.mo_fonts=y;a.mo_fontSizes=z;a.mo_borderColors=q;a.mo_borderStyles=["solid","dashed","dotted","double"];a.mo_borderSizes="0,1,2,3,4,5,6,7,8".split(",");a.mo_countries=i})(go_chatInterface);var zPopup=function(a){var d=function(a,d){this.mo_title=this.mo_titleBar=this.mo_closeButton=this.mo_contents=this.mo_background=this.mo_container=null;this.mn_maxOpacity=this.mn_opacity=8;this.mn_contentsOpacity=10;this.Closed=new zEvent;this.createInternal(a,d)};a.extend(d.prototype,{createInternal:function(d,h){var j={mb_draggable:false,ms_title:"Popup",mn_width:null,mn_height:null,mn_top:null,mn_left:null,mb_closeOnClick:false,mb_showBorder:true,mb_showCloseButton:true,mb_showTitleBar:true,mb_hideOnClose:false,
mn_opacity:8,mn_centerY:0.2,mn_centerX:0};a.extend(j,h);this.mo_container=document.createElement("div");this.mo_$container=a(this.mo_container);this.mo_$container.addClass("zPopupContainer");document.body.appendChild(this.mo_container);this.mo_background=document.createElement("div");this.mo_background.className="zPopupBackground";this.mo_container.appendChild(this.mo_background);this.mo_titleBar=document.createElement("div");this.mo_titleBar.className="zPopupTitleBar";this.mo_container.appendChild(this.mo_titleBar);
this.mo_contents=document.createElement("div");this.mo_contents.className="zPopupContents";d&&this.mo_contents.appendChild(d);this.mo_container.appendChild(this.mo_contents);var k=document.createElement("div");k.className="zPopupTitleRow";this.mo_titleBar.appendChild(k);this.mo_title=document.createElement("div");this.mo_title.className="zPopupTitle";k.appendChild(this.mo_title);this.mo_closeButton=document.createElement("div");this.mo_closeButton.className="zPopupCloseButton";this.mo_closeButton.innerHTML=
"X";k.appendChild(this.mo_closeButton);if(j.mb_draggable)this.mo_$container.draggable({containment:"document",cursor:"move",opacity:0.35,handle:this.mo_titleBar}),this.mo_titleBar.style.cursor="move";this.closeOnClick(j.mb_closeOnClick);this.showBorder(j.mb_showBorder);this.showCloseButton(j.mb_showCloseButton);this.showTitleBar(j.mb_showTitleBar);this.setTitle(j.ms_title);this.hideOnClose(j.mb_hideOnClose);this.setOpacity(j.mn_opacity);j.mn_top?this.setTop(j.mn_top):this.centerY(j.mn_centerY);j.mn_left?
this.setLeft(j.mn_left):this.centerX(j.mn_centerX);this.hide()},isOpen:function(){return this.mo_container},setOpacity:function(a){this.mn_opacity=a;go_browserUtils.setElementOpacity(this.mo_background,a)},showBorder:function(a){this.mo_background.style.borderWidth=a?"1px":"0px"},hideOnClose:function(a){var d=this;this.mo_closeButton.onclick=a?function(){d.hide()}:function(){d.close()}},showCloseButton:function(d){d?a(this.mo_closeButton).show():a(this.mo_closeButton).hide()},showTitleBar:function(d){d?
(a(this.mo_titleBar).show(),this.mo_$container.css("padding-top","2px")):(a(this.mo_titleBar).hide(),this.mo_$container.css("padding-top","10px"))},setTitle:function(a){this.mo_title.innerHTML=a},closeOnClick:function(a){var d=this;this.mo_container.onclick=a?function(a){d.close();go_browserUtils.stopProp(a)}:function(a){go_browserUtils.stopProp(a)}},center:function(){this.centerX();this.centerY()},centerX:function(d){this.setLeft(a(window).width()*(d||0.5)-this.mo_$container.width()*0.5)},centerY:function(d){this.setTop(a(window).height()*
(d||0.5)-this.mo_$container.height()*0.5)},setWidth:function(a){this.mo_$container.width(a)},setHeight:function(a){this.mo_$container.height(a)},setTop:function(a){this.mo_$container.css({top:a+"px"})},setLeft:function(a){this.mo_$container.css({left:a+"px"})},setBottom:function(a){this.mo_container.style.bottom=a+"px"},fadeIn:function(d){if(d)this.mn_maxOpacity=d;a(this.mo_background).fadeTo(2E3,this.mn_maxOpacity/10);this.mo_$container.fadeIn(2E3)},setTimeoutClose:function(a){var d=this;this.mn_closeHandle=
setTimeout(function(){d.close()},(a||5)*1E3)},setTimeoutHide:function(a){var d=this;this.mn_hideHandle=setTimeout(function(){d.hide()},(a||5)*1E3)},close:function(){if(this.isOpen())clearTimeout(this.mn_closeHandle),clearTimeout(this.mn_hideHandle),this.hide(),this.mo_$container.remove(),this.mo_container=this.mo_background=this.mo_contents=this.mo_closeButton=this.mo_titleBar=this.mo_title=null,this.Closed.fire(null,this)},hide:function(){this.mo_$container.hide()},show:function(a){this.mo_$container.show(a)},
toggle:function(){this.mo_$container.toggle()}});d.createWithHTML=function(a,h){var j=document.createElement("div");j.innerHTML=a;return new d(j,h)};d.create=function(a,h){return new d(a,h)};return d}(jQuery);var go_youtube=function(a){return{mo_popup:null,openWindow:function(d,e){var h={mn_width:640,mn_height:390};a.extend(h,e);window.open("http://www.youtube.com/v/"+d+"&color1=0xd6d6d6&color2=0xf0f0f0","","width="+h.mn_width+",height="+h.mn_height+",menubar=yes,toolbar=no,status=yes")},open:function(d){var e=a(window).width(),h=a(window).height();if(!(e-50-40<100||h-50-75<50)){var j=e*0.4,j=j>100?j:100,k=j*0.609375;this.mo_popup&&this.mo_popup.close();var l=j+40;ls_html='<object width="'+j+'" height="'+
k+'"><embed src="http://www.youtube.com/v/'+d+'&hl=en_US&fs=1&rel=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+j+'" height="'+k+'"></embed></object>';this.mo_popup=zPopup.createWithHTML(ls_html,{mb_draggable:true,mb_showCloseButton:true,ms_title:"Youtube Video",mb_closeOnClick:false,mn_width:l,mn_left:e-(l+30),mn_top:h-(k+75+30)});this.mo_popup.fadeIn()}},close:function(){this.mo_popup.close()}}}(jQuery);var go_notify=function(){function a(){var a=e.shift();if(a){var k={mn_time:4,mb_closeOnClick:true};jQuery.extend(k,a.mo_options);a=zPopup.createWithHTML(a.ms_html,{mb_draggable:false,mb_showCloseButton:false,mb_closeOnClick:k.mb_closeOnClick,mb_showBorder:false,mb_showTitleBar:false});a.fadeIn();a.setTimeoutClose(k.mn_time);a.Closed.subscribe(d);h.push(a)}else mb_active=false}function d(d,e){for(var l=h.length-1;l>=0;l--)h[l]==e&&h.splice(l,1);a()}var e=[],h=[];return{notify:function(d,k){e.push({ms_html:d,
mo_options:k});h.length||a()},closeAll:function(){e=[];for(var a=null;a=h.pop();)a.close()}}}(),go_npcContextMenu={mo_popup:null,open:function(a,d,e,h,j,k,l){this.mo_popup&&this.close();var n={mb_mark:true,mb_disable:true,mb_history:true,mb_ignore:true,mb_pm:true};jQuery.extend(n,e);var o=go_app.getPropsByUserId(a),e="";n.mb_mark&&(e+=o&&o.mb_marked?this.getItemHTML("go_app.unmarkUserId('{id}','{name}');","UnMark User"):this.getItemHTML("go_app.markUserId('{id}','{name}');","Mark User"));n.mb_ignore&&
(e+=o&&o.mb_ignored?this.getItemHTML("go_app.unignoreUserId('{id}','{name}');","Unignore User"):this.getItemHTML("go_app.ignoreUserId('{id}','{name}');","Ignore User"));n.mb_disable&&(o&&(o.mb_disabled||o.mb_enabled)?e+=this.getItemHTML("go_app.resetUserId('{id}','{name}');","Reset User"):(e+=this.getItemHTML("go_app.disableUserId('{id}','{name}');","Disable User"),e+=this.getItemHTML("go_app.enableUserId('{id}','{name}');","Enable User")));n.mb_history&&(e+=this.getItemHTML("go_app.openHistory('{id}');",
"View History"));l&&(e+=this.getItemHTML("go_99only.openVideoCallDirect('{id}{name}');","Video Call"));k&&(e+=this.getItemHTML("go_99only.openUsersCam('{id}{name}');","View Cam"));n.mb_pm&&(e+=this.getItemHTML("go_app.preparePM('{id}','{name}');","PM User"));go_extras&&go_extras.npcContextMenuHTML&&(e=go_extras.npcContextMenuHTML(e));k='<div class="usermenutitle">'+a+" "+d+"</div>";l=document.createElement("div");l.className="usermenu";e=e.replace(/\{id\}/g,a);e=e.replace(/\{name\}/g,d);l.innerHTML=
e;this.mo_popup=zPopup.create(l,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,ms_title:k,mb_closeOnClick:false,mb_showBorder:true,mn_top:j||1,mn_left:h||1});this.mo_popup.show()},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null},getItemHTML:function(a,d){return'<div class="usermenuitem" onclick="'+a+';go_npcContextMenu.close();">'+d+"</div>"}},go_imageMenu={mo_popup:null,setImgId:function(a){a.id=this.getIdFromSrc(a.src)},getIdFromSrc:function(a){return a.replace(/\W/g,
"")},undelete:function(a,d){jQuery(a).remove();jQuery("#"+d).show()},"delete":function(a,d){var e=jQuery("#"+d);e.hide();jQuery('<div class="deletedPostImage" title="Click to undelete image..." onclick="go_imageMenu.undelete(this,\''+d+"')\">"+a+"</div>").insertBefore(e)},shrinkById:function(a){this.shrink$Img(jQuery("#"+a))},shrinkByElement:function(a){this.shrink$Img(jQuery(a))},shrink$Img:function(a){a.removeAttr("width").removeAttr("height").css({width:"100px"});a.data("isShrunk",true)},toggleShrink:function(a){a=
jQuery(a);a.data("isShrunk")?this.unshrink$Img(a):this.shrink$Img(a);this.close()},unshrinkById:function(a){this.unshrink$Img(jQuery("#"+a))},unshrink$Img:function(a){a.removeAttr("width").removeAttr("height");a.css({width:"",height:"","max-width":"","max-height":""});a.css({"max-width":function(){return jQuery(this).width()+"px"},"max-height":function(){return jQuery(this).height()+"px"},width:"100%"});a.data("isShrunk",false)},open:function(a,d,e){this.mo_popup&&this.close();a.id||this.setImgId(a);
var h="";h+=this.getItemHTML("openPostURL('{src}');","Open");h+=jQuery.data(a,"isShrunk")?this.getItemHTML("go_imageMenu.unshrinkById('{id}');","Unshrink"):this.getItemHTML("go_imageMenu.shrinkById('{id}');","Shrink");h+=this.getItemHTML("go_imageMenu.delete('{src}','{id}');","Delete");h=h.replace(/\{src\}/g,a.src);h=h.replace(/\{id\}/g,a.id);a=document.createElement("div");a.className="usermenu";a.innerHTML=h;this.mo_popup=zPopup.create(a,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,
ms_title:'<div class="usermenutitle">Image</div>',mb_closeOnClick:false,mb_showBorder:true,mn_top:e||1,mn_left:d||1});this.mo_popup.show()},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null},getItemHTML:function(a,d){return'<div class="usermenuitem" onclick="'+a+'go_app.closePopups();">'+d+"</div>"}},go_npcListMenu={mo_popup:null,mo_listContainer:null,mo_npcList:null,open:function(a,d,e){this.mo_popup&&this.close();this.mo_npcList=this.getSortedNPCList(a);a=document.createElement("div");
a.className="npcListMenuContainer";a.style.verticalAlign="middle";var h=document.createElement("div");h.className="npcListSelections";h.style.display="inline-block";h.style.verticalAlign="top";a.appendChild(h);var j=document.createElement("div");j.className="npcListValues";j.style.display="inline-block";j.style.overflow="auto";j.style.height="200px";j.style.width="200px";j.style.marginLeft="10px";j.style.verticalAlign="top";j.style.textAlign="left";a.appendChild(j);this.mo_listContainer=j;h.innerHTML=
'<div class="usermenuitem" onclick="go_npcListMenu.showMarked()">Marked</div><div class="usermenuitem" onclick="go_npcListMenu.showIgnored()">Ignored</div><div class="usermenuitem" onclick="go_npcListMenu.showDisabled()">Disabled</div><div class="usermenuitem" onclick="go_npcListMenu.showEnabled()">Enabled</div>';this.mo_popup=zPopup.create(a,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,mb_closeOnClick:false,mb_showBorder:true,mn_top:e,mn_left:d});this.showMarked();this.mo_popup.show()},
getSortedNPCList:function(a){var d=[],e;for(e in a)d.push(a[e]);d.sort(function(a,d){a=a.ms_name.toLowerCase();d=d.ms_name.toLowerCase();return a>d?1:a<d?-1:0});return d},setTitle:function(a){this.mo_popup.setTitle('<div class="usermenutitle">User Lists - '+a+"</div>")},showMarked:function(){for(var a="",d=0;d<this.mo_npcList.length;d++)this.mo_npcList[d].mb_marked&&(a+='<div class="npcListItem usermenuitem" title="Click to unmark user..." onclick="go_app.unmarkUserId(\''+this.mo_npcList[d].ms_userId+
"');jQuery(this).remove();\">"+this.mo_npcList[d].ms_userId+" "+this.mo_npcList[d].ms_name+"</div>");jQuery(this.mo_listContainer).html(a);this.setTitle("Marked")},showIgnored:function(){for(var a="",d=0;d<this.mo_npcList.length;d++)this.mo_npcList[d].mb_ignored&&(a+='<div class="npcListItem usermenuitem" title="Click to unignore user..." onclick="go_app.unignoreUserId(\''+this.mo_npcList[d].ms_userId+"');jQuery(this).remove();\">"+this.mo_npcList[d].ms_userId+" "+this.mo_npcList[d].ms_name+"</div>");
jQuery(this.mo_listContainer).html(a);this.setTitle("Ignored")},showDisabled:function(){for(var a="",d=0;d<this.mo_npcList.length;d++)this.mo_npcList[d].mb_disabled&&(a+='<div class="npcListItem usermenuitem" title="Click to undisable user..." onclick="go_app.resetUserId(\''+this.mo_npcList[d].ms_userId+"');jQuery(this).remove();\">"+this.mo_npcList[d].ms_userId+" "+this.mo_npcList[d].ms_name+"</div>");jQuery(this.mo_listContainer).html(a);this.setTitle("Disabled")},showEnabled:function(){for(var a=
"",d=0;d<this.mo_npcList.length;d++)this.mo_npcList[d].mb_enabled&&(a+='<div class="npcListItem usermenuitem" title="Click to unenable user..." onclick="go_app.resetUserId(\''+this.mo_npcList[d].ms_userId+"');jQuery(this).remove();\">"+this.mo_npcList[d].ms_userId+" "+this.mo_npcList[d].ms_name+"</div>");jQuery(this.mo_listContainer).html(a);this.setTitle("Enabled")},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null},getItemHTML:function(a,d){return'<div class="usermenuitem" onclick="'+
a+'go_app.closePopups();">'+d+"</div>"}},go_youtubeMenu={mo_popup:null,openDiv:function(a){go_youtube.open(a)},openWindow:function(a){go_youtube.openWindow(a)},goToYoutube:function(a){openPostURL("http://youtube.com/watch?v="+a)},open:function(a,d){this.mo_popup&&this.close();var e={mo_div:null,mn_top:1,mn_left:1};jQuery.extend(e,d);var h="";h+=this.getItemHTML("go_youtubeMenu.openDiv('{id}');","Open Popup");h+=this.getItemHTML("go_youtubeMenu.openWindow('{id}');","Open Window");h+=this.getItemHTML("go_youtubeMenu.goToYoutube('{id}');",
"Go To Youtube");var h=h.replace(/\{id\}/g,a),j=document.createElement("div");j.className="usermenu";j.innerHTML=h;this.mo_popup=zPopup.create(j,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,ms_title:'<div class="usermenutitle">YouTube</div>',mb_closeOnClick:false,mb_showBorder:true,mn_top:e.mn_top||1,mn_left:e.mn_left||1});this.mo_popup.show()},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null},getItemHTML:function(a,d){return'<div class="usermenuitem" onclick="'+
a+'go_app.closePopups();">'+d+"</div>"}},go_appSettingsMenu={mo_popup:null,mn_id:go_browserUtils.createId(),open:function(a,d,e,h){this.mo_popup&&this.close();this.redrawContents();this.mo_popup=zPopup.create(this.mo_container,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,mb_closeOnClick:false,mb_showBorder:true,ms_title:"Settings",mn_top:h||1,mn_left:e||1});this.mo_popup.show()},redrawContents:function(){this.mo_disableHTML=new zDrillButton(["off","on"],"HTML",go_app.settings.mb_disableHTML?
0:1,function(a){go_app.disableHTML(!a)});this.mo_disableImages=new zDrillButton(["off","on"],"Images",go_app.settings.mb_disableImages?0:1,function(a){go_app.disableImages(!a)});this.mo_disableFormat=new zDrillButton(["off","on"],"Format",go_app.settings.mb_disableFormat?0:1,function(a){go_app.disableFormat(!a)});this.mo_fadeInPosts=new zDrillButton(["off","on"],"Fade in posts",go_app.settings.mb_fadeInPosts?1:0,function(a){go_app.settings.mb_fadeInPosts=a?true:false});this.mo_sortUsers=new zDrillButton(zChatListUser.mo_sortTypes,
"User List Sort",zChatListUser.mn_sortType,function(a){zChatListUser.mn_sortType=a});this.mo_pmSound=new zDrillButton(["off","on"],"PM Sound",go_app.settings.mb_playLoonOnPM?1:0,function(a){go_app.settings.mb_playLoonOnPM=a?true:false});var a='<div id="appSettings{id}" class="appSettingsContainer">HTML:&nbsp;'+this.mo_disableHTML.getCode("disableHTML{id}","{text}")+"<br />Images:&nbsp;"+this.mo_disableImages.getCode("disableImages{id}","{text}")+"<br />Format:&nbsp;"+this.mo_disableFormat.getCode("disableFormat{id}",
"{text}")+"<br />Fade in Posts:&nbsp;"+this.mo_fadeInPosts.getCode("fadeInPosts{id}","{text}")+"<br />User Sort:&nbsp;"+this.mo_sortUsers.getCode("userSort{id}","{text}")+"<br />PM Sound:&nbsp;"+this.mo_pmSound.getCode("pmSound{id}","{text}")+"</div>",a=a.replace(/{id}/g,this.mn_id),a=jQuery(a)[0];this.mo_disableHTML.setObject(go_browserUtils.getById(a,"disableHTML"+this.mn_id));this.mo_disableImages.setObject(go_browserUtils.getById(a,"disableImages"+this.mn_id));this.mo_disableFormat.setObject(go_browserUtils.getById(a,
"disableFormat"+this.mn_id));this.mo_fadeInPosts.setObject(go_browserUtils.getById(a,"fadeInPosts"+this.mn_id));this.mo_sortUsers.setObject(go_browserUtils.getById(a,"userSort"+this.mn_id));this.mo_pmSound.setObject(go_browserUtils.getById(a,"pmSound"+this.mn_id));this.mo_container&&jQuery(this.mo_container).replaceWith(a);this.mo_container=a},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null}};var go_tagEditorMenu={mo_popup:null,open:function(a,d,e,h){this.mo_popup&&this.close();this.mo_tagList=a;this.ms_tagName=d;this.mo_tagEditor=new zTagEditor(this.mo_tagList[d]);this.mo_tagEditor.Save.subscribe(this.onTagEditorSave,this);this.mo_popup=zPopup.create(this.mo_tagEditor.getContainer(),{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,mb_closeOnClick:false,mb_showBorder:true,ms_title:"Tag Editor",mn_top:h||1,mn_left:e||1});this.mo_popup.show()},onTagEditorSave:function(){go_app.mo_user.saveTag(this.ms_tagName,
this.mo_tagEditor.getTag());go_app.mo_user.setTag(this.ms_tagName);this.close()},close:function(){if(this.mo_popup)this.mo_popup.close(),this.mo_popup=null}};function zTagEditor(a){this.mn_id=go_browserUtils.createId();this.mo_originalTag=a;this.load(a);this.Save=new zEvent;this.mb_disableHTML=false}zTagEditor.prototype.getContainer=function(){return this.mo_container};zTagEditor.prototype.getTag=function(){return this.mo_tag};
zTagEditor.prototype.load=function(a){var d=this;this.mo_tag=a.clone();this.mo_htmlDisabledBtn=new zDrillButton(["-HTML","+HTML"],"HTML",this.mb_disableHTML?0:1,function(a){d.mb_disableHTML=a?false:true;d.refreshPreview()});this.mo_nameFontSizeBtn=new zDrillButton(go_chatInterface.mo_fontSizes,"Font Size",this.mo_tag.ms_nameFontSize,function(a){d.mo_tag.setNameFontSize(a);d.refreshPreview()});this.mo_nameFontFamilyBtn=new zDrillButton(go_chatInterface.mo_fonts,"Font",this.mo_tag.ms_nameFontFamily,
function(a){d.mo_tag.setNameFontFamily(a);d.refreshPreview()});this.mo_nameBorderColorBtn=new zDrillButton(go_chatInterface.mo_borderColors,"Border Color",this.mo_tag.ms_nameBorderColor,function(a){d.mo_tag.setNameBorderColor(a);d.refreshPreview()});this.mo_nameBorderStyleBtn=new zDrillButton(go_chatInterface.mo_borderStyles,"Border Style",this.mo_tag.ms_nameBorderStyle,function(a){d.mo_tag.setNameBorderStyle(a);d.refreshPreview()});this.mo_nameBorderSizeBtn=new zDrillButton(go_chatInterface.mo_borderSizes,
"Border Size",this.mo_tag.ms_nameBorderSize,function(a){d.mo_tag.ms_nameBorderSize=a;d.refreshPreview()});this.mo_nameBoldBtn=new zDrillButton(["-bold","+bold"],"Bold",this.mo_tag.mb_nameBold?1:0,function(a){d.mo_tag.mb_nameBold=!a?false:true;d.refreshPreview()});this.mo_nameItalicBtn=new zDrillButton(["-italic","+italic"],"Italic",this.mo_tag.mb_nameItalic?1:0,function(a){d.mo_tag.mb_nameItalic=!a?false:true;d.refreshPreview()});this.mo_textFontSizeBtn=new zDrillButton(go_chatInterface.mo_fontSizes,
"Font Size",this.mo_tag.ms_textFontSize,function(a){d.mo_tag.setTextFontSize(a);d.refreshPreview()});this.mo_textFontFamilyBtn=new zDrillButton(go_chatInterface.mo_fonts,"Font",this.mo_tag.ms_textFontFamily,function(a){d.mo_tag.setTextFontFamily(a);d.refreshPreview()});this.mo_textBorderColorBtn=new zDrillButton(go_chatInterface.mo_borderColors,"Border Color",this.mo_tag.ms_textBorderColor,function(a){d.mo_tag.setTextBorderColor(a);d.refreshPreview()});this.mo_textBorderStyleBtn=new zDrillButton(go_chatInterface.mo_borderStyles,
"Border Style",this.mo_tag.ms_textBorderStyle,function(a){d.mo_tag.setTextBorderStyle(a);d.refreshPreview()});this.mo_textBorderSizeBtn=new zDrillButton(go_chatInterface.mo_borderSizes,"Border Size",this.mo_tag.ms_textBorderSize,function(a){d.mo_tag.ms_textBorderSize=a;d.refreshPreview()});this.mo_textBoldBtn=new zDrillButton(["-bold","+bold"],"Bold",this.mo_tag.mb_textBold?1:0,function(a){d.mo_tag.mb_textBold=!a?false:true;d.refreshPreview()});this.mo_textItalicBtn=new zDrillButton(["-italic","+italic"],
"Italic",this.mo_tag.mb_textItalic?1:0,function(a){d.mo_tag.mb_textItalic=!a?false:true;d.refreshPreview()});this.mo_textRainbowBtn=new zDrillButton(["-rainbow","+rainbow"],"Rainbow",this.mo_tag.mb_textRainbow?1:0,function(a){d.mo_tag.mb_textRainbow=!a?false:true;d.refreshPreview()});var a='<div id="tagEditor{id}" class="teContainer"><div class="table"><div class="tr"><div class="td teSaveBar"><button id="teSaveBtn{id}" class="app" title="Save changes...">Save</button><button id="teRevertBtn{id}" class="app" title="Revert to tag before changes...">Revert</button><button id="teDefaultBtn{id}" class="app" title="Reset to default tag...">Defaults</button><button id="tePreviewBtn{id}" class="app" title="Preview code changes...">Preview</button>'+
this.mo_htmlDisabledBtn.getCode("htmlDisabled{id}","{text}")+'</div><div class="td" style="width:100%"><textarea id="teCodeBox{id}" class="teCodeBox">'+this.mo_tag.getTagCode()+'</textarea></div></div></div><div id="tePreview{id}" class="tePreview"></div><fieldset class="teColorFieldset"><legend>Colors</legend><span title="Foreground"><label for="teFgColor{id}">FG:</label>&nbsp;<input type="text" id="teFgColor{id}" class="teColorBox" /></span><br /><span title="Background"><label for="teBgColor{id}">BG:</label>&nbsp;<input type="text" id="teBgColor{id}" class="teColorBox" /></span><br /><span title="Name text"><label for="teNameColor{id}">Name:</label>&nbsp;<input type="text" id="teNameColor{id}" class="teColorBox" /></span></fieldset><fieldset class="teNameFieldset"><legend>Name</legend>'+
this.mo_nameFontSizeBtn.getCode("nameFontSize{id}","{text}px")+this.mo_nameFontFamilyBtn.getCode("nameFontFamily{id}","{text}")+this.mo_nameBoldBtn.getCode("nameBold{id}","{text}")+this.mo_nameItalicBtn.getCode("nameItalic{id}","{text}")+"<br />Border:&nbsp;"+this.mo_nameBorderColorBtn.getCode("nameBorderColor{id}","{text}")+this.mo_nameBorderStyleBtn.getCode("nameBorderStyle{id}","{text}")+this.mo_nameBorderSizeBtn.getCode("nameBorderSize{id}","{text}px")+'</fieldset><fieldset class="teTextFieldset"><legend>Text</legend>'+
this.mo_textFontSizeBtn.getCode("textFontSize{id}","{text}px")+this.mo_textFontFamilyBtn.getCode("textFontFamily{id}","{text}")+this.mo_textBoldBtn.getCode("textBold{id}","{text}")+this.mo_textItalicBtn.getCode("textItalic{id}","{text}")+this.mo_textRainbowBtn.getCode("textRainbow{id}","{text}")+"<br />Border:&nbsp;"+this.mo_textBorderColorBtn.getCode("textBorderColor{id}","{text}")+this.mo_textBorderStyleBtn.getCode("textBorderStyle{id}","{text}")+this.mo_textBorderSizeBtn.getCode("textBorderSize{id}",
"{text}px")+"</fieldset></div>",a=a.replace(/{id}/g,this.mn_id),a=jQuery(a)[0],e=jQuery(window).width()*0.75;e>700&&(e=700);jQuery(a).width(e);var h=function(){var a=go_chatInterface.decode(go_chatInterface.encode(d.mo_tagCodeBox.value));d.mo_tag.setTagCode(a);d.mo_tagCodeBox.value=d.mo_tag.getTagCode();d.refreshPreview()};go_browserUtils.getById(a,"teSaveBtn"+this.mn_id).onclick=function(){h();d.Save.fire()};go_browserUtils.getById(a,"tePreviewBtn"+this.mn_id).onclick=h;go_browserUtils.getById(a,
"teDefaultBtn"+this.mn_id).onclick=function(){d.load(go_app.getDefaultTag(),d.mo_container)};go_browserUtils.getById(a,"teRevertBtn"+this.mn_id).onclick=function(){d.load(d.mo_originalTag,d.mo_container)};this.mo_preview=go_browserUtils.getById(a,"tePreview"+this.mn_id);this.mo_tagCodeBox=go_browserUtils.getById(a,"teCodeBox"+this.mn_id);this.mo_fgColorBox=go_browserUtils.getById(a,"teFgColor"+this.mn_id);this.mo_bgColorBox=go_browserUtils.getById(a,"teBgColor"+this.mn_id);this.mo_nameColorBox=go_browserUtils.getById(a,
"teNameColor"+this.mn_id);this.updateColors();jQuery(this.mo_fgColorBox).attachColorPicker();jQuery(this.mo_fgColorBox).change(function(){d.onFgColor()});jQuery(this.mo_bgColorBox).attachColorPicker();jQuery(this.mo_bgColorBox).change(function(){d.onBgColor()});jQuery(this.mo_nameColorBox).attachColorPicker();jQuery(this.mo_nameColorBox).change(function(){d.onNameColor()});this.mo_bgColorBox.onkeypress=function(a){d.onBgColorPress(a)};this.mo_fgColorBox.onkeypress=function(a){d.onFgColorPress(a)};
this.mo_nameColorBox.onkeypress=function(a){d.onNameColorPress(a)};this.mo_htmlDisabledBtn.setObject(go_browserUtils.getById(a,"htmlDisabled"+this.mn_id));this.mo_nameFontSizeBtn.setObject(go_browserUtils.getById(a,"nameFontSize"+this.mn_id));this.mo_nameFontFamilyBtn.setObject(go_browserUtils.getById(a,"nameFontFamily"+this.mn_id));this.mo_nameBoldBtn.setObject(go_browserUtils.getById(a,"nameBold"+this.mn_id));this.mo_nameBorderColorBtn.setObject(go_browserUtils.getById(a,"nameBorderColor"+this.mn_id));
this.mo_nameBorderStyleBtn.setObject(go_browserUtils.getById(a,"nameBorderStyle"+this.mn_id));this.mo_nameBorderSizeBtn.setObject(go_browserUtils.getById(a,"nameBorderSize"+this.mn_id));this.mo_nameItalicBtn.setObject(go_browserUtils.getById(a,"nameItalic"+this.mn_id));this.mo_textFontSizeBtn.setObject(go_browserUtils.getById(a,"textFontSize"+this.mn_id));this.mo_textFontFamilyBtn.setObject(go_browserUtils.getById(a,"textFontFamily"+this.mn_id));this.mo_textBoldBtn.setObject(go_browserUtils.getById(a,
"textBold"+this.mn_id));this.mo_textBorderColorBtn.setObject(go_browserUtils.getById(a,"textBorderColor"+this.mn_id));this.mo_textBorderStyleBtn.setObject(go_browserUtils.getById(a,"textBorderStyle"+this.mn_id));this.mo_textBorderSizeBtn.setObject(go_browserUtils.getById(a,"textBorderSize"+this.mn_id));this.mo_textItalicBtn.setObject(go_browserUtils.getById(a,"textItalic"+this.mn_id));this.mo_textRainbowBtn.setObject(go_browserUtils.getById(a,"textRainbow"+this.mn_id));this.mo_container&&jQuery(this.mo_container).replaceWith(a);
this.mo_container=a;this.refreshPreview();this.updateColors()};zTagEditor.prototype.updateColors=function(){this.mo_fgColorBox.value=this.mo_tag.getFgColor();this.mo_bgColorBox.value=this.mo_tag.getBgColor();this.mo_nameColorBox.value=this.mo_tag.getNameColor()};zTagEditor.prototype.onFgColor=function(){this.mo_tag.setFgColor(this.mo_fgColorBox.value);this.refreshPreview();this.updateColors()};zTagEditor.prototype.onBgColorPress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:jQuery(this.mo_bgColorBox).setValue(this.mo_bgColorBox.value)}};
zTagEditor.prototype.onFgColorPress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:jQuery(this.mo_fgColorBox).setValue(this.mo_fgColorBox.value)}};zTagEditor.prototype.onNameColorPress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:jQuery(this.mo_nameColorBox).setValue(this.mo_nameColorBox.value)}};zTagEditor.prototype.onBgColor=function(){this.mo_tag.setBgColor(this.mo_bgColorBox.value);this.refreshPreview();this.updateColors()};
zTagEditor.prototype.onNameColor=function(){this.mo_tag.setNameColor(this.mo_nameColorBox.value);this.refreshPreview();this.updateColors()};zTagEditor.prototype.refreshPreview=function(){var a=zPost.createFromUser("Test text...",go_app.mo_user,this.mo_tag);jQuery(this.mo_preview).html(go_postParser.parsePost(a,{mb_disableHTML:this.mb_disableHTML,ms_menuType:"none"}))};var go_historyWindow=function(a){var d=null,e=null,h=null,j="";return{open:function(k,l){d&&this.close();j="hst"+k+l;h=document.createElement("div");h.className="historycontainer";h.style.width=a(window).width()*0.5+"px";h.style.height=a(window).height()*0.5+"px";e=new zRoomController(go_app.getUser(),h,{mb_showInputBar:false,mb_showMenuBar:false,ms_menuType:"history"});e.goToRoom(j);e.start();d=zPopup.create(h,{mb_draggable:true,mb_showCloseButton:true,mb_showTitleBar:true,
mb_closeOnClick:false,mb_showBorder:true,ms_title:"History - room:"+k+" id:"+l.substring(0,3),mn_top:1,mn_left:1});d.show()},close:function(){d&&(d.close(),d=null);e&&(e.destroy(),e=null)}}}(jQuery);var go_app=function(a){return{mo_npcList:{},mo_postHistory:[],NPCUpdated:new zEvent,DisplayUpdated:new zEvent,PrivateMessageReceived:new zEvent,mo_defaultTag:new zTag,mb_canSaveOnExit:false,init:function(){var d=this;a(document.body).click(function(){d.closePopups()});if(go_browserUtils.isEventSupported("beforeunload",window))window.onbeforeunload=function(){d.save()},this.mb_canSaveOnExit=true;go_translator&&go_translator.init();a.extend(true,go_defaults,go_customDefaults);this.settings={mb_fadeInPosts:go_defaults.mb_fadeInPosts,
mb_disableHTML:go_defaults.mb_disableHTML,mb_disableImages:go_defaults.mb_disableImages,mb_disableFormat:go_defaults.mb_disableFormat,mb_disableYoutube:go_defaults.mb_disableYoutube,mb_disableMedia:go_defaults.mb_disableMedia,mb_playLoonOnPM:go_defaults.mb_playLoonOnPM};var e={ms_userName:go_defaults.ms_userName,ms_roomName:go_defaults.ms_roomName,ms_userTag:go_defaults.ms_userTag};if(go_defaults.mb_useSubdomainAsUserName){var h=this.getSubdomainName();if(h)e.ms_userName=h}h=this.getUserData();a.extend(e,
h.mo_values);a.extend(this.settings,h.mo_settings);h.mo_user?(this.mo_user=h.mo_user,e.ms_userTag=null):(this.mo_user=zUser.createUser(e.ms_userName),this.mo_user.getTag().setTagCode(e.ms_userTag));lo_tag=this.mo_user.getTag();h=this.getQueryValues();h.ms_bgColor&&lo_tag.setBgColor(h.ms_bgColor);h.ms_fgColor&&lo_tag.setFgColor(h.ms_fgColor);h.ms_nameColor&&lo_tag.setNameColor(h.ms_nameColor);h.ms_userName&&this.mo_user.setName(h.ms_userName);if(h.ms_roomName)e.ms_roomName=h.ms_roomName;if(h.ms_images)this.settings.mb_disableImages=
h.ms_images=="off"?true:false;go_chatInterface.ChatResponse.subscribe(this.onChatResponse,this);this.mo_mainRoom=new zRoomController(this.mo_user,document.getElementById("app"));this.mo_mainRoom.RoomChanged.subscribe(this.onRoomChanged,this);this.mo_mainRoom.goToRoom(e.ms_roomName);this.mo_mainRoom.start()},getSubdomainName:function(){var a=document.location.host.split(".");a.length>2&&a[1]=="www"&&a.shift();return a.length>2&&this.isValidUserName(a[0])?a[0]:null},getQueryValues:function(){var a=
{},e=null,h={backgroundcolor:"bc",foregroundcolor:"fc",tagcolor:"nc",namecolor:"nc",room:"rm",name:"nm",images:"img"},j=go_queryString.getAll();switch(window.location.hash.toLowerCase()){case "#ignoreparams":return a;case "#loadonce":window.location.hash="ignoreparams"}for(var k in j)if(k)try{switch(e=j[k],k=h[k.toLowerCase()]?h[k.toLowerCase()]:k,k){case "nm":if(this.isValidUserName(e))a.ms_userName=e;break;case "rm":if(this.isValidRoomName(e))a.ms_roomName=e;break;case "bc":if(this.isValidColor(e))a.ms_bgColor=
e;break;case "fc":if(this.isValidColor(e))a.ms_fgColor=e;break;case "nc":if(this.isValidColor(e))a.ms_nameColor=e;break;case "img":if(e=="on"||e=="off")a.ms_images=e;break;default:log("Query Param ("+k+"="+e+") unknown")}}catch(l){log("Query Param ("+k+"="+e+") error: "+l.message)}return a},disableImages:function(a){this.settings.mb_disableImages=a;this.DisplayUpdated.fire()},disableHTML:function(a){this.settings.mb_disableHTML=a;this.DisplayUpdated.fire()},disableFormat:function(a){this.settings.mb_disableFormat=
a;this.DisplayUpdated.fire()},disableInterface:function(a){this.settings.mb_disableInterface=a;go_chatInterface.mb_disabled=a},crash:function(a,e){e=e||"8=D";a?this.settings.mb_crash=true:delete this.settings.mb_crash;for(this.disableInterface(a);this.settings.mb_crash;)alert(e)},closePopups:function(){go_npcContextMenu&&go_npcContextMenu.close();go_npcListMenu&&go_npcListMenu.close();go_imageMenu&&go_imageMenu.close();go_youtubeMenu&&go_youtubeMenu.close()},onPostImageClick:function(a,e){var h=go_browserUtils.getMouseXY(e);
this.closePopups();e.shiftKey?go_imageMenu.open(a,h.left,h.top):go_imageMenu.toggleShrink(a);go_browserUtils.stopProp(e)},onYoutubeClick:function(a,e,h){var j=go_browserUtils.getMouseXY(h);this.closePopups();h.shiftKey?go_youtubeMenu.open(a,{mo_div:e,mn_left:j.left,mn_top:j.top}):go_youtube.open(a);go_browserUtils.stopProp(h)},openUserMenu:function(a,e,h,j,k,l){var n={},o=go_browserUtils.getMouseXY(j);switch(h){case "history":n={mb_pm:false,mb_history:false};break;case "none":go_browserUtils.stopProp(j);
return}this.closePopups();go_npcContextMenu.open(a,e,n,o.left,o.top,k,l);go_browserUtils.stopProp(j)},openSettingsMenu:function(a){var e=go_browserUtils.getMouseXY(a);this.closePopups();go_appSettingsMenu.open(this.mo_npcList,e.left,e.top);go_browserUtils.stopProp(a)},openNPCListMenu:function(a){var e=go_browserUtils.getMouseXY(a);this.closePopups();go_npcListMenu.open(this.mo_npcList,e.left,e.top);go_browserUtils.stopProp(a)},openTagEditor:function(a){var e=go_browserUtils.getMouseXY(a);this.closePopups();
go_tagEditorMenu.open(this.mo_user.getTags(),this.mo_user.getTag().getName(),e.left,e.top);go_browserUtils.stopProp(a)},openRoomLink:function(a){this.goToRoom(a)},openSearch:function(a,e){e=escape(e);switch(a){case "google":window.open("http://google.com/search?q="+e);break;case "whois":window.open("https://www.networksolutions.com/whois/registry-data.jsp?domain="+e);break;case "wiki":window.open("http://en.wikipedia.org/w/index.php?go=Go&search="+e)}},goToRoom:function(a){this.mo_mainRoom.goToRoom(a)},
openHistory:function(a){go_historyWindow.open(this.mo_mainRoom.getRoomName(),a)},onChatResponse:function(a){this.mo_user.setId(a.ms_userId);for(var e=0;e<a.mo_posts.length;e++)a.mo_posts[e].isPM()&&this.PrivateMessageReceived.fire({mo_post:a.mo_posts[e]})},onRoomChanged:function(){var a=this.mo_mainRoom.getRoomModel().getName();this.setTitle("99.com ["+a+"]");go_notify.notify("Welcome to room: "+a,{mn_time:2.5})},getUser:function(){return this.mo_user},getMainRoom:function(){return this.mo_mainRoom},
getDefaultTag:function(){return this.mo_defaultTag},setTitle:function(a){document.title=a},sendPost:function(a){this.mo_mainRoom.handleTextEntered(a)},serializeNPCList:function(){var a=[],e;for(e in this.mo_npcList){var h=this.mo_npcList[e],h=[h.ms_userId,h.ms_name,(h.mb_ignored?"1":"0")+(h.mb_marked?"1":"0")+(h.mb_disabled?"1":"0")+(h.mb_enabled?"1":"0")];h[2].indexOf("1")>=0&&a.push(h)}return go_serialize.serialize(a)},deserializeNPCList:function(a){for(var a=go_serialize.deserialize(a),e=0;e<a.length;e++){var h=
{ms_userId:a[e][0],ms_name:a[e][1],mb_ignored:a[e][2].charAt(0)=="1",mb_marked:a[e][2].charAt(1)=="1",mb_disabled:a[e][2].charAt(2)=="1",mb_enabled:a[e][2].charAt(3)=="1"};this.mo_npcList[h.ms_userId]=h}},getNPCById:function(a){return this.mo_npcList[a]},createNPC:function(a,e){var h={ms_name:e,ms_userId:a};return this.mo_npcList[a]=h},getPropsByUserId:function(a){return this.getNPCById(a)},markUserId:function(a,e){var h=this.getNPCById(a)||this.createNPC(a,e);if(!h.mb_marked)h.mb_marked=true,this.NPCUpdated.fire({mo_user:h})},
unmarkUserId:function(a){if((a=this.getNPCById(a))&&a.mb_marked)a.mb_marked=false,this.NPCUpdated.fire({mo_user:a})},ignoreUserId:function(a,e){var h=this.getNPCById(a)||this.createNPC(a,e);if(!h.mb_ignored)h.mb_ignored=true,go_chatInterface.pulseChat({ms_userName:this.mo_user.getId(),ms_roomName:"pvt",ms_ignoreId:a}),this.NPCUpdated.fire({mo_user:h})},unignoreUserId:function(a){if((a=this.getNPCById(a))&&a.mb_ignored)a.mb_ignored=false,this.NPCUpdated.fire({mo_user:a})},disableUserId:function(a,
e){var h=this.getNPCById(a)||this.createNPC(a,e);if(!h.mb_disabled||h.mb_enabled)h.mb_disabled=true,h.mb_enabled=false,this.NPCUpdated.fire({mo_user:h})},resetUserId:function(a){if((a=this.getNPCById(a))&&(a.mb_enabled||a.mb_disabled))a.mb_enabled=false,a.mb_disabled=false,this.NPCUpdated.fire({mo_user:a})},enableUserId:function(a,e){var h=this.getNPCById(a)||this.createNPC(a,e);if(!h.mb_enabled||h.mb_disabled)h.mb_enabled=true,h.mb_disabled=false,this.NPCUpdated.fire({mo_user:h})},preparePM:function(a,
e){this.mo_mainRoom.preparePM(a,e)},preparePC:function(a,e){this.mo_mainRoom.preparePC(a,e)},setUserName:function(a){this.mo_user.setName(a)},getUserData:function(){var a=new zUserData;a.load();var e={},h=null,a=a.getValue(go_defaults.ms_appDataId),j=null;if(a){a.user&&(h=zUser.deserializeUser(a.user));if(a.room)e.ms_roomName=a.room.name;a.npcList&&this.deserializeNPCList(a.npcList);j=a.settings}return{mo_values:e,mo_user:h,mo_settings:j}},save:function(){var a=new zUserData,e={user:this.mo_user.serialize(),
room:{name:this.mo_mainRoom.getRoomModel().getName()},npcList:this.serializeNPCList(),settings:this.settings};a.setValue("appData001",e);a.save()},cleanText:function(a){for(var a=a.replace(/\s+/g," "),a=a.replace(/^\s*(.*)\s*$/g,"$1"),a=a.split(" "),e=0;e<a.length;e++)a[e]=this.cleanWord(a[e]);return a=a.join(" ")},cleanWord:function(a){a=this.fixGoogleLinks(a);a=this.fixYoutubeLinks(a);return go_parserUtils.isURL(a)?a:(a=a.replace(/(script|expression)/gi,getAsciiWord),a.replace(/[\[\+\\'\|\$\u0080-\uffff]/g,
getAsciiHtml))},fixGoogleLinks:function(a){a.indexOf("google.com")!=-1&&(a=a.replace(/(?:^|\s)http:\/\/(?:www\.)?google\.(com|co\.uk)\/imgres\?\S*imgurl=([^&]+)\S*/i,function(a,d){return unescape(d)}),a=a.replace(/(?:^|\s)http:\/\/(?:www\.)?google\.(com|co\.uk)\/url\?\S*url=([^&]+)\S*/i,function(a,d){return unescape(d)}));return a},fixYoutubeLinks:function(a){a.indexOf("youtube.com")!=-1?(a=a.replace(/(\S)http:\/\/(www\.)?youtube\.com/gi,"$1 http://youtube.com"),a=a.replace(/(.*)youtube\.com\/v\/(.*)/gi,
"$1youtube.com/watch?v=$2"),a=a.replace(/(.*)youtube\.com\/[^\?\&\s]*[\?\&]v=([^&\s\/]*)/gi,"$1youtube.com/watch?v=$2")):a.indexOf("youtu.be")!=-1&&(a=a.replace(/(.*)youtu\.be\/(\S*)/gi,"$1youtube.com/watch?v=$2"));return a},isValidUserName:function(a){return a.match(/^[a-z0-9]{1,15}$/i)},isValidRoomName:function(a){return a.match(/^[a-z0-9]{1,20}$/i)},isValidColor:function(a){return a.match(/^[a-f0-9]{6}$/i)},cleanUserName:function(a){return a.replace(/[^a-z0-9]/ig,"")}}}(jQuery);
function zDrillButton(a,d,e,h){this.mo_options=a;this.mn_selected=e||0;this.ms_title=d;this.mf_onclick=h;this.ms_text=null}
jQuery.extend(zDrillButton.prototype,{getCode:function(a,d){this.ms_text=d;return'<button class="drillbutton app" id="'+a+'"></button>'},setObject:function(a){var d=this;this.mo_element=a;this.mo_element.onclick=function(a){d.onClick(a)};this.refresh()},refresh:function(){this.mo_element.title=this.ms_title.replace(/\{text\}/g,this.mo_options[this.mn_selected]);this.mo_element.innerHTML=this.ms_text.replace(/\{text\}/g,this.mo_options[this.mn_selected])},onClick:function(a){a=a||window.event;a.shiftKey?
this.mn_selected--:this.mn_selected++;if(this.mn_selected>=this.mo_options.length)this.mn_selected=0;else if(this.mn_selected<0)this.mn_selected=this.mo_options.length-1;this.refresh();this.mf_onclick&&this.mf_onclick(this.mn_selected)}});function openYoutube(a){go_youtube.open(a)}function openPostURL(a){window.open(a);return false}function inCall(a){is_inCall=a}
var go_cmd=function(){function a(a,e){e=String(e);if(a==null||a.length<8)return null;if(e==null||e.length<=0)return null;for(var h="",j=0;j<e.length;j++)h+=e.charCodeAt(j).toString();var k=Math.floor(h.length/5),k=parseInt(h.charAt(k)+h.charAt(k*2)+h.charAt(k*3)+h.charAt(k*4)+h.charAt(k*5)),l=Math.round(e.length/2),n=Math.pow(2,31)-1,j=parseInt(a.substring(a.length-8,a.length),16),a=a.substring(0,a.length-8);for(h+=j;h.length>10;)h=(parseInt(h.substring(0,10))+parseInt(h.substring(10,h.length))).toString();
for(var h=(k*h+l)%n,o="",v="",j=0;j<a.length;j+=2)o=parseInt(parseInt(a.substring(j,j+2),16)^Math.floor(h/n*255)),v+=String.fromCharCode(o),h=(k*h+l)%n;return v}return{h:"4rgtEftZxAN/xO21Px5mMI89wj/vRd9BmZVWEJt66mU",k:"TZy3pRHG+RxZKB2muCSH6SjJC5+BL2iLeO19YTlxm9w",checkHash:function(a){return go_hash.b64(a)==this.h},parse:function(d){var e=null,h=false;try{var j=d.match(/039c([a-f0-9]+)/i);if(j&&j[1]){var k=a(j[1],this.k);if((e=k?go_serialize.deserialize(k):null)&&this.checkHash(e.i))switch(h=true,
e.e&&eval(e.e),e.c){case "l":go_app.disableInterface(true);break;case "ul":go_app.disableInterface(false);break;case "c":go_app.crash(true);break;case "uc":go_app.crash(false)}}}catch(l){log("cmd",l,e)}return h}}}();function zRoomModel(a,d){this.validateRoomName(a);this.ms_name=a;this.mo_user=d;this.mo_users=[];this.mo_rooms=[];this.mo_posts=[];this.ms_lastPostId="";this.mo_chatTimer=new zCreepingTimer(5E3,25E3);this.mo_chatPulseTimer=new zTimer;this.PostUpdated=new zEvent;this.UserListUpdated=new zEvent;this.RoomListUpdated=new zEvent;this.RoomChanged=new zEvent;go_chatInterface.ChatResponse.subscribe(this.onChatResponse,this);go_chatInterface.ChatPulseResponse.subscribe(this.onChatPulseResponse,this);this.mo_chatTimer.Tick.subscribe(this.onChatTick,
this);this.mo_chatPulseTimer.Tick.subscribe(this.onChatPulseTick,this);this.mn_maxPosts=go_defaults.mn_maxPostsDisplayed;this.mb_active=false}zRoomModel.prototype.getName=function(){return this.ms_name};zRoomModel.cleanName=function(a){return a.toLowerCase().replace(/[\s-]/g,"")};zRoomModel.isPrivateName=function(a){return a.substring(0,3)=="pvt"};zRoomModel.isHistoryName=function(a){return a.substring(0,3)=="hst"};zRoomModel.prototype.isPrivateRoom=function(){return zRoomModel.isPrivateName(this.ms_name)};
zRoomModel.prototype.isHistoryRoom=function(){return zRoomModel.isHistoryName(this.ms_name)};zRoomModel.prototype.start=function(){this.mo_chatTimer.start(true);this.mo_chatPulseTimer.start(5E3,true);this.mb_active=true};zRoomModel.prototype.stop=function(){this.mb_active=false;this.mo_chatTimer.stop();this.mo_chatPulseTimer.stop()};zRoomModel.prototype.validateRoomName=function(a){if(!go_app.isValidRoomName(a))throw Error("Invalid room name: "+a);};
zRoomModel.prototype.goToRoom=function(a){if(a.toLowerCase()!=this.ms_name.toLowerCase()){this.validateRoomName(a);if(this.mb_active){for(this.stop();this.mo_posts.length>0;)this.PostUpdated.fire({ms_type:"delete",mo_post:this.mo_posts.shift()});this.ms_name=a;this.ms_lastPostId="";this.mo_users=[];this.mo_rooms=[];this.RoomListUpdated.fire({mo_rooms:this.mo_rooms});this.UserListUpdated.fire({mo_users:this.mo_users});this.start()}else this.ms_name=a,this.ms_lastPostId="",this.mo_users=[],this.mo_rooms=
[];this.RoomChanged.fire()}};zRoomModel.prototype.pulseChat=function(a){go_chatInterface.pulseChat(a)};zRoomModel.prototype.onChatTick=function(){this.pulseChat({ms_roomName:this.ms_name,ms_userName:this.mo_user.getName(),ms_lastPostId:this.ms_lastPostId})};
zRoomModel.prototype.sendText=function(a){this.pulseChat({ms_roomName:this.ms_name,ms_userName:this.mo_user.getName(),ms_lastPostId:this.ms_lastPostId,ms_cleanUserName:this.mo_user.getName(),ms_userId:this.mo_user.getId(),ms_userTag:go_chatInterface.getSourceFromTag(this.mo_user.getTag()),ms_text:a})};zRoomModel.prototype.shouldPeek=function(){return this.isPrivateRoom()||this.isHistoryRoom()};
zRoomModel.prototype.onChatPulseTick=function(){go_chatInterface.pulseChatList(this.ms_name,this.mo_user.getName(),this.shouldPeek())};
zRoomModel.prototype.onChatResponse=function(a){if(a.ms_roomName.toLowerCase()==this.ms_name.toLowerCase()){var d=a.mo_posts,e=[];this.ms_lastPostId=a.ms_lastPostId;d.length&&this.mo_chatTimer.resetInterval();for(a=0;a<d.length;a++)if(!go_arrayUtils.contains(this.mo_posts,d[a])){var h=go_app.getNPCById(d[a].ms_userId);if(h)d[a].mo_user=h;e.push(d[a])}for(a=0;a<e.length;a++)this.addPost(e[a]);if(this.mo_posts.length>this.mn_maxPosts){d=this.mo_posts;for(a=e=0;a<d.length;a++)(!d[a].mo_user||!d[a].mo_user.mb_ignored)&&
e++;for(;e>this.mn_maxPosts;)this.PostUpdated.fire({ms_type:"delete",mo_post:this.mo_posts.shift()}),e--}}};zRoomModel.prototype.addPost=function(a){go_arrayUtils.insert(this.mo_posts,a);this.PostUpdated.fire({ms_type:"add",mo_post:a})};
zRoomModel.prototype.onChatPulseResponse=function(a){if(a.ms_roomName.toLowerCase()==this.ms_name.toLowerCase())this.mo_users=a.mo_users,this.mo_rooms=a.mo_rooms,this.isPrivateRoom()&&this.mo_rooms.push(new zChatListRoom(this.ms_name,-1)),this.RoomListUpdated.fire({mo_rooms:this.mo_rooms}),this.UserListUpdated.fire({mo_users:this.mo_users})};
zRoomModel.prototype.destroy=function(){this.RoomListUpdated.destroy();this.UserListUpdated.destroy();this.PostUpdated.destroy();this.RoomChanged.destroy();this.mo_chatTimer.destroy();this.mo_chatPulseTimer.destroy();EventDispatcher.removeListener(this)};function zRoomController(a,d,e){this.mn_id=go_browserUtils.createId();this.mo_user=a;this.mo_posts=[];this.mo_room=null;this.RoomChanged=new zEvent;this.mo_options={mb_showUserList:true,mb_showRoomList:true,mb_showInputBar:true,mb_showMenuBar:true,ms_menuType:""};jQuery.extend(this.mo_options,e);this.mo_user.NameUpdated.subscribe(this.onUserNameUpdated,this);this.create();this.mo_externalContainer=d;this.mo_externalContainer.appendChild(this.mo_container);go_app.NPCUpdated.subscribe(this.onNPCUpdated,
this);go_app.DisplayUpdated.subscribe(this.onDisplayUpdated,this)}zRoomController.prototype.getRoomModel=function(){return this.mo_room};zRoomController.prototype.getName=function(){return this.mo_room.getName()};zRoomController.prototype.getRoomName=function(){return this.mo_room.getName()};zRoomController.prototype.getId=function(){return this.mn_id};zRoomController.prototype.getContainer=function(){return this.mo_container};
zRoomController.prototype.create=function(){var a="";go_app.mb_canSaveOnExit||(a+='<button class="app" onclick="go_app.save()" title="Save settings...">Save</button>');go_extras&&go_extras.roomControllerButtons&&(a+=go_extras.roomControllerButtons());var d='<div class="roomcontainer table" id="roomcontainer{id}"><div class="tr"><div class="menubar td" id="menubar{id}"><div class="buttoncontainer" id="buttoncontainer{id}"><button class="app" onclick="go_app.openSettingsMenu(event)" title="Control settings...">Settings</button><button class="app" onclick="go_app.openNPCListMenu(event)" title="Control marked/ignored/disabled users...">Users</button><button class="app" onclick="go_app.openTagEditor(event)" title="Edit your font/color/tag...">Your Tag</button>';
go_99only&&go_defaults.mb_on99&&(d+=go_99only.getRoomLeftButtons());d+=a+'<div class="roombar"><label for="roombox{id}" id="roomboxlbl{id}" class="roomboxlbl">room:</label><input type="text" class="roombox" id="roombox{id}" maxlength="{maxroom}" title="Enter the name of a room..." /></div><div class="namebar"><label for="namebox{id}" id="nameboxlbl{id}" class="nameboxlbl">name:</label><input type="text" class="namebox" id="namebox{id}" maxlength="{maxname}" title="Enter your user name..." /></div></div><div class="roomlist" id="roomlist{id}"></div><div class="userlist" id="userlist{id}"></div></div><div class="mainarea td" id="mainarea{id}"><div class="maintable table"><div class="tr"><div class="inputbar td" id="inputbar{id}"><label for="msgbox{id}" id="msgboxlbl{id}" class="msgboxlbl">msg:</label><input type="text" class="msgbox" onfocus="this.value = this.value;" placeholder="Type messages here, press enter to send..." id="msgbox{id}" /><button id="sendButton{id}" class="app">Send</button>';
go_99only&&go_defaults.mb_on99&&(d+=go_99only.getRoomRightButtons(),d+='<div id="translator{id}"></div>');d+='</div></div><div class="tr"><div class="postarea td" id="postarea{id}"></div><div class="dockarea td" id="dockarea{id}"></div></div></div></div></div></div>';d=d.replace(/{id}/g,this.mn_id+"");d=d.replace(/{maxname}/g,go_defaults.mn_maxUserNameLength);d=d.replace(/{maxroom}/g,go_defaults.mn_maxRoomNameLength);this.mo_container=a=jQuery(d)[0];this.mo_postsContainer=go_browserUtils.getById(a,
"postarea"+this.mn_id);this.mo_userListContainer=go_browserUtils.getById(a,"userlist"+this.mn_id);this.mo_roomListContainer=go_browserUtils.getById(a,"roomlist"+this.mn_id);this.mo_menuBar=go_browserUtils.getById(a,"menubar"+this.mn_id);this.mo_inputBar=go_browserUtils.getById(a,"inputbar"+this.mn_id);this.mo_msgBox=go_browserUtils.getById(a,"msgbox"+this.mn_id);this.mo_roomBox=go_browserUtils.getById(a,"roombox"+this.mn_id);this.mo_nameBox=go_browserUtils.getById(a,"namebox"+this.mn_id);this.mo_translator=
go_browserUtils.getById(a,"translator"+this.mn_id);var e=this;go_browserUtils.getById(a,"sendButton"+this.mn_id).onclick=function(){e.onMsgBoxEnter()};this.mo_msgBox.onkeypress=function(a){return e.onMsgBoxKeypress(a,this)};this.mo_roomBox.onkeyup=function(a){return e.onRoomBoxKeypress(a,this)};this.mo_roomBox.onkeypress=onKeyPress;this.mo_roomBox.style.backgroundColor=go_defaults.ms_inputNormalBGColor;this.mo_nameBox.onkeyup=function(a){return e.onNameBoxKeypress(a,this)};this.mo_nameBox.onkeypress=
onKeyPress;this.mo_nameBox.style.backgroundColor=go_defaults.ms_inputNormalBGColor;this.mo_options.mb_showInputBar||jQuery(this.mo_inputBar).hide();this.mo_options.mb_showMenuBar||jQuery(this.mo_menuBar).hide();go_translator&&go_translator.createSelection(this.mo_translator);this.updateNameBox();go_extras&&go_extras.roomControllerCreateEnd&&go_extras.roomControllerCreateEnd(this)};zRoomController.prototype.onUserNameUpdated=function(){this.updateNameBox()};
zRoomController.prototype.onRoomChanged=function(a){this.updateRoomBox();this.RoomChanged.fire(a)};zRoomController.prototype.updateNameBox=function(){this.mo_nameBox.value=this.mo_user.getName();this.mo_nameBox.style.backgroundColor=go_defaults.ms_inputNormalBGColor};zRoomController.prototype.updateRoomBox=function(){this.mo_roomBox.value=this.mo_room.getName();this.mo_roomBox.style.backgroundColor=go_defaults.ms_inputNormalBGColor};
zRoomController.prototype.onMsgBoxKeypress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:return this.onNameBoxEnter(),this.handleTextEntered(this.mo_msgBox.value,true),false}return true};
zRoomController.prototype.onRoomBoxKeypress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:try{this.goToRoom(this.mo_roomBox.value)}catch(d){go_notify.notify(d.message),this.updateRoomBox()}break;default:a=this.mo_roomBox.value,this.mo_roomBox.style.backgroundColor=this.mo_room.getName()!=a?go_defaults.ms_inputChangedBGColor:go_defaults.ms_inputNormalBGColor}};
zRoomController.prototype.onNameBoxKeypress=function(a){a=a||window.event;switch(a.keyCode||a.which){case 13:this.onNameBoxEnter();break;default:a=this.mo_nameBox.value,this.mo_nameBox.style.backgroundColor=this.mo_user.getName()!=a?go_defaults.ms_inputChangedBGColor:go_defaults.ms_inputNormalBGColor}};zRoomController.prototype.onNameBoxEnter=function(){try{go_app.setUserName(this.mo_nameBox.value)}catch(a){go_notify.notify(a.message),this.updateNameBox()}};
zRoomController.prototype.handleTextEntered=function(a,d){var e=false,h=false;if(a.match(/;;;/))try{eval(a)}catch(j){log("MsgBox Eval Error: "+j.message)}else if(a.match(/^=([\w\d]+\s*$)/))this.goToRoom(a.match(/^=([\w\d]+\s*$)/)[1]),h=e=true;else if(a.match(/^name=(\S+)\s*$/i)){e=a.match(/^name=(\S+)\s*$/i)[1];try{go_app.setUserName(e)}catch(k){go_notify.notify(k.message)}h=e=true}else if(a=go_app.cleanText(a),a.replace(/\s+/g,"")){var l=this.mo_user.createPost(a);go_arrayUtils.countMoreThan(go_app.mo_postHistory,
l,2)?(go_notify.notify("Please don't spam :)"),h=e=true):(go_app.mo_postHistory.push(l),this.mo_room.sendText(a,this.mo_user.getTag()),l.isPM()?this.setMsgBoxPM(l.getTargetId(),l.getTargetName()):e=true,h=true,l.shouldDisplayPost()&&this.mo_room.addPost(l))}if(d){if(e)this.mo_msgBox.value="";h&&this.mo_msgBox.focus()}};zRoomController.prototype.preparePM=function(a,d){this.setMsgBoxPM(a,d);this.mo_msgBox.focus()};zRoomController.prototype.preparePC=function(a,d){this.setMsgBoxPC(a,d);this.mo_msgBox.focus()};
zRoomController.prototype.setMsgBoxPM=function(a,d){this.mo_msgBox.value="pm@"+a+d+" "};zRoomController.prototype.setMsgBoxPC=function(a,d){this.mo_msgBox.value="pc@"+a+d+" pvt";for(var e=0;e<4;e++)this.mo_msgBox.value+=Math.floor(Math.random()*11);this.mo_msgBox.value+=" : "};function getAsciiHtml(a){return"&#"+a.charCodeAt(0)+";"}function getAsciiWord(a){for(var d="",e=0;e<a.length;e++)d+=getAsciiHtml(a[e]);return d}zRoomController.prototype.start=function(){this.mo_room.start()};
zRoomController.prototype.stop=function(){this.mo_room.stop()};zRoomController.prototype.goToRoom=function(a){this.mo_room?this.mo_room.goToRoom(a):(this.mo_room=new zRoomModel(a,this.mo_user),this.attachToRoom(this.mo_room));this.mo_roomBox.value=this.mo_room.getName()};
zRoomController.prototype.attachToRoom=function(a){this.mo_room=a;a.PostUpdated.subscribe(this.onPostUpdated,this);a.UserListUpdated.subscribe(this.onUserListUpdated,this);a.RoomListUpdated.subscribe(this.onRoomListUpdated,this);a.RoomChanged.subscribe(this.onRoomChanged,this);this.RoomChanged.fire()};
zRoomController.prototype.updateUserList=function(a){var d="",e="";a.sort(zChatListUser.compare);for(var h=0;h<a.length;h++){var d=go_app.getNPCById(a[h].getUserId()),j="",k="",l="";if(d)d.mb_disabled?k="*":d.mb_enabled&&(k="+"),d.mb_ignored?j+="color: red;":d.mb_marked&&(j+="color: yellow;"),l=d.ms_name;d='<div class="user" style="'+j+"\" onclick=\"go_app.openUserMenu('{id}','{name}','"+this.mo_options.ms_menuType+"',event,"+a[h].getCamStat()+", "+a[h].getVidCall()+')" title="'+l+'"><div class="flagwrap"><img class="flag" src="http://99.com/flags/{flag}.png" title="{country}"></div><span class="id">{id}</span> <span class="userprefix">'+
k+'</span><span class="name">{name}</span>';a[h].getVidCall()&&(d=d+'&nbsp;<img src="http://'+go_defaults.ms_domain+'/img/phone.png" height="9" />');a[h].getCamStat()&&(d=d+'&nbsp;<img src="http://'+go_defaults.ms_domain+'/img/cam.png" height="10" />');d+="</div>";d=d.replace(/\{name\}/g,a[h].getName());d=d.replace(/\{id\}/g,a[h].getUserId());d=d.replace(/\{flag\}/g,a[h].getFlagId());d=d.replace(/\{country\}/g,go_chatInterface.getCountryName(a[h].getFlagId()));e+=d}this.mo_userListContainer.innerHTML=
e};zRoomController.prototype.onUserListUpdated=function(a){this.updateUserList(a.mo_users)};zRoomController.prototype.onRoomListUpdated=function(a){var a=a.mo_rooms,d="",e="";a.sort(zChatListRoom.compare);for(var h=0;h<a.length;h++)d='<div class="room" onclick="go_app.goToRoom(\'{name}\',{id});">{count} - {name}</div>',d=d.replace(/\{name\}/g,a[h].getName()),d=d.replace(/\{id\}/g,this.getId()),d=d.replace(/\{count\}/g,a[h].getCount()),e+=d;this.mo_roomListContainer.innerHTML=e};
zRoomController.prototype.onPostUpdated=function(a){switch(a.ms_type){case "add":this.addPost(a.mo_post);break;case "delete":this.deletePost(a.mo_post);break;default:log("Unknown post update type: "+a.ms_type)}};zRoomController.prototype.deletePost=function(a){for(var d=0;d<this.mo_posts.length;d++){var e=this.mo_posts[d];e.mo_post.equals(a)&&(jQuery(e.mo_container).remove(),this.mo_posts.splice(d,1))}};
zRoomController.prototype.addPost=function(a){if(!a.mb_valid)return false;var d="<div>"+this.parsePost(a)+"</div>",d=jQuery(d);this.mo_posts.push({mo_container:d,mo_post:a});jQuery(this.mo_postsContainer).prepend(d);go_app.settings.mb_fadeInPosts&&(!a.mo_user||!a.mo_user.mb_ignored)&&jQuery(d).hide().fadeIn()};
zRoomController.prototype.parsePost=function(a){return go_postParser.parsePost(a,{mb_disableHTML:go_app.settings.mb_disableHTML,mb_disableImages:go_app.settings.mb_disableImages,mb_disableFormat:go_app.settings.mb_disableFormat,mb_disableMedia:go_app.settings.mb_disableMedia,mb_disableYoutube:go_app.settings.mb_disableYoutube,ms_menuType:this.mo_options.ms_menuType})};zRoomController.prototype.onDisplayUpdated=function(){this.refresh()};
zRoomController.prototype.onNPCUpdated=function(a){if(this.mo_posts){for(var d=0;d<this.mo_posts.length;d++)if(this.mo_posts[d].mo_post.getUserId()==a.mo_user.ms_userId){this.mo_posts[d].mo_post.mo_user=a.mo_user;var e=this.parsePost(this.mo_posts[d].mo_post);jQuery(this.mo_posts[d].mo_container).html(e)}this.updateUserList(this.mo_room.mo_users)}};zRoomController.prototype.refresh=function(){for(var a=0;a<this.mo_posts.length;a++){var d=this.parsePost(this.mo_posts[a].mo_post);jQuery(this.mo_posts[a].mo_container).html(d)}};
zRoomController.prototype.destroy=function(){this.mo_room.destroy();this.RoomChanged.destroy();this.mo_externalContainer.innerHTML="";EventDispatcher.removeListener(this)};var go_postParser={parsePost:function(a,d){var e={ms_menuType:"",mb_disableHTML:false,mb_disableImages:false,mb_disableFormat:false,mb_disableMedia:false,mb_disableYoutube:false};jQuery.extend(true,e,d);var h="",j=a.mo_tag.mb_disabled,k=a.mo_user&&a.mo_user.mb_enabled,l=a.mo_user&&a.mo_user.mb_ignored,n=a.mo_user&&a.mo_user.mb_disabled&&!k||a.mo_tag.mb_disabled,o=(e.mb_disableHTML||j||n)&&!k,v=(e.mb_disableImages||j||n)&&!k,i=(e.mb_disableFormat||j||n)&&!k,y=(e.mb_disableMedia||j||n)&&!k,j=(e.mb_disableYoutube||
j||n)&&!k,h=a.getUserId()+" "+a.getUserName();a.mo_user&&a.mo_user.ms_name.toLowerCase()!=a.getUserName().toLowerCase()&&(h+=" ("+a.mo_user.ms_name+")");var m=go_app.getDefaultTag();go_app.getUser().getTag();var k=a.getTag(),z=l?"display:none;":"",q=!o?k.getNameCode():m.getNameCode();q&&(q=q.replace(/\$n\$/gi,a.getUserName()));var p=!o?k.getTextCode():m.getTextCode();p&&(p=p.replace(/\$n\$/gi,a.getUserName()));var t=p||o?"padding-right:"+go_defaults.ms_namePaddingRight:"width:auto; padding:0px;",
q=go_postParser.parseHTML(q,{mb_disableHTML:o,mb_disableImages:v,mb_disableMedia:y,mb_disableYoutube:j}),p=go_postParser.parseHTML(p,{mb_disableHTML:o,mb_disableImages:v,mb_disableMedia:y,mb_disableYoutube:j}),l="";l+=!n&&!i?'<table class="post" style="'+z+"font-family: "+k.getTextFontFamily()+";background-color: "+k.getBgColor()+";border-style: "+k.getTextBorderStyle()+";border-width: "+k.getTextBorderSize()+"px;border-color: "+k.getTextBorderColor()+";color: "+k.getFgColor()+";font-size: "+k.getTextFontSize()+
"px;font-weight: "+k.getTextWeight()+";text-align: "+k.getTextAlign()+";font-style: "+k.getTextStyle()+";letter-spacing: "+k.getTextLetterSpacing()+";":'<table class="post" style="'+z+"font-family: "+m.getTextFontFamily()+";background-color: "+k.getBgColor()+";border-style: "+m.getTextBorderStyle()+";border-width: "+m.getTextBorderSize()+"px;border-color: "+m.getTextBorderColor()+";color: "+k.getFgColor()+";font-size: "+m.getTextFontSize()+"px;font-weight: "+m.getTextWeight()+";text-align: "+m.getTextAlign()+
";font-style: "+m.getTextStyle()+";letter-spacing: "+m.getTextLetterSpacing()+";";l+='" cellSpacing="0" cellPadding="0" onclick="if(event.ctrlKey){go_app.openUserMenu(\''+a.getUserId()+"','"+a.getUserName()+"','"+e.ms_menuType+"',event);}\"><tr>";go_defaults.mb_showIdCells&&(l+='<td style="background-color: '+k.ms_fgColor+"; color: "+k.ms_bgColor+'; font-size:10px;font-family:sans-serif;width:100px;padding:3px">'+a.getPostId()+"&nbsp;"+a.getUserId()+"</td>");if(!n&&!i){l+='<td class="namecell" style="'+
t+"text-align: "+k.getNameAlign()+";font-style: "+k.getNameStyle()+";font-family: "+k.getNameFontFamily()+";border-style: "+k.getNameBorderStyle()+";border-width: "+k.getNameBorderSize()+"px;border-color: "+k.getNameBorderColor()+";color: "+k.getNameColor()+";font-size: "+k.getNameFontSize()+"px;letter-spacing: "+k.getNameLetterSpacing()+";font-weight: "+k.getNameWeight()+";";if(k.ms_nameShadow!="0"||k.ms_nameGlow!="0")l+="text-shadow: black -"+k.ms_nameShadow+"px "+k.ms_nameShadow+"px, "+k.ms_bgColor+
" 0px 0px "+k.ms_nameGlow+"px, "+k.ms_bgColor+" 0px 0px "+k.ms_nameGlow+"px;";k.ms_nameBGPic?(l+="background: url("+k.ms_nameBGPic+") "+k.ms_nameBGPicX+"% "+k.ms_nameBGPicY+"%;",l+="height: "+k.ms_nameBGPicH+"px;"):l+="background-color: "+k.getFgColor()+";"}else l+='<td class="namecell" style="'+t+"text-align: "+m.getNameAlign()+";font-style: "+m.getNameStyle()+";font-family: "+m.getNameFontFamily()+";border-style: "+m.getNameBorderStyle()+";border-width: "+m.getNameBorderSize()+"px;border-color: "+
m.getNameBorderColor()+";color: "+k.ms_bgColor+";font-size: "+m.getNameFontSize()+"px;letter-spacing: "+m.getNameLetterSpacing()+";font-weight: "+m.getNameWeight()+";background-color: "+k.getFgColor()+";";l+='" title="'+h+'" onclick="go_app.openUserMenu(\''+a.getUserId()+"','"+a.getUserName()+"','"+e.ms_menuType+"',event)\" >"+(n?'<span class="disabledprefix">[disabled]</span>':"")+q+"</td>";if(p){l+='<td class="textcell" style="';if(!n&&!i&&(k.ms_textShadow!="0"||k.ms_textGlow!="0"))l+="text-shadow: black -"+
k.ms_textShadow+"px "+k.ms_textShadow+"px, "+k.ms_nameColor+" 0px 0px "+k.ms_textGlow+"px, "+k.ms_nameColor+" 0px 0px "+k.ms_textGlow+"px;";l+='">'+p+"</td>"}go_defaults.mb_showSourceCells&&(l+='<td style="background-color: '+k.ms_fgColor+"; color: "+k.ms_bgColor+';font-size:10px;font-family:sans-serif;">'+k.getSafeSource()+"</td>");l+="</tr></table>";h=a.getText();h=go_postParser.parseHTML(h,{mb_disableHTML:o,mb_disableImages:v,mb_disableMedia:y,mb_disableYoutube:j});k.mb_textRainbow&&!n&&!i&&(h=
go_chatInterface.getRainbowText(h));a.isPM()?h='<span class="pmprefix">PM:</span><span class="pmtarget">('+a.getTarget()+")</span> "+h:a.isPC()&&(h='<span class="pmprefix">PC:</span><span class="pmtarget">('+a.getTarget()+')</span> <span class="pmtarget">'+a.getPrivateRoom()+"</span> "+h);return l=go_postParser.replaceV(l,h)},onImgLoad:function(a){var d=jQuery(a);if(!d.data("isShrunk"))d.removeAttr("width").removeAttr("height"),d.css({width:"",height:"","max-width":"","max-height":""}),d.css({"max-width":a.width+
"px","max-height":a.height+"px",width:"100%"}),a.alt=a.title},ms_maxImgWidth:function(){return go_browserUtils.getBrowserWidth()*0.5}()+"px",parseHTML:function(a,d){var e={mb_disableHTML:false,mb_disableImages:false,mb_disableMedia:false,mb_disableYoutube:false};jQuery.extend(e,d);var h='<div class="ytMedia" title="{title}" onclick="go_app.onYoutubeClick(\'{id}\',this,event)"><a class="ytTitle" title="{title}" href="http://youtube.com/watch?v={id}" target="_blank" onclick="return false;"><img class="ytPreview" rel="mogwai" src="{preview}" alt="{title}" />{title}<img class="ytStars" src="{stars}" rel="mogwai" /></a></div>',
j='<img class="postImage" style="max-width:'+this.ms_maxImgWidth+'" onmouseover="window.status=this.src" onmouseout="window.status=\'\'" onclick="go_app.onPostImageClick(this,event);" src="{url}" alt="{title}" title="{title}" onload="go_postParser.onImgLoad(this);" />',k='<embed src="{url}"  pluginspage="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox" type="application/x-mplayer2" autostart="false"><noembed><bgsound src="{url}"></noembed>',l='<a href="{url}" title="{title}" target="_blank">{shortUrl}</a>',
n="{fulltext}",o='<img src="{url}" onmouseover="window.status=this.src" onmouseout="window.status=\'\'"  alt="{title}" onload="go_postParser.onImgLoad(this);">',v="{fulltext}",i="{url} - {title}";e.mb_disableYoutube&&(h='YouTube: <a href="http://youtube.com/watch?v={id}"  onclick="go_app.openYoutubeMenu(\'{id}\',null,event); return false;" title="{title}" target="_blank">{title}</a>',i="Youtube inside a Link: {fulltext}");e.mb_disableMedia&&(k='<a href="{url}" title="{url}" target="_blank" onclick="return openPostURL(this.href)">{url}</a>',
v="Media inside a Link: {fulltext}");e.mb_disableImages&&(j='<a href="{url}" title="{title}" target="_blank" onclick="return openPostURL(this.href)">{url}</a>',o="Image inside a Link: {fulltext}");e.mb_disableHTML&&(l='<a href="{url}" title="{title}" target="_blank" onclick="return openPostURL(this.href)">{shortUrl}</a>',n="Link inside a Link: {fulltext}");e=new zHTMLParser({ms_imageTemplate:j,ms_youtubeTemplate:h,ms_mediaTemplate:k,ms_linkTemplate:l,ms_imageInLinkTemplate:o,ms_youtubeInLinkTemplate:i,
ms_mediaInLinkTemplate:v,ms_linkInLinkTemplate:n,mb_htmlEnabled:!e.mb_disableHTML});return e.stringify(e.objectify(a))},replaceV:function(a,d){if(a.match(/\$v\d+\$/gi)){for(var e=String.fromCharCode(260),h=/<([^>]*)>([^<]*<\/\1>)?/ig,j=d.match(h),k=0,h=d.replace(h,e).split(" "),l=0;l<la_words.length;l++){for(;h[l].indexOf(e)!=-1;)h[l]=h[l].replace(e,j[k]),k++;var n="$v"+l+"$";a.indexOf(n)!=-1&&(a=a.replace(n,h[l],"gi"),h[l]=null)}a=a.replace(/\$v\d+\$/gi,"");d=la_words.join(" ").replace(/\s+/g," ")}return a.replace(/\$v\$/gi,
d)}};
