if(typeof(jqac) === 'undefined') { jqac = jQuery; } if (c_push_engine == "1") { jqac("
").attr("pub-key", c_push_publish).attr("sub-key", c_push_subscribe).attr("ssl", "off").attr("origin", "www.arrowpushengine.com").attr("id", "pubnub").appendTo(jqac('body')); } /** * Placeholder Plugin @version 1.0.1 **/ 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); } /** * Highlight Plugin */ 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); } /** * jQuery idleTimer plugin version 0.8.092209 * http://github.com/paulirish/yui-misc/tree/ */ 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);$(document).unbind('.idleTimer');},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); } /** * Pop Out Window Plugin */ 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); } /** * SWFObject v2.2 * is released under the MIT License */ if(!jqac.swfobject) { var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
');swfobject.embedSWF(f.uploader,f.id+"Uploader",f.width,f.height,"9.0.24",f.expressInstall,g,{quality:"high",wmode:f.wmode,allowScriptAccess:f.scriptAccess},{},function(i){if(typeof(f.onSWFReady)=="function"&&i.success){f.onSWFReady()}});if(f.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('
')}else{a("#"+f.queueID).addClass("uploadifyQueue")}}if(typeof(f.onOpen)=="function"){a(this).bind("uploadifyOpen",f.onOpen)}a(this).bind("uploadifySelect",{action:f.onSelect,queueID:f.queueID},function(k,i,j){if(k.data.action(k,i,j)!==false){var l=Math.round(j.size/1024*100)*0.01;var m="KB";if(l>1000){l=Math.round(l*0.001*100)*0.01;m="MB"}var n=l.toString().split(".");if(n.length>1){l=n[0]+"."+n[1].substr(0,2)}else{l=n[0]}if(j.name.length>20){fileName=j.name.substr(0,20)+"..."}else{fileName=j.name}queue="#"+a(this).attr("id")+"Queue";if(k.data.queueID){queue="#"+k.data.queueID}a(queue).append('
'+fileName+" ("+l+m+')
')}});a(this).bind("uploadifySelectOnce",{action:f.onSelectOnce},function(i,j){i.data.action(i,j);if(f.auto){if(f.checkScript){a(this).uploadifyUpload(null,false)}else{a(this).uploadifyUpload(null,true)}}});a(this).bind("uploadifyQueueFull",{action:f.onQueueFull},function(i,j){if(i.data.action(i,j)!==false){alert("The queue is full. The max size is "+j+".")}});a(this).bind("uploadifyCheckExist",{action:f.onCheck},function(n,m,l,k,p){var j=new Object();j=l;j.folder=(k.substr(0,1)=="/")?k:e+k;if(p){for(var i in l){var o=i}}a.post(m,j,function(s){for(var q in s){if(n.data.action(n,s,q)!==false){var r=confirm("Do you want to replace the file "+s[q]+"?");if(!r){document.getElementById(a(n.target).attr("id")+"Uploader").cancelFileUpload(q,true,true)}}}if(p){document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(o,true)}else{document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:f.onCancel},function(n,j,m,o,i,l){if(n.data.action(n,j,m,o,l)!==false){if(i){var k=(l==true)?0:250;a("#"+a(this).attr("id")+j).fadeOut(k,function(){a(this).remove()})}}});a(this).bind("uploadifyClearQueue",{action:f.onClearQueue},function(k,j){var i=(f.queueID)?f.queueID:a(this).attr("id")+"Queue";if(j){a("#"+i).find(".uploadifyQueueItem").remove()}if(k.data.action(k,j)!==false){a("#"+i).find(".uploadifyQueueItem").each(function(){var l=a(".uploadifyQueueItem").index(this);a(this).delay(l*100).fadeOut(250,function(){a(this).remove()})})}});var c=[];a(this).bind("uploadifyError",{action:f.onError},function(m,i,l,k){if(m.data.action(m,i,l,k)!==false){var j=new Array(i,l,k);c.push(j);a("#"+a(this).attr("id")+i).find(".percentage").text(" - "+k.type+" Error");a("#"+a(this).attr("id")+i).find(".uploadifyProgress").hide();a("#"+a(this).attr("id")+i).addClass("uploadifyError")}});if(typeof(f.onUpload)=="function"){a(this).bind("uploadifyUpload",f.onUpload)}a(this).bind("uploadifyProgress",{action:f.onProgress,toDisplay:f.displayData},function(k,i,j,l){if(k.data.action(k,i,j,l)!==false){a("#"+a(this).attr("id")+i+"ProgressBar").animate({width:l.percentage+"%"},250,function(){if(l.percentage==100){a(this).closest(".uploadifyProgress").fadeOut(250,function(){a(this).remove()})}});if(k.data.toDisplay=="percentage"){displayData=" - "+l.percentage+"%"}if(k.data.toDisplay=="speed"){displayData=" - "+l.speed+"KB/s"}if(k.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+i).find(".percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:f.onComplete},function(l,i,k,j,m){if(l.data.action(l,i,k,unescape(j),m)!==false){a("#"+a(this).attr("id")+i).find(".percentage").text(" - Completed");if(f.removeCompleted){a("#"+a(l.target).attr("id")+i).fadeOut(250,function(){a(this).remove()})}a("#"+a(l.target).attr("id")+i).addClass("completed")}});if(typeof(f.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:f.onAllComplete},function(i,j){if(i.data.action(i,j)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(a(this).data("settings").scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+i[k]}j=escape(l.substr(1))}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;dk()?(clearTimeout(s),s=setTimeout(d,b)):(c=k(),a())}var s,c=0;return d} function p(a){return document.getElementById(a)}function g(a){console.log(a)}function m(a,b){var d=[];c(a.split(/\s+/),function(a){c((b||document).getElementsByTagName(a),function(a){d.push(a)})});return d}function c(a,b){if(a&&b)if("undefined"!=typeof a[0])for(var d=0,s=a.length;d"-_.!~*'()".indexOf(a)?a:"%"+a.charCodeAt(0).toString(16).toUpperCase()}).join("")}function u(a){function b(a,b){f||(f=1,a||i(b),d.onerror=null,clearTimeout(g),setTimeout(function(){a&&h();var b=p(e),d=b&&b.parentNode;d&&d.removeChild(b)},x))}if(E||q())return P(a); var d=l("script"),c=a.c,e=t(),f=0,g=setTimeout(function(){b(1)},F),h=a.a||r(),i=a.b||r();window[c]=function(a){b(0,a)};d[J]=J;d.onerror=function(){b(1)};d.src=a.url.join(K);n(d,"id",e);o().appendChild(d);return b}function P(a){function b(a){e||(e=1,clearTimeout(g),c&&(c.onerror=c.onload=null,c.abort&&c.abort(),c=null),a&&h())}function d(){if(!f){f=1;clearTimeout(g);try{response=JSON.parse(c.responseText)}catch(a){return b(1)}i(response)}}var c,e=0,f=0,g=setTimeout(function(){b(1)},F),h=a.a||r(),i= a.b||r();try{c=q()||window.XDomainRequest&&new XDomainRequest||new XMLHttpRequest,c.onerror=c.onabort=function(){b(1)},c.onload=c.onloadend=d,c.timeout=F,c.open("GET",a.url.join(K),!0),c.send()}catch(k){return b(0),E=0,u(a)}return b}function D(){PUBNUB.time(k);PUBNUB.time(function(){setTimeout(function(){C||(C=1,c(I,function(a){a[2].subscribe(a[0],a[1])}))},x)})}function q(){if(!L.get)return 0;var a={id:q.id++,send:r(),abort:function(){a.id={}},open:function(b,c){q[a.id]=a;L.get(a.id,c)}};return a} window.console||(window.console=window.console||{});console.log||(console.log=(window.opera||{}).postError||r());var B=function(){var a=window.localStorage;return{get:function(b){try{return a?a.getItem(b):-1==document.cookie.indexOf(b)?null:((document.cookie||"").match(RegExp(b+"=([^;]+)"))||[])[1]||null}catch(c){}},set:function(b,c){try{if(a)return a.setItem(b,c)&&0;document.cookie=b+"="+c+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(e){}}}}(),N=1,O=/{([\w\-]+)}/g,J="async",K="/",F=14E4, x=1E3,E=-1==navigator.userAgent.indexOf("MSIE 6"),M=function(){var a=Math.floor(9*Math.random())+1;return function(b){return 0++a?a:a=1))||b}}(),y={list:{},unbind:function(a){y.list[a]=[]},bind:function(a,b){(y.list[a]=y.list[a]||[]).push(b)},fire:function(a,b){c(y.list[a]||[],function(a){a(b)})}},v=p("pubnub")||{},C=0,I=[];PUBNUB=w({publish_key:n(v,"pub-key"),subscribe_key:n(v,"sub-key"),ssl:"on"==n(v,"ssl"),origin:n(v,"origin")});H(v,{position:"absolute", top:-x});if("opera"in window||n(v,"flash"))v.innerHTML="";var L=p("pubnubs")||{};h("load",window,function(){setTimeout(D,0)});PUBNUB.rdx=function(a,b){if(!b)return q[a].onerror();q[a].responseText=unescape(b);q[a].onload()};q.id=x;window.jqac&&(window.jqac.PUBNUB=PUBNUB);"undefined"!==typeof module&& (module.f=PUBNUB)&&D()}(); })(); } //**********Templates********** var ArrowChat = {}; ArrowChat.Templates = { bar_hide_tab : function () { return '
'; }, bar_show_tab : function () { return '
'; }, applications_bookmarks_tab : function (k,apps,b) { return '
' + apps[b][11] + '
'; }, applications_bookmarks_window : function (k,apps,b) { return '
'+apps[b][1]+'
'; }, applications_bookmarks_list : function (k,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]+'
    '; }, chat_tab : function (shortname) { return '
    '+shortname+'
    '; }, chat_window : function (c, longname, i, l, b) { return '
    '+c+longname+i+'
    '+lang[60]+'
    '+lang[66]+'
    '+lang[24]+'

    '+lang[84]+'
    '+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 () { return '
    '; }, announcements_display : function (h) { return '
    '+h.data+'
    '; }, chatrooms_tab : function () { return '
    ' + lang[19] + '
    '; }, chatrooms_window : function () { return '
    '+lang[31]+'
    '+lang[91]+'
    '+lang[100]+'
    '+lang[50]+'
    '+lang[49]+'
    '; }, chatrooms_room : function () { return '
    '; } }; ArrowChat.IdleTime = 3; // **********Main Script Start********** // http://www.arrowchat.com (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 $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; function addHover($elements, classes) { $elements.each(function (i, element) { a(element).hover(function () { a(this).addClass(classes); }, function () { a(this).removeClass(classes); }); }); } 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 - 1 - 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 - 1 - custom_top, left: target_offset.left + target_width - tooltip_width + 18 - custom_left, display: "block", 'background-position': tooltip_width - 128 + "px -60px" }).removeClass("arrowchat_tooltip_left"); } else { $tooltip.css({ top: target_offset.top - a(window).scrollTop() - target_height - 1 - custom_top, left: target_offset.left + target_width - tooltip_width + 18 - custom_left, display: "block", 'background-position': tooltip_width - 23 + "px -118px" }).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"); } function smileyreplace(mess) { for (i = 0; i < Smiley.length; i++) { check_emoticon = mess.lastIndexOf(Smiley[i][1]); if (check_emoticon != -1) { mess = mess.replace(Smiley[i][1], "\"\""); } } return mess; } function chatroomKeydown(key, $element) { if (key.keyCode == 13 && key.shiftKey == 0) { if (msgcount == 0) { setTimeout(function () { msgcount = 0; }, 15000); } msgcount++; if (msgcount > 4) { displayMessage("arrowchat_chatroom_message_flyout", lang[51], "error"); } else { 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.post(k + "includes/json/send/send_message_chatroom.php", { userid: u_id, username: u_name, chatroomid: Ccr, message: i }, function (e) { if (e) { addMessageToChatroom(e, u_name, i); $chatroom_chat.scrollTop($chatroom_chat[0].scrollHeight); } }); return false; } } } function userchatKeydown(key, $element, typing) { clearTimeout(pa); pa = setTimeout(function () { a.post(k + "includes/json/send/send_typing.php", { userid: u_id, typing: typing, untype: 1 }, function () {}); fa = -1; }, 5000); if (fa != typing) { a.post(k + "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(); i != "" && a.post(k + "includes/json/send/send_message.php", { userid: u_id, to: typing, message: i }, function (e) { 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(k + "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); a("#arrowchat_userstab_text").html(lang[7]); } function buildMaintenance() { $maintenance = a(ArrowChat.Templates.maintenance_tab()).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 () { a.post(k + "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() { a.post(k + "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(k + "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"); 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_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 () { 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); $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(); }); 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(k + "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(k + "includes/json/send/send_settings.php", { chatroom_window: _chatroomwindow }, function () {}); }); a("#arrowchat_chatroom_block").click(function () { 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(k + "includes/json/send/send_settings.php", { chatroom_block_chats: _chatroomblock }, function () {}); }); a("#arrowchat_chatroom_sound").click(function () { 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(k + "includes/json/send/send_settings.php", { chatroom_sound: _chatroomsound }, 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 () { 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(); 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 () { 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(k + "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(k, 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") { $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(k, 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(k + "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][12] != "1") { a.get(k + "applications/" + apps[c][2] + "/index.php", function (d) { a("#arrowchat_applications_button_" + apps[c][0] + "_content").html(d); }); } apps[c][12] = 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(k, 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(k, 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(k + "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)").live("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 () { 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 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 () { a("#arrowchat_notifications_content").html(lang[25]); var i = 0; a.ajax({ url: k + "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).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"); } } } }); }); $optionsbutton.click(function () { if (a("#arrowchat_notification_alert").length > 0) { a("#arrowchat_notification_alert").remove(); $optionsbutton.removeClass("arrowchat_tab_new_message"); } closePopup($chatrooms_popup, $chatrooms_button); if (Q > 0) { a("#arrowchat_optionsbutton .arrowchat_tabalertnf").remove(); a.post(k + "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 + ")"); 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"); } }); 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) { var global_mod = 0, global_admin = 0, admin_markup = ""; chatroomreceived = 1; a.ajax({ url: k + "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()); $chatroom_chat = a("#arrowchat_chatroom_chat"); $chatroom_room_list = a("#arrowchat_chatroom_room_list"); 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)); }); o && a.each(o, function (i, e) { if (i == "user_title") { a.each(e, function (l, f) { if (f.admin == 1) { global_admin = 1; } if (f.mod == 1) { global_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; a.each(e, function (l, f) { if ((global_admin == 1 || global_mod == 1) && f.t == 1) { admin_markup = "
    " + lang[52] + "
    " + lang[53] + "
    "; } if (global_admin == 1 && f.t == 2) { admin_markup = "
    " + lang[54] + "
    "; } longname = f.n; f.n = f.n.length > 16 ? 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").html("" + f.n + "").appendTo($chatroom_room_list); a("
    ").attr("id", "arrowchat_chatroom_users_flyout_" + f.id).addClass("arrowchat_chatroom_users_flyout").html("
    " + longname + "
    " + lang[43] + "

    " + lang[42] + "
    " + lang[41] + "
    " + lang[84] + "
    " + 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); }); } if (i == "chat_history") { d = ""; a.each(e, function (l, f) { if (typeof blockList[f.userid] == "undefined") { 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 + ":
    " + formatTimestamp(sent_time) + f.m + "
    "; } } }); $chatroom_chat.html("
    " + d + "
    "); showChatroomTime(); $chatroom_chat.scrollTop(50000); } }); 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_message_input").focus(); } else { if (c_user_chatrooms == "1") { $chatroom_create.show(); } } } } }); } function receiveUser(b, c, d, e, l, f, h) { if (!(b == null || b == "")) { if (uc_name[b] == null || uc_name[b] == "") { if (aa[b] != 1) { aa[b] = 1; a.ajax({ url: k + "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); if (c_mobile_device) { mobileSupport(); } } else { a.post(k + "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 { toggleUserChatTab(b, uc_name[b], uc_status[b], uc_avatar[b], uc_link[b], f); } } } function toggleUserChatTab(b, c, d, e, l, f) { 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 = c.length > 12 ? c.substr(0, 12) + "..." : c; longname = c.length > 19 ? c.substr(0, 19) + "..." : c; $users[b] = a(ArrowChat.Templates.chat_tab(shortname)).attr("data-id", b).appendTo($chatboxes_wide); $users[b].append("
    "); $users[b].addClass("arrowchat_tab_" + d); $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 () { a.post(k + "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_popout_on != 1) { a(".arrowchat_chat_popout").hide(); } addHover(a(".arrowchat_video_chat"), "arrowchat_more_hover"); var ts67 = Math.round((new Date).getTime() / 1000); var path = k.replace("../", "/"); a("#arrowchat_file_upload_" + b).uploadify({ uploader: path + "includes/js/uploadify/uploadify.swf", script: path + "includes/classes/class_uploads.php", cancelImg: path + "includes/js/uploadify/cancel.png", hideButton: true, ButtonText: "Browse", wmode: "transparent", scriptData: { unixtime: ts67, user: u_id }, folder: path + "uploads", height: 17, width: 42, auto: true, fileExt: "*.jpg;*.gif;*.png;*.zip;*.rar;*.jpeg;*.txt;*.doc;*.mp3;*.wmv;*.avi;*.mp4;*.docx;*.wav", fileDesc: "Supported File Types (.JPG, .JPEG, .GIF, .PNG, .WMV, .AVI, .MP4, .ZIP, .RAR, .MP3, .WAV, .TXT, .DOC, .DOCX)", onOpen: 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"); }, onComplete: function () { a.post(k + "includes/json/send/send_message.php", { userid: u_id, to: b, message: "file{" + ts67 + "}" }, 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_file_cancel_" + b).click(function () { a("#arrowchat_file_upload_div_" + b).hide("slide", { direction: "up" }, 250); }); a("#arrowchat_file_transfer_" + b).click(function () { 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); }); a("#arrowchat_video_chat_" + b).click(function () { a("#arrowchat_more_popout_" + b).toggle(); a("#arrowchat_more_" + b).toggleClass("arrowchat_more_button_selected"); var RN = Math.floor(Math.random() * 9999999999); while (String(RN).length < 10) { RN = "0" + RN; } a.post(k + "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 { jqac.arrowchat.videoWith(RN); displayMessage("arrowchat_chatbox_message_flyout_" + b, lang[63], "notice"); } a(".arrowchat_tabcontenttext", $user_popups[b]).scrollTop(a(".arrowchat_tabcontenttext", $user_popups[b])[0].scrollHeight); }); }); 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(k + "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(k + "includes/json/send/send_settings.php", { clear_chat: b }, function () {}); }); a(".arrowchat_textarea", $user_popups[b]).keydown(function (h) { return userchatKeydown(h, a(this), b); }); 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 () { hideTooltip(); a.post(k + "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_chat_popout", $user_popups[b]).mouseenter(function () { showTooltip(a(this), lang[88], 0, 10, 5); a(this).addClass("arrowchat_chat_popout_hover"); a(".arrowchat_tabtitle", $user_popups[b]).removeClass("arrowchat_chatboxtabtitlemouseover"); }); a(".arrowchat_tabtitle .arrowchat_chat_popout", $user_popups[b]).mouseleave(function () { a(this).removeClass("arrowchat_chat_popout_hover"); a(".arrowchat_tabtitle", $user_popups[b]).addClass("arrowchat_chatboxtabtitlemouseover"); hideTooltip(); }); a(".arrowchat_tabtitle .arrowchat_chat_popout", $user_popups[b]).click(function () { startPopoutChat(); }); a(".arrowchat_tabtitle .arrowchat_chat_popout", $user_popups[b]).popupWindow({ windowURL: k + "public/popout/", height: 650, width: 900, top: 25, left: 25 }); a(".arrowchat_tabtitle", $user_popups[b]).not(".arrowchat_chat_popout").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 () { 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(k + "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) { receiveHistory(b); ca[b] = 1; } a.post(k + "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(); } } } 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) { a.ajax({ cache: false, url: k + "includes/json/receive/receive_history.php", data: { chatbox: b }, type: "post", dataType: "json", success: function (c) { if (c) { a(".arrowchat_tabcontenttext", $user_popups[b]).html(""); B = null; var d = "", i = uc_name[b], init = false; a.each(c, function (e, l) { e == "messages" && a.each(l, function (f, h) { f = ""; if (h.self == 1) { fromname = u_name; f = " arrowchat_self"; _aa5 = _aa4 = ""; avatar = u_avatar; tooltip = lang[90]; } else { fromname = i; _aa4 = ""; _aa5 = ""; avatar = uc_avatar[h.from]; tooltip = fromname; } var full_name = fromname; var o = new Date(h.sent * 1000); if (c_show_full_name != "1") { if (fromname.indexOf(" ") != -1) { fromname = fromname.slice(0, fromname.indexOf(" ")); } } if (h.sent - B > 60 || B == null || N != full_name) { if (init == true) { d += "
    "; } d += "
    " + fromname + "
    \""
    " + formatTimestamp(o) + h.message + "
    "; B = h.sent; N = full_name; init = true; last_id[h.from] = h.id; } else { d += "
    " + h.message + "
    "; } }); }); a("#arrowchat_tabcontenttext_" + b).html("
    " + d + "
    "); showTimeAndTooltip(); if (c_disable_avatars == 1 || a("#arrowchat_setting_names_only :input").is(":checked")) { setAvatarVisibility(1); } a("#arrowchat_tabcontenttext_" + b).scrollTop(50000); } } }); } 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().children(".arrowchat_chatboxmessagecontent").children(".arrowchat_ts").show(); }); a(".arrowchat_chatboxmessage").mouseleave(function () { a(this).children().children(".arrowchat_chatboxmessagecontent").children(".arrowchat_ts").hide(); }); } function showChatroomTime() { a(".arrowchat_chatroom_box_message").mouseenter(function () { 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").hide(); }); } 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_message_avatar").addClass("arrowchat_hide_avatars"); 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_message_avatar").removeClass("arrowchat_hide_avatars"); 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); 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_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); } 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(k + "includes/json/send/send_settings.php", { theme: theme_switch }, function (theme) { a("#arrowchat_css").attr({ href: k + "external.php?type=css&t=" + theme_switch }); }); }); a("#arrowchat_setting_sound").click(function () { 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(k + "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(k + "includes/json/send/send_settings.php", { window: _windowcheck }, function () {}); }); a("#arrowchat_setting_names_only").click(function () { 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(k + "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: k + "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("