(function(){function h(){if("logs"in f)if("undefined"!=typeof console&&"function"==typeof console.log)if(window.opera)for(var a=0;a<arguments.length;)console.log("Item "+(a+1)+": "+arguments[a]),a++;else 1==Array.prototype.slice.call(arguments).length&&"string"==typeof Array.prototype.slice.call(arguments)[0]?console.log(Array.prototype.slice.call(arguments).toString()):console.log(Array.prototype.slice.call(arguments));else Function.prototype.bind||"undefined"==typeof console||"object"!=typeof console.log||
Function.prototype.call.call(console.log,console,Array.prototype.slice.call(arguments))}function H(a,b){a.readyState?(h("Using readyState callback"),a.onreadystatechange=function(){if("loaded"==a.readyState||"complete"==a.readyState)a.onreadystatechange=null,b()}):(h("Using onload callback"),a.onload=function(){"about:blank"!=a.contentWindow.location.href&&(b(),a.onload=null)})}function r(a){if("custom_langpack"in f&&a in f.custom_langpack)return f.custom_langpack[a].replace(/\n/g,"<br />");a=a in
N?N[a].replace(/\n/g,"<br />"):a;return a}function v(a,b,c){a=["jv",a,f.widget_id].join("_");if(1<arguments.length&&"[object Object]"!==String(b)){"undefined"==typeof c&&(c={});if(null===b||void 0===b)c.expires=-1;if("number"===typeof c.expires){var e=c.expires,g=c.expires=new Date;g.setDate(g.getDate()+e)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"","; path=/"].join("")}c=b||{};g=c.raw?function(a){return a}:
decodeURIComponent;return(e=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(e[1]):null}function I(a,b){var c="jivocb_"+(new Date).getTime(),e=document.createElement("script"),g=document.getElementsByTagName("head")[0]||document.documentElement;window[c]=function(a){g.removeChild(e);b&&b(a)};e.src=a.replace("cb=?","cb="+c);g.appendChild(e)}function D(a){return"#"==a.charAt(0)?a.substring(1,7):a}function J(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,
255));return"0123456789ABCDEF".charAt((a-a%16)/16)+"0123456789ABCDEF".charAt(a%16)}function w(a,b,c){var e=parseInt(D(a).substring(0,2),16),g=parseInt(D(a).substring(2,4),16);a=parseInt(D(a).substring(4,6),16);h("r="+e+" g="+g+" b="+a);e=P.toHSV(new y(e,g,a));e.v=0<e.v?e.v*b:100*(b-1);e.s*=c;b=P.toRGB(e);c=b.g;e=b.b;return"#"+(J(b.r)+J(c)+J(e))}function E(a,b,c){0>=a&&(a=0);0>=b&&(b=0);0>=c&&(c=0);360<a&&(a=360);100<b&&(b=100);100<c&&(c=100);this.h=a;this.s=b;this.v=c}function y(a,b,c){0>=a&&(a=0);
0>=b&&(b=0);0>=c&&(c=0);255<a&&(a=255);255<b&&(b=255);255<c&&(c=255);this.r=a;this.g=b;this.b=c}function F(a,b,c,e){0>=a&&(a=0);0>=b&&(b=0);0>=c&&(c=0);0>=e&&(e=0);100<a&&(a=100);100<b&&(b=100);100<c&&(c=100);100<e&&(e=100);this.c=a;this.m=b;this.y=c;this.k=e}var f=window.jivo_config;(function(){var a=this,b=a._,c={},e=Array.prototype,g=Object.prototype,f=e.push,l=e.slice,h=e.concat,k=g.toString,n=g.hasOwnProperty,r=e.forEach,m=e.map,x=e.reduce,Q=e.reduceRight,R=e.filter,t=e.every,v=e.some,s=e.indexOf,
w=e.lastIndexOf,g=Array.isArray,z=Object.keys,d=function(a){if(a instanceof d)return a;if(!(this instanceof d))return new d(a);this._wrapped=a};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=d),exports._=d):a._=d;d.VERSION="1.4.4";var u=d.each=d.forEach=function(a,q,b){if(null!=a)if(r&&a.forEach===r)a.forEach(q,b);else if(a.length===+a.length)for(var B=0,e=a.length;B<e&&q.call(b,a[B],B,a)!==c;B++);else for(B in a)if(d.has(a,B)&&q.call(b,a[B],B,a)===
c)break};d.map=d.collect=function(a,q,b){var d=[];if(null==a)return d;if(m&&a.map===m)return a.map(q,b);u(a,function(a,p,c){d[d.length]=q.call(b,a,p,c)});return d};d.reduce=d.foldl=d.inject=function(a,q,b,c){var e=2<arguments.length;null==a&&(a=[]);if(x&&a.reduce===x)return c&&(q=d.bind(q,c)),e?a.reduce(q,b):a.reduce(q);u(a,function(a,p,d){e?b=q.call(c,b,a,p,d):(b=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return b};d.reduceRight=d.foldr=function(a,q,b,c){var e=
2<arguments.length;null==a&&(a=[]);if(Q&&a.reduceRight===Q)return c&&(q=d.bind(q,c)),e?a.reduceRight(q,b):a.reduceRight(q);var g=a.length;if(g!==+g)var m=d.keys(a),g=m.length;u(a,function(d,f,x){f=m?m[--g]:--g;e?b=q.call(c,b,a[f],f,x):(b=a[f],e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return b};d.find=d.detect=function(a,q,b){var d;A(a,function(a,p,c){if(q.call(b,a,p,c))return d=a,!0});return d};d.filter=d.select=function(a,q,b){var d=[];if(null==a)return d;if(R&&
a.filter===R)return a.filter(q,b);u(a,function(a,p,c){q.call(b,a,p,c)&&(d[d.length]=a)});return d};d.reject=function(a,q,b){return d.filter(a,function(a,p,d){return!q.call(b,a,p,d)},b)};d.every=d.all=function(a,b,G){b||(b=d.identity);var e=!0;if(null==a)return e;if(t&&a.every===t)return a.every(b,G);u(a,function(a,p,d){if(!(e=e&&b.call(G,a,p,d)))return c});return!!e};var A=d.some=d.any=function(a,b,G){b||(b=d.identity);var e=!1;if(null==a)return e;if(v&&a.some===v)return a.some(b,G);u(a,function(a,
p,d){if(e||(e=b.call(G,a,p,d)))return c});return!!e};d.contains=d.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})};d.invoke=function(a,b){var G=l.call(arguments,2),c=d.isFunction(b);return d.map(a,function(a){return(c?b:a[b]).apply(a,G)})};d.pluck=function(a,b){return d.map(a,function(a){return a[b]})};d.where=function(a,b,c){return d.isEmpty(b)?c?null:[]:d[c?"find":"filter"](a,function(a){for(var p in b)if(b[p]!==a[p])return!1;return!0})};
d.findWhere=function(a,b){return d.where(a,b,!0)};d.max=function(a,b,c){if(!b&&d.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.max.apply(Math,a);if(!b&&d.isEmpty(a))return-Infinity;var e={computed:-Infinity,value:-Infinity};u(a,function(a,p,d){p=b?b.call(c,a,p,d):a;p>=e.computed&&(e={value:a,computed:p})});return e.value};d.min=function(a,b,c){if(!b&&d.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.min.apply(Math,a);if(!b&&d.isEmpty(a))return Infinity;var e={computed:Infinity,value:Infinity};
u(a,function(a,p,d){p=b?b.call(c,a,p,d):a;p<e.computed&&(e={value:a,computed:p})});return e.value};d.shuffle=function(a){var b,c=0,e=[];u(a,function(a){b=d.random(c++);e[c-1]=e[b];e[b]=a});return e};var y=function(a){return d.isFunction(a)?a:function(b){return b[a]}};d.sortBy=function(a,b,c){var e=y(b);return d.pluck(d.map(a,function(a,p,b){return{value:a,index:p,criteria:e.call(c,a,p,b)}}).sort(function(a,p){var b=a.criteria,d=p.criteria;if(b!==d){if(b>d||void 0===b)return 1;if(b<d||void 0===d)return-1}return a.index<
p.index?-1:1}),"value")};var E=function(a,b,c,e){var g={},m=y(b||d.identity);u(a,function(b,d){var q=m.call(c,b,d,a);e(g,q,b)});return g};d.groupBy=function(a,b,c){return E(a,b,c,function(a,b,p){(d.has(a,b)?a[b]:a[b]=[]).push(p)})};d.countBy=function(a,b,c){return E(a,b,c,function(a,b){d.has(a,b)||(a[b]=0);a[b]++})};d.sortedIndex=function(a,b,c,e){c=null==c?d.identity:y(c);b=c.call(e,b);for(var g=0,m=a.length;g<m;){var f=g+m>>>1;c.call(e,a[f])<b?g=f+1:m=f}return g};d.toArray=function(a){return a?
d.isArray(a)?l.call(a):a.length===+a.length?d.map(a,d.identity):d.values(a):[]};d.size=function(a){return null==a?0:a.length===+a.length?a.length:d.keys(a).length};d.first=d.head=d.take=function(a,b,d){return null==a?void 0:null==b||d?a[0]:l.call(a,0,b)};d.initial=function(a,b,d){return l.call(a,0,a.length-(null==b||d?1:b))};d.last=function(a,b,d){return null==a?void 0:null==b||d?a[a.length-1]:l.call(a,Math.max(a.length-b,0))};d.rest=d.tail=d.drop=function(a,b,d){return l.call(a,null==b||d?1:b)};
d.compact=function(a){return d.filter(a,d.identity)};var F=function(a,b,c){u(a,function(a){d.isArray(a)?b?f.apply(c,a):F(a,b,c):c.push(a)});return c};d.flatten=function(a,b){return F(a,b,[])};d.without=function(a){return d.difference(a,l.call(arguments,1))};d.uniq=d.unique=function(a,b,c,e){d.isFunction(b)&&(e=c,c=b,b=!1);c=c?d.map(a,c,e):a;var g=[],m=[];u(c,function(c,e){(b?e&&m[m.length-1]===c:d.contains(m,c))||(m.push(c),g.push(a[e]))});return g};d.union=function(){return d.uniq(h.apply(e,arguments))};
d.intersection=function(a){var b=l.call(arguments,1);return d.filter(d.uniq(a),function(a){return d.every(b,function(b){return 0<=d.indexOf(b,a)})})};d.difference=function(a){var b=h.apply(e,l.call(arguments,1));return d.filter(a,function(a){return!d.contains(b,a)})};d.zip=function(){for(var a=l.call(arguments),b=d.max(d.pluck(a,"length")),c=Array(b),e=0;e<b;e++)c[e]=d.pluck(a,""+e);return c};d.object=function(a,b){if(null==a)return{};for(var d={},c=0,e=a.length;c<e;c++)b?d[a[c]]=b[c]:d[a[c][0]]=
a[c][1];return d};d.indexOf=function(a,b,c){if(null==a)return-1;var e=0,g=a.length;if(c)if("number"==typeof c)e=0>c?Math.max(0,g+c):c;else return e=d.sortedIndex(a,b),a[e]===b?e:-1;if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e<g;e++)if(a[e]===b)return e;return-1};d.lastIndexOf=function(a,b,d){if(null==a)return-1;var c=null!=d;if(w&&a.lastIndexOf===w)return c?a.lastIndexOf(b,d):a.lastIndexOf(b);for(d=c?d:a.length;d--;)if(a[d]===b)return d;return-1};d.range=function(a,b,d){1>=arguments.length&&(b=
a||0,a=0);d=arguments[2]||1;for(var c=Math.max(Math.ceil((b-a)/d),0),e=0,g=Array(c);e<c;)g[e++]=a,a+=d;return g};d.bind=function(a,b){var d=l.call(arguments,2);return function(){return a.apply(b,d.concat(l.call(arguments)))}};d.partial=function(a){var b=l.call(arguments,1);return function(){return a.apply(this,b.concat(l.call(arguments)))}};d.bindAll=function(a){var b=l.call(arguments,1);0===b.length&&(b=d.functions(a));u(b,function(b){a[b]=d.bind(a[b],a)});return a};d.memoize=function(a,b){var c=
{};b||(b=d.identity);return function(){var e=b.apply(this,arguments);return d.has(c,e)?c[e]:c[e]=a.apply(this,arguments)}};d.delay=function(a,b){var d=l.call(arguments,2);return setTimeout(function(){return a.apply(null,d)},b)};d.defer=function(a){return d.delay.apply(d,[a,1].concat(l.call(arguments,1)))};d.throttle=function(a,b){var d,c,e,g,m=0,f=function(){m=new Date;e=null;g=a.apply(d,c)};return function(){var x=new Date,l=b-(x-m);d=this;c=arguments;0>=l?(clearTimeout(e),e=null,m=x,g=a.apply(d,
c)):e||(e=setTimeout(f,l));return g}};d.debounce=function(a,b,d){var c,e;return function(){var g=this,m=arguments,f=d&&!c;clearTimeout(c);c=setTimeout(function(){c=null;d||(e=a.apply(g,m))},b);f&&(e=a.apply(g,m));return e}};d.once=function(a){var b=!1,d;return function(){if(b)return d;b=!0;d=a.apply(this,arguments);a=null;return d}};d.wrap=function(a,b){return function(){var d=[a];f.apply(d,arguments);return b.apply(this,d)}};d.compose=function(){var a=arguments;return function(){for(var b=arguments,
d=a.length-1;0<=d;d--)b=[a[d].apply(this,b)];return b[0]}};d.after=function(a,b){return 0>=a?b():function(){if(1>--a)return b.apply(this,arguments)}};d.keys=z||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],c;for(c in a)d.has(a,c)&&(b[b.length]=c);return b};d.values=function(a){var b=[],c;for(c in a)d.has(a,c)&&b.push(a[c]);return b};d.pairs=function(a){var b=[],c;for(c in a)d.has(a,c)&&b.push([c,a[c]]);return b};d.invert=function(a){var b={},c;for(c in a)d.has(a,c)&&
(b[a[c]]=c);return b};d.functions=d.methods=function(a){var b=[],c;for(c in a)d.isFunction(a[c])&&b.push(c);return b.sort()};d.extend=function(a){u(l.call(arguments,1),function(b){if(b)for(var d in b)a[d]=b[d]});return a};d.pick=function(a){var b={},d=h.apply(e,l.call(arguments,1));u(d,function(d){d in a&&(b[d]=a[d])});return b};d.omit=function(a){var b={},c=h.apply(e,l.call(arguments,1)),g;for(g in a)d.contains(c,g)||(b[g]=a[g]);return b};d.defaults=function(a){u(l.call(arguments,1),function(b){if(b)for(var d in b)null==
a[d]&&(a[d]=b[d])});return a};d.clone=function(a){return d.isObject(a)?d.isArray(a)?a.slice():d.extend({},a):a};d.tap=function(a,b){b(a);return a};var C=function(a,b,c,e){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof d&&(a=a._wrapped);b instanceof d&&(b=b._wrapped);var g=k.call(a);if(g!=k.call(b))return!1;switch(g){case "[object String]":return a==String(b);case "[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case "[object Date]":case "[object Boolean]":return+a==
+b;case "[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var m=c.length;m--;)if(c[m]==a)return e[m]==b;c.push(a);e.push(b);var m=0,f=!0;if("[object Array]"==g){if(m=a.length,f=m==b.length)for(;m--&&(f=C(a[m],b[m],c,e)););}else{var g=a.constructor,x=b.constructor;if(g!==x&&!(d.isFunction(g)&&g instanceof g&&d.isFunction(x)&&x instanceof x))return!1;for(var l in a)if(d.has(a,l)&&
(m++,!(f=d.has(b,l)&&C(a[l],b[l],c,e))))break;if(f){for(l in b)if(d.has(b,l)&&!m--)break;f=!m}}c.pop();e.pop();return f};d.isEqual=function(a,b){return C(a,b,[],[])};d.isEmpty=function(a){if(null==a)return!0;if(d.isArray(a)||d.isString(a))return 0===a.length;for(var b in a)if(d.has(a,b))return!1;return!0};d.isElement=function(a){return!(!a||1!==a.nodeType)};d.isArray=g||function(a){return"[object Array]"==k.call(a)};d.isObject=function(a){return a===Object(a)};u("Arguments Function String Number Date RegExp".split(" "),
function(a){d["is"+a]=function(b){return k.call(b)=="[object "+a+"]"}});d.isArguments(arguments)||(d.isArguments=function(a){return!(!a||!d.has(a,"callee"))});"function"!==typeof/./&&(d.isFunction=function(a){return"function"===typeof a});d.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))};d.isNaN=function(a){return d.isNumber(a)&&a!=+a};d.isBoolean=function(a){return!0===a||!1===a||"[object Boolean]"==k.call(a)};d.isNull=function(a){return null===a};d.isUndefined=function(a){return void 0===
a};d.has=function(a,b){return n.call(a,b)};d.noConflict=function(){a._=b;return this};d.identity=function(a){return a};d.times=function(a,b,d){for(var c=Array(a),e=0;e<a;e++)c[e]=b.call(d,e);return c};d.random=function(a,b){null==b&&(b=a,a=0);return a+Math.floor(Math.random()*(b-a+1))};var K={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};K.unescape=d.invert(K.escape);var H={escape:new RegExp("["+d.keys(K.escape).join("")+"]","g"),unescape:new RegExp("("+d.keys(K.unescape).join("|")+
")","g")};d.each(["escape","unescape"],function(a){d[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return K[a][b]})}});d.result=function(a,b){if(null==a)return null;var c=a[b];return d.isFunction(c)?c.call(a):c};d.mixin=function(a){u(d.functions(a),function(b){var c=d[b]=a[b];d.prototype[b]=function(){var a=[this._wrapped];f.apply(a,arguments);return M.call(this,c.apply(d,a))}})};var I=0;d.uniqueId=function(a){var b=++I+"";return a?a+b:b};d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,
interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;d.template=function(a,b,c){var e;c=d.defaults({},c,d.templateSettings);var g=new RegExp([(c.escape||D).source,(c.interpolate||D).source,(c.evaluate||D).source].join("|")+"|$","g"),m=0,f="__p+='";a.replace(g,function(b,c,d,e,g){f+=a.slice(m,g).replace(L,function(a){return"\\"+J[a]});c&&(f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'");
d&&(f+="'+\n((__t=("+d+"))==null?'':__t)+\n'");e&&(f+="';\n"+e+"\n__p+='");m=g+b.length;return b});f+="';\n";c.variable||(f="with(obj||{}){\n"+f+"}\n");f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{e=new Function(c.variable||"obj","_",f)}catch(x){throw x.source=f,x;}if(b)return e(b,d);b=function(a){return e.call(this,a,d)};b.source="function("+(c.variable||"obj")+"){\n"+f+"}";return b};d.chain=function(a){return d(a).chain()};var M=
function(a){return this._chain?d(a).chain():a};d.mixin(d);u("pop push reverse shift sort splice unshift".split(" "),function(a){var b=e[a];d.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);"shift"!=a&&"splice"!=a||0!==c.length||delete c[0];return M.call(this,c)}});u(["concat","join","slice"],function(a){var b=e[a];d.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}});d.extend(d.prototype,{chain:function(){this._chain=!0;return this},value:function(){return this._wrapped}})}).call(this);
var S=function(a,b){var c=[].slice,e={makeFsmNamespace:function(){var a=0;return function(){return"fsm."+a++}}(),getDefaultOptions:function(){return{initialState:"uninitialized",eventListeners:{"*":[]},states:{},eventQueue:[],namespace:e.makeFsmNamespace(),targetReplayState:"",state:b,priorState:b,_priorAction:"",_currentAction:""}}};if(!a.deepExtend){var g={"*":function(a,b,c){a[b]=c},object:function(a,b,c){a[b]=l({},a[b]||{},c)},array:function(b,c,e){b[c]=[];a.each(e,function(a,e){g[f(a)](b[c],
e,a)},this)}},f=function(b){b=a.isArray(b)?"array":a.isDate(b)?"date":a.isRegExp(b)?"regex":typeof b;return g[b]?b:"*"},l=function(b){a.each(c.call(arguments,1),function(c){a.each(c,function(a,c){g[f(a)](b,c,a)})});return b};a.mixin({deepExtend:l})}var h=function(b){a.extend(this,b);a.defaults(this,e.getDefaultOptions());this.initialize.apply(this,arguments);r.emit("newfsm",this);this.initialState&&this.transition(this.initialState)};a.extend(h.prototype,{initialize:function(){},emit:function(b){var e=
arguments;this.eventListeners["*"]&&a.each(this.eventListeners["*"],function(a){try{a.apply(this,c.call(e,0))}catch(b){console&&"undefined"!==typeof console.log&&console.log(b.toString())}},this);this.eventListeners[b]&&a.each(this.eventListeners[b],function(a){try{a.apply(this,c.call(e,1))}catch(b){console&&"undefined"!==typeof console.log&&console.log(b.toString())}},this)},handle:function(e){if(!this.inExitHandler){var g=this.states,f=this.state,l=c.call(arguments,0),h,O;this.currentActionArgs=
l;g[f][e]||g[f]["*"]||this["*"]?(h=g[f][e]?e:"*",O="*"===h,g[f][h]?(g=g[f][h],f=f+"."+h):(g=this["*"],f="*"),this._currentAction||(this._currentAction=f),this.emit.call(this,"handling",{inputType:e,args:l.slice(1)}),a.isFunction(g)&&(g=g.apply(this,O?l:l.slice(1))),a.isString(g)&&this.transition(g),this.emit.call(this,"handled",{inputType:e,args:l.slice(1)}),this._priorAction=this._currentAction,this._currentAction="",this.processQueue("handler")):this.emit.call(this,"nohandler",{inputType:e,args:l.slice(1)});
this.currentActionArgs=b}},transition:function(a){if(!this.inExitHandler&&a!==this.state){var b;this.states[a]?(this.targetReplayState=a,this.priorState=this.state,this.state=a,b=this.priorState,this.states[b]&&this.states[b]._onExit&&(this.inExitHandler=!0,this.states[b]._onExit.call(this),this.inExitHandler=!1),this.emit.call(this,"transition",{fromState:b,action:this._currentAction,toState:a}),this.states[a]._onEnter&&this.states[a]._onEnter.call(this),this.targetReplayState===a&&this.processQueue("transition")):
this.emit.call(this,"invalidstate",{state:this.state,attemptedState:a})}},processQueue:function(b){b=a.filter(this.eventQueue,"transition"===b?function(a){return"transition"===a.type&&(!a.untilState||a.untilState===this.state)}:function(a){return"handler"===a.type},this);this.eventQueue=a.difference(this.eventQueue,b);a.each(b,function(a){this.handle.apply(this,a.args)},this)},clearQueue:function(b,c){if(b){var e;"transition"===b?e=function(a){return"transition"===a.type&&(c?a.untilState===c:!0)}:
"handler"===b&&(e=function(a){return"handler"===a.type});this.eventQueue=a.filter(this.eventQueue,e)}else this.eventQueue=[]},deferUntilTransition:function(a){this.currentActionArgs&&(a={type:"transition",untilState:a,args:this.currentActionArgs},this.eventQueue.push(a),this.emit.call(this,"deferred",{state:this.state,queuedArgs:a}))},deferUntilNextHandler:function(){if(this.currentActionArgs){var a={type:"transition",args:this.currentActionArgs};this.eventQueue.push(a);this.emit.call(this,"deferred",
{state:this.state,queuedArgs:a})}},on:function(a,b){var c=this;c.eventListeners[a]||(c.eventListeners[a]=[]);c.eventListeners[a].push(b);return{eventName:a,callback:b,off:function(){c.off(a,b)}}},off:function(b,c){b?this.eventListeners[b]&&(this.eventListeners[b]=c?a.without(this.eventListeners[b],c):[]):this.eventListeners={}}});h.prototype.trigger=h.prototype.emit;var k=function(){},n=function(b,c,e){var g;g=c&&c.hasOwnProperty("constructor")?c.constructor:function(){b.apply(this,arguments)};a.deepExtend(g,
b);k.prototype=b.prototype;g.prototype=new k;c&&a.deepExtend(g.prototype,c);e&&a.deepExtend(g,e);g.prototype.constructor=g;g.__super__=b.prototype;return g};h.extend=function(a,b){var c=n(this,a,b);c.extend=this.extend;return c};var r={Fsm:h,utils:e,on:function(a,b){this.eventListeners[a]||(this.eventListeners[a]=[]);this.eventListeners[a].push(b);return b},off:function(b,c){this.eventListeners[b]&&(this.eventListeners[b]=a.without(this.eventListeners[b],c))},trigger:function(b){var e=arguments,g=
this.eventListeners[b]||[];g&&g.length&&a.each(g,function(a){a.apply(null,c.call(e,1))})},eventListeners:{newFsm:[]}};r.emit=r.trigger;return r}(_),T=-1==navigator.appVersion.indexOf("MSIE 7.")?!1:!0,V=-1==navigator.appVersion.indexOf("MSIE 8.")?!1:!0,L=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g,e=function(a,
b){a=String(a);for(b=b||2;a.length<b;)a="0"+a;return a};return function(g,f,l){var h=L;1!=arguments.length||"[object String]"!=Object.prototype.toString.call(g)||/\d/.test(g)||(f=g,g=void 0);g=g?new Date(g):new Date;if(isNaN(g))throw SyntaxError("invalid date");f=String(h.masks[f]||f||h.masks["default"]);"UTC:"==f.slice(0,4)&&(f=f.slice(4),l=!0);var k=l?"getUTC":"get",n=g[k+"Date"](),r=g[k+"Day"](),m=g[k+"Month"](),t=g[k+"FullYear"](),s=g[k+"Hours"](),v=g[k+"Minutes"](),w=g[k+"Seconds"](),k=g[k+"Milliseconds"](),
y=l?0:g.getTimezoneOffset(),z={d:n,dd:e(n),ddd:h.i18n.dayNames[r],dddd:h.i18n.dayNames[r+7],m:m+1,mm:e(m+1),mmm:h.i18n.monthNames[m],mmmm:h.i18n.monthNames[m+12],yy:String(t).slice(2),yyyy:t,h:s%12||12,hh:e(s%12||12),H:s,HH:e(s),M:v,MM:e(v),s:w,ss:e(w),l:e(k,3),L:e(99<k?Math.round(k/10):k),t:12>s?"a":"p",tt:12>s?"am":"pm",T:12>s?"A":"P",TT:12>s?"AM":"PM",Z:l?"UTC":(String(g).match(b)||[""]).pop().replace(c,""),o:(0<y?"-":"+")+e(100*Math.floor(Math.abs(y)/60)+Math.abs(y)%60,4),S:["th","st","nd","rd"][3<
n%10?0:(10!=n%100-n%10)*n%10]};return f.replace(a,function(a){return a in z?z[a]:a.slice(1,a.length-1)})}}();L.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};L.i18n={dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")};var N={"b_onlineCallDefaultText":"\u041f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c \u043d\u0430\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e!","c_callConnected":"\u0412\u044b\u0437\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d","c_callDisconnected":"\u0412\u044b\u0437\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d","c_callProcessing":"\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430...","defOfflineFormText":"\u041e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0435, \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0435\u0433\u043e \u043d\u0430 e-mail \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u043c!","defOfflineWidgetLabel":"\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","defOnlineWidgetLabel":"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043d\u0430\u043c, \u043c\u044b \u043e\u043d\u043b\u0430\u0439\u043d!","defRuleInvitationText":"\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u0427\u0435\u043c \u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c?","lblAgentDisconnected":"\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f","lblCallMe":"\u041f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c","lblChatEnded":"\u0414\u0438\u0430\u043b\u043e\u0433 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d","lblChatIsOnline":"\u041a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u043d\u0442 \u043e\u043d\u043b\u0430\u0439\u043d","lblConnectedToAgent":"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435!","lblConnectionLost":"\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e. \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c...","lblDeclineFile":"\u041e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c","lblDefaultCobrowseComment":"\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435","lblEnterMessageHere":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Enter","lblEvaluateCancel":"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c","lblEvaluatePlease":"\u041e\u0446\u0435\u043d\u0438\u0442\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f","lblEvaluateThanks":"\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043e\u0446\u0435\u043d\u043a\u0443!","lblHangUp":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435","lblHangUpShort":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c","lblIntroduce":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0441\u044f","lblLeaveMessage":"\u041e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","lblLookingForFreeAgent":"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f...","lblMessageError":"\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c","lblNewMessage":"\u041d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435!","lblNoOperators":"\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c","lblOperatorsOnline":"\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043e\u043d\u043b\u0430\u0439\u043d","lblPencilHint":"\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","lblPhoneHint":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00ab\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c\u00bb, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430.\r\n\u0412\u0430\u0448\u0430 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442","lblPwrBy":"\u0427\u0430\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d <a href=\"http:\/\/jivosite.ru\/_URL_\" target=\"_blank\"><span class=\"j1\">Jivo<\/span><span class=\"j2\">Site<\/span><\/a>","lblReceiveFile":"\u041f\u0440\u0438\u043d\u044f\u0442\u044c","lblReopenedElseWhere":"\u0414\u0438\u0430\u043b\u043e\u0433 \u043e\u0442\u043a\u0440\u044b\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u043a\u043d\u0435","lblSendingFile":"_AGENT_ \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0412\u0430\u043c \u0444\u0430\u0439\u043b: _FILE_","lblSendOffline":"\u041e\u041a","lblThankYouMessage":"\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435! \u041c\u044b&nbsp;\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0436\u0435\u043c\u0441\u044f \u0441&nbsp;\u0412\u0430\u043c\u0438 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f","lblTransferred":"\u0414\u0438\u0430\u043b\u043e\u0433 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 _AGENT_","lblView":"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c","lblWaitForOperator":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043e\u0436\u0438\u0434\u0430\u0439\u0442\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430...","lblWebPhoneFlashError":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Flash \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0430\u0442\u043e\u043c","lblWebPhoneMicError":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0447\u0430\u0442\u043e\u043c","lblWebPhoneNotAvail":"\u0412\u044b\u0437\u043e\u0432 \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0447\u0430\u0442\u043e\u043c","lblWebPhoneNotConnected":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0447\u0430\u0442\u043e\u043c","lblYourEmail":"\u0412\u0430\u0448 E-mail","lblYourMessage":"\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","lnkCloseThisWindow":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c","lnkRestartChat":"\u0412\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","ofl_enterEmail":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 e-mail","ofl_enterMessage":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","ofl_enterValidEmail":"\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 e-mail","seo_copyrightText":"\u041e\u043d\u043b\u0430\u0439\u043d \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d <a href=\"http:\/\/jivosite.ru\/\" target=\"_blank\">JivoSite<\/a>","seo_widgetCopyright":"\u041e\u043d\u043b\u0430\u0439\u043d \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u043d\u0442 JivoSite"},s=_.noConflict();s.defaults(f,{online_widget_label:r("defOnlineWidgetLabel"),offline_widget_label:r("defOfflineWidgetLabel"),offline_form_text:r("defOfflineFormText")});var U=S.Fsm.extend({_fireEvent:function(a){delete this._scheduled_events[a];this.handle(a)},_scheduleEvent:function(a,b){a in this._scheduled_events?h("Attempt to re-schedule event",
a):(h("Scheduling",a,b),this._scheduled_events[a]=setTimeout(s.bind(this._fireEvent,this,a),b))},_cancelEvent:function(a){a in this._scheduled_events?(clearTimeout(this._scheduled_events[a]),delete this._scheduled_events[a]):h("Attempt to cancel not scheduled event",a)},constructor:function(){this._scheduled_events={};S.Fsm.apply(this,arguments)}}),z=window.jivo=new U({initialState:"NOT_INITIALIZED",_wrapDiv:0,_cssIsLoad:!1,_mobile:!1,_chatWindow:!1,_proactiveAnswer:!1,_open_params:!1,_forcedCurrentPage:!1,
_scheduledEvents:{},initialize:function(){if(/iPhone|iPod|iPad|Android/.test(navigator.userAgent)||"undefined"!=typeof jivo_ForceMobile)this._mobile=!0;var a=s.bind(this.handle,this,"window.loaded");if(window.parentSandboxBridge&&window.parentSandboxBridge.inAir)var b=setInterval(function(){h("check for document.readyState: "+document.readyState);if("complete"===document.readyState||"loaded"===document.readyState)z.handle("window.loaded"),clearInterval(b)},300);else"complete"===document.readyState?
setTimeout(a):document.addEventListener?(document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",a),window.attachEvent("onload",a))},_createTopWrap:function(){this._wrapDiv=document.createElement("div");this._wrapDiv.setAttribute("id","jivo_top_wrap");document.body.appendChild(this._wrapDiv)},_loadCss:function(){if(!this._cssIsLoad){var a=document.createElement("link");a.setAttribute("rel","stylesheet");
a.setAttribute("id","__jivo_css_style");a.setAttribute("href",f.base_url+"/css/style.css?rnd=2");document.createStyleSheet?(h("createStyleSheet"),document.createStyleSheet(f.base_url+"/css/style.css?rnd=2"),T&&document.createStyleSheet(f.base_url+"/css/style-ie7.css?rnd=2"),V&&document.createStyleSheet(f.base_url+"/css/style-ie8.css?rnd=2")):document.body.appendChild(a);this._cssIsLoad=!0}},_createWidget:function(){this._loadCss();this._createTopWrap();k.create(this._wrapDiv);k.setColor(f.widget_color,
"dark"==f.widget_font_color);n.setColor(f.widget_color,"dark"==f.widget_font_color)},_changeBrowserLocation:function(a,b){"function"==typeof window.parent.history.pushState&&window.parent.history.pushState({},b,a)},_chatserverUrl:function(){var a=window.location.protocol+"//";"comet"in jivo_config?(a+=jivo_config.comet.host,"https:"==window.location.protocol?"secure_port"in jivo_config.comet&&(a+=":"+jivo_config.comet.secure_port):"plain_port"in jivo_config.comet&&(a+=":"+jivo_config.comet.plain_port)):
a+="node.jivosite.com";return a+"/jsonp/"},_checkSession:function(a){I(this._chatserverUrl()+a+"?name=url_change&title="+encodeURIComponent(document.title)+"&url="+encodeURIComponent(window.top.location.href)+"&cb=?",s.bind(this._pingResult,this));this._scheduleEvent("timer.check_session",2E3)},_pingResult:function(a){this._cancelEvent("timer.check_session");"object"==typeof a&&"ok"==a.result?this.handle("session.exist"):this.handle("session.not_found")},_openNewWindow:function(){this._chatWindow=
window.open("http:"+jivo_config.base_url+"/script/window/"+jivo_config.widget_id,"jivo_"+jivo_config.widget_id,"")},_listenMessages:function(a){h("JIVO: listening for window messages");"addEventListener"in window?window.addEventListener("message",s.bind(this._windowMessage,this,a),!1):"attachEvent"in window&&window.attachEvent("message",s.bind(this._windowMessage,this,a))},_windowMessage:function(a,b){this.handle([a,b.data.action].join("."),b)},isMobile:function(){return this._mobile},isSeparateWindow:function(){return"undefined"!=
typeof jivo_newWindow},_callUserFunction:function(a){a="jivo_"+a;if("function"==typeof window[a])try{h("JIVO: calling user function "+a),window[a](),h("JIVO: user function "+a+" returned")}catch(b){}},getCurrentPage:function(){return this._forcedCurrentPage?this._forcedCurrentPage:{url:window.location.href,title:document.title}},_stripHashFromLocation:function(a){0<window.location.href.indexOf("#jvhs_"+a)&&this._changeBrowserLocation(window.location.href.replace("#jvhs_"+a,""),document.title)},states:{NOT_INITIALIZED:{"window.loaded":function(){h("window.loaded");
var a=v("client_id");if(a&&0==a.indexOf("z"))this.transition("BLACKLISTED");else if(this.isSeparateWindow())f.widget_padding=50,this._createWidget(),this._listenMessages("parent"),this.transition("NEW_WINDOW_INIT"),n.create(this._wrapDiv);else{this._mobile&&this._listenMessages("new_window");try{if(window.parentSandboxBridge&&window.parentSandboxBridge.inAir){window.parentSandboxBridge.process("onIframeDomReady");this.transition("COBROWSE_SELECT");return}}catch(b){}a=window.location.hash.split("jvhs_");
s.isUndefined(a[1])||(this._loadCss(),k.getCobrowsingObjectByHashId(a[1]));if(window!=window.top){a=!1;try{a=window.top.jivo_magic_var==jivo_magic_var}catch(c){this.transition("IN_FOREIGN_IFRAME");return}if(a){window.parent.jivo.handle("iframe.url_change",window.location.href,document.title);this.transition("IN_IFRAME");return}}this._createWidget();this._callUserFunction("onLoadCallback");(a=v("sess_id"))?(this._checkSession(a),this.transition("CHECKING_SESSION")):"online"==f.chat_mode?(t.handle("check_rules"),
this.transition("ONLINE")):this.transition("OFFLINE")}}},CHECKING_SESSION:{"session.exist":function(){this.transition("ONLINE")},"session.not_found":function(){v("sess_id",null);"online"==f.chat_mode?(t.handle("check_rules"),this.transition("ONLINE")):(k.setOffline(),k.setText(f.offline_widget_label),this.transition("OFFLINE"))},"timer.check_session":function(){this.handle("session.not_found")}},BLACKLISTED:{},COBROWSE_SELECT:{_onEnter:function(){}},IN_IFRAME:{"cobrowse.highlight":function(a){this._loadCss();
k.getCobrowsingObjectByHashId(a.hash)},"api.open":function(a){window.parent.jivo.handle("api.open",a)},"cobrowse.close":function(a){window.parent.jivo.handle("cobrowse.close",a)}},ONLINE:{"widget.click":function(a){A.trackChatOpenedByClick();t.handle("cancel");a&&(this.open_params=a);this._mobile?(this._openNewWindow(),this.transition("MOBILE")):this.transition("CHAT_INIT")},"api.open":function(a){this.handle("widget.click",a)},"cobrowse.close":function(a){this._stripHashFromLocation(a)},show_proactive:"CHAT_INIT_PROACTIVE"},
CHAT_INIT:{_onEnter:function(){k.setText(r("lblLookingForFreeAgent"));n.create(this._wrapDiv)},"chat.onload":function(){k.hide();n.show(this.open_params);f.disable_iframe||C.create();k.setText(f.online_widget_label);this.transition("CHAT_OPEN")}},CHAT_OPEN:{_onEnter:function(){this._callUserFunction("onOpen")},"chat.minimized":function(){k.show();n.hide();this.transition("CHAT_CLOSED")},"iframe.url_change":function(a,b){this._changeBrowserLocation(a,b);n.sendUrlChange(a,b)},"chat.agent_connected":function(){A.trackChatConnected();
k.setText(r("lblChatIsOnline"))},"chat.agent_disconnected":function(){k.setText(r("lblChatEnded"))},"chat.force_offline":function(){k.setOffline();k.setText(f.offline_widget_label);this.transition("CHAT_OPEN_OFFLINE")},"chat.blacklisted":function(){n.hide();this.transition("BLACKLISTED")},"cobrowsing.click":function(a){var b=document.location.href.split("#")[0],c=a.page_url+"#jvhs_"+a.hash;if(b==a.page_url||b==encodeURI(a.page_url)){try{document.getElementById("jivo_magic_iframe").contentWindow.jivo.handle("cobrowse.highlight",
a)}catch(e){h(e.toString());return}this._changeBrowserLocation(c,document.title)}else C.navigate(c)},"cobrowse.close":function(a){this._stripHashFromLocation(a)}},CHAT_CLOSED:{_onEnter:function(){this._callUserFunction("onClose")},"widget.click":function(){k.hide();n.show();f.disable_iframe||C.create();this.transition("CHAT_OPEN")},"iframe.url_change":function(a,b){this._changeBrowserLocation(a,b);n.sendUrlChange(a,b)},"chat.agent_message":function(){k.hide();n.show();this.transition("CHAT_OPEN")},
"chat.agent_disconnected":function(){k.setText(r("lblChatEnded"))},"chat.blacklisted":function(){k.hide();this.transition("BLACKLISTED")},"api.open":function(){this.handle("widget.click")},"chat.agent_connected":function(){k.hide();n.show();this.transition("CHAT_OPEN")},"cobrowse.close":function(a){this._stripHashFromLocation(a)}},CHAT_INIT_PROACTIVE:{_onEnter:function(){A.trackProactiveInvitationShown(t.matched_rule.name);n.create(this._wrapDiv)},"chat.onload":function(){k.hide();n.show({start:"proactive",
ruleInfo:t.matched_rule,agentInfo:t.agent});k.setText(f.online_widget_label);this.transition("CHAT_OPEN_PROACTIVE")}},CHAT_OPEN_PROACTIVE:{_onEnter:function(){this._callUserFunction("onOpen")},"chat.minimized":function(){k.show();n.hide();A.trackProactiveInvitationRejected(t.matched_rule.name);t.handle("close");this.transition("CHAT_CLOSED")},"chat.client_message":function(a){A.trackProactiveInvitationAccepted(t.matched_rule.name);this._mobile?(this._openNewWindow(),n.hide(),k.show(),this._proactiveAnswer=
a,this.transition("MOBILE_PROACTIVE")):(f.disable_iframe||C.create(),this.transition("CHAT_OPEN"))}},OFFLINE:{_onEnter:function(){k.setOffline();k.setText(f.offline_widget_label)},"widget.click":function(a){A.trackOfflineFormOpenedByClick();this.transition("CHAT_INIT_OFFLINE");n.create(this._wrapDiv)},"api.open":function(){this.handle("widget.click")}},CHAT_INIT_OFFLINE:{_onEnter:function(){k.setText(r("lblLookingForFreeAgent"))},"chat.onload":function(){k.hide();n.show();this.transition("CHAT_OPEN_OFFLINE")}},
CHAT_OPEN_OFFLINE:{_onEnter:function(){k.setText(f.offline_widget_label);this._callUserFunction("onOpen")},"chat.minimized":function(){k.show();n.hide();this.transition("CHAT_CLOSED_OFFLINE")},"chat.close":function(){n.hide();this.transition("CLOSED")},"chat.offline_sent":function(){A.trackOfflineMessageSent()}},CHAT_CLOSED_OFFLINE:{_onEnter:function(){this._callUserFunction("onClose")},"widget.click":function(a){k.hide();n.show();this.transition("CHAT_OPEN_OFFLINE")},"api.open":function(){this.handle("widget.click")}},
CLOSED:{},NEW_WINDOW_INIT:{_onEnter:function(){k.setText(r("lblLookingForFreeAgent"))},"chat.onload":function(){this._scheduleEvent("ios.timer",1E3);this.transition("NEW_WINDOW_IOS_WAIT")}},NEW_WINDOW_IOS_WAIT:{"ios.timer":function(){try{window.opener.postMessage({action:"ready"},"*")}catch(a){h("JIVO: exception when posting message");k.hide();n.show();this.transition("NEW_WINDOW_READY");return}this._scheduleEvent("timer.init_context",2E3);this.transition("NEW_WINDOW_WAIT_DATA")}},NEW_WINDOW_WAIT_DATA:{"parent.init_context":function(a){this._cancelEvent("timer.init_context");
for(var b=a.data.cookies.split(";"),c=0;c<b.length;c++)"undefined"!=typeof b[c]&&-1<b[c].search("__utm")&&(document.cookie=b[c]+"; path=/;");this._forcedCurrentPage=a.data.current_page;k.hide();"proactive_rule"in a.data?(n.show({start:"proactive",ruleInfo:a.data.proactive_rule,agentInfo:a.data.agent}),n.on({name:"ui_message",msg:a.data.answer})):n.show();this.transition("NEW_WINDOW_READY")},"timer.init_context":function(){k.hide();n.show();this.transition("NEW_WINDOW_READY")}},NEW_WINDOW_READY:{"cobrowsing.click":function(a){window.open(a.page_url+
"#jvhs_"+a.hash)}},MOBILE:{"new_window.ready":function(a){a.source.postMessage({action:"init_context",current_page:{url:window.location.href,title:document.title},cookies:document.cookie},a.origin)},"widget.click":function(){this._openNewWindow()},"new_window.store_session_id":function(a){h("JIVO: storing session_id="+a.data.sess_id);v("sess_id",a.data.sess_id)}},MOBILE_PROACTIVE:{"new_window.ready":function(a){a.source.postMessage({action:"init_context",current_page:{url:window.location.href,title:document.title},
cookies:document.cookie,proactive_rule:t.matched_rule,agent:t.agent,answer:this._proactiveAnswer},a.origin);this.transition("MOBILE")}},IN_FOREIGN_IFRAME:{}}});z.on("handling",function(a){h("JIVO: handling "+a.inputType+" in state "+this.state)});z.on("nohandler",function(a){h("JIVO: unhandled "+a.inputType+" in state "+this.state)});z.on("transition",function(a){h(["JIVO: transition from:",a.fromState,"to:",a.toState,"action:",a.action].join(" "))});var t=new U({initialState:"INIT",setActiveRule:function(a){for(var b=
0;b<f.proactive_rules.length;b++)if(f.proactive_rules[b].id==a){this.log("Matched rule is set to "+a);this.matched_rule=f.proactive_rules[b];return}throw Error("Rule with id="+a+" does not exist");},states:{INIT:{check_rules:function(){if(f.options&16&&f.proactive_rules&&0<f.proactive_rules.length){var a=(new Date).getTime(),b=v("enter_ts");b?b=parseInt(b):(b=a,v("enter_ts",b));var c=v("pages_cnt");c||(c=0);v("pages_cnt",++c);this.log("Clean url="+this.url);for(var e,g,h=!1,l=v("closets"),l=l?parseInt(l):
0,k=0;k<f.proactive_rules.length;k++){e=f.proactive_rules[k];if(!e.invitationText)throw Error("Invitation text is empty");s.defaults(e,{name:e.invitationText,urlPrefix:[{url:"/",mm:0}],page_timeout:20,close_timeout:300,enter_timeout:0,pages_count:0});this.checkUrl(e.urlPrefix)&&e.pages_count<=c&&(g=Math.max(a+1E3*e.page_timeout,b+1E3*e.enter_timeout,l+1E3*e.close_timeout),!h||g<h)&&(this.matched_rule=e,h=g)}this.matched_rule?(a=h-a,this.log("Timeouting invite for "+a+" (rule="+this.matched_rule.name+
")"),this._scheduleEvent("invite",a),this.transition("PAUSE")):(this.log("No proactive rules matched"),this.transition("IDLE"))}else this.log("There is no rules!"),this.transition("IDLE")},cancel:"IDLE","api.show":function(a){this.setActiveRule(a);this.transition("LOADING_AGENT")}},PAUSE:{invite:"LOADING_AGENT",cancel:function(){this._cancelEvent("invite");this.transition("IDLE")},"api.show":function(a){this.setActiveRule(a);this.transition("LOADING_AGENT")}},LOADING_AGENT:{_onEnter:function(){var a=
this.restoreAgentInfo(),b=f.base_url+"/script/active-agent/"+f.widget_id+"?cb=?";a&&(b+="&agent_id="+a.agent_id);this.log("Loading agent");I(b,s.bind(this.handle,this,"agent_loaded"))},agent_loaded:function(a){"object"==typeof a?(this.storeAgentInfo(a),z.handle("show_proactive",a),this.transition("SHOWN")):(this.log("Agent not found"),this.transition("IDLE"))},"api.show":function(a){this.setActiveRule(a)},cancel:"IDLE"},CLOSED:{_onEnter:function(){v("closets",(new Date).getTime())},"api.show":function(a){throw Error("Invitation was already closed");
}},IDLE:{"api.show":function(a){this.setActiveRule(a);this.transition("LOADING_AGENT")}},SHOWN:{close:"CLOSED","api.show":function(){throw Error("Invitation is already displayed");}}},matched_rule:!1,agent:!1,url:window.location.href.replace("http://","").replace("https://",""),log:function(a){h("Proactive inviter: "+a)},checkUrl:function(a){for(var b,c=0;c<a.length;c++)switch(a[c].mm){case 1:if(this.url==a[c].url)return!0;break;case 2:try{b=new RegExp(a[c].url,"g")}catch(e){this.log("Regexp error="+
e.toString());continue}if(b.test(this.url))return!0;break;default:if(0<=this.url.toLowerCase().indexOf(a[c].url.toLowerCase()))return!0}return!1},storeAgentInfo:function(a){this.agent=a;v("agent_info",""+a.agent_id)},restoreAgentInfo:function(){var a=v("agent_info");return a?{agent_id:a.split("$$")[0]}:!1}});t.on("handling",function(a){h("Proactive inviter: handling "+a.inputType+" in state "+this.state)});t.on("nohandler",function(a){h("Proactive inviter: unhandled "+a.inputType+" in state "+this.state)});
t.on("transition",function(a){h(["Proactive inviter: transition from:",a.fromState,"to:",a.toState,"action:",a.action].join(" "))});var k={_widgetDiv:0,_html:"<div id='jivo_chat_widget_online'>\r\n\t\t\t\t<div id='jivo-label' class='fixed-"+f.widget_orientation+"'>\r\n\t\t\t\t\t\t<table id='jivo-label-wrapper' class='"+f.style_string+"' style='height: "+f.widget_height+"px'>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-status'></td>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-text'>"+f.online_widget_label+
"</td>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-copyright'></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t",_verticalHtml:"<div id='jivo_chat_widget_online'>\r\n\t\t\t\t<div id='jivo-label' class='fixed-"+f.widget_orientation+"'>\r\n\t\t\t\t\t\t<table id='jivo-label-wrapper' class='"+f.style_string+"'>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-copyright'></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-text'><img src='"+
(f.avatar_url?f.avatar_url:f.base_url)+"/text-img/"+f.widget_id+"_"+f.chat_mode+".png' /></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td id='jivo-label-status'></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t",_statusSpan:0,_containerDiv:0,getOffset:function(a){for(var b=0,c=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{top:c,left:b}},create:function(a){h("adding widget...");
var b=this;this._widgetDiv=document.createElement("div");this._widgetDiv.onclick=function(){b._clicked()};this._widgetDiv.setAttribute("id","jivo_chat_widget");switch(f.widget_orientation){case "top":case "bottom":this._widgetDiv.innerHTML=this._html;break;case "left":case "right":this._widgetDiv.innerHTML=this._verticalHtml}a.appendChild(this._widgetDiv);a=document.getElementById("jivo-label-copyright");if(f.options&8&&f.hide_ad)a.style.width="7px",a.style.height="7px";else{var c="";switch(f.widget_font_color){case "light":switch(f.widget_orientation){case "left":case "right":c=
"js-logo-light_vl.png";break;case "top":case "bottom":c="js-logo-light.png"}break;case "dark":switch(f.widget_orientation){case "left":case "right":c="js-logo-dark_vl.png";break;case "top":case "bottom":c="js-logo-dark.png"}}var e=0,g=document.getElementById("jivo_copyright");g||(g=document.createElement("div"),g.innerHTML=r("seo_copyrightText"),g.id="jivo_copyright",g.style.display="none",document.body.appendChild(g));a.innerHTML="<img src='"+f.base_url+"/images/"+c+"' alt='"+r("seo_widgetCopyright")+
"' title='"+r("seo_widgetCopyright")+"' border='0'/>";c=document.createElement("div");c.setAttribute("id","jivo_copyright_corner");c.setAttribute("class",f.widget_orientation);g.appendChild(c);h("adding copyright...");document.getElementById("jivo-label-wrapper");for(var c=g.getElementsByTagName("a"),k=0;k<c.length;k++)c[k].href+="?utm_source="+encodeURIComponent(location.hostname)+"&utm_medium=link&utm_content=widget_popup&utm_campaign=self_ad";a.onmouseover=function(a){if("none"==g.style.display){g.style.display=
"block";var c=document.getElementById("jivo-label");g.style.left=b.getTooltipPosition(a,c).left+"px";"undefined"!=typeof b.getTooltipPosition(a,c).bottom?g.style.bottom=b.getTooltipPosition(a,c).bottom+"px":g.style.top=b.getTooltipPosition(a,c).top+"px"}clearTimeout(e)};g.onmouseover=function(){clearTimeout(e)};g.onmouseout=a.onmouseout=function(){e=setTimeout(function(){g.style.display="none"},700)};document.getElementById("jivo-label-copyright").onclick=function(){b._clicked();return!1}}this._statusSpan=
document.getElementById("jivo_chat_widget_online");this._containerDiv=document.getElementById("jivo_chat_widget_container");if("[object Opera]"==Object.prototype.toString.call(window.opera)){var l=document.getElementById("jivo-label");window.onresize=function(a){l.style.opacity=.99;setTimeout(function(){l.style.opacity=1},10)}}b.setPosition();this.setFontStyle()},_clicked:function(){h("Opening the chat...");var a=document.getElementById("jivo_copyright");a&&(a.style.display="none");z.handle("widget.click")},
hide:function(){this._widgetDiv.style.display="none"},show:function(){this._widgetDiv.style.display=""},setText:function(a){this._widgetDiv&&"left"!=f.widget_orientation&&"right"!=f.widget_orientation&&(document.getElementById("jivo-label-text").innerHTML=a)},setColor:function(a,b){this._containerDiv=document.getElementById("jivo-label-wrapper");this._textContainer=document.getElementById("jivo-label-text");if(this._containerDiv){this._containerDiv.style.borderColor=w(a,.7,.7);this._containerDiv.style.backgroundColor=
a;this._textContainer.style.fontSize=f.font_size+"px";this._textContainer.style.fontFamily=f.font_family;if(this._isDarkText=b)var c=w(a,1.15,.7)+" 0 1px",e=w(a,.1,.5);else c=w(a,.6,1)+" 0 -1px",e="#ffffff";this._textContainer.style.color=e;this._textContainer.style.textShadow=c}},setOffline:function(){document.getElementById("jivo_chat_widget_online").setAttribute("id","jivo_chat_widget_offline");for(var a=function(a){var b;try{b=document.getElementsByClassName(a)}catch(c){b=[];a=new RegExp("\\b"+
a+"\\b");for(var e=document.getElementsByTagName("*"),f=0;f<e.length;f++)a.test(e[f].className)&&b.push(e[f])}return b},b=!1,c=a("jivo-btn jivo-online-btn"),e=0;e<c.length;e++)b||(b=c[e].style.display),c[e].style.display="none";c=a("jivo-btn jivo-offline-btn");for(e=0;e<c.length;e++)c[e].style.display=b},getElementPosition:function(a){for(var b=a.offsetWidth,c=a.offsetHeight,e=0,g=0,f=document.all&&!window.opera,h=f?this.ietruebody().clientWidth:window.innerWidth,f=f?this.ietruebody().clientHeight:
window.innerHeight,k=a;a;)e+=a.offsetLeft,g+=a.offsetTop,a=a.offsetParent;0==e&&0==g&&(e=k.getBoundingClientRect().left,g=k.getBoundingClientRect().top);return{left:e,top:g,width:b,height:c,windowWidth:h,windowHeight:f}},ietruebody:function(){return document.compatMode&&"BackCompat"!=document.compatMode?document.documentElement:document.body},setPosition:function(){var a=document.getElementById("jivo-label"),b=10;_offset=10;_i=1;_prev=0;_detect=setInterval(function(){var c=a.offsetWidth,e=a.offsetHeight;
switch(f.widget_orientation){case "left":case "right":switch(f.widget_padding){case "0":b=-10;break;case "50":b=e/2;break;case "100":b=e+_offset}break;case "top":case "bottom":switch(f.widget_padding){case "0":b=-10;break;case "50":b=c/2;break;case "100":b=c+_offset}}switch(f.widget_orientation){case "top":case "bottom":"100"==f.widget_padding?(a.style.left="",a.style.right="10px"):(a.style.left=f.widget_padding+"%",a.style.right="",a.style.marginLeft=-1*b+"px");a.style.height=f.widget_height+"px";
break;case "right":case "left":a.style.top=f.widget_padding+"%",a.style.marginTop=-1*b+"px",a.style.width=f.widget_height+"px"}10<=_i&&clearInterval(_detect);_i++},100)},setFontStyle:function(){var a=document.getElementById("jivo-label-text");switch(f.font_type){case "normal":a.style.fontWeight="normal";a.style.fontStyle="normal";break;case "italic":a.style.fontWeight="normal";a.style.fontStyle="italic";break;case "bold":a.style.fontWeight="bold";a.style.fontStyle="normal";break;case "bold italic":a.style.fontWeight=
"bold",a.style.fontStyle="italic"}a.style.fontSize=f.font_size},getTooltipPosition:function(a,b){var c=this.getElementPosition(b),e=this.getElementPosition(document.getElementById("jivo_copyright")),g={top:0,left:0};switch(f.widget_orientation){case "left":g={top:c.top+10,left:c.left+c.width+10};break;case "right":g={top:c.top+10,left:c.left-e.width-10};break;case "top":g={top:c.top+(c.height+15),left:c.left+(c.width-e.width)};break;case "bottom":g={bottom:c.height+10,left:c.left+(c.width-e.width)}}return g},
getCobrowsingObjectByHashId:function(a,b){I(f.base_url+"/script/cobrowsing?cb=?&hash="+a,function(a){s.isObject(a)&&(0==a.comment.length&&(a.comment=r("lblDefaultCobrowseComment")),a.comment=a.comment.replace(/</g,"&lt;").replace(/>/g,"&gt;"),childSandboxBridge.process("highlight",a),childSandboxBridge.process("renderTooltip",a))})}},P={_RGBtoHSV:function(a){var b=new E(0,0,0),c=a.r/255,e=a.g/255;a=a.b/255;var g=Math.min(c,e,a),f=Math.max(c,e,a),h=f-g;b.v=f;if(0==h)b.h=0,b.s=0;else{b.s=h/f;var g=
((f-c)/6+h/2)/h,k=((f-e)/6+h/2)/h,h=((f-a)/6+h/2)/h;c==f?b.h=h-k:e==f?b.h=1/3+g-h:a==f&&(b.h=2/3+k-g);0>b.h&&(b.h+=1);1<b.h&&(b.h-=1)}b.h=Math.round(360*b.h);b.s=Math.round(100*b.s);b.v=Math.round(100*b.v);return b},_HSVtoRGB:function(a){var b=new y(0,0,0),c=a.h/360,e=a.s/100;a=a.v/100;if(0==e)b.r=255*a,b.g=255*a,b.b=255*a;else{var f=6*c,c=Math.floor(f),h=a*(1-e),k=a*(1-e*(f-c)),e=a*(1-e*(1-(f-c)));0==c?(var_r=a,var_g=e,var_b=h):1==c?(var_r=k,var_g=a,var_b=h):2==c?(var_r=h,var_g=a,var_b=e):3==c?(var_r=
h,var_g=k,var_b=a):4==c?(var_r=e,var_g=h,var_b=a):(var_r=a,var_g=h,var_b=k);b.r=255*var_r;b.g=255*var_g;b.b=255*var_b;b.r=Math.round(b.r);b.g=Math.round(b.g);b.b=Math.round(b.b)}return b},_CMYKtoRGB:function(a){var b=new y(0,0,0),c=a.m/100,e=a.y/100,f=a.k/100;b.r=1-Math.min(1,a.c/100*(1-f)+f);b.g=1-Math.min(1,c*(1-f)+f);b.b=1-Math.min(1,e*(1-f)+f);b.r=Math.round(255*b.r);b.g=Math.round(255*b.g);b.b=Math.round(255*b.b);return b},_RGBtoCMYK:function(a){var b=new F(0,0,0,0),c=a.r/255,e=a.g/255;a=a.b/
255;b.k=Math.min(1-c,1-e,1-a);b.c=(1-c-b.k)/(1-b.k);b.m=(1-e-b.k)/(1-b.k);b.y=(1-a-b.k)/(1-b.k);b.c=Math.round(100*b.c);b.m=Math.round(100*b.m);b.y=Math.round(100*b.y);b.k=Math.round(100*b.k);return b},toRGB:function(a){if(a instanceof y)return a;if(a instanceof E)return this._HSVtoRGB(a);if(a instanceof F)return this._CMYKtoRGB(a)},toHSV:function(a){if(a instanceof E)return a;if(a instanceof y)return this._RGBtoHSV(a);if(a instanceof F)return this._RGBtoHSV(this._CMYKtoRGB(a))},toCMYK:function(a){if(a instanceof
F)return a;if(a instanceof y)return this._RGBtoCMYK(a);if(a instanceof E)return this._RGBtoCMYK(this._HSVtoRGB(a))}},A={_trackEvent:function(a,b){"undefined"!=typeof _gaq&&(h("tracking google analytics event: "+a+"/"+b),_gaq.push(["_trackEvent","JivoSite",a,b]))},trackChatOpenedByClick:function(){this._trackEvent("Chat requested","User clicked chat widget")},trackOfflineFormOpenedByClick:function(){this._trackEvent("Offline form shown","User offline form")},trackOfflineMessageSent:function(){this._trackEvent("Offline message sent",
"User sent message via offline form")},trackProactiveInvitationShown:function(a){this._trackEvent("Proactive invitation shown",a)},trackProactiveInvitationAccepted:function(a){this._trackEvent("Proactive invitation accepted",a)},trackProactiveInvitationRejected:function(a){this._trackEvent("Proactive invitation rejected",a)},trackChatConnected:function(){this._trackEvent("Chat established","User connected to agent")}},n={_chatHtml:"\t\t\t\t<div id='jivo_drag_handle'></div>\t\t\t\t<div id='jivo_mouse_tracker' style='display: none'></div>\t\t\t\t<div id='jivo_iframe_wrap'>\t\t\t\t\t<div id='jivo_iframe_placeholder'></div>\t\t\t\t</div>\t",
_content:"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\t\t<html>\t\t<head>\t\t\t<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\t\t\t<link rel='stylesheet' href='"+f.base_url+"/css/chat_inner.css?rnd=2205'/>\t\t\t<link rel='stylesheet' href='"+f.base_url+"/css/buttons.css?rnd=2205'/>\t\t\t\x3c!--[if lte IE 7]>\t\t\t<link rel='stylesheet' href='"+f.base_url+"/css/style-ie7.css?rnd=2205' type='text/css' media='all'/>\t\t\t<![endif]--\x3e\t\t\t\x3c!--[if lte IE 8]>\t\t\t<link rel='stylesheet' href='"+
f.base_url+"/css/style-ie8.css?rnd=2205' type='text/css' media='all'/>\t\t\t<![endif]--\x3e\t\t\t<script type=\"text/javascript\" src=\"//cdn.voximplant.com/voximplant.min.js\">\x3c/script>\t\t\t<title>"+window.document.title+"</title>\t\t</head>\t\t<body id='inner-chat'>\t\t\t<div id='web_phone' class='phone_hidden'>\t\t\t\t<div id='rtc_placeholder'><div id='rtc'></div></div>\t\t\t\t<div id='up_arrow'></div>\t\t\t\t<div id='phone_hint'>"+r("lblPhoneHint")+"</div>\t\t\t</div>\t\t\t<div id='sound_player'></div>\t\t\t<div id='contents_placeholder'></div>\t\t\t<script src='"+
f.base_url+"/js/chat_"+f.locale+".js' charset='UTF-8'>\x3c/script>\t\t</body></html>",_chatDiv:0,_iframe:0,_iframeWrap:0,_doc:0,_window:0,_chat:0,_backgroundColor:0,_borderColor:0,_bodyColor:0,_onload_semaphore:!1,_getDoc:function(){if(this._iframe.contentDocument)return this._iframe.contentDocument;if(this._iframe.contentWindow)return this._iframe.contentWindow.document;h("WARNING! chat_iframe._doc is null");return 0},create:function(a){this._chatDiv=document.createElement("div");this._chatDiv.setAttribute("id",
"jivo_chat");this._chatDiv.style.display="none";switch(f.widget_orientation){case "top":case "bottom":0==f.widget_padding&&(a.style.left="10px");break;case "left":a.style.left="10px";break;case "right":a.style.right="10px"}this._chatDiv.className=f.style_string;this._chatDiv.innerHTML=this._chatHtml;a.appendChild(this._chatDiv);this._iframe=document.createElement("iframe");this._iframe.setAttribute("id","jivo_chat_iframe");this._iframe.setAttribute("frameBorder","0");this._iframe.setAttribute("scrolling",
"no");this._iframe.allowTransparency=!0;this._iframe.style.backgroundColor="transparent";this._iframeWrap=document.getElementById("jivo_iframe_placeholder");this._iframeWrap.appendChild(this._iframe);H(this._iframe,s.bind(this.iframeLoaded,this));this._doc=this._getDoc();this._doc.open();this._doc.write(this._content);this._doc.close();this._window=this._iframe.contentWindow;this.setChatHeight(100);this._updateColor();this.iframeLoaded()},iframeLoaded:function(){this._onload_semaphore?(this._window.chat_contents.init(),
z.handle("chat.onload")):this._onload_semaphore=!0},setColor:function(a,b){h("CHAT: setting color: "+a+" darkText: "+b);this._isDarkText=b;this._backgroundColor=a;this._borderColor=w(a,.6,1);this._bodyColor=w(a,1.15,.5);this._updateColor()},_updateColor:function(){var a=document.getElementById("jivo_chat");a&&(a.style.backgroundColor=this._backgroundColor,a.style.borderColor=this._borderColor,document.getElementById("jivo_iframe_wrap"),this._isDarkText?(w(this._backgroundColor,1.15,.7),w(this._backgroundColor,
.1,.5)):w(this._backgroundColor,.6,1),this._window.setColor&&this._window.setColor(this._backgroundColor,this._isDarkText))},sendUrlChange:function(a,b){if("undefined"!=typeof this._window&&"undefined"!=typeof this._window.controller&&(h("chat_top: got URL change event. New URL: "+a+" newTitle: "+b),"undefined"!=typeof this._window.chat_contents))this._window.chat_contents.onUrlChange(a,b)},setChatHeight:function(a){h("Setting chat height: "+a);this._iframe.style.height=this._iframeWrap.style.height=
a+"px"},setCustomChatHeight:function(a){this._window.chat_contents.setCustomChatHeight(a)},on:function(a){this._window.chat_contents.on(a)},hide:function(){this._chatDiv.style.display="none"},show:function(a){if("undefined"==typeof this._window.chat_contents)throw"chat_contents not ready";this._window.chat_contents.onChatMaximized(a);this._updateColor();this._chatDiv.style.display=""}};window.jivo_chat_top=n;window.jivo_api={open:function(a){z.handle("api.open",a)},showProactiveInvitation:function(a){t.handle("api.show",
a)}};var C={frm:0,create:function(){if(this.frm)h("Magic iframe already created");else{h("Creating iframe");var a=document.createElement("iframe");a.setAttribute("id","jivo_magic_iframe");a.setAttribute("class","frm_inviz");a.setAttribute("frameborder","0px");a.setAttribute("name","col_old_page");document.body.appendChild(a);a.contentWindow.location=window.location;this.frm=a;H(a,s.bind(this.onFrameLoaded,this))}},onFrameLoaded:function(){h("Magic frame content loaded. Time to show the frame...");
var a=document.getElementById("jivo_top_wrap");document.body.setAttribute("id","outer-body");document.body.style.overflow="hidden";document.body.scroll="no";for(var b=document.getElementsByTagName("iframe"),c=0;c<b.length;c++){var e=b[c];"jivo_magic_iframe"!=e.id&&"jivo_chat_iframe"!=e.id&&(e.style.display="none")}this.frm.setAttribute("class","frm_viz");this.frm.style.display="block";T&&(document.body.removeChild(a),document.body.removeChild(this.frm),document.body.innerHTML="",document.body.appendChild(a),
document.body.appendChild(this.frm));document.getElementById("jivo_top_wrap").style.marginRight=this.getScrollBarWidth()+"px";document.getElementById("jivo-label").style.marginRight=this.getScrollBarWidth()+"px";this.syncPageScroll()},navigate:function(a){h("navigating iframe to ",a);this.frm.contentDocument.location.href=a},getDoc:function(){var a=this.frm.contentWindow.document;a||(a=this.frm.contentDocument);return a?a:(h("Cannot find document!! :("),0)},syncPageScroll:function(){var a=0,b=0;"number"==
typeof window.pageYOffset?(b=window.pageYOffset,a=window.pageXOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(b=document.body.scrollTop,a=document.body.scrollLeft):document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)&&(b=document.documentElement.scrollTop,a=document.documentElement.scrollLeft);h("scroll pos x="+a+" y="+b);this.frm.contentWindow.scrollTo(a,b)},getScrollBarWidth:function(){var a=document.createElement("p");a.style.width=
"100%";a.style.height="200px";var b=document.createElement("div");b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.visibility="hidden";b.style.width="200px";b.style.height="150px";b.style.overflow="hidden";b.appendChild(a);document.body.appendChild(b);var c=a.offsetWidth;b.style.overflow="scroll";a=a.offsetWidth;c==a&&(a=b.clientWidth);document.body.removeChild(b);return c-a}};window.childSandboxBridge={_queue:[],_ready:0,_inAir:0,process:function(a,b){var c=document.getElementById("jivo_frame");
c||(window.parentSandboxBridge&&window.parentSandboxBridge.inAir&&(this._inAir=!0),c=W.init(function(){h("jivoFrame has been inited");window.parentSandboxBridge&&window.parentSandboxBridge.process("onJqueryIframeReady");childSandboxBridge._ready=!0;childSandboxBridge.process()}));if(this._ready){if(this._queue.length){var e=this._queue.shift();a=e.name;b=e.params}this.inAir()?(h("controller of childSandboxBridge set as for Air"),c=c.contentWindow.jqueryFrameControllerForAir,e=document.createElement("link"),
e.setAttribute("rel","stylesheet"),e.setAttribute("href",f.base_url+"/css/for_air.css?rnd=2"),document.body.appendChild(e),c.init()):c=c.contentWindow.jqueryFrameController;h("childSandboxBridge has received event "+a);if(c[a])c[a](b);else h("controller has not "+a);this._queue.length&&this.process()}else this._queue.push({name:a,params:b})},inAir:function(){return this._inAir}};window.parentSandboxBridge&&(h=function(a){window.parentSandboxBridge.log(a)},h("parentSandboxBridge.initInterface() called"),
window.parentSandboxBridge.initInterface());var W={_content:"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n\t\t<html>\r\n\t\t<head>\r\n\t\t\t<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n\t\t\t<script type='text/javascript'  src='"+f.base_url+"/js/jquery_frame.js'>\x3c/script>\r\n\t\t\t<script type='text/javascript'>\r\n    lblDefaultCobrowseComment='"+r("lblDefaultCobrowseComment")+"';\r\n\t\t\t\x3c/script>\r\n\t\t</head>\r\n\t\t<body >\r\n\t\t</body>\r\n        </html>",
_iframe:0,init:function(a){this._iframe=document.createElement("iframe");this._iframe.setAttribute("id","jivo_frame");this._iframe.setAttribute("frameBorder","0");this._iframe.setAttribute("scrolling","no");this._iframe.allowTransparency=!0;this._iframe.style.backgroundColor="transparent";window.document.body.appendChild(this._iframe);H(this._iframe,a);this._doc=this._getDoc();this._doc.open();this._doc.write(this._content);this._doc.close();this._window=this._iframe.contentWindow;this._iframe.contentWindow.controller=
this;return this._iframe},_getDoc:function(){if(this._iframe.contentDocument)return this._iframe.contentDocument;if(this._iframe.contentWindow)return this._iframe.contentWindow.document;h("WARNING! chat_iframe._doc is null");return 0}}})();
