/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(){var k=Handlebars.template,l=Handlebars.templates=Handlebars.templates||{};l.agent=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f=e.helperMissing,g=this.escapeExpression;d='';(a=e.name)?a=a.call(b,{hash:{},data:c}):(a=b.name,a="function"===typeof a?a.apply(b):a);d+=g(a);if((a=e.unless.call(b,b.isLast,{hash:{},inverse:this.noop,fn:this.program(9,
function(){return","},c),data:c}))||0===a)d+=a;return d});l.no_threads=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f;d=e.helperMissing;a=this.escapeExpression;c={hash:{},data:c};return b='
'+(a((f=e.L10n,f?f.call(b,"clients.no_clients",c):d.call(b,"L10n","clients.no_clients",c)))+" | ")});l.no_visitors=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f;d=e.helperMissing;a=this.escapeExpression;
c={hash:{},data:c};return b=''+(a((f=e.L10n,f?f.call(b,"visitors.no_visitors",c):d.call(b,"L10n","visitors.no_visitors",c)))+" | ")});l.status_panel=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f,g=e.helperMissing,h=this.escapeExpression;d='';(a=e.message)?a=a.call(b,{hash:{},data:c}):(a=b.message,a="function"===typeof a?a.apply(b):a);d+=h(a);if((f=e["if"].call(b,(a=b.agent,null==a||!1===a?a:a.away),
{hash:{},inverse:this.program(3,function(a,d){var b,c;c={hash:{},data:d};return h((b=e.L10n,b?b.call(a,"pending.status.online",c):g.call(a,"L10n","pending.status.online",c)))},c),fn:this.program(1,function(a,d){var b,c;c={hash:{},data:d};return h((b=e.L10n,b?b.call(a,"pending.status.away",c):g.call(a,"L10n","pending.status.away",c)))},c),data:c}))||0===f)d+=f;d+='
';if((f=e["if"].call(b,(a=b.agent,null==a||!1===a?a:a.away),
{hash:{},inverse:this.program(7,function(a,d){var b,c;c={hash:{},data:d};return h((b=e.L10n,b?b.call(a,"pending.status.setaway",c):g.call(a,"L10n","pending.status.setaway",c)))},c),fn:this.program(5,function(a,d){var b,c;c={hash:{},data:d};return h((b=e.L10n,b?b.call(a,"pending.status.setonline",c):g.call(a,"L10n","pending.status.setonline",c)))},c),data:c}))||0===f)d+=f;return d+" "});l.threads_collection=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};
var f,g=e.helperMissing,h=this.escapeExpression;a={hash:{},data:c};d='\n\n\n '+(h((f=e.L10n,f?f.call(b,"pending.table.head.name",a):g.call(b,"L10n","pending.table.head.name",a)))+" | \n ");a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"pending.table.head.actions",a):g.call(b,"L10n","pending.table.head.actions",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"pending.table.head.contactid",a):g.call(b,"L10n",
"pending.table.head.contactid",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"pending.table.head.state",a):g.call(b,"L10n","pending.table.head.state",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"pending.table.head.operator",a):g.call(b,"L10n","pending.table.head.operator",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"pending.table.head.total",a):g.call(b,"L10n","pending.table.head.total",a)))+" | \n ";a={hash:{},data:c};
d+=h((f=e.L10n,f?f.call(b,"pending.table.head.waittime",a):g.call(b,"L10n","pending.table.head.waittime",a)))+" | \n ";a={hash:{},data:c};return d+=h((f=e.L10n,f?f.call(b,"pending.table.head.etc",a):g.call(b,"L10n","pending.table.head.etc",a)))+' | \n
\n\n\n\n\n
'});l.visitors_collection=k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f,g=e.helperMissing,h=this.escapeExpression;a={hash:{},data:c};
d='\n\n\n '+(h((f=e.L10n,f?f.call(b,"visitors.table.head.name",a):g.call(b,"L10n","visitors.table.head.name",a)))+" | \n ");a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.actions",a):g.call(b,"L10n","visitors.table.head.actions",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.contactid",a):g.call(b,"L10n","visitors.table.head.contactid",a)))+" | \n ";
a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.firsttimeonsite",a):g.call(b,"L10n","visitors.table.head.firsttimeonsite",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.lasttimeonsite",a):g.call(b,"L10n","visitors.table.head.lasttimeonsite",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.invited.by",a):g.call(b,"L10n","visitors.table.head.invited.by",a)))+" | \n ";a={hash:{},data:c};d+=h((f=
e.L10n,f?f.call(b,"visitors.table.head.invitationtime",a):g.call(b,"L10n","visitors.table.head.invitationtime",a)))+" | \n ";a={hash:{},data:c};d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.invitations",a):g.call(b,"L10n","visitors.table.head.invitations",a)))+" | \n ";a={hash:{},data:c};return d+=h((f=e.L10n,f?f.call(b,"visitors.table.head.etc",a):g.call(b,"L10n","visitors.table.head.etc",a)))+' | \n
\n\n\n\n
'});l.queued_thread=
k(function(d,b,e,a,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var f=e.helperMissing,g=this.escapeExpression;d='\n ';if((a=e["if"].call(b,b.ban,{hash:{},inverse:this.noop,fn:this.program(5,function(a,d){var b,c;b={hash:{},data:d};return b=""+(g((c=e.L10n,c?c.call(a,"chat.client.spam.prefix",b):f.call(a,"L10n","chat.client.spam.prefix",b)))+" ")},c),data:c}))||0===a)d+=a;(a=e.userName)?a=a.call(b,{hash:{},data:c}):(a=b.userName,a="function"===typeof a?a.apply(b):a);d+=g(a)+" \n ";
if((a=e["if"].call(b,b.firstMessage,{hash:{},inverse:this.noop,fn:this.program(7,function(a,d){var b,c;b='"},c),data:c}))||0===a)d+=a;d+='\n | \n\n \n ';
if((a=e["if"].call(b,b.canOpen,{hash:{},inverse:this.noop,fn:this.program(9,function(a,d){var b,c;b={hash:{},data:d};return b='\n \n ')},c),data:c}))||0===a)d+=a;d+="\n ";if((a=e["if"].call(b,b.canView,{hash:{},inverse:this.noop,fn:this.program(11,function(a,d){var b,c;b={hash:{},data:d};return b='\n \n ')},c),data:c}))||0===a)d+=a;d+="\n ";if((a=e["if"].call(b,b.tracked,{hash:{},inverse:this.noop,fn:this.program(13,function(a,d){var b,c;b={hash:{},data:d};return b='\n \n ')},c),data:c}))||0===a)d+=a;d+="\n ";
if((a=e["if"].call(b,b.canBan,{hash:{},inverse:this.noop,fn:this.program(15,function(a,b){var d,c;d={hash:{},data:b};return d='\n \n ')},c),data:c}))||0===a)d+=a;d+='\n \n \n | \n';if((a=e["if"].call(b,b.userIp,{hash:{},inverse:this.program(19,function(a,
d){var b;(b=e.remote)?b=b.call(a,{hash:{},data:d}):(b=a.remote,b="function"===typeof b?b.apply(a):b);return g(b)},c),fn:this.program(17,function(a,b){var d,c;d='';(c=e.remote)?c=c.call(a,{hash:{},data:b}):(c=a.remote,c="function"===typeof c?c.apply(a):c);return d+=g(c)+""},c),data:c}))||0===a)d+=a;d+=' | \n';(a=e.stateDesc)?a=a.call(b,{hash:{},data:c}):(a=b.stateDesc,a="function"===typeof a?a.apply(b):a);
d+=g(a)+' | \n';(a=e.agentName)?a=a.call(b,{hash:{},data:c}):(a=b.agentName,a="function"===typeof a?a.apply(b):a);d+=g(a)+' | \n | \n';if((a=e.unless.call(b,b.chatting,{hash:{},inverse:this.program(23,function(){return"-"},c),fn:this.program(21,function(a,b){var d,c;d=''},c),data:c}))||0===a)d+=a;d+=' | \n';if((a=e["if"].call(b,b.ban,{hash:{},inverse:this.program(27,function(a,b){var c;(c=e.userAgent)?c=c.call(a,{hash:{},data:b}):(c=a.userAgent,c="function"===typeof c?c.apply(a):c);return g(c)},c),fn:this.program(25,function(a){var c;return g((c=(c=a.ban,null==c||!1===c?c:c.reason),"function"===typeof c?c.apply(a):
c))},c),data:c}))||0===a)d+=a;return d+" | "});l.visitor=k(function(d,b,e,a,c){function f(){return"-"}this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||d.helpers;c=c||{};var g,h=e.helperMissing,j=this.escapeExpression;d='\n ';if((a=e.unless.call(b,b.invitationInfo,{hash:{},inverse:this.program(3,function(a,c){var b;(b=e.userName)?b=b.call(a,{hash:{},data:c}):(b=a.userName,b="function"===typeof b?b.apply(a):b);return j(b)},c),fn:this.program(1,function(a,c){var b,d;b={hash:{},data:c};
b='');(d=e.userName)?d=d.call(a,{hash:{},data:c}):(d=a.userName,d="function"===typeof d?d.apply(a):d);return b+=j(d)+""},c),data:c}))||0===a)d+=a;g={hash:{},data:c};d=d+'\n | \n\n \n \n | \n');if((a=e["if"].call(b,b.userIp,{hash:{},inverse:this.program(7,function(a,c){var b;(b=e.remote)?b=b.call(a,{hash:{},data:c}):(b=a.remote,b="function"===typeof b?b.apply(a):b);return j(b)},c),fn:this.program(5,function(a,b){var c,d;c='';(d=e.remote)?d=d.call(a,
{hash:{},data:b}):(d=a.remote,d="function"===typeof d?d.apply(a):d);return c+=j(d)+""},c),data:c}))||0===a)d+=a;d+=' | \n | \n | \n';
if((a=e["if"].call(b,b.invitationInfo,{hash:{},inverse:this.program(11,f,c),fn:this.program(9,function(a){var b;return j((b=(b=a.invitationInfo,null==b||!1===b?b:b.agentName),"function"===typeof b?b.apply(a):b))},c),data:c}))||0===a)d+=a;d+=' | \n';if((a=e["if"].call(b,b.invitationInfo,{hash:{},inverse:this.program(11,f,c),fn:this.program(13,function(a){var b;return a=""+('')},c),data:c}))||0===a)d+=a;d+=' | \n';(a=e.invitations)?a=a.call(b,{hash:{},data:c}):(a=b.invitations,a="function"===typeof a?a.apply(b):a);d+=j(a)+" / ";(a=e.chats)?a=a.call(b,{hash:{},data:c}):(a=b.chats,a="function"===typeof a?a.apply(b):a);d+=j(a)+' | \n';(a=e.userAgent)?a=a.call(b,{hash:{},data:c}):(a=b.userAgent,a="function"===typeof a?a.apply(b):a);return d+=j(a)+" | "})})();
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(a,e){a.Regions={};a.Popup={};a.Popup.open=function(b,a,g){b=window.open(b,a,g);b.focus();b.opener=window};a.Utils.updateTimers=function(a,f){a.find(f).each(function(){var a=e(this).data("timestamp");if(a){var c=Math.round((new Date).getTime()/1E3)-a,a=c%60,b=Math.floor(c/60)%60,c=Math.floor(c/3600),d=[];0b?"0"+b:b);d.push(10>a?"0"+a:a);e(this).html(d.join(":"))}})}})(Mibew,jQuery);
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
MibewAPIUsersInteraction=function(){this.obligatoryArguments={"*":{agentId:null,"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]};MibewAPIUsersInteraction.prototype=new MibewAPIInteraction;
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(a,b){a.Models.Agent=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{id:null,isAgent:!0,away:!1}),away:function(){this.setAvailability(!1)},available:function(){this.setAvailability(!0)},setAvailability:function(c){var b=this;a.Objects.server.callFunctions([{"function":c?"available":"away",arguments:{agentId:this.id,references:{},"return":{}}}],function(a){0==a.errorCode&&b.set({away:!c})},!0)}})})(Mibew,_);
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(a,c){var b=[],f=a.Models.QueuedThread=a.Models.Thread.extend({defaults:c.extend({},a.Models.Thread.prototype.defaults,{controls:null,userName:"",userIp:"",remote:"",userAgent:"",agentName:"",canOpen:!1,canView:!1,canBan:!1,ban:!1,totalTime:0,waitingTime:0,firstMessage:null}),initialize:function(){for(var e=[],b=f.getControls(),d=0,c=b.length;d