if(typeof(jqac)==='undefined'){jqac=jQuery;} if(!jqac.placeholder){new function($){$.fn.placeholder=function(settings){settings=settings||{};var key=settings.dataKey||"placeholderValue";var attr=settings.attr||"placeholder";var className=settings.className||"placeholder";var values=settings.values||[];var block=settings.blockSubmit||false;var blank=settings.blankSubmit||false;var submit=settings.onSubmit||false;var value=settings.value||"";var position=settings.cursor_position||0;return this.filter(":input").each(function(index){$.data(this,key,values[index]||$(this).attr(attr));}).each(function(){if($.trim($(this).val())==="")$(this).addClass(className).val($.data(this,key));}).focus(function(){if($.trim($(this).val())===$.data(this,key))$(this).removeClass(className).val(value);if($.fn.setCursorPosition){$(this).setCursorPosition(position);}}).blur(function(){if($.trim($(this).val())===value)$(this).addClass(className).val($.data(this,key));}).each(function(index,elem){if(block)new function(e){$(e.form).submit(function(){return $.trim($(e).val())!=$.data(e,key)});}(elem);else if(blank)new function(e){$(e.form).submit(function(){if($.trim($(e).val())==$.data(e,key))$(e).removeClass(className).val("");return true;});}(elem);else if(submit)new function(e){$(e.form).submit(submit);}(elem);});};}(jqac);} if(!jqac.highlight){jqac.fn.highlight=function(b){function a(e,j){var l=0;if(e.nodeType==3){var k=e.data.toUpperCase().indexOf(j);if(k>=0){var h=document.createElement("span");h.className="highlight";var f=e.splitText(k);var c=f.splitText(j.length);var d=f.cloneNode(true);h.appendChild(d);f.parentNode.replaceChild(h,f);l=1}}else{if(e.nodeType==1&&e.childNodes&&!/(script|style)/i.test(e.tagName)){for(var g=0;g=1.3?0:1};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return $.browser.safari||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.speed||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jqac); } if(!jqac.idleTimer){(function($){$.idleTimer=function f(newTimeout){var idle=false,enabled=true,timeout=30000,events='mousemove keydown DOMMouseScroll mousewheel mousedown',toggleIdleState=function(){idle=!idle;f.olddate=+new Date;$(document).trigger($.data(document,'idleTimer',idle?"idle":"active")+'.idleTimer');},stop=function(){enabled=false;clearTimeout($.idleTimer.tId);},handleUserEvent=function(){clearTimeout($.idleTimer.tId);if(enabled){if(idle){toggleIdleState();}$.idleTimer.tId=setTimeout(toggleIdleState,timeout);}};f.olddate=f.olddate||+new Date;if(typeof newTimeout=="number"){timeout=newTimeout;}else if(newTimeout==='destroy'){stop();return this;}else if(newTimeout==='getElapsedTime'){return(+new Date)-f.olddate;}$(document).bind($.trim((events+' ').split(' ').join('.idleTimer ')),handleUserEvent);$.idleTimer.tId=setTimeout(toggleIdleState,timeout);$.data(document,'idleTimer',"active");};})(jqac);} if(!jqac.popupWindow){(function($){$.fn.popupWindow=function(instanceSettings){return this.each(function(){$(this).click(function(){$.fn.popupWindow.defaultSettings={centerBrowser:0,centerScreen:0,height:500,left:0,location:0,menubar:0,resizable:0,scrollbars:0,status:0,width:500,windowName:null,windowURL:null,top:0,toolbar:0};settings=$.extend({},$.fn.popupWindow.defaultSettings,instanceSettings||{});var windowFeatures='height='+settings.height+',width='+settings.width+',toolbar='+settings.toolbar+',scrollbars='+settings.scrollbars+',status='+settings.status+',resizable='+settings.resizable+',location='+settings.location+',menuBar='+settings.menubar;settings.windowName=this.name||settings.windowName;settings.windowURL=this.href||settings.windowURL;var centeredY,centeredX;if(settings.centerBrowser){if($.browser.msie){centeredY=(window.screenTop-120)+((((document.documentElement.clientHeight+120)/2)-(settings.height/2)));centeredX=window.screenLeft+((((document.body.offsetWidth+20)/2)-(settings.width/2)));}else{centeredY=window.screenY+(((window.outerHeight/2)-(settings.height/2)));centeredX=window.screenX+(((window.outerWidth/2)-(settings.width/2)));}window.open(settings.windowURL,settings.windowName,windowFeatures+',left='+centeredX+',top='+centeredY).focus();}else if(settings.centerScreen){centeredY=(screen.height-settings.height)/2;centeredX=(screen.width-settings.width)/2;window.open(settings.windowURL,settings.windowName,windowFeatures+',left='+centeredX+',top='+centeredY).focus();}else{window.open(settings.windowURL,settings.windowName,windowFeatures+',left='+settings.left+',top='+settings.top).focus();}return false;});});};})(jqac); };var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)];}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j};}(),aK=function(){if(!ah.w3){return;}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP();}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false);}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP();}});if(af==top){(function(){if(ak){return;}try{aL.documentElement.doScroll("left");}catch(a){setTimeout(arguments.callee,0);return;}aP();})();}}if(ah.wk){(function(){if(ak){return;}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return;}aP();})();}aC(aP);}}();function aP(){if(ak){return;}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b);}catch(a){return;}ak=true;var d=Z.length;for(var c=0;c0){for(var h=0;h0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a);}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class");}if(i.getAttribute("align")){e.align=i.getAttribute("align");}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j';}}a.outerHTML='"+h+"";ag[ag.length]=e.id;d=aS(e.id);}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k]);}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k]);}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l]);}}a.parentNode.replaceChild(b,a);d=b;}}return d;}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a);}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a);}else{setTimeout(arguments.callee,10);}})();}else{b.parentNode.removeChild(b);}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null;}}b.parentNode.removeChild(b);}}function aS(a){var c=null;try{c=aL.getElementById(a);}catch(b){}return c;}function ar(a){return aL.createElement(a);}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b];}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false;}function az(b,f,a,c){if(ah.ie&&ah.mac){return;}var e=aL.getElementsByTagName("head")[0];if(!e){return;}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null;}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1];}an=g;}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f);}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"));}}}function ay(a,c){if(!aI){return;}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b;}else{az("#"+a,"visibility:"+b);}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b;}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b','','','','','','',""].join("");};SWFUpload.prototype.getFlashVars=function(){var c=this.buildParamString();var d=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(d),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(c),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("");};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName);}if(this.movieElement===null){throw"Could not find Flash element";}return this.movieElement;};SWFUpload.prototype.buildParamString=function(){var f=this.settings.post_params;var d=[];if(typeof(f)==="object"){for(var e in f){if(f.hasOwnProperty(e)){d.push(encodeURIComponent(e.toString())+"="+encodeURIComponent(f[e].toString()));}}}return d.join("&");};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var g=null;g=this.getMovieElement();if(g&&typeof(g.CallFunction)==="unknown"){for(var j in g){try{if(typeof(g[j])==="function"){g[j]=null;}}catch(h){}}try{g.parentNode.removeChild(g);}catch(f){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true;}catch(i){return false;}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned: ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned: ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned: ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned: ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned: ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned: ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned: ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned: ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""));};SWFUpload.prototype.addSetting=function(d,f,e){if(f==undefined){return(this.settings[d]=e);}else{return(this.settings[d]=f);}};SWFUpload.prototype.getSetting=function(b){if(this.settings[b]!=undefined){return this.settings[b];}return"";};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction(''+__flash__argumentsToXML(argumentArray,0)+"");returnValue=eval(returnString);}catch(ex){throw"Call to "+functionName+" failed";}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue);}return returnValue;};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile");};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles");};SWFUpload.prototype.startUpload=function(b){this.callFlash("StartUpload",[b]);};SWFUpload.prototype.cancelUpload=function(d,c){if(c!==false){c=true;}this.callFlash("CancelUpload",[d,c]);};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload");};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats");};SWFUpload.prototype.setStats=function(b){this.callFlash("SetStats",[b]);};SWFUpload.prototype.getFile=function(b){if(typeof(b)==="number"){return this.callFlash("GetFileByIndex",[b]);}else{return this.callFlash("GetFile",[b]);}};SWFUpload.prototype.addFileParam=function(e,d,f){return this.callFlash("AddFileParam",[e,d,f]);};SWFUpload.prototype.removeFileParam=function(d,c){this.callFlash("RemoveFileParam",[d,c]);};SWFUpload.prototype.setUploadURL=function(b){this.settings.upload_url=b.toString();this.callFlash("SetUploadURL",[b]);};SWFUpload.prototype.setPostParams=function(b){this.settings.post_params=b;this.callFlash("SetPostParams",[b]);};SWFUpload.prototype.addPostParam=function(d,c){this.settings.post_params[d]=c;this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.removePostParam=function(b){delete this.settings.post_params[b];this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.setFileTypes=function(d,c){this.settings.file_types=d;this.settings.file_types_description=c;this.callFlash("SetFileTypes",[d,c]);};SWFUpload.prototype.setFileSizeLimit=function(b){this.settings.file_size_limit=b;this.callFlash("SetFileSizeLimit",[b]);};SWFUpload.prototype.setFileUploadLimit=function(b){this.settings.file_upload_limit=b;this.callFlash("SetFileUploadLimit",[b]);};SWFUpload.prototype.setFileQueueLimit=function(b){this.settings.file_queue_limit=b;this.callFlash("SetFileQueueLimit",[b]);};SWFUpload.prototype.setFilePostName=function(b){this.settings.file_post_name=b;this.callFlash("SetFilePostName",[b]);};SWFUpload.prototype.setUseQueryString=function(b){this.settings.use_query_string=b;this.callFlash("SetUseQueryString",[b]);};SWFUpload.prototype.setRequeueOnError=function(b){this.settings.requeue_on_error=b;this.callFlash("SetRequeueOnError",[b]);};SWFUpload.prototype.setHTTPSuccess=function(b){if(typeof b==="string"){b=b.replace(" ","").split(",");}this.settings.http_success=b;this.callFlash("SetHTTPSuccess",[b]);};SWFUpload.prototype.setAssumeSuccessTimeout=function(b){this.settings.assume_success_timeout=b;this.callFlash("SetAssumeSuccessTimeout",[b]);};SWFUpload.prototype.setDebugEnabled=function(b){this.settings.debug_enabled=b;this.callFlash("SetDebugEnabled",[b]);};SWFUpload.prototype.setButtonImageURL=function(b){if(b==undefined){b="";}this.settings.button_image_url=b;this.callFlash("SetButtonImageURL",[b]);};SWFUpload.prototype.setButtonDimensions=function(f,e){this.settings.button_width=f;this.settings.button_height=e;var d=this.getMovieElement();if(d!=undefined){d.style.width=f+"px";d.style.height=e+"px";}this.callFlash("SetButtonDimensions",[f,e]);};SWFUpload.prototype.setButtonText=function(b){this.settings.button_text=b;this.callFlash("SetButtonText",[b]);};SWFUpload.prototype.setButtonTextPadding=function(c,d){this.settings.button_text_top_padding=d;this.settings.button_text_left_padding=c;this.callFlash("SetButtonTextPadding",[c,d]);};SWFUpload.prototype.setButtonTextStyle=function(b){this.settings.button_text_style=b;this.callFlash("SetButtonTextStyle",[b]);};SWFUpload.prototype.setButtonDisabled=function(b){this.settings.button_disabled=b;this.callFlash("SetButtonDisabled",[b]);};SWFUpload.prototype.setButtonAction=function(b){this.settings.button_action=b;this.callFlash("SetButtonAction",[b]);};SWFUpload.prototype.setButtonCursor=function(b){this.settings.button_cursor=b;this.callFlash("SetButtonCursor",[b]);};SWFUpload.prototype.queueEvent=function(d,f){if(f==undefined){f=[];}else{if(!(f instanceof Array)){f=[f];}}var e=this;if(typeof this.settings[d]==="function"){this.eventQueue.push(function(){this.settings[d].apply(this,f);});setTimeout(function(){e.executeNextEvent();},0);}else{if(this.settings[d]!==null){throw"Event handler "+d+" is unknown or is not a function";}}};SWFUpload.prototype.executeNextEvent=function(){var b=this.eventQueue?this.eventQueue.shift():null;if(typeof(b)==="function"){b.apply(this);}};SWFUpload.prototype.unescapeFilePostParams=function(l){var j=/[$]([0-9a-f]{4})/i;var i={};var k;if(l!=undefined){for(var h in l.post){if(l.post.hasOwnProperty(h)){k=h;var g;while((g=j.exec(k))!==null){k=k.replace(g[0],String.fromCharCode(parseInt("0x"+g[1],16)));}i[k]=l.post[h];}}l.post=i;}return l;};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface");}catch(b){return false;}};SWFUpload.prototype.flashReady=function(){var b=this.getMovieElement();if(!b){this.debug("Flash called back ready but the flash movie can't be found.");return;}this.cleanUp(b);this.queueEvent("swfupload_loaded_handler");};SWFUpload.prototype.cleanUp=function(f){try{if(this.movieElement&&typeof(f.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var h in f){try{if(typeof(f[h])==="function"){f[h]=null;}}catch(e){}}}}catch(g){}window.__flash__removeCallback=function(c,b){try{if(c){c[b]=null;}}catch(a){}};};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler");};SWFUpload.prototype.fileQueued=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("file_queued_handler",b);};SWFUpload.prototype.fileQueueError=function(e,f,d){e=this.unescapeFilePostParams(e);this.queueEvent("file_queue_error_handler",[e,f,d]);};SWFUpload.prototype.fileDialogComplete=function(d,f,e){this.queueEvent("file_dialog_complete_handler",[d,f,e]);};SWFUpload.prototype.uploadStart=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("return_upload_start_handler",b);};SWFUpload.prototype.returnUploadStart=function(d){var c;if(typeof this.settings.upload_start_handler==="function"){d=this.unescapeFilePostParams(d);c=this.settings.upload_start_handler.call(this,d);}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function";}}if(c===undefined){c=true;}c=!!c;this.callFlash("ReturnUploadStart",[c]);};SWFUpload.prototype.uploadProgress=function(e,f,d){e=this.unescapeFilePostParams(e);this.queueEvent("upload_progress_handler",[e,f,d]);};SWFUpload.prototype.uploadError=function(e,f,d){e=this.unescapeFilePostParams(e);this.queueEvent("upload_error_handler",[e,f,d]);};SWFUpload.prototype.uploadSuccess=function(d,e,f){d=this.unescapeFilePostParams(d);this.queueEvent("upload_success_handler",[d,e,f]);};SWFUpload.prototype.uploadComplete=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("upload_complete_handler",b);};SWFUpload.prototype.debug=function(b){this.queueEvent("debug_handler",b);};SWFUpload.prototype.debugMessage=function(h){if(this.settings.debug){var f,g=[];if(typeof h==="object"&&typeof h.name==="string"&&typeof h.message==="string"){for(var e in h){if(h.hasOwnProperty(e)){g.push(e+": "+h[e]);}}f=g.join("\n")||"";g=f.split("\n");f="EXCEPTION: "+g.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(f);}else{SWFUpload.Console.writeLine(h);}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(g){var e,f;try{e=document.getElementById("SWFUpload_Console");if(!e){f=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(f);e=document.createElement("textarea");e.id="SWFUpload_Console";e.style.fontFamily="monospace";e.setAttribute("wrap","off");e.wrap="off";e.style.overflow="auto";e.style.width="700px";e.style.height="350px";e.style.margin="5px";f.appendChild(e);}e.value+=g+"\n";e.scrollTop=e.scrollHeight-e.clientHeight;}catch(h){alert("Exception: "+h.name+" Message: "+h.message);}};(function(c){var b={init:function(d,e){return this.each(function(){var n=c(this);var m=n.clone();var j=c.extend({id:n.attr("id"),swf:"uploadify.swf",uploader:"uploadify.php",auto:true,buttonClass:"",buttonCursor:"hand",buttonImage:null,buttonText:"SELECT FILES",checkExisting:false,debug:false,fileObjName:"Filedata",fileSizeLimit:0,fileTypeDesc:"All Files",fileTypeExts:"*.*",height:30,method:"post",multi:true,formData:{},preventCaching:true,progressData:"percentage",queueID:false,queueSizeLimit:999,removeCompleted:true,removeTimeout:3,requeueErrors:false,successTimeout:30,uploadLimit:0,width:120,overrideEvents:[]},d);var g={assume_success_timeout:j.successTimeout,button_placeholder_id:j.id,button_width:j.width,button_height:j.height,button_text:null,button_text_style:null,button_text_top_padding:0,button_text_left_padding:0,button_action:(j.multi?SWFUpload.BUTTON_ACTION.SELECT_FILES:SWFUpload.BUTTON_ACTION.SELECT_FILE),button_disabled:false,button_cursor:(j.buttonCursor=="arrow"?SWFUpload.CURSOR.ARROW:SWFUpload.CURSOR.HAND),button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,debug:j.debug,requeue_on_error:j.requeueErrors,file_post_name:j.fileObjName,file_size_limit:j.fileSizeLimit,file_types:j.fileTypeExts,file_types_description:j.fileTypeDesc,file_queue_limit:j.queueSizeLimit,file_upload_limit:j.uploadLimit,flash_url:j.swf,prevent_swf_caching:j.preventCaching,post_params:j.formData,upload_url:j.uploader,use_query_string:(j.method=="get"),file_dialog_complete_handler:a.onDialogClose,file_dialog_start_handler:a.onDialogOpen,file_queued_handler:a.onSelect,file_queue_error_handler:a.onSelectError,swfupload_loaded_handler:j.onSWFReady,upload_complete_handler:a.onUploadComplete,upload_error_handler:a.onUploadError,upload_progress_handler:a.onUploadProgress,upload_start_handler:a.onUploadStart,upload_success_handler:a.onUploadSuccess};if(e){g=c.extend(g,e);}g=c.extend(g,j);var o=swfobject.getFlashPlayerVersion();var h=(o.major>=9);if(h){window["uploadify_"+j.id]=new SWFUpload(g);var i=window["uploadify_"+j.id];n.data("uploadify",i);var l=c("
",{id:j.id,"class":"uploadify",css:{height:j.height+"px",width:j.width+"px"}});c("#"+i.movieName).wrap(l);l=c("#"+j.id);l.data("uploadify",i);var f=c("
",{id:j.id+"-button","class":"uploadify-button "+j.buttonClass});if(j.buttonImage){f.css({"background-image":"url('"+j.buttonImage+"')","text-indent":"-9999px"});}f.html(''+j.buttonText+"").css({height:j.height+"px","line-height":j.height+"px",width:j.width+"px"});l.append(f);c("#"+i.movieName).css({position:"relative","z-index":1});if(!j.queueID){var k=c("
",{id:j.id+"-queue","class":"uploadify-queue"});l.after(k);i.settings.queueID=j.id+"-queue";i.settings.defaultQueue=true;}i.queueData={files:{},filesSelected:0,filesQueued:0,filesReplaced:0,filesCancelled:0,filesErrored:0,uploadsSuccessful:0,uploadsErrored:0,averageSpeed:0,queueLength:0,queueSize:0,uploadSize:0,queueBytesUploaded:0,uploadQueue:[],errorMsg:"Some files were not added to the queue:"};i.original=m;i.wrapper=l;i.button=f;i.queue=k;if(j.onInit){j.onInit.call(n,i);}}else{if(j.onFallback){j.onFallback.call(n);}}});},cancel:function(d,f){var e=arguments;this.each(function(){var l=c(this),i=l.data("uploadify"),j=i.settings,h=-1;if(e[0]){if(e[0]=="*"){var g=i.queueData.queueLength;c("#"+j.queueID).find(".uploadify-queue-item").each(function(){h++;if(e[1]===true){i.cancelUpload(c(this).attr("id"),false);}else{i.cancelUpload(c(this).attr("id"));}c(this).find(".data").removeClass("data").html(" - Cancelled");c(this).find(".uploadify-progress-bar").remove();c(this).delay(1000+100*h).fadeOut(500,function(){c(this).remove();});});i.queueData.queueSize=0;i.queueData.queueLength=0;if(j.onClearQueue){j.onClearQueue.call(l,g);}}else{for(var m=0;m0){alert(this.queueData.errorMsg);}}if(e.onDialogClose){e.onDialogClose.call(this,this.queueData);}if(e.auto){c("#"+e.id).uploadify("upload","*");}},onSelect:function(g){var h=this.settings;var e={};for(var f in this.queueData.files){e=this.queueData.files[f];if(e.uploaded!=true&&e.name==g.name){var d=confirm('The file named "'+g.name+'" is already in the queue.\nDo you want to replace the existing item in the queue?');if(!d){this.cancelUpload(g.id);this.queueData.filesCancelled++;return false;}else{c("#"+e.id).remove();this.cancelUpload(e.id);this.queueData.filesReplaced++;}}}var i=Math.round(g.size/1024);var l="KB";if(i>1000){i=Math.round(i/1000);l="MB";}var k=i.toString().split(".");i=k[0];if(k.length>1){i+="."+k[1].substr(0,2);}i+=l;var j=g.name;if(j.length>25){j=j.substr(0,25)+"...";}if(c.inArray("onSelect",h.overrideEvents)<0){c("#"+h.queueID).append('
X
'+j+" ("+i+')
');}this.queueData.queueSize+=g.size;this.queueData.files[g.id]=g;if(h.onSelect){h.onSelect.apply(this,arguments);}},onSelectError:function(d,g,f){var e=this.settings;if(c.inArray("onSelectError",e.overrideEvents)<0){switch(g){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:if(e.queueSizeLimit>f){this.queueData.errorMsg+="\nThe number of files selected exceeds the remaining upload limit ("+f+").";}else{this.queueData.errorMsg+="\nThe number of files selected exceeds the queue size limit ("+e.queueSizeLimit+").";}break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:this.queueData.errorMsg+='\nThe file "'+d.name+'" exceeds the size limit ('+e.fileSizeLimit+").";break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:this.queueData.errorMsg+='\nThe file "'+d.name+'" is empty.';break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:this.queueData.errorMsg+='\nThe file "'+d.name+'" is not an accepted file type ('+e.fileTypeDesc+").";break;}}if(g!=SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){delete this.queueData.files[d.id];}if(e.onSelectError){e.onSelectError.apply(this,arguments);}},onQueueComplete:function(){if(this.settings.onQueueComplete){this.settings.onQueueComplete.call(this,this.settings.queueData);}},onUploadComplete:function(f){var g=this.settings,d=this;var e=this.getStats();this.queueData.queueLength=e.files_queued;if(this.queueData.uploadQueue[0]=="*"){if(this.queueData.queueLength>0){this.startUpload();}else{this.queueData.uploadQueue=[];if(g.onQueueComplete){g.onQueueComplete.call(this,this.queueData);}}}else{if(this.queueData.uploadQueue.length>0){this.startUpload(this.queueData.uploadQueue.shift());}else{this.queueData.uploadQueue=[];if(g.onQueueComplete){g.onQueueComplete.call(this,this.queueData);}}}if(c.inArray("onUploadComplete",g.overrideEvents)<0){if(g.removeCompleted){switch(f.filestatus){case SWFUpload.FILE_STATUS.COMPLETE:setTimeout(function(){if(c("#"+f.id)){d.queueData.queueSize-=f.size;d.queueData.queueLength-=1;delete d.queueData.files[f.id];c("#"+f.id).fadeOut(500,function(){c(this).remove();});}},g.removeTimeout*1000);break;case SWFUpload.FILE_STATUS.ERROR:if(!g.requeueErrors){setTimeout(function(){if(c("#"+f.id)){d.queueData.queueSize-=f.size;d.queueData.queueLength-=1;delete d.queueData.files[f.id];c("#"+f.id).fadeOut(500,function(){c(this).remove();});}},g.removeTimeout*1000);}break;}}else{f.uploaded=true;}}if(g.onUploadComplete){g.onUploadComplete.call(this,f);}},onUploadError:function(e,i,h){var f=this.settings;var g="Error";switch(i){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:g="HTTP Error ("+h+")";break;case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:g="Missing Upload URL";break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:g="IO Error";break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:g="Security Error";break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:alert("The upload limit has been reached ("+h+").");g="Exceeds Upload Limit";break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:g="Failed";break;case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:g="Validation Error";break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:g="Cancelled";this.queueData.queueSize-=e.size;this.queueData.queueLength-=1;if(e.status==SWFUpload.FILE_STATUS.IN_PROGRESS||c.inArray(e.id,this.queueData.uploadQueue)>=0){this.queueData.uploadSize-=e.size;}if(f.onCancel){f.onCancel.call(this,e);}delete this.queueData.files[e.id];break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:g="Stopped";break;}if(c.inArray("onUploadError",f.overrideEvents)<0){if(i!=SWFUpload.UPLOAD_ERROR.FILE_CANCELLED&&i!=SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED){c("#"+e.id).addClass("uploadify-error");}c("#"+e.id).find(".uploadify-progress-bar").css("width","1px");if(i!=SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND&&e.status!=SWFUpload.FILE_STATUS.COMPLETE){c("#"+e.id).find(".data").html(" - "+g);}}var d=this.getStats();this.queueData.uploadsErrored=d.upload_errors;if(f.onUploadError){f.onUploadError.call(this,e,i,h,g);}},onUploadProgress:function(g,m,j){var h=this.settings;var e=new Date();var n=e.getTime();var k=n-this.timer;if(k>500){this.timer=n;}var i=m-this.bytesLoaded;this.bytesLoaded=m;var d=this.queueData.queueBytesUploaded+m;var p=Math.round(m/j*100);var o="KB/s";var l=0;var f=(i/1024)/(k/1000);f=Math.floor(f*10)/10;if(this.queueData.averageSpeed>0){this.queueData.averageSpeed=Math.floor((this.queueData.averageSpeed+f)/2);}else{this.queueData.averageSpeed=Math.floor(f);}if(f>1000){l=(f*0.001);this.queueData.averageSpeed=Math.floor(l);o="MB/s";}if(c.inArray("onUploadProgress",h.overrideEvents)<0){if(h.progressData=="percentage"){c("#"+g.id).find(".data").html(" - "+p+"%");}else{if(h.progressData=="speed"&&k>500){c("#"+g.id).find(".data").html(" - "+this.queueData.averageSpeed+o);}}c("#"+g.id).find(".uploadify-progress-bar").css("width",p+"%");}if(h.onUploadProgress){h.onUploadProgress.call(this,g,m,j,d,this.queueData.uploadSize);}},onUploadStart:function(d){var e=this.settings;var f=new Date();this.timer=f.getTime();this.bytesLoaded=0;if(this.queueData.uploadQueue.length==0){this.queueData.uploadSize=d.size;}if(e.checkExisting){c.ajax({type:"POST",async:false,url:e.checkExisting,data:{filename:d.name},success:function(h){if(h==1){var g=confirm('A file with the name "'+d.name+'" already exists on the server.\nWould you like to replace the existing file?');if(!g){this.cancelUpload(d.id);c("#"+d.id).remove();if(this.queueData.uploadQueue.length>0&&this.queueData.queueLength>0){if(this.queueData.uploadQueue[0]=="*"){this.startUpload();}else{this.startUpload(this.queueData.uploadQueue.shift());}}}}}});}if(e.onUploadStart){e.onUploadStart.call(this,d);}},onUploadSuccess:function(f,h,d){var g=this.settings;var e=this.getStats();this.queueData.uploadsSuccessful=e.successful_uploads;this.queueData.queueBytesUploaded+=f.size;if(c.inArray("onUploadSuccess",g.overrideEvents)<0){c("#"+f.id).find(".data").html(" - Complete");}if(g.onUploadSuccess){g.onUploadSuccess.call(this,f,h,d);}}};c.fn.uploadify=function(d){if(b[d]){return b[d].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof d==="object"||!d){return b.init.apply(this,arguments);}else{c.error("The method "+d+" does not exist in $.uploadify");}}};})(jqac); (function(factory){if(typeof define==='function'&&define.amd){define(['jqac'],factory);}else{factory(jqac);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);} function decode(s){return config.raw?s:decodeURIComponent(s);} function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));} function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');} try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}} function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;} var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);} return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));} var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i
');(function(){var e=document.createElement('script');e.type='text/javascript';e.src=document.location.protocol+'//connect.facebook.net/en_US/all.js';e.async=true;document.getElementsByTagName('head')[0].appendChild(e);}());window.fbAsyncInit=function(){FB.init({appId:c_facebook_app_id,cookie:true,status:true,xfbml:true});FB.getLoginStatus(function(response){if(response.authResponse){if(ac_fb_logged_in){jqac.arrowchat.facebook(response);}else{ac_fb_logged_in=false;}}});};function arrowchatdoLogin(){if(ac_fb_logged_in){jqac.arrowchat.facebookLogout();ac_fb_logged_in=false;}else{FB.login(function(response){if(response.authResponse){FB.api('/me/permissions',function(response2){if(response2.data[0].xmpp_login==1){jqac.arrowchat.facebook(response);ac_fb_logged_in=true;}});}else{}},{scope:'xmpp_login,offline_access'});}}} (function(w){var E=w(window),u,f,F=-1,n,x,D,v,y,L,r,m=!window.XMLHttpRequest,s=[],l=document.documentElement,k={},t=new Image(),J=new Image(),H,a,g,p,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('
').click(C)[0],a=w('
')[0],G=w('
')[0]]).css("display","none"));g=w('
').appendTo(a).append(p=w('
').append([I=w('').click(B)[0],d=w('').click(e)[0]])[0])[0];c=w('
').appendTo(G).append([w('').click(C)[0],A=w('
')[0],K=w('
')[0],w('
')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+(E.height()/2);L=u.initialWidth;r=u.initialHeight;w(a).css({top:Math.max(0,y-(r/2)),width:L,height:r,marginLeft:-L/2}).show();v=m||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();j(1);f=O;u.loop=u.loop&&(f.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q=0)?C():(M(N,u.nextKeys)>=0)?e():(M(N,u.previousKeys)>=0)?B():null}function B(){return b(x)}function e(){return b(D)}function b(M){if(M>=0){F=M;n=f[F][0];x=(F||(u.loop?f.length:0))-1;D=((F+1)%f.length)||(u.loop?0:-1);q();a.className="lbLoading";k=new Image();k.onload=i;k.src=n}return false}function i(){a.className="";var winWidth=window.innerWidth-20;var winHeight=window.innerHeight-120;if(winWidth>winHeight){var maxSize=winHeight;}else{var maxSize=winWidth;} var my_w=k.width;var my_h=k.height;if(my_w>my_h){my_h=maxSize*my_h/my_w;my_w=maxSize;}else{my_w=maxSize*my_w/my_h;my_h=maxSize;} if(k.width>my_w||k.height>my_h){w(g).css({backgroundImage:"url("+n+")",backgroundSize:""+my_w+"px "+my_h+"px",visibility:"hidden",display:""});w(p).width(my_w);w([p,I,d]).height(my_h);} else{w(g).css({backgroundImage:"url("+n+")",backgroundSize:"",visibility:"hidden",display:""});w(p).width(k.width);w([p,I,d]).height(k.height);}w(A).html(f[F][1]||"");w(K).html((((f.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,f.length));if(x>=0){t.src=f[x][0]}if(D>=0){J.src=f[D][0]}L=g.offsetWidth;r=g.offsetHeight;var M=Math.max(0,y-(r/2));if(a.offsetHeight!=r){w(a).animate({height:r,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+r,marginLeft:-L/2,visibility:"hidden",display:""});w(g).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,h)})}function h(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function q(){k.onload=null;k.src=t.src=J.src=n;w([a,g,c]).stop(true);w([I,d,g,G]).hide()}function C(){if(F>=0){q();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,j)}return false}})(jqac);if(c_push_engine=="1"){(function(){var aa=void 0,v=!0,z=null,A=!1;function C(){return function(){}} window.JSON&&window.JSON.stringify||function(){function a(){try{return this.valueOf()}catch(a){return z}}function d(a){c.lastIndex=0;return c.test(a)?'"'+a.replace(c,function(a){var b=q[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(c,q){var s,r,f,h,j,m=e,l=q[c];l&&"object"===typeof l&&(l=a.call(l));"function"===typeof g&&(l=g.call(q,c,l));switch(typeof l){case"string":return d(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";e+=p;j=[];if("[object Array]"===Object.prototype.toString.apply(l)){h=l.length;for(s=0;s++pa?pa:pa=1))||a};function ra(a,d){var b=a.join(ja),c=[];if(!d)return b;H(d,function(a,b){var d="object"==typeof b?JSON.stringify(b):b;"undefined"!=typeof b&&(b!=z&&0E()?(clearTimeout(c),c=setTimeout(b,d)):(e=E(),a())}var c,e=0;return b}function ta(a,d){var b=[];H(a||[],function(a){d(a)&&b.push(a)});return b}function ua(a,d){return a.replace(la,function(a,c){return d[c]||a})} function qa(a){var d="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=16*Math.random()|0;return("x"==a?c:c&3|8).toString(16)});a&&a(d);return d}function H(a,d){if(a&&d)if(a&&Array.isArray&&Array.isArray(a))for(var b=0,c=a.length;ba.search("-pnpres")&&e.h&&b.push(a):e.h&&b.push(a)});return b.sort()}function xa(a,d){var b=[];H(a,function(a,e){d?0>channel.search("-pnpres")&&e.h&&b.push(a):e.h&&b.push(a)});return b.sort()}function ya(){setTimeout(function(){ea||(ea=1,H(ha,function(a){a()}))},D)}var L,R=14,S=8,za=A;function Ba(a,d){var b="",c,e;if(d){c=a[15];if(16e;e++)b+=String.fromCharCode(a[e]);return b}function Ca(a,d){var b=[],c;if(!d)try{a=unescape(encodeURIComponent(a))}catch(e){throw"Error on UTF-8 encode";}for(c=0;cx.length&&(r=16-x.length,s=[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]);for(r=0;rc;c++)b[c]=d[a[c]];return b}function Ma(a){var d=[],b=za?[0,13,10,7,4,1,14,11,8,5,2,15,12,9,6,3]:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11],c;for(c=0;16>c;c++)d[c]=a[b[c]];return d} function Na(a){var d=[],b;if(za)for(b=0;4>b;b++)d[4*b]=Qa[a[4*b]]^Sa[a[1+4*b]]^Ta[a[2+4*b]]^Ua[a[3+4*b]],d[1+4*b]=Ua[a[4*b]]^Qa[a[1+4*b]]^Sa[a[2+4*b]]^Ta[a[3+4*b]],d[2+4*b]=Ta[a[4*b]]^Ua[a[1+4*b]]^Qa[a[2+4*b]]^Sa[a[3+4*b]],d[3+4*b]=Sa[a[4*b]]^Ta[a[1+4*b]]^Ua[a[2+4*b]]^Qa[a[3+4*b]];else for(b=0;4>b;b++)d[4*b]=Va[a[4*b]]^bb[a[1+4*b]]^a[2+4*b]^a[3+4*b],d[1+4*b]=a[4*b]^Va[a[1+4*b]]^bb[a[2+4*b]]^a[3+4*b],d[2+4*b]=a[4*b]^a[1+4*b]^Va[a[2+4*b]]^bb[a[3+4*b]],d[3+4*b]=bb[a[4*b]]^a[1+4*b]^a[2+4*b]^Va[a[3+4*b]];return d}function Ka(a,d,b){var c=[],e;for(e=0;16>e;e++)c[e]=a[e]^d[b][e];return c}function Ga(a,d){var b=[],c;for(c=0;16>c;c++)b[c]=a[c]^d[c];return b} function Fa(a){var d=[],b=[],c,e,p=[];for(c=0;ca;a++)b[a]=d[c-1][a];if(0===c%S){a=b[0];e=aa;for(e=0;4>e;e++)b[e]=b[e+1];b[3]=a;b=cb(b);b[0]^=db[c/S-1]}else 6a;a++)d[c][a]=d[c-S][a]^b[a]}for(c=0;cb;b++)p[c].push(d[4*c+b][0],d[4*c+b][1],d[4*c+b][2],d[4*c+b][3])}return p}function cb(a){for(var d=0;4>d;d++)a[d]=Pa[a[d]];return a} function eb(a,d){var b=[];for(i=0;ib;b++){for(var c=a,e=b,p=aa,q=aa,p=q=0;8>p;p++)q=1==(e&1)?q^c:q,c=127>>=1;d[b]=q}return d} var Pa=eb("637c777bf26b6fc53001672bfed7ab76ca82c97dfa5947f0add4a2af9ca472c0b7fd9326363ff7cc34a5e5f171d8311504c723c31896059a071280e2eb27b27509832c1a1b6e5aa0523bd6b329e32f8453d100ed20fcb15b6acbbe394a4c58cfd0efaafb434d338545f9027f503c9fa851a3408f929d38f5bcb6da2110fff3d2cd0c13ec5f974417c4a77e3d645d197360814fdc222a908846eeb814de5e0bdbe0323a0a4906245cc2d3ac629195e479e7c8376d8dd54ea96c56f4ea657aae08ba78252e1ca6b4c6e8dd741f4bbd8b8a703eb5664803f60e613557b986c11d9ee1f8981169d98e949b1e87e9ce5528df8ca1890dbfe6426841992d0fb054bb16",2),Oa,gb=Pa,hb=[];for(i=0;i>2],b+=lb[(d[c]&3)<<4|d[c+1]>>4],b=d[c+1]!==aa?b+lb[(d[c+1]&15)<<2|d[c+2]>>6]:b+"=",b=d[c+2]!==aa?b+lb[d[c+2]&63]:b+"=";a=b.slice(0,64);for(c=1;c>4,c[1]=(b[1]&15)<<4|b[2]>>2,c[2]=(b[2]&3)<<6|b[3],d.push(c[0],c[1],c[2]);return d=d.slice(0,d.length-d.length%16)}};L={size:function(a){switch(a){case 128:R=10;S=4;break;case 192:R=12;S=6;break;case 256:R=14;S=8;break;default:throw"Invalid Key Size Specified:"+a;}},h2a:function(a){var d=[];a.replace(/(..)/g,function(a){d.push(parseInt(a,16))});return d},expandKey:Fa,encryptBlock:Ha,decryptBlock:Ja,Decrypt:za,s2a:Ca,rawEncrypt:Ea,rawDecrypt:Ia,dec:function(a,d,b){var a=ib.ja(a),c=a.slice(8,16),c=Da(Ca(d,b),c),d=c.key,c=c.J,a=a.slice(16,a.length);return a=Ia(a,d,c,b)},openSSLKey:Da,a2h:function(a){var d="",b;for(b=0;ba[b]?"0":"")+a[b].toString(16);return d},enc:function(a,d,b){var c;c=[];var e;for(e=0;8>e;e++)c=c.concat(Math.floor(256*Math.random()));e=Da(Ca(d,b),c);d=e.key;e=e.J;c=[[83,97,108,116,101,100,95,95].concat(c)];a=Ca(a,b);a=Ea(a,d,e);a=c.concat(a);return ib.ka(a)},Hash:{MD5:function(a){function d(a,b){var d,c,e,f,g;e=a&2147483648;f=b&2147483648;d=a&1073741824;c=b&1073741824;g=(a&1073741823)+(b&1073741823);return d&c?g^2147483648^e^f:d|c?g&1073741824?g^3221225472^e^f:g^1073741824^e^f:g^e^f}function b(a,b,c,e,f,g,l){a=d(a,d(d(b&c|~b&e,f),l));return d(a<>>32-g,b)}function c(a,b,c,e,f,g,l){a=d(a,d(d(b&e|c&~e,f),l));return d(a<>>32-g,b)}function e(a,b,c,e,g,f,l){a=d(a,d(d(b^c^e,g),l));return d(a<>>32-f,b)}function p(a,b,c,e,f,g,l){a=d(a,d(d(c^(b|~e),f),l));return d(a<>>32-g,b)}function q(a){var b,d,c=[];for(d=0;3>=d;d++)b=a>>>8*d&255,c=c.concat(b);return c}var g=[],t,x,s,r,f,h,j,m,l=eb("67452301efcdab8998badcfe10325476d76aa478e8c7b756242070dbc1bdceeef57c0faf4787c62aa8304613fd469501698098d88b44f7afffff5bb1895cd7be6b901122fd987193a679438e49b40821f61e2562c040b340265e5a51e9b6c7aad62f105d02441453d8a1e681e7d3fbc821e1cde6c33707d6f4d50d87455a14eda9e3e905fcefa3f8676f02d98d2a4c8afffa39428771f6816d9d6122fde5380ca4beea444bdecfa9f6bb4b60bebfbc70289b7ec6eaa127fad4ef308504881d05d9d4d039e6db99e51fa27cf8c4ac5665f4292244432aff97ab9423a7fc93a039655b59c38f0ccc92ffeff47d85845dd16fa87e4ffe2ce6e0a30143144e0811a1f7537e82bd3af2352ad7d2bbeb86d391",8),g=a.length;t=g+8;x=16*((t-t%64)/64+1);s=[];for(f=r=0;f>>29;g=s;f=l[0];h=l[1];j=l[2];m=l[3];for(a=0;aM||!wa(F,v).length?ob=A:(ob=v,B.presence_heartbeat({callback:function(){Xa=setTimeout(f,M*D)},error:function(a){u&&u("Presence Heartbeat unable to reach Pubnub servers."+JSON.stringify(a));Xa=setTimeout(f,M*D)}}))}function h(a,b){return Ya.decrypt(a,b||N)||Ya.decrypt(a,N)||a}function j(a,b,d){var c=A;if("number"===typeof a)c=5 5 or x = 0). Current Value : "+(b||5)),b||5):a}function m(a){var b="",d=[];H(a,function(a){d.push(a)});var c=d.sort(),e;for(e in c){var f=c[e],b=b+(f+"="+encodeURIComponent(a[f]));e!=c.length-1&&(b+="&")}return b}function l(a){a||(a={});H($,function(b,d){b in a||(a[b]=d)});return a}function y(a){return Sb(a)}function W(a){function b(a,d){var c=(a&65535)+(d&65535);return(a>>16)+(d>>16)+(c>>16)<<16|c&65535}function d(a,b){return a>>>b|a<<32-b}var c;c=a.replace(/\r\n/g,"\n");for(var a="",e=0;ef?a+=String.fromCharCode(f):(127f?a+=String.fromCharCode(f>>6|192):(a+=String.fromCharCode(f>>12|224),a+=String.fromCharCode(f>>6&63|128)),a+=String.fromCharCode(f&63|128))}e=a;c=[];for(f=0;f<8*e.length;f+=8)c[f>>5]|=(e.charCodeAt(f/8)&255)<<24-f%32;var g=8*a.length,e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],f=Array(64),l,h,j,m,p,q,r,t,u,s,w;c[g>>5]|=128<<24-g%32;c[(g+64>>9<<4)+15]=g;for(t=0;tu;u++)f[u]=16>u?c[u+t]:b(b(b(d(f[u-2],17)^d(f[u-2],19)^f[u-2]>>>10,f[u-7]),d(f[u-15],7)^d(f[u-15],18)^f[u-15]>>>3),f[u-16]),s=b(b(b(b(r,d(m,6)^d(m,11)^d(m,25)),m&p^~m&q),e[u]),f[u]),w=b(d(g,2)^d(g,13)^d(g,22),g&l^g&h^l&h),r=q,q=p,p=m,m=b(j,s),j=h,h=l,l=g,g=b(s,w);a[0]=b(g,a[0]);a[1]=b(l,a[1]);a[2]=b(h,a[2]);a[3]=b(j,a[3]);a[4]=b(m,a[4]);a[5]=b(p,a[5]);a[6]=b(q,a[6]);a[7]=b(r,a[7])}c="";for(e=0;e<4*a.length;e++)c+="0123456789abcdef".charAt(a[e>>2]>>8*(3-e%4)+4&15)+"0123456789abcdef".charAt(a[e>>2]>>8*(3-e%4)&15);return c}a.jsonp&&(Bb=0);var T=a.subscribe_key||"";a.uuid||Hb.get(T+"uuid");var kb=a.leave_on_unload||0;a.xdr=Db;a.db=Hb;a.error=a.error||ub;a._is_online=Fb;a.jsonp_cb=Cb;a.hmac_SHA256=mb;L.size(256);var Ra=L.s2a("0123456789012345");a.crypto_obj={encrypt:function(a,b){if(!b)return a;var d=L.s2a(W(b).slice(0,32)),c=L.s2a(JSON.stringify(a)),d=L.rawEncrypt(c,d,Ra);return L.Base64.encode(d)||a},decrypt:function(a,b){if(!b)return a;var d=L.s2a(W(b).slice(0,32));try{var c=L.Base64.decode(a),e=L.rawDecrypt(c,d,Ra,A);return JSON.parse(e)}catch(f){}}};a.params={pnsdk:"PubNub-JS-Web/3.7.2"};var lc=+a.windowing||10,mc=(+a.timeout||310)*D,Rb=(+a.keepalive||60)*D,qc=a.noleave||0,O=a.publish_key||"demo",w=a.subscribe_key||"demo",P=a.auth_key||"",Za=a.secret_key||"",Wb=a.hmac_SHA256,pb=a.ssl?"s":"",Aa=c_push_ssl==1?"":"",J=na(Aa),Xb=na(Aa),Z=[],qb=v,nb=0,rb=0,Yb=0,Wa=0,$a=a.restore||0,fa=0,sb=A,F={},da={},Q={},Xa=z,U=j(a.heartbeat||a.pnexpires||0,a.error),M=a.heartbeat_interval||U-3,ob=A,tc=a.no_wait_for_pending,uc=a["compatible_3.5"]||A,G=a.xdr,$=a.params||{},u=a.error||C(),sc=a._is_online||function(){return 1},I=a.jsonp_cb||function(){return 0},ga=a.db||{get:C(),set:C()},N=a.cipher_key,K=a.uuid||ga&&ga.get(w+"uuid")||"",ca,Y,Ya=a.crypto_obj||{encrypt:function(a){return a},decrypt:function(a){return a}},B={LEAVE:function(a,b,d,c){var e={uuid:K,auth:P},f=na(Aa),d=d||C(),h=c||C(),c=I();if(0U&&(c.heartbeat=U);"0"!=a&&(c.callback=a);var e;e=wa(F,v).join(",");e=encodeURIComponent(e);var f=xa(da,v).join(",");e||(e=",");f&&(c["channel-group"]=f);G({c:a,data:l(c),timeout:5*D,url:[J,"v2","presence","sub-key",w,"channel",e,"heartbeat"],e:function(a){t(a,b,d)},d:function(a){g(a,d)}})},stop_timers:function(){clearTimeout(ca);clearTimeout(Y)},xdr:G,ready:ya,db:ga,uuid:qa,map:va,each:H,"each-channel":x,grep:ta,offline:function(){c(1,{message:"Offline. Please check your network settings."})},supplant:ua,now:E,unique:ma,updater:sa};K||(K=B.uuid());ga.set(w+"uuid",K);ca=setTimeout(p,D);Y=setTimeout(e,Rb);Xa=setTimeout(r,(M-3)*D);b();var T=B,ab;for(ab in T)T.hasOwnProperty(ab)&&(y[ab]=T[ab]);y.css=zb;y.$=tb;y.create=Ab;y.bind=wb;y.head=xb;y.search=vb;y.attr=yb;y.events=Pb;y.init=y;y.secure=y;wb("beforeunload",window,function(){if(kb)y["each-channel"](function(a){y.LEAVE(a.name,0)});return v});if(a.notest)return y;wb("offline",window,y.offline);wb("offline",document,y.offline);return y};Sb.init=Sb;Sb.secure=Sb;"complete"===document.readyState?setTimeout(ya,0):wb("load",window,function(){setTimeout(ya,0)});var Tb=Qb||{};PUBNUB=Sb({notest:1,publish_key:yb(Tb,"pub-key"),subscribe_key:yb(Tb,"sub-key"),ssl:!document.location.href.indexOf("https")||"on"==yb(Tb,"ssl"),origin:yb(Tb,"origin"),uuid:yb(Tb,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=Sb);"undefined"!==typeof module&&(module.exports=PUBNUB)&&ya();var Gb=tb("pubnubs")||0;if(Qb){zb(Qb,{position:"absolute",top:-D});if("opera"in window||yb(Qb,"flash"))Qb.innerHTML="";PUBNUB.rdx=function(a,d){if(!d)return X[a].onerror();X[a].responseText=unescape(d);X[a].onload()};X.id=D}} var Ub=PUBNUB.ws=function(a,d){if(!(this instanceof Ub))return new Ub(a,d);var b=this,a=b.url=a||"";b.protocol=d||"Sec-WebSocket-Protocol";var c=a.split("/"),c={ssl:"wss:"===c[0],origin:c[2],publish_key:c[3],subscribe_key:c[4],channel:c[5]};b.CONNECTING=0;b.OPEN=1;b.CLOSING=2;b.CLOSED=3;b.CLOSE_NORMAL=1E3;b.CLOSE_GOING_AWAY=1001;b.CLOSE_PROTOCOL_ERROR=1002;b.CLOSE_UNSUPPORTED=1003;b.CLOSE_TOO_LARGE=1004;b.CLOSE_NO_STATUS=1005;b.CLOSE_ABNORMAL=1006;b.onclose=b.onerror=b.onmessage=b.onopen=b.onsend=C();b.binaryType="";b.extensions="";b.bufferedAmount=0;b.trasnmitting=A;b.buffer=[];b.readyState=b.CONNECTING;if(!a)return b.readyState=b.CLOSED,b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:v}),b;b.o=PUBNUB.init(c);b.o.M=c;b.M=c;b.o.subscribe({restore:A,channel:c.channel,disconnect:b.onerror,reconnect:b.onopen,error:function(){b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:A})},callback:function(a){b.onmessage({data:a})},connect:function(){b.readyState=b.OPEN;b.onopen()}})};Ub.prototype.send=function(a){var d=this;d.o.publish({channel:d.o.M.channel,message:a,callback:function(a){d.onsend({data:a})}})};var Vb;if(!(Vb=V)){var Zb=Math,$b={},ac=$b.t={},bc=C(),cc=ac.O={extend:function(a){bc.prototype=this;var d=new bc;a&&d.da(a);d.hasOwnProperty("init")||(d.a=function(){d.N.a.apply(this,arguments)});d.a.prototype=d;d.N=this;return d},create:function(){var a=this.extend();a.a.apply(a,arguments);return a},a:C(),da:function(a){for(var d in a)a.hasOwnProperty(d)&&(this[d]=a[d]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},g:function(){return this.a.prototype.extend(this)}},ec=ac.u=cc.extend({a:function(a,d){a=this.f=a||[];this.b=d!=aa?d:4*a.length},toString:function(a){return(a||dc).stringify(this)},concat:function(a){var d=this.f,b=a.f,c=this.b,a=a.b;this.s();if(c%4)for(var e=0;e>>2]|=(b[e>>>2]>>>24-8*(e%4)&255)<<24-8*((c+e)%4);else if(65535>>2]=b[e>>>2];else d.push.apply(d,b);this.b+=a;return this},s:function(){var a=this.f,d=this.b;a[d>>>2]&=4294967295<<32-8*(d%4);a.length=Zb.ceil(d/4)},g:function(){var a=cc.g.call(this);a.f=this.f.slice(0);return a},random:function(a){for(var d=[],b=0;b>>2]>>>24-8*(c%4)&255;b.push((e>>>4).toString(16));b.push((e&15).toString(16))}return b.join("")},parse:function(a){for(var d=a.length,b=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return new ec.a(b,d/2)}},gc=fc.ia={stringify:function(a){for(var d=a.f,a=a.b,b=[],c=0;c>>2]>>>24-8*(c%4)&255));return b.join("")},parse:function(a){for(var d=a.length,b=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new ec.a(b,d)}},hc=fc.U={stringify:function(a){try{return decodeURIComponent(escape(gc.stringify(a)))}catch(d){throw Error("Malformed UTF-8 data");}},parse:function(a){return gc.parse(unescape(encodeURIComponent(a)))}},ic=ac.fa=cc.extend({reset:function(){this.k=new ec.a;this.q=0},v:function(a){"string"==typeof a&&(a=hc.parse(a));this.k.concat(a);this.q+=a.b},A:function(a){var d=this.k,b=d.f,c=d.b,e=this.C,p=c/(4*e),p=a?Zb.ceil(p):Zb.max((p|0)-this.ba,0),a=p*e,c=Zb.min(4*a,c);if(a){for(var q=0;qxc;){var yc;a:{yc=wc;for(var zc=kc.sqrt(yc),Ac=2;Ac<=zc;Ac++)if(!(yc%Ac)){yc=A;break a}yc=v}yc&&(8>xc&&(rc[xc]=4294967296*(kc.pow(wc,0.5)-(kc.pow(wc,0.5)|0))|0),vc[xc]=4294967296*(kc.pow(wc,1/3)-(kc.pow(wc,1/3)|0))|0,xc++);wc++} var Bc=[],nc=nc.T=pc.extend({Z:function(){this.n=new oc.a(rc.slice(0))},Y:function(a,d){for(var b=this.n.f,c=b[0],e=b[1],p=b[2],q=b[3],g=b[4],t=b[5],x=b[6],s=b[7],r=0;64>r;r++){if(16>r)Bc[r]=a[d+r]|0;else{var f=Bc[r-15],h=Bc[r-2];Bc[r]=((f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3)+Bc[r-7]+((h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10)+Bc[r-16]}f=s+((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+(g&t^~g&x)+vc[r]+Bc[r];h=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&e^c&p^e&p);s=x;x=t;t=g;g=q+f|0;q=p;p=e;e=c;c=f+h|0}b[0]=b[0]+c|0;b[1]=b[1]+e|0;b[2]=b[2]+p|0;b[3]=b[3]+q|0;b[4]=b[4]+g|0;b[5]=b[5]+t|0;b[6]=b[6]+x|0;b[7]=b[7]+s|0},X:function(){var a=this.k,d=a.f,b=8*this.q,c=8*a.b;d[c>>>5]|=128<<24-c%32;d[(c+64>>>9<<4)+14]=kc.floor(b/4294967296);d[(c+64>>>9<<4)+15]=b;a.b=4*d.length;this.A();return this.n},g:function(){var a=pc.g.call(this);a.n=this.n.g();return a}});V.T=pc.V(nc);V.ha=pc.W(nc);var Cc=V.I.U;V.B.P=V.t.O.extend({a:function(a,d){a=this.p=new a.a;"string"==typeof d&&(d=Cc.parse(d));var b=a.C,c=4*b;d.b>c&&(d=a.j(d));d.s();for(var e=this.ca=d.g(),p=this.aa=d.g(),q=e.f,g=p.f,t=0;t>>2]>>>24-8*(e%4)&255)<<16|(d[e+1>>>2]>>>24-8*((e+1)%4)&255)<<8|d[e+2>>>2]>>>24-8*((e+2)%4)&255,q=0;4>q&&e+0.75*q>>6*(3-q)&63));if(d=c.charAt(64))for(;a.length%4;)a.push(d);return a.join("")},parse:function(a){var d=a.length,b=this.z,c=b.charAt(64);c&&(c=a.indexOf(c),-1!=c&&(d=c));for(var c=[],e=0,p=0;p>>2]|=(b.indexOf(a.charAt(p-1))<<2*(p%4)|b.indexOf(a.charAt(p))>>>6-2*(p%4))<<24-8*(e%4),e++);return Dc.create(c,e)},z:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};})();} var ArrowChat={};ArrowChat.Templates={bar_hide_tab:function(){return'
';},bar_show_tab:function(){return'
';},applications_bookmarks_tab:function(c_ac_path,apps,b){return'
'+ apps[b][11]+'
';},applications_bookmarks_window:function(c_ac_path,apps,b){return'
';},applications_bookmarks_list:function(c_ac_path,apps,b){return'
  • ';},applications_tab:function(){return'
    '+lang[16]+'
    ';},applications_window:function(){return'
    '+lang[16]+'
    '+lang[65]+'
    ';},notifications_tab:function(){return'
    ';},notifications_window:function(){return'
    '+lang[0]+'
    '+lang[9]+'
    ';},mod_tab:function(){return'
    ';},mod_window:function(){return'
    '+lang[166]+'
    '+lang[182]+'
    ';},mod_report:function(){return'
    '+lang[181]+'
    ';},warnings_display:function(h){return'
    '+lang[199]+'
    '+h.data+'
    ';},chat_tab:function(shortname){return'
    '+shortname+'
    ';},chat_window:function(c,longname,i,l,b){return'
    '+c+longname+i+'
    '+lang[66]+'
    '+lang[60]+'
    '+lang[24]+'

    '+lang[84]+'
    '+lang[167]+'
    '+lang[68]+'
    ';},buddylist_tab:function(){return'
    '+lang[4]+' (0)
    ';},buddylist_window:function(d,_ts,acp){return'
    '+lang[4]+'
    '+lang[108]+'
    '+lang[109]+'
    '+acp+'
    ';},maintenance_tab:function(c_login_url){if(c_login_url=="")c_login_url="#";return'';},announcements_display:function(h){return'
    '+h.data+'
    ';},chatrooms_tab:function(){return'
    '+ lang[19]+'
    ';},chatrooms_window:function(){return'
    '+lang[19]+'
    '+lang[172]+'
    '+lang[174]+'
    '+lang[175]+'
    '+lang[173]+'
    '+lang[31]+'
    '+lang[91]+'
    '+lang[100]+'
    '+lang[50]+'
    '+lang[49]+'
    ';},chatrooms_room:function(c_max_chatroom_msg){return'
    '+lang[148]+'
    '+lang[149]+'
    '+lang[147]+'
    ';}};ArrowChat.IdleTime=3;(function(a){a.arrowchat=function(){var $body=a("body");var $base;var $maintenance;var $show_bar_button;var $popout_chat_button;var $optionsbutton;var $optionsbutton_popup;var $modbutton;var $modbutton_popup;var $chatrooms_button;var $buddy_list_tab;var $userstab_popup;var $tooltip=null;var $tooltip_content;var $chatroom_chat;var $chatroom_room_list;var $chatrooms_popup;var $chatroom_create;var $chatroom_create_flyout;var $application_buttons={};var $application_button_popups={};var $applications_button;var $applications_button_popup;var $applications_button_popups;var $users=[];var $user_popups=[];var $chatbox_right;var $chatboxes;var $chatboxes_wide;var $chatbox_left;var $chatroom_admin_controls="";function addHover($elements,classes){$elements.each(function(i,element){a(element).hover(function(){a(this).addClass(classes);},function(){a(this).removeClass(classes);});});}function preventScrolling($target){$target.bind("mousewheel DOMMouseScroll",function(e){var e0=e.originalEvent,delta=e0.wheelDelta||- e0.detail;this.scrollTop+=(delta<0?1:-1)*30;e.preventDefault();});}function showLoading($element){a(".arrowchat_hide_loading",$element).hide();a(".arrowchat_show_loading",$element).show();}function hideLoading($element){a(".arrowchat_hide_loading",$element).show();a(".arrowchat_show_loading",$element).hide();}function closePopup($popup,$button,hidden){if($popup!==undefined){if(hidden==1){$popup.addClass("arrowchat_tabopen_hidden");}else{$popup.removeClass("arrowchat_tabopen");}}if($button!==undefined){$button.removeClass("arrowchat_tabclick arrowchat_userstabclick arrowchat_trayclick arrowchat_usertabclick");}}function hideTooltip(){if($tooltip){$tooltip.hide();}}function showTooltip($target,text,is_left,custom_left,custom_top,is_sideways){if($tooltip===null){$tooltip=a("
    ").appendTo($body);$tooltip_content=a(".arrowchat_tooltip_content",$tooltip);}$tooltip_content.html(text);var target_offset=$target.offset();var target_width=$target.width();var target_height=$target.height();var tooltip_width=$tooltip.width();if(!custom_left){custom_left=0;}if(!custom_top){custom_top=0;}if(is_left){$tooltip.css({top:target_offset.top- a(window).scrollTop()- target_height- 5- custom_top,left:target_offset.left+ target_width- 16- custom_left,display:"block"}).addClass("arrowchat_tooltip_left");}else if(is_sideways){$tooltip.css({top:target_offset.top- a(window).scrollTop()- target_height- 5- custom_top,left:target_offset.left+ target_width- tooltip_width+ 18- custom_left,display:"block",'background-position':tooltip_width- 128+"px -58px"}).removeClass("arrowchat_tooltip_left");}else{$tooltip.css({top:target_offset.top- a(window).scrollTop()- target_height- 5- custom_top,left:target_offset.left+ target_width- tooltip_width+ 18- custom_left,display:"block",'background-position':tooltip_width- 23+"px -114px"}).removeClass("arrowchat_tooltip_left");}if(W){$tooltip.css("position","absolute");$tooltip.css("top",parseInt(a(window).height())- parseInt($tooltip.css("bottom"))- parseInt($tooltip.height())+ a(window).scrollTop()+"px");}}var exp=/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;function replaceURLWithHTMLLinks(text){return text.replace(exp,"$1");}RegExp.escape=function(text){return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");};function smileyreplace(mess){if(c_disable_smilies!=1){for(i=0;i/g,">");var check_emoticon=mess.lastIndexOf(smiley_test);if(check_emoticon!=-1){mess=mess.replace(new RegExp(RegExp.escape(smiley_test),"g"),"\"\"");}}}return mess;}function chatroomKeydown(key,$element){if(key.keyCode==13&&key.shiftKey==0){var i=$element.val();i=i.replace(/^\s+|\s+$/g,"");$element.val("");$element.css("height","18px");$element.css("overflow-y","hidden");$element.focus();i!=""&&a.ajax({url:c_ac_path+"includes/json/send/send_message_chatroom.php",type:"post",cache:false,dataType:"json",data:{userid:u_id,username:u_name,chatroomid:Ccr,message:i},beforeSend:function(){a(".arrowchat_chatroom_message_input").addClass("arrowchat_message_sending");},error:function(){a(".arrowchat_chatroom_message_input").removeClass("arrowchat_message_sending");displayMessage("arrowchat_chatroom_message_flyout",lang[135],"error");},success:function(o){a(".arrowchat_chatroom_message_input").removeClass("arrowchat_message_sending");if(o){var no_error=true;o&&a.each(o,function(i,e){if(i=="error"){a.each(e,function(l,f){no_error=false;displayMessage("arrowchat_chatroom_message_flyout",f.m,"error");});}});if(no_error){addMessageToChatroom(o,u_name,i);$chatroom_chat.scrollTop($chatroom_chat[0].scrollHeight);}}}});return false;}}function userchatKeydown(key,$element,typing,jabber){if(jabber!=1){clearTimeout(pa);pa=setTimeout(function(){a.post(c_ac_path+"includes/json/send/send_typing.php",{userid:u_id,typing:typing,untype:1},function(){});fa=-1;},5000);if(fa!=typing){a.post(c_ac_path+"includes/json/send/send_typing.php",{userid:u_id,typing:typing},function(){});fa=typing;}}if(key.keyCode==13&&key.shiftKey==0){var i=$element.val();i=i.replace(/^\s+|\s+$/g,"");$element.val("").css({height:"18px",'overflow-y':"hidden"}).focus();if(jabber==1&&i!=""){sendJabberMessage(typing,i);}else{i!=""&&a.ajax({url:c_ac_path+"includes/json/send/send_message.php",type:"post",cache:false,dataType:"json",data:{userid:u_id,to:typing,message:i},beforeSend:function(){a(".arrowchat_textarea").addClass("arrowchat_message_sending");},error:function(){a(".arrowchat_textarea").removeClass("arrowchat_message_sending");displayMessage("arrowchat_chatbox_message_flyout_"+ typing,lang[135],"error");},success:function(e){a(".arrowchat_textarea").removeClass("arrowchat_message_sending");if(e){if(e=="-1"){displayMessage("arrowchat_chatbox_message_flyout_"+ typing,lang[102],"error");}else{addMessageToChatbox(typing,i,"1","1",e,1,Math.floor((new Date).getTime()/ 1000));}}K = 1;}});}return false;}}function resizeChatfield($element) {var height = $element[0].clientHeight;if (height < 94) {height = Math.max($element[0].scrollHeight, height);height = Math.min(94, height);if (height > $element[0].clientHeight) {$element.css("height", height + 4 + "px");}} else {$element.css("overflow-y", "auto");}}function chatroomKeyup(b, $element) {resizeChatfield($element);$chatroom_chat.scrollTop($chatroom_chat[0].scrollHeight);}function userchatKeyup(key, $element, d) {resizeChatfield($element);a(".arrowchat_tabcontenttext", $user_popups[d]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[d])[0].scrollHeight);}function clearUserStatus() {a("#arrowchat_userstab_icon").removeClass("arrowchat_user_available2 arrowchat_user_busy2 arrowchat_user_invisible2 arrowchat_user_away2");}function setUserStatus(status) {a("#arrowchat_userstab_icon").removeClass("arrowchat_user_available2 arrowchat_user_busy2 arrowchat_user_invisible2");a.post(c_ac_path + "includes/json/send/send_status.php", {userid:u_id, status:status}, function () {});}function showUserOffline() {w = 1;clearUserStatus();a("#arrowchat_userstab_icon").addClass("arrowchat_user_invisible2");setUserStatus("offline");closePopup($userstab_popup, $buddy_list_tab);closePopup($optionsbutton_popup, $optionsbutton);closePopup($modbutton_popup, $modbutton);a("#arrowchat_userstab_text").html(lang[7]);}function buildMaintenance() {$maintenance = a(ArrowChat.Templates.maintenance_tab(c_login_url)).appendTo($base);$maintenance.mouseover(function () {if (c_guests_login_msg == "1" && u_id == "") {showTooltip($maintenance, lang[58]);} else {showTooltip($maintenance, lang[27]);}a(this).addClass("arrowchat_tabmouseover");});$maintenance.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});}function buildHideBarButton() {$hide_bar_button = a(ArrowChat.Templates.bar_hide_tab()).appendTo($base);$hide_bar_button.mouseover(function () {showTooltip($hide_bar_button, lang[14]);a(this).addClass("arrowchat_tabmouseover");});$hide_bar_button.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});$hide_bar_button.click(function () {lsClick("#arrowchat_hide_bar_button", "ac_click");a.post(c_ac_path + "includes/json/send/send_settings.php", {hide:"1"});showUserOffline();closePopup($chatrooms_popup, $chatrooms_button);closePopup($applications_button_popup, $applications_button);if (m != "") {closePopup($application_button_popups[m], $application_buttons[m]);m = "";}if (j != "") {closePopup($user_popups[j], $users[j]);a(".arrowchat_closebox_bottom", $users[j]).removeClass("arrowchat_closebox_bottom_click");j = "";}clearTimeout(Z);a.idleTimer("destroy");pushCancelAll();cancelJSONP();$base.hide();$show_bar_button.show();});}function buildShowBarButton() {$show_bar_button = a(ArrowChat.Templates.bar_show_tab()).appendTo($body);$show_bar_button.mouseover(function () {showTooltip($show_bar_button, lang[15]);a(this).addClass("arrowchat_tabmouseover");});$show_bar_button.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});$show_bar_button.click(function () {showBar();});}function showBar() {lsClick("#arrowchat_show_bar_button", "ac_click");a.post(c_ac_path + "includes/json/send/send_settings.php", {hide:"-1"});setUserStatus("available");a("#arrowchat_userstab_icon").addClass("arrowchat_user_available2");w = 0;loadBuddyList();pushSubscribe();receiveCore();a.idleTimer(60000 * ArrowChat.IdleTime);$show_bar_button.hide();$base.show();}function startCreateChatRoom() {var i = a("#arrowchat_chatroom_create_input").val();var passinput = a("#arrowchat_chatroom_create_password_input").val();a("#arrowchat_chatroom_create_input").val("");a("#arrowchat_chatroom_create_password_input").val("");i = i.replace(/^\s+|\s+$/g, "");i != "" && a.post(c_ac_path + "includes/json/send/send_chatroom_create.php", {userid:u_id, name:i, password:passinput}, function (e) {if (e) {$chatroom_create_flyout.hide("slide", {direction:"up"}, 250);a("#arrowchat_chatroom_options_flyout").removeClass("arrowchat_chatroom_options_flyout_display");if (e == "-1") {displayMessage("arrowchat_chatroom_message_flyout", lang[39], "error");} else if (e == "-2") {displayMessage("arrowchat_chatroom_message_flyout", lang[40], "error");} else {chatroomreceived = 0;loadChatroomList();}}});}function buildChatroomsButton() {$chatrooms_button = a(ArrowChat.Templates.chatrooms_tab()).appendTo($base);$chatrooms_popup = a(ArrowChat.Templates.chatrooms_window()).css("display", "none").appendTo($body);$chatroom_create = a("#arrowchat_chatroom_create");$chatroom_create_flyout = a("#arrowchat_chatroom_create_flyout");$chatrooms_button.css("width", c_width_chatroom + "px");a("#arrowchat_chatroom_create_input").placeholder();a("#arrowchat_chatroom_create_password_input").placeholder();if (c_width_chatroom <= 25) {a("#arrowchat_chatrooms_text", $chatrooms_button).hide();}if (u_chatroom_block_chats == 1) {a("#arrowchat_chatroom_block :input").attr("checked", true);} else {a("#arrowchat_chatroom_block").addClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_block :input").attr("checked", false);}if (u_chatroom_sound == 1) {a("#arrowchat_chatroom_sound :input").attr("checked", true);} else {a("#arrowchat_chatroom_sound").addClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_sound :input").attr("checked", false);}if (u_chatroom_show_names == 1) {a("#arrowchat_chatroom_show_names :input").attr("checked", true);} else {a("#arrowchat_chatroom_show_names").addClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_show_names :input").attr("checked", false);}if (u_chatroom_stay != "-1") {a("#arrowchat_chatroom_stay :input").attr("checked", true);} else {a("#arrowchat_chatroom_stay").addClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_stay :input").attr("checked", false);}if (u_chatroom_open != "-1") {a("#arrowchat_chatroom_window :input").attr("checked", true);} else {a("#arrowchat_chatroom_window").addClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_window :input").attr("checked", false);}if (c_user_chatrooms == "0") {$chatroom_create.hide();}$chatrooms_button.click(function () {lsClick("#arrowchat_chatrooms_button", "ac_openclose");count = 0;if (c_width_chatroom <= 25) {hideTooltip();}if (a(".arrowchat_tabalert", $chatrooms_button).length > 0) {a(".arrowchat_tabalert", $chatrooms_button).remove();$chatrooms_button.removeClass("arrowchat_tab_new_message");}loadChatroomList();closePopup($userstab_popup, $buddy_list_tab);closePopup($optionsbutton_popup, $optionsbutton);closePopup($modbutton_popup, $modbutton);$chatrooms_popup.css("left", $chatrooms_button.offset().left - $chatrooms_popup.outerWidth() + $chatrooms_button.outerWidth()).css("bottom", "25px");a(this).toggleClass("arrowchat_tabclick").toggleClass("arrowchat_userstabclick");$chatrooms_popup.toggleClass("arrowchat_tabopen");if ($chatroom_chat !== undefined) {$chatroom_chat.scrollTop(50000);}a(".arrowchat_chatroom_message_input").focus();});$chatrooms_button.mouseover(function () {if (c_width_chatroom <= 25) {if ($chatrooms_button.hasClass("arrowchat_tabclick")) {} else {showTooltip($chatrooms_button, lang[19]);}}a(this).addClass("arrowchat_tabmouseover");});$chatrooms_button.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});preventScrolling(a(".arrowchat_chatroom_content"));a("#arrowchat_chatroom_password_input").keydown(function (h) {if (h.keyCode == 13) {c = a("#arrowchat_chatroom_password_id").val();a("#arrowchat_chatroom_password_flyout").hide();input_value = a("#arrowchat_chatroom_password_input").val();a("#arrowchat_chatroom_password_input").val("");input_value = input_value.replace(/^\s+|\s+$/g, "");a(".arrowchat_chatroom_full_content").html("
    " + lang[34] + "
    ");$chatroom_create.hide();Ccr = c;loadChatroom(c, crt[c], input_value);}});a("#arrowchat_password_button").click(function () {c = a("#arrowchat_chatroom_password_id").val();a("#arrowchat_chatroom_password_flyout").hide();input_value = a("#arrowchat_chatroom_password_input").val();a("#arrowchat_chatroom_password_input").val("");input_value = input_value.replace(/^\s+|\s+$/g, "");a(".arrowchat_chatroom_full_content").html("
    " + lang[34] + "
    ");$chatroom_create.hide();Ccr = c;loadChatroom(c, crt[c], input_value);});a("#arrowchat_chatroom_stay").click(function () {a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_chatroom_stay :input").is(":checked")) {a("#arrowchat_chatroom_stay :input").attr("checked", false);_chatroomstay = -1;} else {a("#arrowchat_chatroom_stay :input").attr("checked", true);u_chatroom_stay = Ccr;_chatroomstay = Ccr;}if (a("#arrowchat_chatroom_window :input").is(":checked")) {a("#arrowchat_chatroom_window").toggleClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_window :input").attr("checked", false);}a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_stay:_chatroomstay}, function () {});});a("#arrowchat_chatroom_window").click(function () {a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_chatroom_window :input").is(":checked")) {a("#arrowchat_chatroom_window :input").attr("checked", false);_chatroomwindow = -1;} else {a("#arrowchat_chatroom_window :input").attr("checked", true);u_chatroom_open = Ccr;_chatroomwindow = Ccr;}if (a("#arrowchat_chatroom_stay :input").is(":checked")) {a("#arrowchat_chatroom_stay").toggleClass("arrowchat_menu_unchecked");a("#arrowchat_chatroom_stay :input").attr("checked", false);}a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_window:_chatroomwindow}, function () {});});a("#arrowchat_chatroom_block").click(function () {lsClick("#arrowchat_chatroom_block", "ac_click");a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_chatroom_block :input").is(":checked")) {a("#arrowchat_chatroom_block :input").attr("checked", false);_chatroomblock = -1;} else {a("#arrowchat_chatroom_block :input").attr("checked", true);_chatroomblock = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_block_chats:_chatroomblock}, function () {});});a("#arrowchat_chatroom_sound").click(function () {lsClick("#arrowchat_chatroom_sound", "ac_click");a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_chatroom_sound :input").is(":checked")) {a("#arrowchat_chatroom_sound :input").attr("checked", false);_chatroomsound = -1;u_chatroom_sound = 0;} else {a("#arrowchat_chatroom_sound :input").attr("checked", true);_chatroomsound = 1;u_chatroom_sound = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_sound:_chatroomsound}, function () {});});a("#arrowchat_chatroom_show_names").click(function () {lsClick("#arrowchat_chatroom_show_names", "ac_click");a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_chatroom_show_names :input").is(":checked")) {a("#arrowchat_chatroom_show_names :input").attr("checked", false);_chatroomshownames = -1;u_chatroom_show_names = 0;a(".arrowchat_chatroom_message_name").hide();$chatroom_chat.scrollTop(50000);} else {a("#arrowchat_chatroom_show_names :input").attr("checked", true);_chatroomshownames = 1;u_chatroom_show_names = 1;a(".arrowchat_chatroom_message_name").show();$chatroom_chat.scrollTop(50000);}a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_show_names:_chatroomshownames}, function () {});});a(".arrowchat_chatrooms_title", $chatrooms_popup).click(function () {$chatrooms_button.click();}).children().not(".arrowchat_tab_name").click(function () {return false;});a(".arrowchat_chatrooms_title", $chatrooms_popup).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatrooms_title", $chatrooms_popup).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover3");});a("#arrowchat_chatroom_create_input").keydown(function (h) {if (h.keyCode == 13) {startCreateChatRoom();}});a("#arrowchat_create_button").click(function () {startCreateChatRoom();});a("#arrowchat_chatroom_leave").click(function () {lsClick("#arrowchat_chatroom_leave", "ac_click");if (a(".arrowchat_smiley_box", $chatrooms_popup).is(":visible")) {a(".arrowchat_smiley_box", $chatrooms_popup).hide("slide", {direction:"up"}, 250, function () {});}if (a("#arrowchat_chatroom_options_flyout", $chatrooms_popup).is(":visible")) {a(".arrowchat_chatroom_item2").click();}if ($chatroom_admin_controls.length) {$chatroom_admin_controls.remove();}clearTimeout(Crref2);a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19]);a(".arrowchat_chatroom_full_content").html("
    " + lang[34] + "
    ");a("#arrowchat_chatroom_leave").hide();a(".arrowchat_chatroom_popout").hide();if (c_user_chatrooms == "1") {$chatroom_create.show();}chatroomreceived = 0;loadChatroomList();var retain_ccr = Ccr;Ccr = 0;if (c_push_engine != 1) {cancelJSONP();receiveCore();} else {changePushChannel("chatroom" + retain_ccr, 0);}});a(".arrowchat_chatroom_leave").mouseenter(function () {showTooltip(a(this), lang[92], 0, 10, 5);a(this).addClass("arrowchat_chatroom_leave_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatroom_leave").mouseleave(function () {a(this).removeClass("arrowchat_chatroom_leave_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3");hideTooltip();});function i() {a("#arrowchat_chatroom_options_flyout").removeClass("arrowchat_chatroom_options_flyout_display");}function kal() {if ($chatroom_create_flyout.is(":visible")) {$chatroom_create_flyout.hide("slide", {direction:"up"}, 250);}}a(".arrowchat_chatroom_item").click(function () {i();if (a(".arrowchat_chatroom_item2").hasClass("arrowchat_more_button_selected")) {a(".arrowchat_chatroom_item2").toggleClass("arrowchat_more_button_selected");}if (!$chatroom_create_flyout.is(":visible")) {$chatroom_create_flyout.show("slide", {direction:"up"}, 250);} else {$chatroom_create_flyout.hide("slide", {direction:"up"}, 250);}if (a("#arrowchat_chatroom_password_flyout").is(":visible")) {a(".arrowchat_chatroom_list").removeClass("arrowchat_chatroom_clicked");a("#arrowchat_chatroom_password_flyout").hide("slide", {direction:"up"}, 250);}});a(".arrowchat_chatroom_item").mouseenter(function () {showTooltip(a(this), lang[93], 0, 10, 5);a(this).parent().addClass("arrowchat_chatroom_create_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatroom_item").mouseleave(function () {hideTooltip();a(this).parent().removeClass("arrowchat_chatroom_create_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatroom_item2").click(function () {a("#arrowchat_chatroom_options_flyout").children(".arrowchat_inner_menu").show();a(".arrowchat_flood_menu").hide();hideTooltip();kal();a("#arrowchat_chatroom_options_flyout").toggleClass("arrowchat_chatroom_options_flyout_display");a(this).addClass("arrowchat_more_button_hover");a(this).toggleClass("arrowchat_more_button_selected");});a(".arrowchat_chatroom_item2").mouseenter(function () {showTooltip(a(this), lang[23], 0, 10, 5);a(this).parent().addClass("arrowchat_more_button_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").removeClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatroom_item2").mouseleave(function () {hideTooltip();a(this).parent().removeClass("arrowchat_more_button_hover");a("#arrowchat_chatrooms_popup .arrowchat_chatrooms_title").addClass("arrowchat_chatboxtabtitlemouseover3");});}function buildPopoutChatButton() {$popout_chat_button = a("
    ").attr("id", "arrowchat_popoutchatbutton").addClass("arrowchat_bar_right").addClass("arrowchat_bar_button").html("
    ").appendTo($base);$popout_chat_button.mouseover(function () {showTooltip($popout_chat_button, lang[11]);a(this).addClass("arrowchat_tabmouseover");});$popout_chat_button.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});$popout_chat_button.click(function () {a(this).hide();$buddy_list_tab.show();$chatboxes.show();$chatbox_right.show();$chatbox_left.show();if (j != "") {$user_popups[j].show();}a.post(c_ac_path + "includes/json/send/send_settings.php", {popoutchat:"99"}, function () {});loadBuddyList();receiveCore();pushSubscribe();a.idleTimer(60000 * ArrowChat.IdleTime);});}function buildApplicationButtons() {var pold = apps.slice();function mysortfn(a, b) {if (a[13] < b[13]) {return -1;}if (a[13] > b[13]) {return 1;}return 0;}apps.sort(mysortfn);for (b in apps) {if (typeof apps[b][0] != "undefined") {if (apps[b][10] == "" || apps[b][10] == 0) {apps[b][10] = 16;}$application_buttons[apps[b][0]] = a("
    ").attr("id", "arrowchat_applications_button_" + apps[b][0]).addClass("arrowchat_appname_" + apps[b][2]).addClass("arrowchat_bar_left").addClass("arrowchat_apps_button").css("width", apps[b][10] + "px").html(ArrowChat.Templates.applications_bookmarks_tab(c_ac_path, apps, b)).appendTo($base);if ((apps[b][12] == "1" || apps[b][9] != "1" && u_id == "" || u_id != "" && apps[b][9] != "1" && u_is_guest == "1") && c_no_apps_menu != 1) {$application_buttons[apps[b][0]].hide();}if (apps[b][6] == "") {$application_button_popups[apps[b][0]] = a("
    ").attr("id", "arrowchat_applications_button_" + apps[b][0] + "_popup").addClass("arrowchat_apppopup").css("display", "none").html(ArrowChat.Templates.applications_bookmarks_window(c_ac_path, apps, b)).appendTo($body);}}}apps = pold.slice();a(".arrowchat_app_keep_open").addClass("arrowchat_menu_unchecked");a(".arrowchat_app_keep_open :input").attr("checked", false);if (u_apps_open != "" && u_apps_open != "0") {a("#arrowchat_app_keep_open_" + u_apps_open + " :input").attr("checked", true);a("#arrowchat_app_keep_open_" + u_apps_open).removeClass("arrowchat_menu_unchecked");}a(".arrowchat_apps_button").mouseover(function () {var c = a(this).attr("id").substr(30);if ($application_buttons[c].hasClass("arrowchat_trayclick")) {} else {if (apps[c][10] <= 16 || apps[c][10] == "") {showTooltip($application_buttons[c], apps[c][1], true);}}a(this).addClass("arrowchat_tabmouseover");});a(".arrowchat_apps_button").mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});a(".arrowchat_traytitle").click(function () {var e = a(this).parent().attr("id");e = e.substring(30, e.length - 6);if ($application_buttons[e]) {$application_buttons[e].click();}}).children().not(".arrowchat_tab_name").click(function () {return false;});a(".arrowchat_traytitle").each(function (i, element) {a(element).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover");});a(element).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover");});});a(".arrowchat_traytitle .arrowchat_more_button").each(function (i, element) {a(element).mouseenter(function () {showTooltip(a(this), lang[23], 0, 10, 5);a(this).addClass("arrowchat_more_button_hover");a(".arrowchat_traytitle").removeClass("arrowchat_chatboxtabtitlemouseover");});a(element).mouseleave(function () {hideTooltip();a(this).removeClass("arrowchat_more_button_hover");a(".arrowchat_traytitle").addClass("arrowchat_chatboxtabtitlemouseover");});});a(".arrowchat_traytitle .arrowchat_more_anchor").click(function () {hideTooltip();var c = a(this).attr("id").substr(20);a("#arrowchat_apps_more_popout_" + c).toggle();a(this).addClass("arrowchat_more_button_hover");a(this).toggleClass("arrowchat_more_button_selected");});addHover(a(".arrowchat_menu_item"), "arrowchat_more_hover");a(".arrowchat_app_keep_open").click(function () {var c = a(this).attr("id").substr(24);a(".arrowchat_app_keep_open").addClass("arrowchat_menu_unchecked");if (a("#arrowchat_app_keep_open_" + c + " :input").is(":checked")) {a("#arrowchat_app_keep_open_" + c + " :input").attr("checked", false);var keep_open_id = -1;u_apps_open = "";} else {a(".arrowchat_app_keep_open :input").attr("checked", false);a("#arrowchat_app_keep_open_" + c + " :input").attr("checked", true);var keep_open_id = c;u_apps_open = c;a(this).removeClass("arrowchat_menu_unchecked");}a.post(c_ac_path + "includes/json/send/send_settings.php", {app_keep:keep_open_id}, function () {});});a(".arrowchat_apps_button").click(function () {var c = a(this).attr("id").substr(30);closePopup($applications_button_popup, $applications_button);a(this).children(".arrowchat_tabalert").remove();if (apps[c][6] == "") {if (m != c && m !== "") {if (apps[m][7] == 1) {closePopup($application_button_popups[m], $application_buttons[m], 1);} else {closePopup($application_button_popups[m], $application_buttons[m]);}m = "";}if (m == "") {$application_button_popups[c].css("left", $application_buttons[c].offset().left).css("bottom", "25px").css("width", apps[c][4]);$application_button_popups[c].removeClass("arrowchat_tabopen_hidden");$application_button_popups[c].addClass("arrowchat_tabopen");$application_buttons[c].addClass("arrowchat_trayclick");if (apps[c][7] != "1" || apps[c][14] != "1") {a.get(c_ac_path + "applications/" + apps[c][2] + "/index.php", function (d) {a("#arrowchat_applications_button_" + apps[c][0] + "_content").html(d);});}apps[c][14] = 1;m = c;} else {if (apps[m][7] == 1) {closePopup($application_button_popups[m], $application_buttons[m], 1);} else {closePopup($application_button_popups[m], $application_buttons[m]);}var test = a("#arrowchatapplist_" + m).parent().attr("id");if (test == "arrowchat_other_applications") {$application_buttons[m].hide();}m = "";}} else {window.open(apps[c][6], "self");}});}function buildApplicationsButton() {$applications_button = a("
    ").attr("id", "arrowchat_applications_button").addClass("arrowchat_bar_left").addClass("arrowchat_bar_button").html(ArrowChat.Templates.applications_tab()).appendTo($base);$applications_button_popup = a("
    ").attr("id", "arrowchat_applications_button_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.applications_window()).appendTo($body);$applications_button.css("width", c_width_apps + "px");if (c_width_apps <= 25) {a(".arrowchat_tray_name", $applications_button).hide();}var pold = apps.slice();function mysortfn(a, b) {if (a[13] < b[13]) {return -1;}if (a[13] > b[13]) {return 1;}return 0;}apps.sort(mysortfn);_appslist = "
    " + lang[20] + "
      ";for (b in apps) {if (typeof apps[b][0] != "undefined") {if (apps[b][12] != "1") {if (apps[b][9] == "1" && u_id == "" || u_id != "" && u_is_guest == "1" && apps[b][9] == "1" || u_id != "" && u_is_guest != "1") {_appslist += ArrowChat.Templates.applications_bookmarks_list(c_ac_path, apps, b);}}}}_appslist += "
    " + lang[64] + "
      ";for (b in apps) {if (typeof apps[b][0] != "undefined") {if (apps[b][12] == "1") {if (apps[b][9] == "1" && u_id == "" || u_id != "" && u_is_guest == "1" && apps[b][9] == "1" || u_id != "" && u_is_guest != "1") {_appslist += ArrowChat.Templates.applications_bookmarks_list(c_ac_path, apps, b);}}}}_appslist += "
    ";apps = pold.slice();a("#arrowchat_bookmarks").append("
    " + _appslist + "
    ");if (u_id != "") {a("#arrowchat_applications, #arrowchat_other_applications").sortable({delay:50, connectWith:".arrowchat_connectedSortable", scroll:false, axis:"y", containment:".arrowchat_traycontent", update:function () {var result = a("#arrowchat_other_applications").sortable("toArray");var result2 = a(this).sortable("serialize") + "&" + a(this).attr("id") + "=1";a.post(c_ac_path + "includes/json/send/send_settings.php", result2, function () {});for (var b = 0; b < result.length; b++) {var c = result[b].substr(17);$application_buttons[c].hide();apps[c][12] = "1";}var result2 = a("#arrowchat_applications").sortable("toArray");for (var b = 0; b < result2.length; b++) {var d = result2[b].substr(17);$application_buttons[d].show();apps[d][12] = "";}}});} else {a(".arrowchat_apps_subtitle").hide();}a(".arrowchat_app_link:not(.ui-sortable-helper)").on("click", function () {var c = a(this).attr("id").substr(19);if (apps[c][6] == "") {$application_buttons[c].show();closePopup($applications_button_popup, $applications_button);}$application_buttons[c].click();});a(".arrowchat_traytitle", $applications_button_popup).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover");});a(".arrowchat_traytitle", $applications_button_popup).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover");});$applications_button.mouseover(function () {if (c_width_apps <= 25) {if ($applications_button.hasClass("arrowchat_tabclick")) {} else {showTooltip($applications_button, lang[16], true);}}a(this).addClass("arrowchat_tabmouseover");});$applications_button.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");if (c_width_apps <= 25) {hideTooltip();}});a(".arrowchat_traytitle", $applications_button_popup).click(function () {$applications_button.click();});$applications_button.click(function () {lsClick("#arrowchat_applications_button", "ac_openclose");if (c_width_apps <= 25) {hideTooltip();}if (m != "") {$application_buttons[m].click();m = "";}$applications_button_popup.css("left", $applications_button.offset().left).css("bottom", "25px");a(this).toggleClass("arrowchat_tabclick");$applications_button_popup.toggleClass("arrowchat_tabopen");});}function buildModButton() {$modbutton = a("
    ").attr("id", "arrowchat_modbutton").addClass("arrowchat_bar_right").addClass("arrowchat_bar_button").html(ArrowChat.Templates.mod_tab()).appendTo($base);$modbutton_popup = a("
    ").attr("id", "arrowchat_modbutton_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.mod_window()).appendTo($body);$modbutton.mouseover(function () {$modbutton_popup.hasClass("arrowchat_tabopen") || ($ == 0 ? showTooltip($modbutton, lang[166]) : showTooltip($modbutton, lang[166]));a(this).addClass("arrowchat_tabmouseover");});$modbutton.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});$modbutton.click(function () {lsClick("#arrowchat_modbutton", "ac_openclose");if (a("#arrowchat_modbutton .arrowchat_tabalertnf").length) {a("#arrowchat_modbutton .arrowchat_tabalertnf").remove();}closePopup($chatrooms_popup, $chatrooms_button);closePopup($userstab_popup, $buddy_list_tab);closePopup($optionsbutton_popup, $optionsbutton);hideTooltip();$modbutton_popup.css("left", $modbutton.offset().left - $modbutton_popup.outerWidth() + $modbutton.outerWidth()).css("bottom", "25px");a(this).toggleClass("arrowchat_tabclick");$modbutton_popup.toggleClass("arrowchat_tabopen");$modbutton.toggleClass("arrowchat_modimages_click");adjustBarSize();if ($modbutton.hasClass("arrowchat_tabclick")) {loadModerationContent();}});a(".arrowchat_moderation_title", $modbutton_popup).click(function () {$modbutton.click();}).children().not(".arrowchat_tab_name").click(function () {return false;});a(".arrowchat_moderation_title", $modbutton_popup).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover2");});a(".arrowchat_moderation_title", $modbutton_popup).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover2");});if (u_num_mod_reports > 0) {a("
    ").css("top", "-11px").css("left", "8px").addClass("arrowchat_tabalertnf").html(u_num_mod_reports).prependTo($modbutton);}}function loadModerationContent() {a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");a.ajax({url:c_ac_path + "includes/json/receive/receive_moderation.php", cache:false, type:"get", dataType:"json", success:function (b) {buildModerationContent(b);}});}function buildModerationContent(b) {a(".arrowchat_moderation_full_content").html("");a(".arrowchat_reports_subtitle").html("
    " + lang[177] + "
    " + lang[178] + "
    " + lang[179] + "
    ");var c = {}, no_reports = true;b && a.each(b, function (i, e) {if (i == "reports") {a.each(e, function (l, f) {no_reports = false;a("
    ").attr("id", "arrowchat_report_" + f.id).mouseover(function () {a(this).addClass("arrowchat_report_list_hover");}).mouseout(function () {a(this).removeClass("arrowchat_report_list_hover");}).addClass("arrowchat_report_list").html("
    \"\"
    " + f.from + "
    \"\"
    " + f.about + " (" + f.about_num + ")
    " + f.time + "
    ").appendTo(a(".arrowchat_moderation_full_content"));});}if (i == "total_reports") {a(".arrowchat_moderation_title .arrowchat_tab_name").html(lang[166] + " (" + e.count + " " + lang[180] + ")");}});if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) {a(".arrowchat_report_from_image").addClass("arrowchat_hide_avatars");a(".arrowchat_report_about_image").addClass("arrowchat_hide_avatars");a(".arrowchat_report_from_name").css("width", "165px");}if (no_reports) {a("
    ").attr("id", "arrowchat_report_no_reports").html(lang[189]).appendTo(a(".arrowchat_moderation_full_content"));}preventScrolling(a(".arrowchat_moderation_content"));a(".arrowchat_report_list").click(function (l) {reportClicked(a(this));});}function reportClicked(b) {c = "";if (a(b).attr("id")) {c = a(b).attr("id").substr(17);}if (c == "") {c = a(b).parent().attr("id").substr(17);}a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");open_report = c;loadReport(c);}function loadReport(b) {a.ajax({url:c_ac_path + "includes/json/receive/receive_report.php", data:{reportid:b}, type:"post", cache:false, dataType:"json", success:function (o) {if (o) {clearTimeout(Crref2);var no_error = true;o && a.each(o, function (i, e) {if (i == "error") {a.each(e, function (l, f) {no_error = false;open_report = 0;displayMessage("arrowchat_moderation_flyout", f.m, "error");loadModerationContent();});}});if (no_error) {a(".arrowchat_reports_subtitle").html("");a(".arrowchat_moderation_full_content").html(ArrowChat.Templates.mod_report());a(".arrowchat_report_sub_back a").click(function () {loadModerationContent();});a(".arrowchat_report_sub_close a").click(function () {a(".arrowchat_reports_subtitle").html("");a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");a.post(c_ac_path + "includes/json/send/send_settings.php", {report_id:b}, function () {loadModerationContent();});});a(".arrowchat_report_sub_ban a").click(function () {var r = confirm(lang[195]);if (r == true) {a(".arrowchat_reports_subtitle").html("");a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");a.post(c_ac_path + "includes/json/send/send_settings.php", {report_ban:b}, function () {loadModerationContent();});}});a(".arrowchat_report_sub_warn a").click(function () {var reason = prompt(lang[196]);if (reason != null && reason != "") {a.post(c_ac_path + "includes/json/send/send_settings.php", {report_warn:b, report_warn_reason:reason}, function (e) {if (e == 2) {var r = confirm(lang[197]);if (r == true) {a(".arrowchat_reports_subtitle").html("");a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");a.post(c_ac_path + "includes/json/send/send_settings.php", {report_warn:b, report_warn_reason:reason, report_warn_confirm:1}, function () {loadModerationContent();});}} else {a(".arrowchat_reports_subtitle").html("");a(".arrowchat_moderation_full_content").html("
    " + lang[34] + "
    ");loadModerationContent();}});}});$report_history = a("#arrowchat_report_history");$report_list = a("#arrowchat_report_list");preventScrolling(a("#arrowchat_report_list"));var no_additional_reports = true, report_time = 0;o && a.each(o, function (i, e) {if (i == "reports") {a.each(e, function (l, f) {no_additional_reports = false;a("
    ").attr("id", "arrowchat_report_list_id_" + f.id).mouseover(function () {a(this).addClass("arrowchat_report_list_hover");}).mouseout(function () {a(this).removeClass("arrowchat_report_list_hover");}).click(function () {if (f.id != open_report) {a("#arrowchat_report_history_content").html("
    " + lang[34] + "
    ");loadReport(f.id);open_report = f.id;}}).addClass("arrowchat_report_other_list").html("" + lang[187] + f.id + "").appendTo(a("#arrowchat_list_reports"));if (f.id == open_report) {a("#arrowchat_report_list_id_" + f.id).addClass("arrowchat_report_clicked");}});}if (i == "report_info") {a.each(e, function (l, f) {a(".arrowchat_report_info_about").html(lang[190] + "" + f.about_name + "");a(".arrowchat_report_info_from").html(lang[191] + "" + f.from_name + "");a(".arrowchat_report_info_warnings").html(lang[192] + f.previous_warnings);a(".arrowchat_report_info_time").html(lang[193] + f.time);a(".arrowchat_report_info_about a").click(function () {receiveUser(f.about, uc_name[f.about], uc_status[f.about], uc_avatar[f.about], uc_link[f.about]);});a(".arrowchat_report_info_from a").click(function () {receiveUser(f.from, uc_name[f.from], uc_status[f.from], uc_avatar[f.from], uc_link[f.from]);});report_time = f.unix;});}if (i == "report_history") {var d = "", report_here_used = false;a.each(e, function (l, f) {if (typeof blockList[f.userid] == "undefined") {var title = "", important = "";if (f.mod == 1) {title = lang[137];important = " arrowchat_chatroom_important";}if (f.admin == 1) {title = lang[136];important = " arrowchat_chatroom_important";}l = "", repotee = "";fromname = f.n;if (f.reportee == 1) {repotee = " arrowchat_reportee";}var sent_time = new Date(f.t * 1000);if (f.t >= report_time && !report_here_used) {d += "
    " + lang[194] + "
    ";report_here_used = true;}if (f.global == 1) {d += "
    " + formatTimestamp(sent_time) + f.m + "
    ";} else {d += "
    \""
    " + fromname + title + ":
    " + formatTimestamp(sent_time) + "" + f.m + "
    ";}}});if (!report_here_used) {d += "
    " + lang[194] + "
    ";}a("#arrowchat_report_history_content").html(d);showChatroomTime();}});if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) {a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_name").show();}a("#arrowchat_report_history").scrollTop(a("#arrowchat_report_history").scrollTop() + a(".arrowchat_report_here").position().top - a("#arrowchat_report_history").height() / 2 + a(".arrowchat_report_here").height() / 2);a(".arrowchat_image_message img").one("load", function () {a("#arrowchat_report_history").scrollTop(a("#arrowchat_report_history").scrollTop() + a(".arrowchat_report_here").position().top - a("#arrowchat_report_history").height() / 2 + a(".arrowchat_report_here").height() / 2);}).each(function () {if (this.complete) {a(this).load();}});preventScrolling(a("#arrowchat_report_history"));if (no_additional_reports) {a("
    ").attr("id", "arrowchat_report_list_none").addClass("arrowchat_report_other_list").html("" + lang[188] + "").appendTo(a("#arrowchat_list_reports"));}}}}});}function receiveWarning(h) {if (h.read == 0 && h.data != "") {a("#arrowchat_warnings").remove();$body.append(ArrowChat.Templates.warnings_display(h));if (a("#arrowchat_announcement").length) {var nb = parseInt(a(window).height() - a("#arrowchat_announcement").position().top);a("#arrowchat_warnings").css("bottom", nb + 5 + "px");}a("#arrowchat_warnings .arrowchat_warnings_close").click(function () {a("#arrowchat_warnings").remove();if (a("#arrowchat_announcement").length) {a("#arrowchat_announcement").css("bottom", "35px");}a.post(c_ac_path + "includes/json/send/send_settings.php", {warning_read:1}, function () {});});} else {a("#arrowchat_warnings").remove();}}function buildOptionsButton() {$optionsbutton = a("
    ").attr("id", "arrowchat_optionsbutton").addClass("arrowchat_bar_right").addClass("arrowchat_bar_button").html(ArrowChat.Templates.notifications_tab()).appendTo($base);$optionsbutton_popup = a("
    ").attr("id", "arrowchat_optionsbutton_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.notifications_window()).appendTo($body);$optionsbutton.mouseover(function () {$optionsbutton_popup.hasClass("arrowchat_tabopen") || ($ == 0 ? showTooltip($optionsbutton, lang[0]) : showTooltip($optionsbutton, lang[0]));a(this).addClass("arrowchat_tabmouseover");});$optionsbutton.mouseout(function () {a(this).removeClass("arrowchat_tabmouseover");hideTooltip();});a(".arrowchat_see_all_link").mouseenter(function () {showTooltip(a(this), lang[21], 0, 10, 5);a(this).parent().addClass("arrowchat_see_all_button_hover");a("#arrowchat_userstab_popup .arrowchat_userstabtitle").removeClass("arrowchat_chatboxtabtitlemouseover2");});a(".arrowchat_see_all_link").mouseleave(function () {hideTooltip();a(this).parent().removeClass("arrowchat_see_all_button_hover");a("#arrowchat_userstab_popup .arrowchat_userstabtitle").addClass("arrowchat_chatboxtabtitlemouseover2");});a(".arrowchat_see_all_link").click(function () {lsClick(".arrowchat_see_all_link", "ac_click");a("#arrowchat_notifications_content").html("
    ");var i = 0;a.ajax({url:c_ac_path + "includes/json/receive/receive_notifications.php", type:"get", cache:false, dataType:"json", success:function (b) {if (b && b != null) {a("#arrowchat_notifications_content").html("");a.each(b, function (e, l) {a.each(l, function (f, h) {a("
    ").attr("id", "arrowchat_alert_" + h.alert_id).attr("class", "arrowchat_notification_message_div").html(h.markup).appendTo(a("#arrowchat_notifications_content"));i++;});});if (i == 0) {a("#arrowchat_notifications_content").html(lang[9]);}if (a(window).height() - $optionsbutton_popup.height() < 80) {a("#arrowchat_notifications_content").css("height", a(window).height() - 135);} else {a("#arrowchat_notifications_content").css("height", "auto");}adjustBarSize();}}});});$optionsbutton.click(function () {lsClick("#arrowchat_optionsbutton", "ac_openclose");if (a("#arrowchat_notification_alert").length > 0) {a("#arrowchat_notification_alert").remove();$optionsbutton.removeClass("arrowchat_tab_new_message");}closePopup($modbutton_popup, $modbutton);closePopup($chatrooms_popup, $chatrooms_button);if (Q > 0) {a("#arrowchat_optionsbutton .arrowchat_tabalertnf").remove();a.post(c_ac_path + "includes/json/send/send_notifications.php", {userid:u_id}, function () {});Q = 0;}if ($ == 0) {if (w == 1) {w = 0;a("#arrowchat_userstab_text").html(lang[4] + " (" + (R + jabberOnlineNumber) + ")");receiveCore();a(".available", $optionsbutton_popup).click();}hideTooltip();$optionsbutton_popup.css("left", $optionsbutton.offset().left - $optionsbutton_popup.outerWidth() + $optionsbutton.outerWidth()).css("bottom", "25px");a(this).toggleClass("arrowchat_tabclick");$optionsbutton_popup.toggleClass("arrowchat_tabopen");$optionsbutton.toggleClass("arrowchat_optionsimages_click");closePopup($userstab_popup, $buddy_list_tab);} else if (lang[16] != "") {location.href = lang[16];}if (a(window).height() - $optionsbutton_popup.height() < 80) {a("#arrowchat_notifications_content").css("height", a(window).height() - 135);} else {a("#arrowchat_notifications_content").css("height", "auto");}adjustBarSize();});a(".arrowchat_userstabtitle", $optionsbutton_popup).click(function () {$optionsbutton.click();}).children().not(".arrowchat_tab_name").click(function () {return false;});a(".arrowchat_userstabtitle", $optionsbutton_popup).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover2");});a(".arrowchat_userstabtitle", $optionsbutton_popup).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover2");});}function displayMessage(id, message, type) {clearTimeout(message_timeout);if (a("#" + id).is(":visible")) {a("#" + id).hide("slide", {direction:"up"}, 250, function () {a("#" + id + " .arrowchat_message_text").html(message);type == "error" && a(".arrowchat_message_box").css("background-color", "#ffe2e2").css("border-bottom", "1px solid #ffbebe");type == "notice" && a(".arrowchat_message_box").css("background-color", "#fffae2").css("border-bottom", "1px solid #ffecbe");a("#" + id).show("slide", {direction:"up"}, 250);});} else {type == "error" && a(".arrowchat_message_box").css("background-color", "#ffe2e2").css("border-bottom", "1px solid #ffbebe");type == "notice" && a(".arrowchat_message_box").css("background-color", "#fffae2").css("border-bottom", "1px solid #ffecbe");a("#" + id + " .arrowchat_message_text").html(message);a("#" + id).show("slide", {direction:"up"}, 250);}message_timeout = setTimeout(function () {a("#" + id).hide("slide", {direction:"up"}, 250);}, 5000);}function loadChatroom(b, c, pass) {lsClick("#arrowchat_chatroom_" + b, "ac_click");var global_mod = 0, global_admin = 0, admin_markup = "";chatroom_mod = 0;chatroom_admin = 0;chatroomreceived = 1;a.ajax({url:c_ac_path + "includes/json/receive/receive_chatroom_room.php", data:{chatroomid:b, chatroom_window:u_chatroom_open, chatroom_stay:u_chatroom_stay, chatroom_pw:pass}, type:"post", cache:false, dataType:"json", success:function (o) {if (o) {clearTimeout(Crref2);var no_error = true;o && a.each(o, function (i, e) {if (i == "error") {a.each(e, function (l, f) {no_error = false;Ccr = 0;chatroomreceived = 0;loadChatroomList();displayMessage("arrowchat_chatroom_message_flyout", f.m, "error");});}});if (no_error) {setTimeout(function () {receiveChatroom(b);}, 30000);if (c_push_engine != 1) {cancelJSONP();receiveCore();} else {changePushChannel("chatroom" + b, 1);}if (typeof crt2[b] != "undefined") {a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19] + "  (" + crt2[b] + ")");}a("#arrowchat_chatroom_leave").show();a(".arrowchat_chatroom_full_content").html(ArrowChat.Templates.chatrooms_room(c_max_chatroom_msg));$chatroom_chat = a("#arrowchat_chatroom_chat");$chatroom_room_list = a("#arrowchat_chatroom_room_list");if (c_popout_on == 1) {a(".arrowchat_chatroom_popout", $chatrooms_popup).show();}a(".arrowchat_chatroom_popout", $chatrooms_popup).mouseenter(function () {showTooltip(a(this), lang[117], 0, 10, 5);a(this).addClass("arrowchat_chatroom_popout_hover");a(".arrowchat_chatrooms_title", $chatrooms_popup).removeClass("arrowchat_chatboxtabtitlemouseover3");});a(".arrowchat_chatroom_popout", $chatrooms_popup).mouseleave(function () {a(this).removeClass("arrowchat_chatroom_popout_hover");a(".arrowchat_chatrooms_title", $chatrooms_popup).addClass("arrowchat_chatboxtabtitlemouseover3");hideTooltip();});a(".arrowchat_chatroom_popout", $chatrooms_popup).unbind("click");a(".arrowchat_chatroom_popout", $chatrooms_popup).click(function () {a("#arrowchat_chatroom_leave").click();window.open(c_ac_path + "public/chatroom/?id=" + b, "chatroom", "menubar=0,resizable=0,width=700,height=450,top=25,left=25,scrollbars=0,status=0");});a(".arrowchat_chatroom_message_input", $chatrooms_popup).keydown(function (h) {return chatroomKeydown(h, a(this));});a(".arrowchat_chatroom_message_input", $chatrooms_popup).keyup(function (h) {return chatroomKeyup(h, a(this));});var smiley_exist = [];a(".arrowchat_smiley_box", $chatrooms_popup).html("");for (var i = 0; i < Smiley.length; i++) {if (a.inArray(Smiley[i][0], smiley_exist) > -1) {} else {a(".arrowchat_smiley_box", $chatrooms_popup).append("
    \"\"
    ");smiley_exist.push(Smiley[i][0]);}}a(".arrowchat_smiley_button", $chatrooms_popup).mouseenter(function () {a(this).addClass("arrowchat_smiley_button_hover");});a(".arrowchat_smiley_button", $chatrooms_popup).mouseleave(function () {a(this).removeClass("arrowchat_smiley_button_hover");});a(".arrowchat_smiley_wrapper", $chatrooms_popup).click(function () {var smiley_code = a(this).attr("data-id");var existing_text = a(".arrowchat_chatroom_message_input", $chatrooms_popup).val();a(".arrowchat_chatroom_message_input", $chatrooms_popup).focus().val("").val(existing_text + Smiley[smiley_code][1]);});a(".arrowchat_smiley_button", $chatrooms_popup).click(function () {if (a(".arrowchat_smiley_popout", $chatrooms_popup).is(":visible")) {a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").hide();} else {a(".arrowchat_smiley_popout", $chatrooms_popup).children(".arrowchat_more_popout").show();}});chatroomUploadProcessing();if (c_chatroom_transfer != 1) {a("#arrowchat_upload_button", $chatrooms_popup).hide();}preventScrolling(a(".arrowchat_smiley_box"));preventScrolling(a("#arrowchat_chatroom_chat"));preventScrolling(a("#arrowchat_chatroom_room_list"));if (c_disable_smilies == 1) {a(".arrowchat_smiley_button").hide();a(".arrowchat_chatroom_message_input").css("width", "99%");}o && a.each(o, function (i, e) {if (i == "user_title") {a.each(e, function (l, f) {if (f.admin == 1) {global_admin = 1;chatroom_admin = 1;}if (f.mod == 1) {global_mod = 1;chatroom_mod = 1;}});}if (i == "chat_name") {a.each(e, function (l, f) {if (typeof crt2[b] == "undefined") {crt2[b] = f.n;a(".arrowchat_chatrooms_title .arrowchat_tab_name").html(lang[19] + "  (" + crt2[b] + ")");}});}if (i == "chat_users") {var longname, adminCount = 0, modCount = 0, userCount = 0;a.each(e, function (l, f) {if ((global_admin == 1 || global_mod == 1) && f.t == 1) {admin_markup = "
    " + lang[52] + "
    " + lang[161] + "
    " + lang[53] + "
    ";}if (global_admin == 1 && f.t == 2) {admin_markup = "
    " + lang[54] + "
    ";}appendVal = a("#arrowchat_chatroom_list_users");if (f.t == 2) {appendVal = a("#arrowchat_chatroom_list_mods");modCount++;} else if (f.t == 3) {appendVal = a("#arrowchat_chatroom_list_admins");adminCount++;} else {userCount++;}longname = renderHTMLString(f.n);f.n = renderHTMLString(f.n).length > 16 ? renderHTMLString(f.n).substr(0, 16) + "..." : f.n;a("
    ").attr("id", "arrowchat_chatroom_user_" + f.id).mouseover(function () {a(this).addClass("arrowchat_chatroom_list_hover");}).mouseout(function () {a(this).removeClass("arrowchat_chatroom_list_hover");}).addClass("arrowchat_chatroom_room_list").addClass("arrowchat_chatroom_admin_" + f.t).html("" + f.n + "").appendTo(appendVal);var pm_opacity = "";if (f.b == 1 && global_admin != 1 || f.id == u_id) {pm_opacity = " arrowchat_no_private_msg";}a("
    ").attr("id", "arrowchat_chatroom_users_flyout_" + f.id).addClass("arrowchat_more_wrapper_chatroom").html("
    \"\"
    " + longname + "
    " + lang[43] + "

    " + lang[41] + "
    " + lang[84] + "
    " + lang[167] + "
    " + admin_markup + "
    ").appendTo(a("#arrowchat_chatroom_user_" + f.id));if (f.t == 2) {a("#arrowchat_chatroom_title_" + f.id).html("" + longname + "
    " + lang[44]);} else if (f.t == 3) {a("#arrowchat_chatroom_title_" + f.id).html("" + longname + "
    " + lang[45]);}addHover(a(".arrowchat_chatroom_options_padding"), "arrowchat_options_padding_hover");chatroomUserOptions(f, global_admin);});userCount == 0 && a("#arrowchat_chatroom_line_users").hide();adminCount == 0 && a("#arrowchat_chatroom_line_admins").hide();modCount == 0 && a("#arrowchat_chatroom_line_mods").hide();a(".arrowchat_chatroom_admin_3").css("background-color", "#" + c_admin_bg);a(".arrowchat_chatroom_admin_3").css("color", "#" + c_admin_txt);}if (i == "chat_history") {d = "";a.each(e, function (l, f) {if (typeof blockList[f.userid] == "undefined") {var title = "", important = "";if (f.mod == 1) {title = lang[137];important = " arrowchat_chatroom_important";}if (f.admin == 1) {title = lang[136];important = " arrowchat_chatroom_important";}l = "";fromname = f.n;if (f.n == u_name) {l = " arrowchat_self";}var sent_time = new Date(f.t * 1000);if (f.global == 1) {d += "
    " + formatTimestamp(sent_time) + f.m + "
    ";} else {d += "
    \""
    " + fromname + title + ":
    " + formatTimestamp(sent_time) + "" + f.m + "
    ";}}});a("#arrowchat_chatroom_chat #arrowchat_chatroom_chat_content").html(d);showChatroomTime();}if (i == "room_info") {a.each(e, function (l, f) {if (f.welcome_msg != "") {var message = stripslashes(f.welcome_msg);room_info[b] = message;message = replaceURLWithHTMLLinks(message);$chatroom_chat.append("
    " + message + "
    ");}room_desc[b] = f.desc;room_limit_msg[b] = f.limit_msg;room_limit_sec[b] = f.limit_sec;});}});modDeleteControls();if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) {a(".arrowchat_chatroom_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_flyout_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_name").show();}if (a("#arrowchat_chatroom_show_names :input").is(":checked")) {a(".arrowchat_chatroom_message_name").show();}$chatroom_chat.scrollTop(50000);a(".arrowchat_chatroom_message_input").focus();if (global_admin == 1 || global_mod == 1) {if (!a(".arrowchat_chatroom_admin_menu").length || !a(".arrowchat_flood_menu").length) {addChatroomAdminControls();}} else {if ($chatroom_admin_controls.length) {$chatroom_admin_controls.remove();}}a(".arrowchat_image_message img").one("load", function () {$chatroom_chat.scrollTop(50000);}).each(function () {if (this.complete) {a(this).load();}});} else {if (c_user_chatrooms == "1") {$chatroom_create.show();}}}}});}function modDeleteControls() {if (chatroom_mod == 1 || chatroom_admin == 1) {a(".arrowchat_chatroom_delete").show();a(".arrowchat_chatroom_delete", $chatrooms_popup).unbind("mouseenter").unbind("mouseleave").unbind("click");a(".arrowchat_chatroom_delete", $chatrooms_popup).mouseenter(function () {showTooltip(a(this), lang[160], 0, 3, 21);a(this).addClass("arrowchat_chatroom_delete_hover");});a(".arrowchat_chatroom_delete", $chatrooms_popup).mouseleave(function () {hideTooltip();a(this).removeClass("arrowchat_chatroom_delete_hover");});a(".arrowchat_chatroom_delete").click(function () {hideTooltip();var msg_id = a(this).attr("data-id");a("#arrowchat_chatroom_message_" + msg_id + " .arrowchat_chatroom_delete").remove();a.post(c_ac_path + "includes/json/send/send_settings.php", {delete_msg:msg_id, chatroom_id:Ccr, delete_name:u_name}, function () {a("#arrowchat_chatroom_message_" + msg_id + " .arrowchat_chatroom_msg").html(lang[159] + u_name);});});} else {a(".arrowchat_chatroom_delete").hide();}}function chatroomUploadProcessing() {var ts67 = Math.round((new Date).getTime());var path = c_ac_path.replace("", "/");a("#arrowchat_upload_button").uploadify({swf:path + "includes/js/uploadify/uploadify.swf", uploader:path + "includes/classes/class_uploads.php", hideButton:true, buttonText:" ", wmode:"transparent", formData:{unixtime:ts67, user:u_id}, height:25, width:24, multi:false, auto:true, fileTypeExts:"*.jpg;*.gif;*.png;*.zip;*.rar;*.jpeg;*.txt;*.doc;*.mp3;*.wmv;*.avi;*.mp4;*.docx;*.wav", fileTypeDesc:"Supported File Types (.JPG, .JPEG, .GIF, .PNG, .WMV, .AVI, .MP4, .ZIP, .RAR, .MP3, .WAV, .TXT, .DOC, .DOCX)", fileSizeLimit:c_max_upload_size + "MB", onSelect:function () {}, onCancel:function () {}, onUploadComplete:function () {chatroomUploadProcessing();}, onUploadError:function (file, errorCode, errorMsg, errorString) {displayMessage("arrowchat_chatroom_message_flyout", lang[151], "error");}, onUploadSuccess:function (file) {var uploadType = "file", fileType = file.type.toLowerCase();if (fileType == ".png" || fileType == ".gif" || fileType == ".jpg" || fileType == ".jpeg") {uploadType = "image";}a.post(c_ac_path + "includes/json/send/send_message_chatroom.php", {userid:u_id, username:u_name, chatroomid:Ccr, message:uploadType + "{" + ts67 + "}{" + file.name + "}"}, function (e) {if (e == "-1") {displayMessage("arrowchat_chatroom_message_flyout", lang[102], "error");} else {displayMessage("arrowchat_chatroom_message_flyout", lang[68], "notice");}$chatroom_chat.scrollTop(50000);});}});a("#arrowchat_upload_button", $chatrooms_popup).mouseenter(function () {a(this).addClass("arrowchat_upload_button_hover");});a("#arrowchat_upload_button", $chatrooms_popup).mouseleave(function () {a(this).removeClass("arrowchat_upload_button_hover");});}function addChatroomAdminControls() {$chatroom_admin_controls = a("
    ").addClass("arrowchat_chatroom_admin_menu").html("
  • " + lang[157] + "
  • " + lang[153] + "
  • " + lang[171] + "
  • ").appendTo("#arrowchat_chatroom_options_flyout .arrowchat_inner_menu");addHover(a(".arrowchat_menu_item"), "arrowchat_more_hover");a("#arrowchat_edit_welcome").click(function () {var welcome_msg_input = prompt(lang[154], room_info[Ccr]);if (welcome_msg_input || welcome_msg_input == "") {a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_welcome_msg:welcome_msg_input, chatroom_id:Ccr}, function () {displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice");room_info[Ccr] = welcome_msg_input;a(".arrowchat_chatroom_item2").click();});}});a("#arrowchat_edit_description").click(function () {var desc_input = prompt(lang[158], room_desc[Ccr]);if (desc_input || desc_input == "") {a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_description:desc_input, chatroom_id:Ccr}, function () {displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice");room_desc[Ccr] = desc_input;a(".arrowchat_chatroom_item2").click();});}});a("#arrowchat_edit_flood").unbind("click");a("#arrowchat_edit_flood").click(function () {a(this).parent().parent().parent(".arrowchat_inner_menu").hide();a("#arrowchat_flood_select_messages").val(room_limit_msg[Ccr]);a("#arrowchat_flood_select_seconds").val(room_limit_sec[Ccr]);a(".arrowchat_flood_menu").show();});a("#arrowchat_flood_button").unbind("click");a("#arrowchat_flood_button").click(function () {a(".arrowchat_chatroom_item2").click();var flood_message = a("#arrowchat_flood_select_messages").val();var flood_seconds = a("#arrowchat_flood_select_seconds").val();if (!isNaN(flood_message) && !isNaN(flood_seconds)) {a.post(c_ac_path + "includes/json/send/send_settings.php", {chatroom_id:Ccr, flood_message:flood_message, flood_seconds:flood_seconds}, function () {displayMessage("arrowchat_chatroom_message_flyout", lang[155], "notice");room_limit_msg[Ccr] = flood_message;room_limit_sec[Ccr] = flood_seconds;});}});}function receiveUser(b, c, d, e, l, f, h) {if (!(b == null || b == "")) {if ((uc_name[b] == null || uc_name[b] == "") && b.toString().search("facebook") == "-1") {if (aa[b] != 1) {aa[b] = 1;a.ajax({url:c_ac_path + "includes/json/receive/receive_user.php", data:{userid:b}, type:"post", cache:false, dataType:"json", success:function (o) {if (o) {c = uc_name[b] = o.n;d = uc_status[b] = o.s;e = uc_avatar[b] = o.a;l = uc_link[b] = o.l;if (G[b] != null) {a(".arrowchat_closebox_bottom_status", $user[b]).removeClass("arrowchat_available arrowchat_busy arrowchat_offline").addClass("arrowchat_" + d);$users[b].removeClass("arrowchat_tab_offline").addClass("arrowchat_tab_" + c);$user_popups[b].length > 0 && a(".arrowchat_tabsubtitle .arrowchat_message", $user_popups[b]).html(i);}aa[b] = 0;if (c != null) {toggleUserChatTab(b, c, d, e, l, f);} else {a.post(c_ac_path + "includes/json/send/send_settings.php", {unfocus_chat:b}, function () {});}}}});} else {setTimeout(function () {receiveUser(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f, h);}, 500);}} else {if (b.toString().search("facebook") == "-1") {toggleUserChatTab(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f);} else {toggleUserChatTab(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f, 1);}}}}function toggleUserChatTab(b, c, d, e, l, f, jabber) {if (G[b] != null) {if (!$users[b].hasClass("arrowchat_tabclick") && f != 1) {if (j != "") {closePopup($user_popups[j], $users[j]);j = "";}if ($users[b].offset().left < $chatboxes.offset().left + $chatboxes.width() && $users[b].offset().left - $chatboxes.offset().left >= 0) {$users[b].click();} else {a(".arrowchat_tabalert").css("display", "none");e = 800;if (get("initialize") == 1) {e = 0;}$chatboxes.scrollTo($users[b], e, function () {$users[b].click();updateRightLastClasses();positionTabAlerts();});}}updateRightLastClasses();} else {$chatboxes_wide.width($chatboxes_wide.width() + 148);adjustBarSize();shortname = renderHTMLString(c).length > 12 ? renderHTMLString(c).substr(0, 12) + "..." : c;longname = renderHTMLString(c).length > 17 ? renderHTMLString(c).substr(0, 17) + "..." : c;$users[b] = a(ArrowChat.Templates.chat_tab(shortname)).attr("data-id", b).appendTo($chatboxes_wide);$users[b].children(".arrowchat_inner_button").prepend("
    ");$users[b].addClass("arrowchat_tab_" + d);jabber == 1 && $users[b].addClass("arrowchat_jabber_user_tab");$users[b].append("
    ");a(".arrowchat_closebox_bottom", $users[b]).mouseenter(function () {a(this).addClass("arrowchat_closebox_bottomhover");});a(".arrowchat_closebox_bottom", $users[b]).mouseleave(function () {a(this).removeClass("arrowchat_closebox_bottomhover");});a(".arrowchat_closebox_bottom", $users[b]).click(function () {lsClick(".arrowchat_closebox_bottom", "ac_click", "users['" + b + "']");a.post(c_ac_path + "includes/json/send/send_settings.php", {close_chat:b, tab_alert:1}, function () {});$user_popups[b].remove();$users[b].remove();if (j == b) {j = "";}$chatboxes_wide.width($chatboxes_wide.width() - 148);$chatboxes.scrollTo("-=148px");adjustBarSize();y[b] = null;G[b] = null;ca[b] = 0;});i = c = "";if (l != "") {c = "";i = "";}l = "";if (e != "") {l = "
    " + c + "" + i + "
    ";}$user_popups[b] = a(ArrowChat.Templates.chat_window(c, longname, i, l, b)).css("display", "none").appendTo($body);if (c_video_chat != 1) {a("#arrowchat_video_chat_" + b).hide();}if (c_file_transfer != 1) {a("#arrowchat_file_transfer_" + b).hide();}if (c_enable_moderation != 1) {a("#arrowchat_report_" + b).hide();}if (c_popout_on != 1) {a(".arrowchat_chat_popout").hide();}addHover(a(".arrowchat_video_chat"), "arrowchat_more_hover");a("#arrowchat_file_cancel_" + b).click(function () {a("#arrowchat_file_upload_div_" + b).hide("slide", {direction:"up"}, 250);});a("#arrowchat_file_transfer_" + b).click(function () {var ts67 = Math.round((new Date).getTime());var path = c_ac_path.replace("", "/");a("#arrowchat_file_upload_" + b).uploadify({swf:path + "includes/js/uploadify/uploadify.swf", uploader:path + "includes/classes/class_uploads.php", hideButton:true, buttonText:" ", wmode:"transparent", formData:{unixtime:ts67, user:u_id}, height:17, width:42, multi:false, auto:true, fileTypeExts:"*.jpg;*.gif;*.png;*.zip;*.rar;*.jpeg;*.txt;*.doc;*.mp3;*.wmv;*.avi;*.mp4;*.docx;*.wav", fileTypeDesc:"Supported File Types (.JPG, .JPEG, .GIF, .PNG, .WMV, .AVI, .MP4, .ZIP, .RAR, .MP3, .WAV, .TXT, .DOC, .DOCX)", fileSizeLimit:c_max_upload_size + "MB", onSelect:function () {a(".arrowchat_upload_info_text").hide();a(".arrowchat_upload_text").hide();a(".arrowchat_ui_button").css("background", "none");a(".arrowchat_ui_button").css("border", "none");}, onCancel:function () {a("#arrowchat_file_upload_div_" + b).hide("slide", {direction:"up"}, 250);a(".arrowchat_upload_info_text").show();a(".arrowchat_upload_text").show();a(".arrowchat_ui_button").css("background", "#5B74A8");a(".arrowchat_ui_button").css("border", "1px solid #999");}, onUploadError:function (file, errorCode, errorMsg, errorString) {a("#arrowchat_file_upload_div_" + b).hide();a(".arrowchat_upload_info_text").show();a(".arrowchat_upload_text").show();a(".arrowchat_ui_button").css("background", "#5B74A8");a(".arrowchat_ui_button").css("border", "1px solid #999");displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[151], "error");}, onUploadComplete:function (file) {var uploadType = "file", fileType = file.type.toLowerCase();if (fileType == ".png" || fileType == ".gif" || fileType == ".jpg" || fileType == ".jpeg") {uploadType = "image";}a.post(c_ac_path + "includes/json/send/send_message.php", {userid:u_id, to:b, message:uploadType + "{" + ts67 + "}{" + file.name + "}"}, function (e) {if (e == "-1") {displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[102], "error");} else {displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[68], "notice");}a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight);});a("#arrowchat_file_upload_div_" + b).hide();a(".arrowchat_upload_info_text").show();a(".arrowchat_upload_text").show();a(".arrowchat_ui_button").css("background", "#5B74A8");a(".arrowchat_ui_button").css("border", "1px solid #999");}});a("#arrowchat_more_popout_" + b).toggle();a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected");a("#arrowchat_file_upload_div_" + b).show("slide", {direction:"up"}, 250);});if (uc_status[b] == "offline" || uc_status[b] == "busy") {a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).addClass("arrowchat_video_unavailable");} else {a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).removeClass("arrowchat_video_unavailable");}a("#arrowchat_video_chat_" + b).click(function () {if (uc_status[b] != "offline" && uc_status[b] != "busy") {var RN = Math.floor(Math.random() * 9999999999);while (String(RN).length < 10) {RN = "0" + RN;}jqac.arrowchat.videoWith(RN);a.post(c_ac_path + "includes/json/send/send_message.php", {userid:u_id, to:b, message:"video{" + RN + "}"}, function (e) {if (e == "-1") {displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[102], "error");} else {displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[63], "notice");}a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight);});}});preventScrolling(a(".arrowchat_tabcontenttext, .arrowchat_smiley_box"));var smiley_exist = [];for (var i = 0; i < Smiley.length; i++) {if (a.inArray(Smiley[i][0], smiley_exist) > -1) {} else {a(".arrowchat_smiley_box", $user_popups[b]).append("
    \"\"
    ");smiley_exist.push(Smiley[i][0]);}}a(".arrowchat_smiley_button", $user_popups[b]).mouseenter(function () {a(this).addClass("arrowchat_smiley_button_hover");});a(".arrowchat_smiley_button", $user_popups[b]).mouseleave(function () {a(this).removeClass("arrowchat_smiley_button_hover");});a(".arrowchat_smiley_wrapper", $user_popups[b]).click(function () {var smiley_code = a(this).attr("data-id");var existing_text = a(".arrowchat_textarea", $user_popups[b]).val();a(".arrowchat_textarea", $user_popups[b]).focus().val("").val(existing_text + Smiley[smiley_code][1]);});a(".arrowchat_smiley_button", $user_popups[b]).click(function () {if (a(".arrowchat_smiley_popout", $user_popups[b]).is(":visible")) {a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").hide();} else {a(".arrowchat_smiley_popout", $user_popups[b]).children(".arrowchat_more_popout").show();}});if (c_disable_smilies == 1) {a(".arrowchat_smiley_button").hide();a(".arrowchat_textarea").css("width", "99%");}a(".arrowchat_tabtitle .arrowchat_more_button", $user_popups[b]).mouseenter(function () {showTooltip(a(this), lang[23], 0, 10, 5);a(this).addClass("arrowchat_more_button_hover");a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover");});a(".arrowchat_tabtitle .arrowchat_more_button", $user_popups[b]).mouseleave(function () {hideTooltip();a(this).removeClass("arrowchat_more_button_hover");a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover");});a("#arrowchat_more_" + b).click(function () {hideTooltip();a("#arrowchat_more_popout_" + b).toggle();a(this).addClass("arrowchat_more_button_hover");a(this).toggleClass("arrowchat_more_button_selected");});a("#arrowchat_block_" + b).click(function () {a("#arrowchat_more_popout_" + b).toggle();a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected");a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).click();a.post(c_ac_path + "includes/json/send/send_settings.php", {block_chat:b}, function () {if (typeof blockList[b] == "undefined") {blockList[b] = b;}loadBuddyList();});});a("#arrowchat_clear_" + b).click(function () {a("#arrowchat_more_popout_" + b).toggle();a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected");a("#arrowchat_tabcontenttext_" + b).html("");a.post(c_ac_path + "includes/json/send/send_settings.php", {clear_chat:b}, function () {});});a("#arrowchat_report_" + b).click(function () {a("#arrowchat_more_popout_" + b).toggle();a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected");a.post(c_ac_path + "includes/json/send/send_settings.php", {report_from:u_id, report_about:b}, function () {displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[168], "notice");});});a(".arrowchat_textarea", $user_popups[b]).keydown(function (h) {return userchatKeydown(h, a(this), b, jabber);});a(".arrowchat_textarea", $user_popups[b]).keyup(function (h) {return userchatKeyup(h, a(this), b);});a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).mouseenter(function () {showTooltip(a(this), lang[89], 0, 10, 5);a(this).addClass("arrowchat_chatboxmouseoverclose");a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover");});a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).mouseleave(function () {a(this).removeClass("arrowchat_chatboxmouseoverclose");a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover");hideTooltip();});a(".arrowchat_tabtitle .arrowchat_closebox", $user_popups[b]).click(function () {lsClick(".arrowchat_tabtitle .arrowchat_closebox", "ac_click", "user_popups['" + b + "']");hideTooltip();a.post(c_ac_path + "includes/json/send/send_settings.php", {close_chat:b, tab_alert:1}, function () {});$user_popups[b].remove();$users[b].remove();if (j == b) {j = "";}$chatboxes_wide.width($chatboxes_wide.width() - 148);$chatboxes.scrollTo("-=148px");adjustBarSize();G[b] = null;y[b] = null;ca[b] = 0;});a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).mouseenter(function () {if (uc_status[b] == "offline" || uc_status[b] == "busy") {showTooltip(a(this), lang[146], 0, 10, 5);} else {showTooltip(a(this), lang[88], 0, 10, 5);a(this).addClass("arrowchat_video_icon_hover");}a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover");});a(".arrowchat_tabtitle .arrowchat_video_icon", $user_popups[b]).mouseleave(function () {a(this).removeClass("arrowchat_video_icon_hover");a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover");hideTooltip();});a(".arrowchat_more_popout .arrowchat_chat_popout", $user_popups[b]).click(function () {a("#arrowchat_more_popout_" + b).toggle();a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected");startPopoutChat();});a(".arrowchat_more_popout .arrowchat_chat_popout", $user_popups[b]).popupWindow({windowURL:c_ac_path + "public/popout/", height:450, width:700, top:25, left:25});a(".arrowchat_tabtitle", $user_popups[b]).not(".arrowchat_video_icon").click(function () {$users[b].click();}).children().not(".arrowchat_tab_name").click(function () {return false;});a(".arrowchat_tabtitle", $user_popups[b]).mouseenter(function () {a(this).addClass("arrowchat_chatboxtabtitlemouseover");});a(".arrowchat_tabtitle", $user_popups[b]).mouseleave(function () {a(this).removeClass("arrowchat_chatboxtabtitlemouseover");});$users[b].mouseenter(function () {a(this).addClass("arrowchat_tabmouseover");a("div", $users[b]).addClass("arrowchat_tabmouseovertext");});$users[b].mouseleave(function () {a(this).removeClass("arrowchat_tabmouseover");a("div", $users[b]).removeClass("arrowchat_tabmouseovertext");});$users[b].click(function () {lsClick(" ", "ac_openclose", "users['" + b + "']");var tba = 0;if (a(".arrowchat_tabalert", $users[b]).length > 0) {tba = 1;a(".arrowchat_tabalert", $users[b]).remove();$users[b].removeClass("arrowchat_tab_new_message");G[b] = 0;y[b] = 0;}if (a(this).hasClass("arrowchat_tabclick")) {closePopup($user_popups[b], a(this));a(".arrowchat_closebox_bottom", $users[b]).removeClass("arrowchat_closebox_bottom_click");j = "";a.post(c_ac_path + "includes/json/send/send_settings.php", {unfocus_chat:b, tab_alert:1}, function () {});} else {if (j != "") {closePopup($user_popups[j], $users[j]);a(".arrowchat_closebox_bottom", $users[j]).removeClass("arrowchat_closebox_bottom_click");j = "";}if (!($users[b].offset().left < $chatboxes.offset().left + $chatboxes.width() && $users[b].offset().left - $chatboxes.offset().left >= 0)) {$chatboxes.scrollTo($users[b]);updateRightLastClasses();}if (ca[b] != 1) {if (jabber == 1) {getJabberHistory(b);} else {receiveHistory(b);}ca[b] = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {focus_chat:b, tab_alert:tba}, function () {});$user_popups[b].css("left", $users[b].offset().left - $user_popups[b].outerWidth() + $users[b].outerWidth()).css("bottom", "25px");a(this).addClass("arrowchat_tabclick").addClass("arrowchat_usertabclick");$user_popups[b].addClass("arrowchat_tabopen");a(".arrowchat_closebox_bottom", $users[b]).addClass("arrowchat_closebox_bottom_click");j = b;if (W) {$user_popups[j].css("position", "absolute").css("top", parseInt(a(window).height()) - parseInt($user_popups[j].css("bottom")) - parseInt($user_popups[j].height()) + a(window).scrollTop() + "px");}}a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight);getStatus("updatingsession") != 1 && a(".arrowchat_textarea", $user_popups[b]).focus();});f != 1 && $users[b].click();y[b] = 0;G[b] = 0;if (c_disable_avatars == 1) {a(".arrowchat_avatarbox").hide();a("#arrowchat_setting_names_only").parent("li").hide();}if (jabber == 1) {a(".arrowchat_more_button", $user_popups[b]).hide();a(".arrowchat_video_icon", $user_popups[b]).hide();a(".arrowchat_user_status", $user_popups[b]).show();}}}function formatTimestamp(b) {var c = "am", d = b.getHours(), i = b.getMinutes(), e = b.getDate();b = b.getMonth();var g = d;if (d > 11) {c = "pm";}if (d > 12) {d -= 12;}if (d == 0) {d = 12;}if (d < 10) {d = d;}if (i < 10) {i = "0" + i;}var l = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], f = "th";if (e == 1 || e == 21 || e == 31) {f = "st";} else if (e == 2 || e == 22) {f = "nd";} else if (e == 3 || e == 23) {f = "rd";}if (c_us_time != 1) {return e != Na ? "" + g + ":" + i + " " + e + f + " " + l[b] + "" : "" + g + ":" + i + "";} else {return e != Na ? "" + d + ":" + i + c + " " + e + f + " " + l[b] + "" : "" + d + ":" + i + c + "";}}function receiveHistory(b, times) {if (times) {} else {times = 1;}if (times > 1) {a("
    \"Loading\"
    ").prependTo(a("#arrowchat_tabcontenttext_" + b));}a.ajax({cache:false, url:c_ac_path + "includes/json/receive/receive_history.php", data:{chatbox:b, history:times}, type:"post", dataType:"json", success:function (c) {a(".arrowchat_message_history_loading").remove();history_ids[b] = 0;numMessages = 0;if (c) {if (times == 1) {a(".arrowchat_tabcontenttext", $user_popups[b]).html("");}last_sent[b] = null;var d = "", i = uc_name[b], init = false;a.each(c, function (e, l) {e == "messages" && a.each(l, function (f, h) {numMessages++;f = "";if (h.self == 1) {fromname = u_name;fromid = u_id;f = " arrowchat_self";_aa5 = _aa4 = "";avatar = u_avatar;tooltip = lang[90];} else {fromname = i;fromid = b;_aa4 = "";_aa5 = "";avatar = uc_avatar[h.from];tooltip = fromname;}var full_name = fromid;var o = new Date(h.sent * 1000);if (c_show_full_name != "1") {if (fromname.indexOf(" ") != -1) {fromname = fromname.slice(0, fromname.indexOf(" "));}}d += "
    " + formatTimestamp(o) + "
    " + fromname + "
    \""
    " + h.message + "
    ";last_sent[h.from] = h.sent;last_name[h.from] = full_name;init = true;last_id[h.from] = h.id;});});var current_top_element = a("#arrowchat_tabcontenttext_" + b).children().children().first();if (times > 1) {a(d).prependTo(a("#arrowchat_tabcontenttext_" + b).children("div"));} else {a("#arrowchat_tabcontenttext_" + b).html("
    " + d + "
    ");}showTimeAndTooltip();if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) {setAvatarVisibility(1);}var previous_height = 0;current_top_element.prevAll().each(function () {previous_height += a(this).outerHeight();});if (times == 1) {a("#arrowchat_tabcontenttext_" + b).scrollTop(50000);} else {a("#arrowchat_tabcontenttext_" + b).scrollTop(previous_height);}a("#arrowchat_tabcontenttext_" + b).scroll(function () {if (a("#arrowchat_tabcontenttext_" + b).scrollTop() < 50 && history_ids[b] != 1) {history_ids[b] = 1;if (numMessages == 20) {times++;receiveHistory(b, times);}}});a(".arrowchat_image_message img").one("load", function () {a("#arrowchat_tabcontenttext_" + b).scrollTop(50000);}).each(function () {if (this.complete) {a(this).load();}});}}});}function showTimeAndTooltip() {a(".arrowchat_chatbox_avatar").mouseenter(function () {showTooltip(a(this), a(this).attr("alt"), false, 55, -38, 1);});a(".arrowchat_chatbox_avatar").mouseleave(function () {hideTooltip();});a(".arrowchat_chatboxmessage").mouseenter(function () {a(this).children(".arrowchat_ts").show();});a(".arrowchat_chatboxmessage").mouseleave(function () {a(this).children(".arrowchat_ts").hide();});a(".arrowchat_lightbox").click(function () {a.slimbox(a(this).attr("data-id"), "", {resizeDuration:1, overlayFadeDuration:1, imageFadeDuration:1, captionAnimationDuration:1});});}function showChatroomTime() {a(".arrowchat_chatroom_message_avatar").mouseenter(function () {showTooltip(a(this), a(this).attr("alt"), false, 50, -28, 1);});a(".arrowchat_chatroom_message_avatar").mouseleave(function () {hideTooltip();});a(".arrowchat_chatroom_box_message").mouseenter(function () {if (a(".arrowchat_chatroom_message_name").is(":visible")) {a(this).children(".arrowchat_chatroom_message_content").children(".arrowchat_ts").addClass("arrowchat_ts_name_fix");}a(this).children(".arrowchat_chatroom_message_content").children(".arrowchat_ts").show();});a(".arrowchat_chatroom_box_message").mouseleave(function () {a(this).children(".arrowchat_chatroom_message_content").children(".arrowchat_ts").removeClass("arrowchat_ts_name_fix");a(this).children(".arrowchat_chatroom_message_content").children(".arrowchat_ts").hide();});a(".arrowchat_lightbox").click(function () {a.slimbox(a(this).attr("data-id"), "", {resizeDuration:1, overlayFadeDuration:1, imageFadeDuration:1, captionAnimationDuration:1});});}function notifyNewMessage(b, c, d) {if (uc_name[b] == null || uc_name[b] == "") {setTimeout(function () {notifyNewMessage(b, c, d);}, 500);} else {receiveUser(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], 1);if (d == 1) {if (a(".arrowchat_tabalert", $users[b]).length > 0) {c = parseInt(a(".arrowchat_tabalert", $users[b]).html()) + parseInt(c);}}if (c == 0) {$users[b].removeClass("arrowchat_tab_new_message");a(".arrowchat_tabalert", $users[b]).remove();} else {if (a(".arrowchat_tabalert", $users[b]).length > 0) {a(".arrowchat_tabalert", $users[b]).html(c);if (bounce3 == 1) {bounce3 = 0;a(".arrowchat_tabalert", $users[b]).stop(true, true).effect("bounce", {times:3, distance:5}, 200, function () {bounce3 = 1;});}} else {a("
    ").css("top", "-11px").css("left", "112px").addClass("arrowchat_tabalert").html(c).appendTo($users[b]);}$users[b].removeClass("arrowchat_tab_new_message").addClass("arrowchat_tab_new_message");}y[b] = c;positionTabAlerts();}}function setAvatarVisibility(b) {if (b == 1) {a(".arrowchat_userlist_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_flyout_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_avatar").addClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_name").show();a(".arrowchat_chatbox_avatar").hide();a(".arrowchat_disable_avatars_name").show();a(".arrowchat_chatboxmessage_wrapper").addClass("arrowchat_chatboxmessage_wrapper2");a(".arrowchat_chatboxmessagecontent").addClass("arrowchat_chatboxmessagecontent2");} else {a(".arrowchat_userlist_avatar").removeClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_avatar").removeClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_flyout_avatar").removeClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_avatar").removeClass("arrowchat_hide_avatars");a(".arrowchat_chatroom_message_name").hide();a(".arrowchat_chatbox_avatar").show();a(".arrowchat_disable_avatars_name").hide();a(".arrowchat_chatboxmessage_wrapper").removeClass("arrowchat_chatboxmessage_wrapper2");a(".arrowchat_chatboxmessagecontent").removeClass("arrowchat_chatboxmessagecontent2");}}function buildBuddyListTab() {var d = "";$buddy_list_tab = a("
    ").attr("id", "arrowchat_buddy_list_tab").addClass("arrowchat_bar_button").addClass("arrowchat_bar_right").html(ArrowChat.Templates.buddylist_tab()).appendTo($base);$userstab_popup = a("
    ").attr("id", "arrowchat_userstab_popup").addClass("arrowchat_tabpopup").css("display", "none").html(ArrowChat.Templates.buddylist_window(d, _ts, acp)).appendTo($body);a(".arrowchat_facebook_connect").append("\"Connect" + lang[140] + "").mouseover(function () {a(this).addClass("arrowchat_facebook_connect_hover");}).mouseout(function () {a(this).removeClass("arrowchat_facebook_connect_hover");});a(".arrowchat_facebook_connect").click(function () {arrowchatdoLogin();return false;});if (c_disable_avatars == 1) {a("#arrowchat_name_box").hide();a("#arrowchat_setting_names_only").parent("li").hide();}$buddy_list_tab.css("width", c_width_blist + "px");if (c_width_blist <= 25) {a("#arrowchat_userstab_text").hide();}if (c_theme_change != 1) {a(".arrowchat_theme_button").hide();}a(".arrowchat_powered_by").css("display", "none");a(".arrowchat_search_friends_text").placeholder();if (u_sounds == 1) {a("#arrowchat_setting_sound :input").attr("checked", true);} else {a("#arrowchat_setting_sound").addClass("arrowchat_menu_unchecked");a("#arrowchat_setting_sound :input").attr("checked", false);}if (u_blist_open == 1) {a("#arrowchat_setting_window_open :input").attr("checked", true);} else {a("#arrowchat_setting_window_open").addClass("arrowchat_menu_unchecked");a("#arrowchat_setting_window_open :input").attr("checked", false);}if (u_no_avatars == 1) {a("#arrowchat_setting_names_only :input").attr("checked", true);} else {a("#arrowchat_setting_names_only").addClass("arrowchat_menu_unchecked");a("#arrowchat_setting_names_only :input").attr("checked", false);}u_is_guest == 1 && c_guest_name_change == 1 && u_guest_name == "" && a(".arrowchat_enter_name_wrapper").show();a("#arrowchat_guest_name_input").placeholder();a("#arrowchat_guest_name_input").keydown(function (h) {if (h.keyCode == 13) {a.post(c_ac_path + "includes/json/send/send_settings.php", {chat_name:a(this).val()}, function (data) {if (data != "1") {displayMessage("arrowchat_buddylist_message_flyout", data, "error");} else {a(".arrowchat_enter_name_wrapper").slideUp("fast");u_name = a(this).val();}});}});a(".arrowchat_search_friends_text").keyup(function () {a(".arrowchat_search_not_found").remove();var i = 1, e = true, l = "", f = a(this).val();if (f == "") {a(".arrowchat_userlist").each(function () {l = a(this).attr("id").substr(19);a("#arrowchat_userlist_" + l).removeClass("arrowchat_userlist_hover2").show();a("#arrowchat_userlist_" + l + " > span.arrowchat_userscontentname:icontains('" + f + "')").removeHighlight();});e = false;} else {a(".arrowchat_userlist").each(function () {l = a(this).attr("id").substr(19);if (a("#arrowchat_userlist_" + l + " > span.arrowchat_userscontentname:icontains('" + f + "')").length > 0) {a("#arrowchat_userlist_" + l).removeClass("arrowchat_userlist_hover2").show();i == 1 && a("#arrowchat_userlist_" + l).addClass("arrowchat_userlist_hover2");a("#arrowchat_userlist_" + l + " > span.arrowchat_userscontentname:icontains('" + f + "')").removeHighlight();a("#arrowchat_userlist_" + l + " > span.arrowchat_userscontentname:icontains('" + f + "')").highlight(f);e = false;i++;} else {a("#arrowchat_userlist_" + l).hide();}});}e && a("
    ").attr("class", "arrowchat_search_not_found arrowchat_nofriends").html(lang[26]).prependTo("#arrowchat_userscontent");});a(document).bind("idle.idleTimer", function () {if (w != 1) {clearUserStatus();a("#arrowchat_userstab_icon").addClass("arrowchat_user_away2");setUserStatus("away");isAway = 1;}});a(document).bind("active.idleTimer", function () {if (w != 1) {clearUserStatus();setUserStatus("available");a("#arrowchat_userstab_icon").addClass("arrowchat_user_available2");isAway = 0;}});a.idleTimer(60000 * ArrowChat.IdleTime);a("#arrowchat_theme_button").click(function () {a("#arrowchat_theme_flyout").toggleClass("arrowchat_theme_flyout_display");a(".arrowchat_theme_link").addClass("arrowchat_theme_button_hover");a(".arrowchat_theme_link").toggleClass("arrowchat_more_button_selected");var theme_switch = a(".arrowchat_themeswitcher").val();a.post(c_ac_path + "includes/json/send/send_settings.php", {theme:theme_switch}, function (theme) {a("#arrowchat_css").attr({href:c_ac_path + "external.php?type=css&t=" + theme_switch});window.location.reload();});});a("#arrowchat_setting_sound").click(function () {lsClick("#arrowchat_setting_sound", "ac_click");a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_setting_sound :input").is(":checked")) {a("#arrowchat_setting_sound :input").attr("checked", false);_soundcheck = -1;u_sounds = 0;} else {a("#arrowchat_setting_sound :input").attr("checked", true);_soundcheck = 1;u_sounds = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {sound:_soundcheck}, function () {});});a("#arrowchat_setting_window_open").click(function () {a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_setting_window_open :input").is(":checked")) {a("#arrowchat_setting_window_open :input").attr("checked", false);_windowcheck = -1;} else {a("#arrowchat_setting_window_open :input").attr("checked", true);_windowcheck = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {window:_windowcheck}, function () {});});a("#arrowchat_setting_names_only").click(function () {lsClick("#arrowchat_setting_names_only", "ac_click");a(this).toggleClass("arrowchat_menu_unchecked");if (a("#arrowchat_setting_names_only :input").is(":checked")) {a("#arrowchat_setting_names_only :input").attr("checked", false);setAvatarVisibility(0);_namecheck = -1;} else {a("#arrowchat_setting_names_only :input").attr("checked", true);setAvatarVisibility(1);_namecheck = 1;}a.post(c_ac_path + "includes/json/send/send_settings.php", {name:_namecheck}, function () {});});a("#arrowchat_setting_block_list").click(function () {a(this).parent().parent(".arrowchat_inner_menu").hide();a(".arrowchat_block_menu").show();a.ajax({url:c_ac_path + "includes/json/receive/receive_block_list.php", type:"get", cache:false, dataType:"json", success:function (b) {if (b && b != null) {a(".arrowchat_block_menu select").html("");a("