(function(){function a(a){return function(){var c=function(){},d={};if(window.console)d=window.console,c=window.console[a]||window.console.info||c;else if(window.opera)d=window.opera,c=window.opera.postError||c;try{c.apply(d,arguments)}catch(b){try{c(arguments.join(" "))}catch(h){}}}}olark._.P("application");olark("api.chat.onBeginConversation",function(){olark._.hlog("started chatting #begin_conversation")});var b=/^\s*(__Extension0\..+|__ChatApiHelper|__BoxApiHelper|[A-Z]\w+)\s*$/,c=/^\s*(api|box|browser|chat|data|extensions|system|olark|.*olark.*)\s*$/,
d={GoogleAnalytics:null,VisitorInsight:null,VisitorImportance:null,Mixpanel:null,OfflineWarning:null},e="545dc1e1503bdb00791e982129d12cd9";e="545dc1e1503bdb00791e982129d12cd9";var i={Shopify:"84b511ae86af64aa8ab0db5b37fbe132",WelcomeAssist:e,CalloutBubble:"cdf36515aa3da44ff3ea06bddfdbd9d5",WelcomeAssist:e,OfflineWarning:"a019e45d1183d9dd0d80ab0b3c283982",Cobrowse:"ba30b90e67afbcc87f749508c897fd8a"},l=/.*YOUR-SITE-ID-HERE.*/;olark.extend("VisitorInsight");olark.extend("VisitorImportance");olark.extend("Mixpanel");
olark.extend("OfflineWarning");window.olark.__buildinfo=window.olark.__buildinfo||{olarkfile:"/javascript/olark.js",corefile:"/javascript/application.js",jshost:window.olark.__version?"static.olark.com":"olarkdev:8001",dev:!0};var f;if(window.olark.__buildinfo.dev)f={log:a("log"),info:a("info"),warn:a("warn"),error:a("error"),debug:a("debug"),showErrorBacktrace:a("error")};else{f={log:function(){},info:function(){},warn:a("warn"),error:a("error"),debug:function(){},showErrorBacktrace:function(){}};
var g=f.error,v=f.warn;f.error=function(){try{var a=Array.prototype.slice.call(arguments||[]);olark._.hlog(a.join(" "),"#error")}catch(c){}try{g.apply(f,arguments)}catch(d){}};f.warn=function(){try{var a=Array.prototype.slice.call(arguments||[]);olark._.hlog(a.join(" "),"#warn")}catch(c){}try{v.apply(f,arguments)}catch(d){}}}window.olark.__legacy_shim=window.olark.__legacy_shim||{};document.hbl_ssl=/.*https:.*/.test(document.location.protocol)?!0:!1;var n=null,k=null;(function(){var a={};n=function(c){var d=
c.namespace,b=c.type;c=c.callback;if(!d)throw Error("[olark] namespace required");if(!b)throw Error("[olark] type required");if(!c)throw Error("[olark] callback required");a[d]=a[d]||{};a[d][b]=a[d][b]||[];a[d][b].push(c)};k=function(c){var d=c.namespace,b=c.type,h=c.after||null;if(!d)throw Error("[olark] namespace required");if(!b)throw Error("[olark] type required");try{c.namespace=void 0,c.type=void 0,delete c.namespace,delete c.type,delete c.after}catch(g){}a[d]=a[d]||{};for(var i=a[d][b]||[],
j=0;j<i.length;){var k=i[j++];k&&x(function(){k(c)},function(a){f.error("[olark] event handler for '"+d+"."+b+"' failed: "+a.toString());f.showErrorBacktrace(a)})}h&&h()}})();var q=null,r=null,j=null,m=null,h=null,o=null,z=null,p=null,u=null,s=null,x=null;(function(){var a=[];h=function(c,d){var b=setTimeout(d,c.delay);a.push(b);return b};q=function(a){var c=!1;return function(){if(!c)return c=!0,a.apply(a,arguments)}};r=function(a){for(var c=a.length,d="\n";c--;){var b=a[c];d+=c===0?"- "+b:"- "+
b+"\n"}return d};u=function(a){var c=a.url;if(typeof c!="string")throw Error("[olark] string 'url' is required");a=c.indexOf("http://")!=-1;var d=c.indexOf("https://")!=-1;c=c.split("/")[0].indexOf(".")!==0;return!a&&!d&&!c};var c={};j=function(a){var d=a.url;if(typeof d!="string")throw Error("[olark] string 'url' is required");var b="https:"==document.location.protocol?!0:!1;a=d.indexOf("http://")==-1?!1:!0;var h=d.indexOf("https://")==-1?!1:!0,g=a||h;a=null;a=u({url:d})?d:g?d:(b?"https://":"http://")+
d;b&&g&&!h&&f.warn("[olark] you cannot load from ",a," when you are on an SSL page, you will probably get mixed-content warnings");if(!c[a])c[a]=!0,d=document.createElement("script"),b=document.getElementsByTagName("script")[0],d.setAttribute("async",""),d.setAttribute("defer","true"),d.src=a,b.parentNode.insertBefore(d,b)};m=function(a,c){var d=!1,b=function(){a()?d||(d=!0,c()):d||h({delay:50},b)};b()};o=function(a){if(a===null||typeof a!="object")return a;var c=a.constructor(),d;for(d in a)c[d]=
o(a[d]);return c};z=function(a,c){if(a==c||typeof a=="number"&&typeof c=="number"&&isNaN(a)&&isNaN(c))return!0;else if(typeof a=="object"&&typeof c=="object"){for(var d in a)if(!z(a[d],c[d]))return!1;for(var b in c)if(!z(a[b],c[b]))return!1;return!0}else return!1};p=function(a){return a.replace(/\s+$/,"").replace(/^\s+/,"")};s=function(a){if(typeof a.list=="undefined")throw Error("[olark] 'list' required");if(typeof a.separator=="undefined")throw Error("[olark] 'separator' required");var c=a.list;
a=a.separator;for(var d=!0,b="",h=0;h<c.length;h++){var g=c[h];d?(d=!1,b+=g):b+=a+g}return b};x=function(a,c){if(window.olark.__buildinfo.strict)return a();else try{return a()}catch(d){return c(d)}}})();var w=function(a,c){var d=window[a];if(!d)throw Error("[lightloader] stub library not defined: "+a);var b=d.__lightload,h={publicMethods:{}},g=[],i=[];h.getLightloaderVersion=function(){return b.V};h.isDocumentReady=function(){return b.A||0};h.isWindowLoaded=function(){return b.B||0};h.whenDocumentReady=
function(a){h.isDocumentReady()?a():g.push(a)};h.whenWindowLoaded=function(a){h.isWindowLoaded()?a():i.push(a)};h.reloadLibrary=function(){b.D=[];b.l()};var f=function(a){for(var c=a.length>0?a.shift():void 0;c;)c(),c=a.shift()};b.a=function(){b.A=!0;f(g)};b.b=function(){b.B=!0;f(i)};c(d,h);olark.extend=h.publicMethods.extend;olark.declare=h.publicMethods.declare;olark.configure=h.publicMethods.configure;olark.ready=h.publicMethods.ready;(function(){var a=b.D;a.reverse();for(var c=a.length;c-- >0;){var h=
a[c],g=h[0];h=h[1];var i=d[g];i?i.apply(d,h):window.console&&window.console.error&&window.console.error("[lightloader] missing method '"+g+"'")}a.reverse()})()},t=function(a,c){function d(){for(var a=b.callstack,c,j,k,o,e;a.length;)if((c=a.shift())&&c.length)try{if(k=Array.prototype.slice.call(c||[]),j=k.length?k.shift():void 0,e=/api\.[a-zA-Z]+\.(__SPI_)?[a-zA-Z]+/.test(j),j=="debug")(function(){var a=document.createElement("script");a.src="https://static.olark.com/record.js";document.getElementsByTagName("head")[0].appendChild(a)})();
else if(e){var n;a:switch(j){case "api.chat.getVisitorNickname":case "api.chat.getVisitorStatus":case "api.chat.operatorsAreAvailable":case "api.chat.operatorsAreBusy":case "api.chat.operatorsAreAway":case "api.chat.onNotificationToVisitor":case "api.chat.getVisitorNickname":case "api.chat.getVisitorNickname":n=!0;break a;default:n=!1}n?f.warn("[olark] the API call '"+j+"' is deprecated"):(g.push([j,k]),i())}else h.publicMethods.hasOwnProperty(j)?(o=h.publicMethods[j],o.apply(o,k)):f.warn("[olark] unknown method 'olark."+
j+"'")}catch(l){f.error("[olark] unknown exception in dequeueCallbacks: method: "+j+" ",l.message)}else f.warn("[olark] empty method call in dequeueCallbacks #empty_dequeue_call")}var b=olark._,h={publicMethods:{}};h.getLightloaderVersion=function(){return b.v};h.whenDocumentReady=function(a){a()};h.reloadLibrary=function(){olark=olark._=null;b.i()};var g=[],i=function(){};olark.extend(function(a){i=function(){for(var c;g.length;){c=g.shift();var d=c[0];c=c[1];var b=d.split("."),h=b[1];b=b[2];if(a[h]&&
a[h][b])try{a[h][b].apply(a[h],c)}catch(i){f.error(i)}else f.warn("[olark] unknown API call '"+d+"'")}};g.length>0&&i()});c(olark,h);h.publicMethods.call=function(a,c){var d=h.publicMethods[a];d?d.apply(d,c):f.warn("[olark] unknown method 'olark."+a+"'")};olark._.s={push:function(a){b.callstack.push(a);d()}};d()};(function(){var a=window.olark;if(a.__v){f.warn("[olark] you are using an old version of the Olark Code on your page, please check your dashboard to get the new code.");var c=olark.__v[0],
d=olark.__v[1],b=olark.__v[2],h=olark.__v[3],g;for(g in c)typeof c[g]!="function"&&a.configure.apply(a,c[g]);for(var i in d)typeof d[i]!="function"&&a.extend.apply(a,d[i]);for(var j in b)typeof b[j]!="function"&&a.declare.apply(a,b[j]);for(var k in h)typeof h[k]!="function"&&a.ready.apply(a,h[k]);a.__lightload.A=!0}})();(function(a,c){olark._?t(a,c):w(a,c)})("olark",function(a,g){var e=function(a){this.__name=a.name;this.__startup=a.startup;if(typeof this.__name=="undefined")throw Error("[olark] 'name' required");
if(typeof this.__startup=="undefined")throw Error("[olark] 'startup' required");this.__version=a.version||null;this.__source=a.source||null};(function(c){c.get_name=function(){return this.__name};c.get_version=function(){return this.__version};c.get_source=function(){return this.__source};c.get_pretty_string=function(){var a=this.__name;this.__version&&this.__source?a+=" (version "+this.__version+", from "+this.__source+")":this.__version&&(a+=" (version "+this.__version+")");return a};c.activate=
function(c){c=c.configuration;if(typeof c=="undefined")throw Error("[olark] 'configuration' required");var d=/__.+/.test(this.__name)?"__inline":this.__name;this.__startup(new a.__core.api.ApiInstance({conf:c,namespace:d,extension_name:this.__name}),c);k({namespace:"Extension",type:"extensionActivated"})}})(e.prototype);var v=function(a){this.__name=a.name;if(typeof this.__name=="undefined")throw Error("[olark] 'name' required");this.__version=a.version||null;this.__source=a.source||t.get_instance().get_expected_source_for_extension({name:this.__name})};
(function(a){a.get_name=function(){return this.__name};a.get_version=function(){return this.__version};a.get_source=function(){return this.__source};a.get_pretty_string=function(){return this.__name&&this.__version&&this.__source?this.__name+" (version "+this.__version+", from "+this.__source+")":this.__name&&this.__version?this.__name+" (version "+this.__version+")":this.__name&&this.__source?this.__name+" (from "+this.__source+")":this.__name};a.begin_download=function(){this.__source&&j({url:this.__source})};
a.is_downloaded=function(){return t.get_instance().search_for_extension({extension_spec:this}).length>0?!0:!1};a.when_downloaded=function(a){var c=this,d=!1,b=function(){c.is_downloaded()&&!d&&(d=!0,a())};b();n({namespace:"ExtensionManager",type:"registeredExtension",callback:b})}})(v.prototype);var t=function(){this.__extension_specs=[];this.__extension_specs_by_name={};this.__extensions_by_name={};this.__extensions_by_source={};this.__extensions_by_name_and_version={};this.__extensions_by_name_and_source=
{};this.__extensions_by_name_and_version_and_source={}};(function(h){var g=null;t.get_instance=function(){return g=g||new t};var j=0;t.get_next_extension_name=function(){j+=1;return"__Extension0."+j};h.__lazy_load_data_structures=function(a){var c=a.name,d=a.version;a=a.source;this.__extensions_by_name[c]=this.__extensions_by_name[c]||[];this.__extensions_by_source[a]=this.__extensions_by_name[a]||[];this.__extensions_by_name_and_version[c]=this.__extensions_by_name_and_version[c]||{};this.__extensions_by_name_and_version[c][d]=
this.__extensions_by_name_and_version[c][d]||[];this.__extensions_by_name_and_source[c]=this.__extensions_by_name_and_source[c]||{};this.__extensions_by_name_and_source[c][a]=this.__extensions_by_name_and_source[c][a]||[];this.__extensions_by_name_and_version_and_source[c]=this.__extensions_by_name_and_version_and_source[c]||{};this.__extensions_by_name_and_version_and_source[c][d]=this.__extensions_by_name_and_version_and_source[c][d]||{};this.__extensions_by_name_and_version_and_source[c][d][a]=
this.__extensions_by_name_and_version_and_source[c][d][a]||[]};h.get_expected_source_for_extension=function(h){if(typeof h.name=="undefined")throw Error("[olark] 'name' required for extension source lookup");h=h.name;var g=b.test(h)?!1:!0;g=(g=g||c.test(h.toLowerCase()))||/.*_.*/.test(h);if(typeof d[h]!="undefined")return d[h];else if(g)return null;else{g="";for(var j=0;j<h.length;j++){var f=h[j]||h.slice(j,j+1);/[ABCDEFGHIJKLMNOPQRSTUVWXYZ]/.test(f)?(g.length>0&&(g+="-"),g+=f.toLowerCase()):g+=f}return(a._&&
a._.plugins?a._.plugins:window.olark.__buildinfo.jshost+"/javascript/plugins")+"/"+g+".js?v="+(i[h]||"1")}};h.register_declared_extension=function(a){a=a.extension;if(typeof a=="undefined")throw Error("[olark] 'extension' required");var c=a.get_name(),d=a.get_version(),b=a.get_source();b&&u({url:b})&&(b=null);this.__lazy_load_data_structures({name:c,version:d,source:b});this.__extensions_by_name[c].push(a);this.__extensions_by_source[b].push(a);this.__extensions_by_name_and_version[c][d].push(a);
this.__extensions_by_name_and_source[c][b].push(a);this.__extensions_by_name_and_version_and_source[c][d][b].push(a);k({namespace:"ExtensionManager",type:"registeredExtension"})};h.for_each_extension_spec=function(a){for(var c=this,d=c.__extension_specs.length,b=c.__extension_specs,h=0;h<d;)x(function(){a(c.__extension_specs[h],b)},function(a){f.error("[olark] error while iterating over required extension specs: "+a.toString(),b);f.showErrorBacktrace(a)}),h++};h.register_extension_spec=function(a){a=
a.extension_spec;if(typeof a=="undefined")throw Error("[olark] 'extension_spec' required");var c=a.get_name(),d=a.get_version(),b=a.get_source();b&&u({url:b})&&(b=null);var h=this.__extension_specs_by_name[c];if(h){var g=h.get_version(),i=h.get_source();d&&b&&g&&i?(d!=g||b!=i)&&f.warn("[olark] conflicting extensions:",a.get_pretty_string(),"and",h.get_pretty_string()):d&&g?d!=g&&f.warn("[olark] conflicting extensions:",a.get_pretty_string(),"and",h.get_pretty_string()):b&&i&&b!=i&&f.warn("[olark] conflicting extensions:",
a.get_pretty_string(),"and",h.get_pretty_string())}this.__extension_specs.unshift(a);this.__extension_specs_by_name[c]=a;k({namespace:"ExtensionManager",type:"registeredExtensionSpec"})};h.search_for_extension=function(a){var c=a.name,d=a.version,b=a.source;if(a=a.extension_spec)c=a.get_name(),d=a.get_version(),b=a.get_source();b&&u({url:b});b=null;this.__lazy_load_data_structures({name:c,version:d,source:b});if(c&&d&&b)return this.__extensions_by_name_and_version_and_source[c][d][b];else if(c&&d)return this.__extensions_by_name_and_version[c][d];
else if(c&&b)return this.__extensions_by_name_and_source[c][b];else if(d&&b)throw Error("[olark] cannot search by version and source");else if(c)return this.__extensions_by_name[c];else if(b)return this.__extensions_by_source[b];else if(d)throw Error("[olark] cannot search by version");else throw Error("[olark] missing search criteria");}})(t.prototype);var w=function(){var a=this;a.__configuration_callbacks=[];n({namespace:"ExtensionManager",type:"registeredExtensionSpec",callback:function(){a.__check_for_olark_key()}})};
(function(c){function d(c){var b,h,g=a._?a._.defaults:null;if(g)for(b in g)if(g.hasOwnProperty(b))for(h in c[b]||(c[b]={}),g[b])g[b].hasOwnProperty(h)&&(c[b][h]=g[b][h]);return c}var b=null;w.get_instance=function(){return b=b||new w};c.register_configure_callback=function(a){a=a.callback;if(typeof a=="undefined")throw Error("[olark] 'callback' required");this.__configuration_callbacks.push(a);this.__check_for_olark_key()};c.read_configuration=function(){var a=this.__read_configuration({ignore_errors:!1});
a.system.olark_key=this.get_olark_key();return a};c.get_olark_key=function(){var a=this.__read_configuration({ignore_errors:!0});if(a.chat.legacy_site_id)a.system.legacy_site_id=a.system.legacy_site_id||a.chat.legacy_site_id,f.warn("[olark] conf.chat.legacy_site_id is deprecated, please use conf.system.legacy_site_id instead");var c=this.__parse_olark_site_id_from_dom();if(a=a.system.site_id||a.system.olark_key||a.system.legacy_site_id||window.olark.__k||c)a=a.replace(/^\s*/,"").replace(/\s*$/,""),
l.test(a)&&(a="0000-0000-0000-0000");return a};c.__parse_olark_site_id_from_dom=function(){var a=document.getElementById("olark-key");if(a&&a.className)return p(a.className.replace("site-",""));else for(var c in a=document.getElementsByTagName("a"),a)if(typeof a[c]!="function"){var d=a[c];if(d&&d.className=="olark-key")return d.style.display="none",d.id.replace("olark-","")}return null};c.__read_configuration=function(a){a=a||{};a=a.ignore_errors?!0:!1;var c={box:{},chat:{},data:{},browser:{},extensions:{},
system:{},locale:{}};c=d(c);t.get_instance().for_each_extension_spec(function(a){c[a.get_name()]=c[a.get_name()]||{}});for(var b=0;b<this.__configuration_callbacks.length;){if(typeof this.__configuration_callbacks[b]=="function"){var h=this.__configuration_callbacks[b];if(a)try{h(c)}catch(g){}else x(function(){h(c)},function(a){f.error("[olark] error with your configuration, overall configuration may be incomplete now: "+a.toString());f.showErrorBacktrace(a)})}b++}return c};c.__check_for_olark_key=
function(){this.get_olark_key()&&k({namespace:"ConfigurationManager",type:"olarkKeyAvailable"})}})(w.prototype);var G=function(a){if(a.length<6)throw Error("[olark] extensions cannot be named '"+a+"', names must be more than 6 letters long");if(b.test(a)){if(c.test(a.toLowerCase()))throw Error("[olark] extensions cannot be named '"+a+"', that name is protected for internal use");}else throw Error("[olark] extensions cannot be named '"+a+"', names must start with a capital alphabetic letter and contain only alpha characters");
},L=function(a){var c=!1,d=function(){var d=!0;t.get_instance().for_each_extension_spec(function(a){a.is_downloaded()||(d=!1)});d&&!c&&(c=!0,a())};d();n({namespace:"ExtensionManager",type:"registeredExtension",callback:d});h({delay:6E3},function(){if(!c){c=!0;a();var d=[];t.get_instance().for_each_extension_spec(function(a){a.is_downloaded()||d.push(a.get_pretty_string())});f.warn("[olark] unable to download some extensions:",d.join(","))}})},I=function(a){var c=!1;m(function(){return window.olark&&
window.olark.__core&&window.olark.__core.api&&window.olark.__core.box&&window.olark.__core.chat&&window.olark.__core.data&&window.olark.__core.extensions&&window.olark.__core.framestorewithjson&&window.olark.__legacy_shim&&window.olark.__legacy_shim.legacy_stub_is_loaded&&window.olark.__legacy_shim.legacy_post_stub_is_loaded},function(){c||(c=!0,a())});h({delay:5E3},function(){c||(c=!0,a(),f.warn("[olark] unable to download core libraries."))})},M=function(a){var c={};t.get_instance().for_each_extension_spec(function(d,
b){var h=t.get_instance().search_for_extension({extension_spec:d}),g=null;if(h.length===0)f.error("[olark] no loaded extensions matched:"+d.get_pretty_string(),b);else if(h.length==1)g=h[0];else{g=h[0];h=h.slice(1);for(var i=[],j=h.length;j--;){var k=h[j].get_pretty_string();i.push(k)}f.warn("[olark] more than one extension matched for "+d.get_pretty_string(),", so we used the first one:",g.get_pretty_string(),"\nYou might want to be more specific. These extensions were also found:",r(i))}(h=c[d.get_name()])?
f.warn("[olark] we already loaded an extension by the name of "+d.get_name(),"(",h.get_pretty_string(),")",b):g&&(g.activate({configuration:a}),c[d.get_name()]=g)});k({namespace:"core",type:"extensionsActivated"})},B=function(){g.publicMethods.extend=function(a){f.warn("[olark] you cannot do olark.extend() once Olark is already starting up (dropping extension:"+a+")")};g.publicMethods.configure=function(){f.warn("[olark] you cannot do olark.configure() once Olark is already starting up.")}},O=function(a){var c=
w.get_instance().get_olark_key();a=q(a);c?a():n({namespace:"ConfigurationManager",type:"olarkKeyAvailable",callback:a})};a.__core={listen_for_event:n,trigger_event:k,async_script_load:j,logger:f,format_bulleted_list_for_logger:r,wait_for:m,is_extension_required:function(a){var c=a.extension_name;if(typeof c=="undefined")throw Error("[olark] 'extension_name' required");var d=!1;t.get_instance().for_each_extension_spec(function(a){a.get_name()==c&&(d=!0)});return d},create_idempotent_callback:q,trigger_olark_boot_process:function(){window.olark.__buildinfo.dev&&
j({url:window.olark.__buildinfo.jshost+"/javascript/olark/__development.js?"+ +new Date});I(function(){g.whenDocumentReady(function(){O(function(){var c=w.get_instance().get_olark_key();window.olark.__core.data.prepare(c,function(){var c=new window.olark.__core.data.StorejsKeyStore({conversationId:a._.conversationId});if(a._.isNewConversation)c.clearConversationData(),window.olark.__legacy_shim.isNewConversation=!0;B();L(function(){a._.P("extready");var c=w.get_instance().read_configuration();if(c.system.domain)try{window.olark.__core.data.forceDomain(c.system.domain),
window.olark.__legacy_shim.forced_cookie_domain=c.system.domain}catch(d){f.warn("[olark] unable to use domain '"+c.system.domain+"' ("+d+")")}if(c.system.path)try{window.olark.__core.data.forcePath(c.system.path)}catch(b){f.warn("[olark] unable to use path '"+c.system.path+"' ("+b+")")}M(c);var h=new a.__core.api.ApiInstance({conf:c,namespace:"__bootprocessplugin",extension_name:"__bootprocessplugin"}),g=c.system.deferred_chat_connection!==!0||h.chat.__SPI_hasConnectedAlready();a._.preventBoot!=!0&&
g&&c.system.disable_event_connection!==!0&&h.chat.connect()})})})})})},when_document_is_ready:function(a){g.whenDocumentReady(a)},when_corelib_is_available:I,do_async_call:h,run_legacy_code:function(a){return a(window)},clone_object:o,deep_equals:z,join_string_list:s,for_each_extension_name_starting_with_most_recent:function(a){t.get_instance().for_each_extension_spec(function(c){a(c.get_name())})},after_extensions_are_activated:function(a){n({namespace:"core",type:"extensionsActivated",callback:a})},
try_and_optionally_catch:x,ConfigurationManager:w};g.publicMethods.extend=function(c,d){x(function(){var b=null,h=null,g=null;if(typeof c=="function")b=t.get_next_extension_name(),a.declare({name:b,startup:c});else if(typeof c=="string")b=c,h=d?d.version:null,g=d?d.source:null,G(b);else throw Error("[olark] extend requires either an extension name or an inline startup function");b=new v({name:b,version:h,source:g});b.begin_download();t.get_instance().register_extension_spec({extension_spec:b})},function(a){f.error("[olark] failed in olark.extend: "+
a.toString());f.showErrorBacktrace(a)})};g.publicMethods.declare=function(a,c){x(function(){var d=null,b=null,h=null;typeof a=="string"?(f.warn("[olark] old-style extension declarations are no longer supported"),b=a.split("@"),d=b[0],b=b.length==2?b[1]:null,h=c):(d=a.name,b=a.version,h=a.startup);G(d);d=new e({name:d,version:b,startup:h});t.get_instance().register_declared_extension({extension:d})},function(a){f.error("[olark] failed in olark.declare: "+a.toString());f.showErrorBacktrace(a)})};g.publicMethods.configure=
function(a,c){var d,b;typeof a=="string"?(b=a.split("."),d=function(a){var d=b[0];(a=a[b[0]])?(d=b[1])&&d[0]!="_"?a[d]=c:f.warn("[olark] cannot configure private key:",d):f.warn("[olark] unknown configuration namespace:",d)}):d=a;w.get_instance().register_configure_callback({callback:d})};g.publicMethods.ready=function(a){a()};g.publicMethods.identify=function(){};g.publicMethods.load=function(){}});try{window.olark.__core.trigger_olark_boot_process()}catch(B){j({url:""})}})();
window.hbl_ssl=document.location.protocol=="https:"?!0:!1;hbl_ext=window.hbl_ssl?"https":"http";hblCacheConstant="application";hbl_hostname="olark.com/nrpc";hbl_static_hostname="static.olark.com";hblStaticPath=hbl_ext+"://static.olark.com/js";hblPostURL=hbl_ext+"://www.olark.com/emails/create";hblPopupURL=olark&&olark._&&olark._.popout?olark._.popout:hblStaticPath+"/html/popout.html";hblUrlHandler=olark&&olark._&&olark._.follow?olark._.follow:hblStaticPath+"/html/url_handler.html";
hblPostStub=hblStaticPath+"/wc_post.js?"+hblCacheConstant;hblJSInline=!0;hblName="Olark Chat";hblInstallUrl="http://www.olark.com/dashboard/install";var hbl={util:{},pipelines:{},themes:{},hwindow_util:{},plugins:{},hwindow:{config:function(){this.vars={};this.palette={};this.style_id={};this.style={};this.style_classes={};this.style_classes_map={}}},jsoncallback_norv:function(){}};
hbl.util.eventmanager=function(){this.registered_events={};this.register=function(a,b,c){this.registered_events[a]==void 0&&(this.registered_events[a]=[]);c==void 0&&(c=999);this.registered_events[a].push({handler:b,priority:c});this.registered_events[a]=this.registered_events[a].sort(function(a,c){return a.priority-c.priority})};this.handle=function(a,b){if(this.registered_events[a]!=void 0){b==void 0&&(b={});b.window=this.win;b.event_name=a;var c="",d;for(d in b)b.hasOwnProperty(d)&&(c+=d+"="+b[d]+
"|");for(var e in this.registered_events[a])this.registered_events[a].hasOwnProperty(e)&&this.registered_events[a][e]&&typeof this.registered_events[a][e].handler=="function"&&this.registered_events[a][e].handler(b)}};this.unregister_all=function(a){this.registered_events[a]=[]};this.setWindow=function(a){this.win=a}};var hblrpcTrick=1,hblDEBUG=0,hblnoconsole=1,hblHideUnsupported=1,hblJavaScriptVersion="0.5m",hblBegincall="begin_2",hblJSInline=!0,hbl_max_event=1E3,hbl_hostname_delimiter=".";
hbl.eventmgr=new hbl.util.eventmanager;habla_window=void 0;hbl.get_current_page=function(){return document.URL};hbl.get_current_referrer=function(){return document.referrer};hbl.hconfig=function(){this.vars={input_width_offset_normal:16,input_width_offset_ie:16,input_width_offset_compat:8,theme_url:"../theme.js"};this.palette={};this.style={};this.plugins=new hbl.util.pluginlist;this.style_id={};this.style_classes={};this.style_classes_map={}};
hbl.hconfig.prototype.setMargin=function(a){this.setMargins(a,a,a,a)};hbl.hconfig.prototype.setMargins=function(a,b,c,d){this.vars.bottom_margin=d;this.vars.right_margin=c;this.vars.left_margin=a;this.vars.top_margin=b};hbl.hconfig.prototype.setPosition=function(a){this.vars.corner_position=a};
hbl.hconfig.prototype.setDirectionRtl=function(a){this.vars.rtl=a;this.style_classes.habla_conversation_div='height: $vars["convo_height_px"]; overflow: auto; border-bottom: 1px dotted $palette["control"]; background: transparent; line-height: 1.5em; padding: 3px 23px 3px 3px; border: 1px solid';this.style_classes.habla_window_div="z-index:3000; direction: rtl";this.style_classes.habla_conversation_message_off="margin: 0; padding: 3px 23px 3px 3px;";this.style_classes.habla_conversation_p_item='color: $palette["main_fg"]; margin: 0; padding: 0; text-indent: -20px; background: transparent; text-align: right;';
this.style_classes.habla_conversation_person1='color: $palette["local"]; padding-left: 5px; float: right;';this.style_classes.habla_conversation_person2='color: $palette["remote"]; padding-left: 5px; float: right;'};hbl.hconfig.prototype.setInline=function(a){a?(this.vars.is_inline=1,this.vars.disableFocus=1):(this.vars.is_inline=0,this.vars.disableFocus=0)};hbl.hconfig.prototype.setHeight=function(a){this.vars.convo_height=a};hbl.hconfig.prototype.setWidth=function(a){this.vars.width=a};
hbl.util.pluginlist=function(){this.todo=[];this.defined={};this.add=function(a,b){b==void 0&&(b=999);if(a!=void 0&&!this.defined[a.name])this.defined[a.name]=1,this.todo.push({handler:a,priority:b}),this.todo=this.todo.sort(function(a,d){return a.priority-d.priority})}};
hbl.util.get_body=function(){var a=document.getElementsByTagName("html"),b=null;a.length<1?(b=document.createElement("html"),document.appendChild(b)):b=a[0];a=document.getElementsByTagName("body");var c=null;a.length>0?c=document.getElementsByTagName("body").item(0):(c=document.createElement("body"),b.appendChild(c));return c};
hbl.util.get_head=function(){var a=document.getElementsByTagName("html"),b=null;a.length<1?(b=document.createElement("html"),document.appendChild(b)):b=a[0];a=document.getElementsByTagName("head");var c=null;a.length>0?c=document.getElementsByTagName("head").item(0):(c=document.createElement("head"),b.appendChild(c));return c};
hbl.util.simple_load_js_async=function(a){html_doc=hbl.util.get_body();var b=document.createElement("script");b.setAttribute("language","javascript");b.setAttribute("type","text/javascript");b.setAttribute("src",a);html_doc.appendChild(b)};
hbl.util.BrowserDetect={_initialized:!1,init:function(){if(!this._initialized){this.browser=this.searchString(this.dataBrowser,1)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.need_submit_button=this.backwards_dimension=this.backwards_position=!1;if(document.compatMode=="BackCompat")this.backwards_dimension=!0;if(this.browser=="Explorer"&&(this.backwards_position=!0,(this.version>=7||document.body&&typeof document.body.style.maxHeight!=
"undefined")&&document.compatMode!="BackCompat"))this.backwards_position=!1;if(navigator.userAgent&&navigator.userAgent.toLowerCase().indexOf("wii")>-1)this.need_submit_button=!0;this._initialized=!0}},searchString:function(a,b){for(var c=0;c<a.length;c++){var d=a[c].string,e=a[c].prop;this.versionSearchString=a[c].versionSearch||a[c].identity;if(d){if(d.indexOf(a[c].subString)!=-1){if(b!=void 0)this.supported=a[c].supported;return a[c].identity}}else if(e){if(a[c].identity)this.supported=a[c].supported;
return a[c].identity}}},searchVersion:function(a){var b=a.indexOf(this.versionSearchString);if(b!=-1)return parseFloat(a.substring(b+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari",supported:"1"},{prop:window.opera,identity:"Opera",supported:"1"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox",supported:"1"},{string:navigator.vendor,subString:"Camino",identity:"Camino",supported:"1"},{string:navigator.userAgent,subString:"Netscape",
identity:"Netscape",supported:"1"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE",supported:"1"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv",supported:"1"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla",supported:"1"},{string:navigator.userAgent,subString:"iPad",identity:"iPad",supported:"1"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone",supported:"1"}]};
function wc_config(){return new hbl.hconfig}hblHasinit=void 0;
function wc_init(a,b){if(!(hblHasinit||document.URL.search("hblNoInit")>-1))if(hblHasinit=1,hbl.util.BrowserDetect.init(),hbl.util.BrowserDetect.supported||!hblHideUnsupported){a=a||window.__get_olark_key();if(typeof a=="undefined"||!a){var c=document.getElementById("hbl_code");c?(a=c.href.split("#")[1],c.style.display="none"):a="missing-site-id"}hbl.siteid=a;if((hbl.config=b)&&b.palette)for(var d in b.palette)if(typeof b.palette[d]=="string")hbl.need_ugly_backwards_palette_hack=!0;hbl.started=0;
hbl.prev_onload=window.onload;window.onload=function(){habla_load_func(hbl.prev_onload)};window.setTimeout("habla_load_func(hbl.prev_onload)",2500)}}function habla_load_func(a){if(!hbl.started){hbl.started=1;if(a&&typeof a=="function")try{a()}catch(b){}hblJSInline||hbl.util.simple_load_js_async(hblPostStub);hbl.eventmgr.handle("habla_called_wc_init")}}window.__olark_external_start&&window.__olark_external_start();var hbl_link=document.getElementById("hbl_code");
if(hbl_link)hbl_link.style.display="none";(function(){try{var a=document.getElementsByTagName("head")[0],b=document.createElement("style"),c=document.createTextNode(".olark-key,#hbl_code,#olark-data{display: none !important;}");b.type="text/css";b.styleSheet?b.styleSheet.cssText=c.nodeValue:b.appendChild(c);a.appendChild(b)}catch(d){}})();
window.__get_olark_key=function(){var a=document.getElementById("olark-data");if(a&&a.childNodes)for(var b=a.childNodes.length;b--;){var c=a.childNodes[b];if((c.className||"").indexOf("olark-key")!=-1)return c.id.replace("olark-","")}a=document.getElementsByTagName("a");for(b=a.length;b--;)if(c=a[b],(c.className||"").indexOf("olark-key")!=-1)return c.id.replace("olark-","");return null};if(window.olark&&window.olark.__legacy_shim)window.olark.__legacy_shim.legacy_stub_is_loaded=!0;
hbl.hconfig.prototype.merge=function(a,b){this.copy_hash(this.vars,a.vars,b);this.copy_hash(this.style,a.style,b);this.copy_hash(this.palette,a.palette,b);this.copy_hash(this.style_id,a.style_id,b);this.copy_hash(this.style_classes,a.style_classes,b);this.copy_hash(this.style_classes_map,a.style_classes_map,b);if(a.plugins&&a.plugins.todo)for(var c in a.plugins.todo)a.plugins.todo.hasOwnProperty(c)&&this.plugins.add(a.plugins.todo.handler,a.plugins.todo.priority)};
hbl.hconfig.prototype.copy_hash=function(a,b,c){if(b)for(var d in b)if(b.hasOwnProperty(d)&&(c||a[d]==void 0))a[d]=b[d]};hbl.hconfig.prototype.up=function(a){this.merge(a,!0)};hbl.hconfig.prototype.render_all_styles=function(a){for(var b in this.style_classes_map)this.style_classes_map.hasOwnProperty(b)&&typeof b=="string"&&a[b]&&this.render_element_classes(a,b)};
hbl.hconfig.prototype.render_stylesheet=function(){hbl.util.css.create_css_class("div#habla_window_div p","padding:0;");for(var a in this.style_classes)if(this.style_classes.hasOwnProperty(a)){var b=this.render_part(this.style_classes[a]);hbl.util.css.create_css_class("."+a,b)}};hbl.hconfig.prototype.smart_join=function(a,b){var c="",d;for(d in a)a.hasOwnProperty(d)&&typeof a[d]=="string"&&(c+=a[d]+b);return c};
hbl.hconfig.prototype.render_element_classes=function(a,b){this.set_element_classes(a[b],b)};hbl.hconfig.prototype.set_element_classes=function(a,b){if(a&&this.style_classes_map[b]&&this.style_classes_map[b].join)a.className=this.smart_join(this.style_classes_map[b]," ")};hbl.hconfig.prototype.render_element=function(a,b){this.render_element_classes(a,b)};
hbl.hconfig.prototype.render_class=function(a,b,c){if(a&&a.className){var d=a.className.split(" "),e=[],i;for(i in d)d.hasOwnProperty(i)&&typeof i=="string"&&d[i]!=c&&d[i]!=b&&e.push(d[i]);e.push(b);a.className=this.smart_join(e," ")}};hbl.hconfig.prototype.render_ie_hacks=function(){if((hbl.util.BrowserDetect.backwards_position&&this.vars.disableJSStyles&&!this.vars.is_inline||this.vars.yahoo_ui)&&!window.hbl.__ie6_floating_div_monitor)window.hbl.__ie6_floating_div_monitor=new window.__ie6_float_hack};
hbl.hconfig.prototype.remap_palette=function(){var a={mainbg:"main_bg",mainfg:"main_fg",titlebg:"title_bg",titlefg:"title_fg",buttonbg:"button_bg",buttonfg:"button_fg",buttonhi:"button_bg_highlight",titlebg_highlight:"title_bg_highlight",titlefg_highlight:"title_fg_highlight",control:"control_border",control_highlight:"control_highlight_border",local:"local_fg",remote:"remote_fg",border:"panel_border"},b;for(b in a)a.hasOwnProperty(b)&&typeof b=="string"&&this.palette[b]&&(this.palette[a[b]]=this.palette[b]);
this.palette.buttonfg&&(this.palette.button_fg_highlight=this.palette.buttonfg)};
hbl.hconfig.prototype.init_from_config=function(a){a.setWidth(this.vars.width);a.setHeight(this.vars.height);this.vars.is_inline?a.setInline(this.vars.is_inline):a.setPosition(this.vars.corner_position);a.setMargins(this.vars.left_margin,this.vars.top_margin,this.vars.right_margin,this.vars.bottom_margin);a.setInputHeight(this.vars.input_height);a.setFormInputHeight(this.vars.input_height);hbl.util.BrowserDetect.browser=="Opera"&&(this.vars.poll=!0)};
hbl.hconfig.prototype.load_defaults=function(){this.plugins=new hbl.util.pluginlist;this.vars=[];this.palette={};this.palette.link="#e75917";this.vars.line_length=21;this.vars.bottom_margin=10;this.vars.right_margin=10;this.vars.left_margin=10;this.vars.top_margin=10;this.vars.width=260;this.vars.height=155;this.vars.panel_offset=20;this.vars.resize_input_height=60;this.vars.input_height=20;this.vars.corner_position="BR";this.vars.offline_msg_mode=!0;this.vars.rtl=!1;this.vars.resize_length=25;this.vars.myname=
"you";this.vars.say_text="Type here and hit <enter> to chat";this.vars.send_text="Send";this.vars.check_for_status=hblName+" (startup)";this.vars.disable_expand_text_input=!1;this.vars.disable_set_cookies=!1;this.vars.disable_get_cookies=!1;this.vars.cookie_path="/";this.vars.hbl_cookie_path="/";this.vars.session_expire=void 0;this.vars.local_user_display_name="&rarr;";this.vars.disableGoogleAnalytics=0;this.vars.expandOnMessageReceived=0;this.vars.enable_google_analytics=!1;this.vars.google_analytics_domain=
"auto";this.vars.language="en";this.vars.enableLanguageTranslation=!1;this.vars.expandOnFirstMessageReceived=1;this.vars.close_hides_window=!1;this.vars.plugin_path=hblStaticPath+"/plugins/";this.vars.divid="habla_window_div";this.vars.poll=!1;hbl.util.BrowserDetect.browser=="Opera"&&(this.vars.poll=!0);this.vars.habla_name_input_text="<click here> and type your Name";this.vars.habla_offline_email_text="<click here> and type your Email";this.vars.habla_offline_body_text="We're not around but we still want to hear from you!  Leave us a note:";
this.vars.habla_offline_submit_value="Send";this.vars.habla_offline_sent_text="Thanks for your message!  We'll get back to you shortly.";this.vars.in_chat_text="Now Chatting";this.vars.before_chat_text="Chat with us!";this.vars.not_available_text="Contact us!";this.vars.busy_text="Contact us";this.vars.away_text="Contact us";this.vars.offline_message="We're not around, but we'd love to chat another time.";this.vars.welcome_msg="Questions? We'd love to chat!";this.vars.busy_message="All of our representatives are with other customers at this time. We will be with you shortly.";
this.vars.enable_buttons=1;this.vars.hide_min_max_buttons=0;this.vars.local_name_override=void 0;this.vars.url_handler_target_window="_top";this.vars.url_handler=hblUrlHandler;this.vars.url_local_pattern=document.domain;this.vars.parse_links=1;this.vars.is_inline=0;this.vars.start_expanded=0;this.vars.start_hidden=0;this.vars.hide_not_available=0;this.vars.append_to_body=1;this.vars.show_away=0;this.vars.hide_when_away=0;this.vars.show_away_as_header=0;this.vars.habla_sizebutton_text_expanded="_";
this.vars.habla_sizebutton_text_compressed="^";this.vars.habla_closebutton_text="x";this.vars.habla_popout_text=">";this.vars.habla_end_popout_text="&lt;&lt;";this.vars.start_visible=!1;this.vars.start_habla_window_visible=!1;this.vars.pre_chat_message="Hi, I am around, click 'start chatting' to contact me.";this.vars.pre_chat_submit="Click here to start chatting";this.vars.pre_chat_error_text="Please enter your name and email in case we get disconnected.";this.vars.show_pre_chat=0;this.vars.require_name=
2;this.vars.require_email=1;this.vars.require_phone=0;this.vars.show_end_popout=0;this.vars.show_popout=0;this.vars.is_popup=0;this.vars.sending_text="sending";this.vars.email_body_error_text="You must complete all fields and specify a valid email address";this.vars.habla_special_div_show_type="block";this.vars.operator_has_stopped_typing_text="has stopped typing";this.vars.operator_is_typing_text="is typing...";this.vars.flash_icons=1;this.vars.flash_titlebar=1;this.vars.default_flash_off_icon=hblStaticPath+
"/images/white.ico";this.vars.default_flash_on_icon=hblStaticPath+"/images/orange.ico";this.style_classes_map={};this.style_id={};this.style_classes={}};if(!window.hbl)window.hbl={};window.hbl.__ie6_floating_div_monitor=void 0;
window.__ie6_float_hack=function(){var a=this;a.__moving=!1;a.__need_to_move=function(){var b=a.__with_complete_habla_window(function(a){var d=a.config.vars;d=__get_element_position({dom_element:a.theme.habla_window_div,top:d.top_margin,bottom:d.bottom_margin,left:d.left_margin,right:d.right_margin,corner:d.corner_position});if(a.theme){var b={x:a.theme.getX(),y:a.theme.getY()};a=d.x-b.x;d=d.y-b.y;return{x:a,y:d,max_diff:Math.max(Math.abs(a),Math.abs(d))}}else return{x:0,y:0,max_diff:0}});return b?
b:{x:0,y:0,max_diff:0}};a.__with_complete_habla_window=function(a){var c=window.habla_window;if(c&&c.config&&c.config.vars&&c.config.vars.corner_position)return a(c)};a.__move_window=function(b,c){a.__with_complete_habla_window(function(a){var e=a.config.vars;e=__get_element_position({dom_element:a.theme.habla_window_div,top:e.top_margin,bottom:e.bottom_margin,left:e.left_margin,right:e.right_margin,corner:e.corner_position});a.theme.setXY(e.x-b,e.y-c)})};a.__check_location=function(){a.__move_to_correct_location();
setTimeout(function(){a.__check_location()},500)};a.__move_to_correct_location=function(b){var c=a.__need_to_move();if(b||!(c.max_diff<2))b||c.max_diff<15?a.__move_window(0,0):(a.__move_window(0,c.y*0.5),setTimeout(function(){a.__move_to_correct_location()},40))};a.stop=function(){a.__timeout&&clearTimeout(a.__timeout);a.__timeout=void 0};a.start=function(){a.stop();a.__timeout=setTimeout(function(){a.__check_location()},500)};a.__move_to_correct_location(!0);a.start()};
var __get_element_position=function(a){var b=0,c=0;b=a.dom_element.offsetWidth;c=a.dom_element.offsetHeight;var d=window.innerWidth||(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth),e=window.innerHeight||(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight),i=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,l=document.documentElement.scrollTop?document.documentElement.scrollTop:
document.body.scrollTop;b=a.corner.match("R")?d+i-a.right-b:a.left+i;c=a.corner.match("B")?e+l-a.bottom-c:a.top+l;if(!c)c=margin.top;if(!b)b=margin.right;return{x:b,y:c}};hbl.util.pluginlist.prototype.load=function(a){for(var b=0;b<this.todo.length;b++)this.todo[b]&&this.todo[b].handler&&typeof this.todo[b].handler.load=="function"&&this.defined[this.todo[b].handler.name]==1&&(this.todo[b].handler.load(a),this.defined[this.todo[b].handler.name]=2);return a};hbl.util.last_js_id=0;
hbl.util.last_js_pollid=0;hbl.util.pipeline=function(a){this.todo=[];this.host_obj=a;this.add=function(a,c){c==void 0&&(c=999);this.todo.push({handler:a,priority:c});this.todo=this.todo.sort(function(a,c){return a.priority-c.priority})};this.run=function(a){for(var c=a,d=0;d<this.todo.length;d++)if(this.todo[d]&&typeof this.todo[d].handler=="function"){c=this.todo[d].handler(a,this.host_obj);if(c==void 0)return;a=c}return c};this.setTarget=function(a){this.host_obj=a}};
hbl.util.pluginloader=function(a,b,c){hbl.pluginArgs={conf:a,client:b,hwindow:c};a.plugins.load({conf:a,client:b,hwindow:c})};hbl.util.timestamp=function(){return(new Date).toUTCString()};hbl.util.reportException=function(a){olark._.hlog("exception:",a,"#error")};hbl.util.urlencode=function(a){var b="",c;for(c in a)a.hasOwnProperty(c)&&(b+=c+"="+encodeURIComponent(a[c])+"&");return b};
hbl.util.load_js_async=function(a){hbl.util.last_js_id+=1;hbl.util.last_js_pollid+=1;var b="jscript"+hbl.util.last_js_id;a+=a.indexOf("?")>-1?"&"+b:"?"+b;if(hbl.util.last_js_id>1900)if(a.match(/sendmessage/i)||a.match(/begin/i))hbl.util.last_js_id=1;else return;html_doc=hbl.util.get_body();var c=document.createElement("script");c.setAttribute("language","javascript");c.setAttribute("id",b);c.setAttribute("type","text/javascript");c.setAttribute("src",a);html_doc.appendChild(c)};
hbl.util.remove_element=function(a){a=document.getElementById(a);a!=void 0&&a.parentNode!=void 0&&a.parentNode.removeChild(a)};hbl.util.monitor_wcsid_changes_from_another_tab_periodically=function(){function a(){olark.__legacy_shim.stop_refreshing_oklv!==!0&&(olark._.cookieManager.set("_oklv",+new Date),setTimeout(a,b))}var b=(hbl.client.config||hbl.config).vars.max_milliseconds_conversation_can_be_idle/2;a()};
hbl.util.append_script=function(a,b,c){var d=hbl.util.append_script,e=c.scriptid,i=c.url,l=c.tries,f=c.timeout,g=c.error_callback,v=c.success_callback,n=c.cache,k=c.retryid?c.retryid:"";a.opera&&!f&&(f=200);var q=function(c){var h=b.getElementById(e+k);h?(h.loaded=!0,h.parentNode!=void 0&&h.parentNode.removeChild(h),g&&g({status:c}),l>0?a.setTimeout(function(){d(a,b,{scriptid:e,retryid:"r"+l,url:i,tries:l,timeout:f,error_callback:g,cache:n})},800):window.olark&&window.olark._.hlog&&olark._.hlog("#rpc_call_error-"+
c+" url:"+i)):v&&v()};c=i;if(!n){var r=c.length>0&&c.charAt(c.length-1)!="&"&&c.charAt(c.length-1)!="?";c.match(/\?/)?r&&(c+="&"):c+="?";c+="_rnd="+Math.random()}c=c.replace("?","?j="+e+k+"&");var j=b.createElement("script");j.setAttribute("language","javascript");j.setAttribute("id",e+k);j.setAttribute("type","text/javascript");j.setAttribute("src",c);j.loaded=!1;l&&(l-=1);if(f)j.timeout=a.setTimeout(function(){q("timeout")},f);j.readyState?j.onreadystatechange=function(){if((j.readyState=="loaded"||
j.readyState=="complete")&&!j.loaded)j.onreadystatechange=function(){},j.loaded=!0,j.timeout&&a.clearTimeout(j.timeout),a.setTimeout(function(){q("error")},100)}:(j.onload=function(){if(!j.loaded)j.loaded=!0,j.timeout&&a.clearTimeout(j.timeout),a.setTimeout(function(){q("error")},100)},j.onerror=function(){if(!j.loaded)j.loaded=!0,j.timeout&&a.clearTimeout(j.timeout),a.setTimeout(function(){q("error")},100)});c=b.getElementsByTagName("script")[0];c.parentNode.insertBefore(j,c)};
hbl.util.as_dom=function(a){var b;if(typeof a=="object")return a;b=document.createElement("span");b.innerHTML=a;return b};hbl.util.find_or_create_el=function(a,b,c){var d=document.getElementById(a);if(!d||d.length<0)b==void 0&&(b="div"),d=document.createElement(b),d.setAttribute("id",a),c!=void 0&&c.appendChild(d);if(b=="input"||b=="textarea")d.name=a;return d};hbl.util.find_or_create_div=function(a,b){return hbl.util.find_or_create_el(a,"div",b)};
hbl.util.hide_div=function(a){typeof a!="object"&&(a=document.getElementById(a));if(a!=void 0)return a.style.display="none",!0;return!1};hbl.util.show_div=function(a,b){b==void 0&&(b="block");typeof a!="object"&&(a=document.getElementById(a));if(a!=void 0)return a.style.display=b,!0;return!1};hbl.util.clean_whitespace=function(a){a=a.replace(/^\s*/,"");a=a.replace(/\s*$/,"");return a=a.replace("'","")};
hbl.util.decode_base64=function(a,b){var c="";if(window.atob)c=window.atob(a);else{var d,e,i,l,f,g=0;a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(g++)),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(g++)),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(g++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(g++)),
d=d<<2|e>>4,e=(e&15)<<4|l>>2,i=(l&3)<<6|f,c+=String.fromCharCode(d),l!=64&&(c+=String.fromCharCode(e)),f!=64&&(c+=String.fromCharCode(i));while(g<a.length)}if(b)eval("output1 = "+c);else return c};
hbl.util.encode_base64=function(a){var b,c,d,e,i=0,l=0,f="";f=[];if(!a)return a;a=hbl.util.utf8_encode(a+"");do b=a.charCodeAt(i++),c=a.charCodeAt(i++),d=a.charCodeAt(i++),e=b<<16|c<<8|d,b=e>>18&63,c=e>>12&63,d=e>>6&63,e&=63,f[l++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e);
while(i<a.length);f=f.join("");switch(a.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f};hbl.util.is_valid_email=function(a){if(/([a-zA-Z0-9_\+\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+/.test(a))return!0;return!1};
hbl.util.utf8_encode=function(a){a=(a+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var b="",c,d,e=0;c=d=0;e=a.length;for(var i=0;i<e;i++){var l=a.charCodeAt(i),f=null;l<128?d++:f=l>127&&l<2048?String.fromCharCode(l>>6|192)+String.fromCharCode(l&63|128):String.fromCharCode(l>>12|224)+String.fromCharCode(l>>6&63|128)+String.fromCharCode(l&63|128);f!==null&&(d>c&&(b+=a.substring(c,d)),b+=f,c=d=i+1)}d>c&&(b+=a.substring(c,a.length));return b};hbl.util.css={};
hbl.util.getElementsByClass=function(a,b){a||(a=document.getElementsByTagName("body")[0]);for(var c=[],d=RegExp("\\b"+b+"\\b"),e=a.getElementsByTagName("*"),i=0,l=e.length;i<l;i++)d.test(e[i].className)&&c.push(e[i]);return c};
var PollingManager=function(a,b,c,d,e){var i=this,l=1,f=!0,g=!1,v=!1,n=!1,k=void 0,q=void 0,r=void 0,j=void 0,m=void 0,h=15,o=0,z=+new Date;c("api.chat.onOperatorsAvailable",function(){n=!0;m=+new Date});c("api.chat.onOperatorsAway",function(){n=!1});/irefox/.test(e.userAgent)&&a.addEventListener&&a.addEventListener("unload",function(){g&&v&&d.client.sendcommand("return_long_poll_now","")},!1);i.setMinAvailablePollTime=function(a){o=a};i.setAllowedDelayWhenSlow=function(a){h=a};i.reset=function(){z=
+new Date};i.__timeOnPage=function(){return(+new Date-z)/1E3};i.__secondsSinceOnline=function(){return m?(+new Date-m)/1E3:void 0};i.__setLastPollStartedTimestamp=function(a){r=a};i.setLongPoll=function(a){f=a};i.startFailSafeIntervalIfNeeded=function(){k||(k=a.setInterval(function(){i.__getNextPollTime(function(a){var c=!1,d=r?(+new Date-r)/1E3:void 0,b=a-+new Date;a==void 0?r==void 0?c=!0:d>300&&(c=!0):r&&+new Date-(r+b)<h&&(c=!0);c&&(i.finishLastPoll(),i.startNextPollNow())})},3E4))};i.startNextPollNow=
function(){v||p()};i.finishLastPoll=function(){v&&(v=!1);j=void 0;lastPollFinishedTimestamp=+new Date;return g};var p=function(c){g=!0;q&&a.clearTimeout(q);q=void 0;i.startFailSafeIntervalIfNeeded();c==void 0&&(c=f?0:900);q=a.setTimeout(function(){i.poll()},c);j=+new Date+c;l=c};i.__determinePollTime=function(a,c,d){return a?(a=0,a=c<120?4E3:c<300?1E4:c<1800?3E4:c<7200?45E3:c/20*1E3,a<o?o:a):d&&d<60?15E3:c<300?45E3:c<3600?15E5:(c=c/2*1300,c<15E5?15E5:c)};i.__getNextPollTime=function(a){c("api.visitor.getDetails",
function(c){var d=c.secondsSinceLastMessage,b=c.secondsSinceLastNotificationToOperator;c=d;if(b!=void 0&&(d==void 0||b<d))c=b;d=i.__timeOnPage();b=i.__secondsSinceOnline();return c!=void 0?c<180?a(void 0):c<300?a(1E4):c<1800?a(2E4):a(i.__determinePollTime(n,d,b)):a(i.__determinePollTime(n,d,b))})};i.scheduleNextPoll=function(){v||i.__getNextPollTime(function(a){if(!j||a==void 0||j>+new Date+a)a>18E5?i.stop():p(a)})};i.stop=function(){g?(g=!1,q&&a.clearTimeout(q),k&&a.clearInterval(k),k=q=void 0,d.client.sendcommand("return_long_poll_now",
"")):g=!1};i.isRunning=function(){return g};i.poll=function(){v=!0;r=+new Date;l==0&&f?d.client.proxy2.getmessages(d.client.sid,d.client.last_poll_index,d.client.callbacks.getmessages):d.client.proxy3.pollmessages(d.client.sid,d.client.last_poll_index,d.client.callbacks.pollmessages)}};
hbl.client={SENDMESSAGE_DELAY:100,incoming_pipeline:new hbl.util.pipeline,first_time:!0,recorded_ssl_ip:!1,op_nickname_map:{},pollingmanager:new PollingManager(window,document,olark,hbl,navigator),is_conversation:function(){var a,b=!1,c=!1;for(a=0;a<hbl.client.buffer.length;++a)hbl.client.buffer[a]&&(hbl.client.buffer[a][0]=="you"&&(b=!0),hbl.client.buffer[a][0]!="you"&&(c=!0));return b&&c},current_operator:function(){var a,b="";for(a=0;a<hbl.client.buffer.length;++a)hbl.client.buffer[a]&&hbl.client.buffer[a][0]!=
"you"&&(b=hbl.client.buffer[a][0]);return b},noop:function(){},callbacks:{precreate:function(){olark._.P("precreate")},begin:function(a){hbl.client.jsoncallback(a,hbl.client.begin_call_back)},sendmessage:function(a){hbl.client.msg_callback(a)},sendpresence:function(){},sendcommand:function(){},pollevents:function(a){hbl.client.pollingmanager.finishLastPoll()&&hbl.client.jsoncallback(a,hbl.client.callbacks.pollmessages1)},pollmessages1:function(a){var b=a;b.is_new_conversation&&hbl.client.eventmgr.handle("session_was_not_in_memcache",
{});b.ipaddress_lookup_needed&&hbl.client.record_ssl_ip();hbl.client.site_is_online=b.site_is_online;hbl.client.conversation_has_slot=b.conversation_has_slot;a={sid:b.conversation_id,hblid:b.visitor_id,chatting:b.in_active_conversation,opstatus:b.status_state,opavailable:b.site_is_online,geoip:b.geolocation_data,ipaddress:b.ipaddress,pop_out:b.is_popup,ssl:b.ssl,box_visible:!0,opbusy:!1,operator_composing_state:a.operator_composing_state,operator_nickname:a.operator_nickname};if(b.operator_has_sent_message&&
b.site_is_online)a.opstatus="available";if(!b.operator_has_sent_message&&b.site_is_online&&a.opstatus!="available")a.opavailable=!1;hbl.client.chatting=a.chatting;if(!a.disconnected){if(hbl.client.first_time)hbl.client.first_time=!1;if(a.exception!="no session found"){if(a.opavailable!=hbl.client.opavailable||hbl.client.opmessage!=a.opmessage||hbl.client.opstatus!=a.opstatus||hbl.client.opbusy!=a.opbusy||hbl.client.pop_out!=a.pop_out)hbl.client.eventmgr.handle("operator_status_change",{available:a.opavailable,
opavailable:a.opavailable,status:a.opstatus,opstatus:a.opstatus,message:a.opmessage,busy:a.opbusy,pop_out:a.pop_out,pop_out_change:hbl.client.pop_out!=a.pop_out,chatting:hbl.client.chatting,box_visible:hbl.client.box_visible,opbusy:a.opbusy}),hbl.client.first_time=!1,hbl.client.opavailable=a.opavailable,hbl.client.opmessage=a.opmessage,hbl.client.opstatus=a.opstatus,hbl.client.opbusy=a.opbusy,hbl.client.pop_out=a.pop_out;if(hbl.client.composing!=a.operator_composing_state)hbl.client.eventmgr.handle("operator_composing",
{composing_type:a.operator_composing_state,operator_nickname:a.operator_nickname}),hbl.client.composing=a.operator_composing_state;a=[];for(var c=!1,d,e=0;e<b.new_events.length;e++){var i=b.new_events[e][0];if(i>hbl.client.last_poll_index)hbl.client.last_poll_index=i;var l=b.new_events[e][1];if(l.body&&l.nickname!="you")a.push([l.nickname,l.body,i]),hbl.client.op_nickname_map[l.nickname]=l.operator_id;if(l.type=="site_config_changed")c=!0,d=l.md5}hbl.client.append1(a);c&&(olark._.setSiteAssetHash(d),
olark._.setLoaderUseAssets("1"));hbl.client.whenNicknameAndPresenceAreAllowed(function(){b.resend_nickname&&hbl.client.eventmgr.handle("resend_nickname",{});b.resend_status&&hbl.client.eventmgr.handle("resend_status",{})});hbl.client.pollingmanager.scheduleNextPoll()}}}},siteid:"",wc_sid:"",sid:"",proxy:null,buffer:[],myname:"you",jsoncallback:function(a,b){a.conversation_does_not_exist?hbl.client.restart_session():a.retry?hbl.client.pollingmanager.startNextPollNow():b!=null&&!a.duplicate_session_id&&
b(a)},begin_call_back:function(a){function b(){function a(c){olark._.cookieManager.erase(c)}a("hblid");a("wcsid");a("_oklv");a("_okbk")}var c=olark._.hlog,d=a;if(a.error){var e=[];a.error=="fatal_boot_exception"&&(b(),e.push("#fatal_boot_exception"));d.invalid_id_format&&(b(),e.push("#invalid_id_format"));d.conversation_does_not_exist&&(b(),e.push("#conversation_does_not_exist"));c("stopped begin call:",a.error,"#error #begin_call_error",e.join(" "))}else if(d.invalid_id_format||d.conversation_does_not_exist)b(),
c("RPC reported no errors, but gave error flags #error #unexpected_rpc_output");else{d.conversation_id!=olark._.conversationId&&c("RPC reported new conversationId:",d.conversation_id,"!=",olark._.conversationId,"#error #new_rpc_wcsid");if(d.visitor_id!=olark._.visitorId&&(c("RPC reported new visitorId, re-storing to cookie:",d.visitor_id,"!=",olark._.visitorId,"#error #new_rpc_hblid"),d.visitor_id))olark._.visitorId=d.visitor_id,olark._.cookieManager.set("hblid",olark._.visitorId,63072E6);c=function(){olark("api.box.__SPI_getLegacyState",
function(c){if(a.no_operator_has_logged_in){olark._.needsFirstTimeOperatorLogin=!0;var d='<b><a href="http://www.olark.com/tutorials/imclient.html?utm_medium=widget&utm_campaign=one_step&utm_source='+hbl.siteid+'" target="_blank">Olark</a> is almost setup</b><br>';d+='The next step is to <a href="http://www.olark.com/tutorials/imclient.html?utm_medium=widget&utm_campaign=one_step&utm_source='+hbl.siteid+'" onclick="hmpmetrics.track(\'next_link_clicked\', {site_id: hbl.siteid, page:hbl.get_current_page() } );return true;">configure your Instant Messaging Program with ';
d+='your username and password</a>. <a href="http://www.olark.com/tutorials/imclient.html" onclick="hmpmetrics.track(\'next_link_clicked\', {site_id: hbl.siteid, page: hbl.get_current_page() } );return true;">Click here for help</a>.';a.habla_message={msg:d,header:"Olark: One Step to Go"}}else olark._.needsFirstTimeOperatorLogin=!1;var b=a;a.site_config_changed&&(olark._.setSiteAssetHash(a.site_md5||a.assets_config_md5),olark._.setLoaderUseAssets("1"));a={sid:b.conversation_id,hblid:b.visitor_id,
chatting:b.in_active_conversation,opstatus:b.status_state,opavailable:b.site_is_online,geoip:b.geolocation_data,ipaddress:b.ipaddress,pop_out:b.is_popup,ssl:b.ssl,opbusy:!1,operator_composing_state:a.operator_composing_state,operator_nickname:a.operator_nickname,habla_message:a.habla_message,box_visible:c.box_visible,box_open:c.box_open};if(b.operator_has_sent_message&&b.site_is_online)a.opstatus="available";if(!b.operator_has_sent_message&&b.site_is_online&&a.opstatus!="available")a.opavailable=
!1;if(a!=null&&!a.error){hbl.client.sid=a.sid;hbl.client.wcsid=a.sid;hbl.client.hblid=a.hblid;hbl.client.chatting=a.chatting;hbl.client.site_is_online=b.site_is_online;hbl.client.conversation_has_slot=b.conversation_has_slot;hbl.client.opavailable=a.opavailable;hbl.client.opmessage=a.opmessage;hbl.client.opstatus=a.opstatus;hbl.client.opbusy=a.opbusy;hbl.client.pop_out=a.pop_out;hbl.client.ssl=a.ssl;hbl.client.box_visible=a.box_visible;hbl.client.geolocation=a.geocode_ip;hbl.client.ip_address=a.ipaddress;
olark._.geoip=a.geoip;olark._.ipaddress=a.ipaddress;hbl.client.eventmgr.handle("chat_started",{chatting:a.chatting,box_open:a.box_open,box_visible:a.box_visible,opstatus:a.opstatus,opavailable:a.opavailable,opmessage:a.opmessage,opbusy:a.opbusy,pop_out:a.pop_out,config:a.config,dconfig:a.dconfig,habla_message:a.habla_message,browser_ip:a.ipaddress,geolocation:a.geocode_ip});hbl.client.last_poll_index=0;if(b.conversation_history){c=[];for(d=0;d<b.conversation_history.length;d++){var g=b.conversation_history[d][0];
if(g>hbl.client.last_poll_index)hbl.client.last_poll_index=g;var e=b.conversation_history[d][1];if(e.body)e.type=="visitor_message"&&(g=0),c.push([e.nickname,e.body,g]),hbl.client.op_nickname_map[e.nickname]=e.operator_id}hbl.client.setContents(c);c.length>0&&hmpmetrics.track("changed_page_while_chatting",{site_id:hbl.siteid,opavailable:a.opavailable,opbusy:a.opbusy,page:hbl.get_current_page()})}hbl.client.eventmgr.handle("operator_status_change",{available:a.opavailable,opavailable:a.opavailable,
opstatus:a.opstatus,status:a.opstatus,message:a.opmessage,busy:a.opbusy,pop_out:a.pop_out,pop_out_change:hbl.client.pop_out!=a.pop_out,chatting:hbl.client.chatting,box_visible:hbl.client.box_visible,opbusy:a.opbusy});hbl.client.opavailable=a.opavailable;hbl.client.opmessage=a.opmessage;hbl.client.opstatus=a.opstatus;hbl.client.opbusy=a.opbusy;hbl.client.pop_out=a.pop_out;hbl.client.eventmgr.handle("operator_composing",{composing_type:a.operator_composing_state,operator_nickname:a.operator_nickname});
hbl.client.composing=a.composing_type;hbl.client.whenNicknameAndPresenceAreAllowed(function(){b.resend_nickname&&hbl.client.eventmgr.handle("resend_nickname",{});b.resend_status&&hbl.client.eventmgr.handle("resend_status",{})});b.is_new_conversation&&hbl.client.eventmgr.handle("session_was_not_in_memcache",{});hbl.client.pollingmanager.scheduleNextPoll()}else a&&a.error&&hbl.client.eventmgr.handle("habla_error",{etype:a.error})})};a.error!="fatal exception"?a.ipaddress_lookup_needed?(hbl.client.sid=
a.conversation_id,hbl.client.wcsid=a.conversation_id,hbl.client.record_ssl_ip(),setTimeout(c,1200)):c():olark._.hlog("#boot #spoof detected")}},start:function(a,b,c,d,e){hbl.client.siteid=c;hbl.client.wcsid=a;if(hbl.client.hblid==void 0)hbl.client.hblid=b;hbl.client.eventmgr=d;hbl.client.config=e;hbl.client.opstatus=null;hbl.client.opavailable=null;hbl.client.opmessage=null;hbl.client.chatting=!1;hbl.client.pop_out=!1;hbl.client.buffer=[];hbl.client.the_count=0;hbl.client.newlinecount=0;hbl.client.lastindex=
0;hbl.client.last_getmessages=new Date;hbl.client.jsondata=null;hbl.client.datareadycallback=null;hbl.client.getmsgcallback=null;hbl.client.first_time=!0;hbl.client.incoming_pipeline.setTarget(this);try{if(hblrpcTrick){var i=parseInt(Math.random()*1E3).toString()+"-async"+hbl_hostname_delimiter+hbl_hostname;hbl.client.proxy=new hbl.client.jsonproxy(i,!1);i=parseInt(Math.random()*1E3).toString()+"-async"+hbl_hostname_delimiter+hbl_hostname;hbl.client.proxy3=new hbl.client.jsonproxy(i,!1);var l=parseInt(Math.random()*
hbl_max_event).toString()+"-events"+hbl_hostname_delimiter;hbl.client.proxy2=new hbl.client.jsonproxy(l+hbl_hostname)}else hbl.client.proxy=new hbl.client.jsonproxy(hbl_hostname),hbl.client.proxy2=hbl.client.proxy,hbl.client.proxy3=hbl.client.proxy;hbl.config&&hbl.config.vars&&!hbl.config.vars.local_mode&&(olark._.P("begin"),hbl.client.proxy.begin(hbl.client.wcsid,hbl.client.hblid,hbl.client.siteid,hbl.get_current_page(),hbl.get_current_referrer(),e.vars.start_passive,e.vars.force_nickname,e.vars.no_system_messages,
hbl.client.begin_call_back))}catch(f){throw hbl.client.chatting=!1,hbl.util.reportException(f),f;}},jsoncallback_norv:function(){},jsonproxy:function(a,b){this.uri=a;this.callq=[];this.rnd=b},check_getmsg:function(){},setContents:function(a){if(!a||a.length==0)if(window.olark&&window.olark.__legacy_shim&&window.olark.__legacy_shim.has_messages_in_history)a=[[null,"  ",0.2]];else return;for(var b=hbl.client.lastindex=0;b<a.length;++b)if(hbl.client.buffer[hbl.client.buffer.length]=[a[b][0],a[b][1],
a[b][2]],a[b][2]>hbl.client.lastindex)hbl.client.lastindex=a[b][2];hbl.client.newlinecount=1;window.olark&&window.olark.__legacy_shim&&window.olark.__legacy_shim.load_missed_messages&&window.olark.__legacy_shim.load_missed_messages(a);hbl.client.eventmgr.handle("receive_message",{type:"start",msg:a})},append:function(a){if(a&&a.length>0){for(var b=0;b<a.length;++b)hbl.client.buffer[hbl.client.buffer.length]=[a[b][0],a[b][1],a[b][2]];hbl.client.newlinecount+=a.length;hbl.client.chatting=!0;hbl.client.eventmgr.handle("send_message",
{type:"local_update",msg:a})}},append1:function(a){if(a&&a.length>0){for(var b=[],c=0,d=0;d<a.length;++d)if(a[d][2]>hbl.client.lastindex){hbl.client.lastindex=a[d][2];var e=hbl.client.incoming_pipeline.run(a[d]);e!=void 0&&(hbl.client.buffer[hbl.client.buffer.length]=e,b.push(e));a[d]&&(c+=1)}hbl.client.newlinecount+=a.length;if(c>0)hbl.client.chatting=!0;b.length>0&&(hbl.client.eventmgr.handle("receive_message",{type:"remote_update",msg:b}),hmpmetrics.track("window_receive_message",{site_id:hbl.siteid,
page:hbl.get_current_page()}))}},msg_callback:function(a){a.error=="operator_is_busy"&&hbl.eventmgr.handle("habla_error",{etype:"operator_is_busy"})},sendmessage:function(a,b,c,d,e,i){hbl.client.lastNickname=e;hbl.client.lastStatusMessage=i;var l=!b;b=[[hbl.client.myname,a,l,c]];l&&hbl.client.append(b);d&&(hbl.client.proxy.setnickname(hbl.client.sid,e),hbl.client.proxy.sendpresence(hbl.client.sid,i,"chat"));setTimeout(function(){hbl.client.proxy.sendmessage(hbl.client.sid,a,l,c,hbl.client.msg_callback)},
hbl.client.SENDMESSAGE_DELAY);hbl.client.pollingmanager.startNextPollNow()},sendofflinemessage:function(a,b){hbl.client.proxy.setnickname(hbl.client.sid,hbl.client.lastNickname);hbl.client.proxy.sendpresence(hbl.client.sid,hbl.client.lastStatusMessage,"chat");setTimeout(function(){hbl.client.proxy.sendofflinemessage(hbl.client.sid,a,b)},hbl.client.SENDMESSAGE_DELAY)},setnickname:function(a){hbl.client.lastNickname=a;hbl.client.whenNicknameAndPresenceAreAllowed(function(){hbl.client.proxy.setnickname(hbl.client.sid,
a)})},sendcommand:function(a,b){hbl.client.proxy.sendcommand(hbl.client.sid,a,b)},record_ssl_ip:function(){if(!hbl.client.recorded_ssl_ip)hbl.client.proxy.geolocation(hbl.client.sid,hbl.client.hblid),hbl.client.recorded_ssl_ip=!0},restart_session:function(){hbl.client.proxy.noop(hbl.client.sid,hbl.client.hblid)},setvcard:function(){},sendpresence:function(a,b){hbl.client.lastStatusMessage=a;hbl.client.whenNicknameAndPresenceAreAllowed(function(){hbl.client.proxy.sendpresence(hbl.client.sid,a,b)})},
log_event:function(a,b){hbl.client.proxy&&hbl.client.proxy.log_event(hbl.client.sid,a,b)},sendexpand:function(){},sendcompress:function(){},sendend:function(){},sendhide:function(){},sendshow:function(){},popout:function(){hbl.client.proxy&&hbl.client.proxy.popout(hbl.client.sid)},end_popout:function(){hbl.client.proxy&&hbl.client.proxy.end_popout(hbl.client.sid)},whenNicknameAndPresenceAreAllowed:function(a){olark("api.visitor.getDetails",function(b){if(b.secondsSinceLastMessage!=void 0||b.secondsSinceLastNotificationToOperator!=
void 0)a();else if(hbl.config.vars.show_in_buddy_list!="chatting")b=hbl.client.site_is_online,hbl.client.conversation_has_slot&&b&&a()})}};hbl.client.map={command:"c",callback:"cb",group_id:"g",group_idstring:"g",conversation_id:"i",script_id:"j",site_idstring:"s",sequence_id:"q",status_message:"m",status_state:"p",current_url:"u",visitor_id:"v",referrer_url:"r"};
hbl.client.jsonproxy.prototype.__build_nrpc_arguments=function(a){var b="";a.command&&(b+="&c="+encodeURIComponent(a.command+""));a.sequence_id&&(b+="&q="+a.sequence_id);var c=hbl.client.map,d=[],e;for(e in a)if(d.push(e),a.hasOwnProperty(e)&&a[e]&&e!="append_settings"&&e!="throttle"&&e!="sequence_id"&&e!="command"){var i=encodeURIComponent(a[e]+"");c[e]&&(e=c[e]);b+="&"+e+"="+i}b==""&&(b="?command=invalid_buffer&buffer_is_empty="+escape(d.join(",")));return b};
hbl.client.jsonproxy.prototype.do_nrpc_call=function(a){var b=a.command,c=a.append_settings,d="",e=hbl_ext;if(b=="create"||b=="sendmessage")hbl.util.last_js_id=1;hbl.util.last_js_id+=1;if(hbl.util.last_js_id<1900){hbl.util.last_js_pollid+=1;this.rnd&&(d=parseInt(Math.random()*10).toString()+"-");var i="/"+b.charAt(0)+"?";b=="geolocation"&&hblrpcTrick?(d="start-"+parseInt(Math.random()*3).toString()+"."+hbl_hostname,d+=i,e="https"):b=="precreate"?(d+=this.uri+i,d=d.replace("/nrpc","/grpc")):d+=this.uri+
i;b=parseInt(Math.random()*1E4)+"."+ +new Date%1E5+"."+hbl.util.last_js_pollid;a.sequence_id=b;a.version=hblJavaScriptVersion;a.pretty=!0;a.throw_exceptions=window.olark.__buildinfo.strict?!0:!1;d+=this.__build_nrpc_arguments(a);hbl.util.append_script(window,document,{scriptid:"o"+hbl.util.last_js_pollid,url:e+"://"+d,tries:c.tries,timeout:c.timeout,cache:!1,error_callback:c.error_callback})}};
hbl.client.jsonproxy.prototype.begin=function(a,b,c,d,e){a||olark._.hlog("missing sid #no_begin_wcsid_input");b||olark._.hlog("missing hblid #no_begin_hblid_input");var i=olark.__legacy_shim.currentGroupIdstring||"ALL";this.do_nrpc_call({command:"precreate",conversation_id:a,visitor_id:b,site_idstring:c,current_url:d,referrer_url:e,callback:"hbl.client.callbacks.precreate",group_id:i,throttle:!1,append_settings:{tries:3,timeout:2E4}});this.do_nrpc_call({command:"create",conversation_id:a,visitor_id:b,
site_idstring:c,current_url:d,referrer_url:e,callback:"hbl.client.callbacks.begin",group_id:i,throttle:!1,append_settings:{tries:3,timeout:2E4}})};hbl.client.jsonproxy.prototype.sendmessage=function(a,b,c,d){this.do_nrpc_call({command:"sendmessage",conversation_id:a,site_idstring:hbl.client.siteid,body:b,no_history:!c,notification:d,callback:"hbl.client.callbacks.sendmessage",group_idstring:olark.__legacy_shim.currentGroupIdstring,version:hblJavaScriptVersion,append_settings:{tries:3,timeout:45E3}})};
hbl.client.jsonproxy.prototype.sendofflinemessage=function(a,b,c){a={command:"sendofflinemessage",conversation_id:a,site_idstring:hbl.client.siteid,body:b,callback:"hbl.client.noop",group_idstring:olark.__legacy_shim.currentGroupIdstring,version:hblJavaScriptVersion,append_settings:{tries:3,timeout:45E3}};for(var d in c)c.hasOwnProperty(d)&&(a["form_"+d]=c[d]);this.do_nrpc_call(a)};
hbl.client.jsonproxy.prototype.sendcommand=function(a,b,c){if(b=="disconnectchat")this.do_nrpc_call({command:"destroy",conversation_id:a,callback:"hbl.client.noop",append_settings:{tries:3,timeout:45E3}});else if(b=="send_compose_state")this.do_nrpc_call({command:"sendcomposing",conversation_id:a,callback:"hbl.client.noop",state:c,append_settings:{tries:3,timeout:45E3}});else if(b=="return_long_poll_now")this.do_nrpc_call({command:"finishlongpoll",conversation_id:a,callback:"hbl.client.noop",state:c,
append_settings:{tries:3,timeout:45E3}});else if(b=="unlock_operator")this.do_nrpc_call({command:"sendunlock",conversation_id:a,callback:"hbl.client.noop",message:c,append_settings:{tries:3,timeout:45E3}});else throw"Unsupported command: "+b;};hbl.client.jsonproxy.prototype.setnickname=function(a,b){this.do_nrpc_call({command:"sendnickname",conversation_id:a,callback:"hbl.client.noop",nickname:b,group_idstring:olark.__legacy_shim.currentGroupIdstring,append_settings:{tries:3,timeout:45E3}})};
hbl.client.jsonproxy.prototype.noop=function(a,b){this.do_nrpc_call({command:"noop",conversation_id:a,visitor_id:b,site_idstring:hbl.siteid,callback:"hbl.client.noop",append_settings:{tries:3,timeout:45E3}})};hbl.client.jsonproxy.prototype.geolocation=function(a,b){this.do_nrpc_call({command:"geolocation",conversation_id:a,visitor_id:b,site_idstring:hbl.siteid,callback:"hbl.client.noop",append_settings:{tries:3,timeout:45E3}})};
hbl.client.jsonproxy.prototype.sendpresence=function(a,b,c){this.do_nrpc_call({command:"sendpresence",conversation_id:a,callback:"hbl.client.noop",status_message:b,status_state:c,group_idstring:olark.__legacy_shim.currentGroupIdstring,append_settings:{tries:5,timeout:45E3}})};
hbl.client.jsonproxy.prototype.getmessages=function(a,b){hbl.client.the_count++;hbl.client.last_getmessages=new Date;this.do_nrpc_call({command:"pollevents",throttle:!1,conversation_id:a,callback:"hbl.client.callbacks.pollevents",timeout:29,after:b,append_settings:{timeout:4E4,error_callback:function(){hbl.client.pollingmanager.finishLastPoll();hbl.client.pollingmanager.startNextPollNow()}}})};
hbl.client.jsonproxy.prototype.pollmessages=function(a,b){hbl.client.the_count++;this.do_nrpc_call({command:"pollevents",throttle:!1,conversation_id:a,callback:"hbl.client.callbacks.pollevents",timeout:0,after:b,append_settings:{timeout:1E4,error_callback:function(){hbl.client.pollingmanager.finishLastPoll();hbl.client.pollingmanager.startNextPollNow()}}})};
hbl.client.jsonproxy.prototype.popout=function(a){this.do_nrpc_call({command:"popout",conversation_id:a,callback:"hbl.client.noop",append_settings:{tries:3,timeout:45E3}})};hbl.client.jsonproxy.prototype.end_popout=function(a){this.do_nrpc_call({command:"endpopout",conversation_id:a,callback:"hbl.client.noop",append_settings:{tries:3,timeout:45E3}})};
hbl.client.jsonproxy.prototype.log_event=function(a,b,c){this.do_nrpc_call({command:"logevent",conversation_id:a,site_idstring:hbl.siteid,callback:"hbl.client.noop",event_type:b,body:c,append_settings:{tries:3,timeout:45E3}})};
hbl._hwindow=function(a,b,c){this.config=b;this.client=a;this.handlers=!1;this.theme=void 0;this.eventmgr=c;this.pop_out=this.offline_msg_visible=this.offline_msg_started=this.has_typed=this.expanded_textbox=this.loaded=!1;this.setTheme=function(a){this.theme&&this.theme.remove();this.theme=a;this.theme.build(this.config,this.client,this.config.vars.start_visible,this.config.vars.start_habla_window_visible);this.check_theme_for_link_div();hbl.util.pluginloader(this.config,this.client,this)};this.check_theme_for_link_div=
function(){if(this.theme){this.config.vars.hkey&&(this.config.vars.special_link=hbl.util.decode_base64(this.config.vars.hkey).replace("href",'style="'+this.config.vars._habla_link_a+'" href'));if(!this.theme.habla_link_div||this.theme.habla_link_div.style&&this.theme.habla_link_div.style.display=="none"||this.theme.habla_link_div.innerHTML.indexOf("http://hab.la")<0&&this.theme.habla_link_div.innerHTML.indexOf("http://www.olark.com")<0||!this.theme.habla_link_div.parentNode){this.theme.habla_link_div=
document.createElement("div");this.config.vars.force_name_habla_link_div&&this.theme.habla_link_div.setAttribute("id","habla_link_div");if(this.config.vars.special_link)this.theme.habla_link_div.innerHTML=this.config.vars.special_link.replace("hblink1","hblink9");this.theme.config.vars.append_middle?this.theme.habla_middle_div.appendChild(this.theme.habla_link_div):this.theme.habla_expanded_div.appendChild(this.theme.habla_link_div)}if(!document.getElementById("hblink9"))this.theme.habla_link_div.innerHTML=
hbl.util.decode_base64("RnJlZSA8YSBocmVmPSJodHRwOi8vd3d3Lm9sYXJrLmNvbS8/ZnJlZV9saXZlaGVscCIgaWQ9ImhibGluazkiIHRhcmdldD0iX2JsYW5rIj5PbGFyazwvYT4gbGl2ZWhlbHAgfCA8YSBocmVmPSJodHRwOi8vd3d3Lm9sYXJrLmNvbS8/bW9yZSIgaWQ9ImhibGluazk5IiB0YXJnZXQ9Il9ibGFuayI+R2V0IGl0ITwvYT48IS0taHR0cDovL3d3dy5vbGFyay5jb20tLT4=");this.set_link(document.getElementById("hblink9"));this.set_link(document.getElementById("hblink99"));this.theme.habla_link_div.setAttribute("style",this.config.vars._habla_link_div);document.getElementById("hblink9")&&
document.getElementById("hblink9").setAttribute("style",this.config.vars._habla_link_a);document.getElementById("hblink99")&&document.getElementById("hblink99").setAttribute("style",this.config.vars._habla_link_a)}};this.set_link=function(a){if(a&&a.href){var c=a.href.split(/[\?\#]/);a.href=c[0]+"?rid="+hbl.siteid+"&"+c[1];a.onclick=function(){hmpmetrics.track("olark_link_clicked",{site_id:hbl.siteid,page:hbl.get_current_page(),extra:c[1]});return!0}}};this.register_handlers=function(){if(!this.handlers)this.handlers=
!0,this.eventmgr.register("window_focus",this.events.onWindowFocus,0),this.eventmgr.register("window_click",this.events.onWindowFocus,0),this.eventmgr.register("window_submit",this.events.onWindowSubmit,0),this.eventmgr.register("window_form_submit",this.events.onWindowFormSubmit,0),this.eventmgr.register("window_topbar_clicked",this.events.topBarClicked,0),this.eventmgr.register("habla_closebutton_a_onclick",this.events.closeClicked,0),this.eventmgr.register("habla_sizebutton_a_onclick",this.events.topBarClicked,
0),this.eventmgr.register("habla_oplink_a_onclick",this.events.topBarClicked,0),this.eventmgr.register("operator_status_change",this.events.onOpstatusStatusChanged,0),this.eventmgr.register("receive_message",this.events.onChatUpdated,0),this.eventmgr.register("send_message",this.events.onChatUpdated,0),this.eventmgr.register("chat_started",this.events.onChatStarted,0),this.eventmgr.register("theme_loaded",this.events.onThemeLoaded,0)};this.get_operator_state=function(){if(this.config.vars.local_mode)return this.config.vars.local_operator_state||
"available";return this.opavailable?this.opbusy?this.config.vars.show_busy_message?"busy":"available":this.opstatus=="chat"||this.opstatus=="available"||!this.opstatus||this.opstatus==""?"available":"notavailable":"notavailable"};this.determine_window_status=function(a){var c={};if(window.olark&&window.olark.__legacy_shim){c=window.olark.__legacy_shim;c.box_state!=null&&(a.box_open=c.box_state=="expanded"?!0:!1);if(c.box_visible!=null)a.window.theme.visible=c.box_visible?!0:!1,a.box_visible=c.box_visible?
!0:!1;a.window.config.vars.close_hides_window&&c.box_state=="closed"&&(a.box_visible=!1);a.window.theme.state=c.box_state||a.window.theme.state}if(a.pop_out&&!a.window.config.vars.is_popup)return!1;if(a.pop_out_change&&!a.pop_out)return!0;if(a.chatting||hbl.client.buffer.length>0&&!a.window.config.vars.close_hides_window)return!0;if(a.box_open||a.window.theme.state=="expanded")return!0;if(a.window.config.vars.start_hidden&&!a.window.theme.visible)return!1;if(a.window.config.vars.close_hides_window&&
!a.box_visible)return!1;if(a.window.config.vars.hide_not_available&&!a.opavailable)return!1;c=a.opavailable&&a.opstatus!="chat"&&a.opstatus!=void 0&&a.opstatus!=""&&a.opstatus!="available";if(a.window.config.vars.hide_not_available&&c)return!1;return!0};this.setInputBox=function(a,c,b){this.theme.setInputBox(a,c,b)};this.setWindowText=function(){var a=this.get_operator_state();if((a=="notavailable"||this.offline_msg_started)&&this.config.vars.offline_msg_mode)this.setHeader(this.config.vars.not_available_text),
this.setOfflineWindow(this.config.vars.offline_message||" ");else if(this.setOfflineWindow(!1),a=="notavailable")this.setHeader(this.config.vars.not_available_text),hbl.client.buffer.length<1&&this.setBody(this.config.vars.offline_message);else if(a=="away")this.config.vars.show_away_as_header&&this.opmessage?this.setHeader(this.opmessage,!0):this.setHeader(this.config.vars.busy_text||this.config.vars.away_text),this.client.buffer.length==0&&this.setBody(this.config.vars.away_message||this.config.vars.busy_message||
this.config.vars.offline_message);else if(a=="busy")this.setHeader(this.config.vars.busy_text),this.setBody(this.config.vars.busy_message);else if(this.client.buffer.length==0){a=b.vars.force_nickname&&b.vars.force_nickname!="";var c=window.olark&&window.olark.__legacy_shim?!0:!1;this.config.vars.show_pre_chat&&!this.theme.pre_chat_sent&&(c||!a)?this.setShowPreChat(!0):this.setBody(this.config.vars.welcome_msg);this.setHeader(this.config.vars.before_chat_text)}else this.setHeader(this.config.vars.in_chat_text)};
this.appendFromBuffer=function(a){if(!this.offline_msg_started)if(this.theme)for(var c=0;c<a.length;c++)a[c]&&this.theme.appendNiceMessage(a[c][0],a[c][1],!0);else hbl.hwindow_last_buffer=a,this.eventmgr.register("theme_loaded",function(a){a.window.appendFromBuffer(hbl.hwindow_last_buffer);hbl.hwindow_last_buffer=""},100)};this.setHeader=function(a,c){a!=void 0&&(c&&(a=".."+a.substr(0,10)+".."),this.theme.setHeader(a))};this.events={onOpstatusStatusChanged:function(a){a.window.opstatus=a.status;a.window.opmessage=
a.message;a.window.opbusy=a.busy;a.window.pop_out=a.pop_out;!a.window.opavailable&&a.available&&(!a.window.config.vars.offline_msg_mode||!a.window.offline_msg_mode)&&a.window.reloadBuffer();a.window.opavailable=a.available;a.window.setWindowText();var c=a.window.determine_window_status(a),b=!a.pop_out&&a.pop_out_change;if(window.olark&&window.olark.__legacy_shim&&b&&window.olark.__legacy_shim.populate_message_history_from_chat_api)habla_conversation_div.innerHTML="",window.olark.__legacy_shim.populate_message_history_from_chat_api();
c||(a.available||!a.window.config.vars.hide_not_available)&&a.window.theme.visible?a.window.show():a.window.hide(1)},onChatUpdated:function(a){a.window.setShowPreChat(!1);a.window.appendFromBuffer(a.msg)},onChatStarted:function(a){a.window.opavailable=a.opavailable;a.window.opbusy=a.busy;a.config&&a.window.config.merge(hbl.util.decode_base64(a.config,!0));a.dconfig&&a.window.config.merge(hbl.util.decode_base64(a.dconfig,!0));a.nick!=null&&!a.nick.match(/webuser\d\d/)&&a.window.setnickname(a.nick,
1);hbl.chat_started_arg=a;if(a.window.theme)a.window.theme.build(a.window.config,a.window.client,!0),a.window.events.onThemeLoaded(a);else if(a.window.config.vars.theme_obj)a.window.setTheme(b.vars.theme_obj),a.window.events.onThemeLoaded(a);else{hbl.chat_started_arg=a;var c="";a.window.config.vars.theme_path&&(c="http://"+hbl_static_hostname+"/"+a.window.config.vars.theme_path);a.window.config.vars.theme_url&&(c=a.window.config.vars.theme_url);hbl.util.simple_load_js_async(c)}hbl.client.eventmgr.handle("chat_loaded",
a)},onThemeLoaded:function(a){a.window.theme||a.window.setTheme(a.obj);hbl.util.BrowserDetect.backwards_position&&hbl.config.render_ie_hacks();a=hbl.chat_started_arg;a.window.determine_window_status(a)?(a.window.show(1),(!a.pop_out||a.window.config.vars.is_popup)&&(a.box_open||a.window.config.vars.start_expanded||window.olark&&window.olark.__legacy_shim&&olark.__legacy_shim.box_state=="expanded")&&a.window.expand()):a.window.hide(1);if(a.habla_message){a.window.config.vars.offline_message=a.habla_message.msg;
if(a.habla_message.header)a.window.config.vars.not_available_text=a.habla_message.header,a.window.setHeader(habla_window.config.vars.not_available_text);a.window.show(1);a.habla_message.expand&&a.window.expand();a.window.theme.habla_conversation_div.scrollTop=0}},onWindowFocus:function(a){a.window.normal();a.window.setWindowText()},topBarClicked:function(a){a.window.normal();a.window.expanded?(a.window.compress(),hmpmetrics.track("window_compressed",{site_id:hbl.siteid,page:hbl.get_current_page()}),
hbl.client.eventmgr.handle("window_compressed")):(a.window.expand(),hmpmetrics.track("window_expanded",{site_id:hbl.siteid,page:hbl.get_current_page()}),hbl.client.eventmgr.handle("window_expanded"));return!1},closeClicked:function(a){a.window.close();hmpmetrics.track("window_close",{site_id:hbl.siteid,page:hbl.get_current_page()});hbl.client.eventmgr.handle("window_closed");return!1},onWindowFormSubmit:function(a){a.window.send()},onWindowSubmit:function(a){a.window.send()}};this.send_pipeline=new hbl.util.pipeline(this);
this.send_pipeline.add(hbl.pipelines.nickname,999);return this};hbl._hwindow.prototype.setnickname=function(a,b){b==void 0&&this.client.setnickname(nickname);b||hmpmetrics.track("window_setnickname",{site_id:hbl.siteid,page:hbl.get_current_page()})};
hbl._hwindow.prototype.show=function(a){this.theme.state=="closed"&&this.theme.__set_css_window_state("compressed");this.theme.show();this.visible=!0;!a&&!this.config.vars.disable_rpc_state&&this.client.sendshow();hbl.eventmgr.handle("habla_window_changed",{type:"show"})};
hbl._hwindow.prototype.popout=function(a){if(habla_popup=window.open(hblPopupURL+"?_ok="+hbl.siteid+"&wcsid="+hbl.client.sid+"&hblid="+hbl.client.hblid+"&olfsk="+olark._.cookieManager.get("olfsk")+"&host="+window.location.host,"habla_popout","width=300,height=400,scrollbars=no,location=no,status=no,menubar=no,toolbar=no,directories=no,resizable=yes"))a||this.client.popout(),this.pop_out=!0,hbl.client.pop_out=!0,habla_popup.focus(),this.hide(a),a||hmpmetrics.track("window_popout",{site_id:hbl.siteid,
page:hbl.get_current_page()}),hbl.eventmgr.handle("habla_window_changed",{type:"popout"})};hbl._hwindow.prototype.end_popout=function(a){this.pop_out=!1;a||this.client.end_popout();hbl.eventmgr.handle("habla_window_changed",{type:"endpop_out"});a||hmpmetrics.track("window_end_popout",{site_id:hbl.siteid,page:hbl.get_current_page()})};
hbl._hwindow.prototype.close=function(a){this.theme.close();!a&&!this.config.vars.disable_rpc_state&&this.client.sendend();this.config.vars.close_hides_window&&this.hide();hbl.eventmgr.handle("habla_window_changed",{type:"close"});a||hmpmetrics.track("window_close",{site_id:hbl.siteid,page:hbl.get_current_page()})};hbl._hwindow.prototype.hide=function(a){this.theme.hide();this.visible=!1;!a&&!this.config.vars.disable_rpc_state&&this.client.sendhide();hbl.eventmgr.handle("habla_window_changed",{type:"hide"})};
hbl._hwindow.prototype.setWidth=function(a){this.theme&&this.theme.setWidth(a);hbl.eventmgr.handle("habla_window_changed",{type:"resize"})};hbl._hwindow.prototype.setInputHeight=function(a){this.theme.setInputHeight(a);hbl.eventmgr.handle("habla_window_changed",{type:"resize"})};hbl._hwindow.prototype.setHeight=function(a){this.theme&&this.theme.setHeight(a);hbl.eventmgr.handle("habla_window_changed",{type:"resize"})};
hbl._hwindow.prototype.compress=function(){this.expanded=!1;this.theme.compress();hbl.util.BrowserDetect.backwards_position&&this.visible&&window.hbl.__ie6_floating_div_monitor&&window.hbl.__ie6_floating_div_monitor.__move_to_correct_location();hbl.eventmgr.handle("habla_window_changed",{type:"compress"});this.config.vars.disable_rpc_state||this.client.sendcompress()};
hbl._hwindow.prototype.expand=function(){this.expanded=!0;hbl.util.BrowserDetect.backwards_position&&this.config.vars.ycorner=="bottom"&&this.theme.setXY(this.theme.habla_window_div.style.left.match(/\d\d*/),this.theme.habla_window_div.style.top.match(/\d\d*/)-this.config.vars.convo_height-this.config.vars.panel_offset);this.theme&&this.theme.expand();this.config.vars.disable_rpc_state||this.client.sendexpand();hbl.eventmgr.handle("habla_window_changed",{type:"expand"})};
hbl._hwindow.prototype.setPosition=function(a){this.theme.setPosition(a);hbl.wcsid||hmpmetrics.track("window_set_position",{site_id:hbl.siteid,corner:a,page:hbl.get_current_page()})};hbl._hwindow.prototype.setInline=function(a){this.theme.setInline(a);hbl.wcsid||hmpmetrics.track("window_set_inline",{site_id:hbl.siteid,value:a,page:hbl.get_current_page()})};
hbl._hwindow.prototype.setMargins=function(a,b,c,d){this.theme.setMargins(a,b,c,d);hbl.wcsid||hmpmetrics.track("window_set_margins",{site_id:hbl.siteid,left:a,top:b,right:c,bottom:d,page:hbl.get_current_page()})};hbl._hwindow.prototype.getHeader=function(){return this.theme.getHeader()};hbl._hwindow.prototype.reloadBuffer=function(){this.theme.setBody("");this.appendFromBuffer(this.client.buffer)};hbl._hwindow.prototype.setBody=function(a){this.setOfflineWindow(!1);this.theme.setBody(a||"")};
hbl._hwindow.prototype.setOfflineWindow=function(a){this.theme.setOfflineWindow(a);hbl.wcsid||hmpmetrics.track("window_show_offline_message_box",{site_id:hbl.siteid,page:hbl.get_current_page()})};hbl._hwindow.prototype.setShowPreChat=function(a){this.theme.setShowPreChat(a);!hbl.wcsid&&a&&hmpmetrics.track("window_show_enter_name",{site_id:hbl.siteid,page:hbl.get_current_page()})};hbl._hwindow.prototype.highlight=function(){this.theme.highlight()};hbl._hwindow.prototype.normal=function(){this.theme.normal()};
hbl._hwindow.prototype.send=function(){var a=this.theme.getMessageInputField(),b=this.theme.getMessageInputFieldValue();if(b==this.config.vars.say_text)this.theme.setMessageInputFieldValue("");else if(b&&b.length>0)try{this.theme.setMessageInputFieldValue("");if(b=this.send_pipeline.run(b))this.client.sendmessage(b),hmpmetrics.track("window_sent_message",{site_id:hbl.siteid,opavailable:this.opavailable,opbusy:this.opbusy,page:hbl.get_current_page()});this.normal()}catch(c){throw c;}this.config.vars.disableFocus||
(a.focus(),setTimeout(function(){habla_window.theme.getMessageInputField().focus()},10));return!1};
hbl.hwindow_util.wrap_and_create_links=function(a,b){function c(a){var b=a.childNodes;if(b.length==0){if(a.data&&(b=a.data.replace(/([^\s]{13})/g,"$1%|%").split("%|%"),b.length>1))for(var d in a=document.createElement("span"),b)if(b.hasOwnProperty(d)&&typeof b[d]=="string"){var i=document.createElement("span");d>0&&i.setAttribute("class","olark_new_line");b[d]=b[d].replace("<","&lt;");b[d]=b[d].replace(">","&gt;");i.innerHTML=b[d];a.appendChild(i);a.appendChild(document.createElement("wbr"))}}else for(d in b)typeof b[d]==
"object"&&a.replaceChild(c(b[d]),b[d]);return a}function d(a,c,b){var d=/^[\<\[]?((https?|ftp|file|telnet|ldap|irc|nntp|news|irc):\/\/\/?)?([\w-]+\.)+[a-zA-Z]{2,4}(:\d+)?(\/[\w\!\#\$\%\&\'\*\+\/\-\=\?\^\_\.\`\{\|\}\~\-]*)*(\?.*)?[\>\]]?$|^[\w\!\#\$\%\&\'\*\+\.\/\-\=\?\^\_\`\{\|\}\~\-]+(?:\.[\w!\#$%&'*+\/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?$/;a=a.split(" ");for(var n in a)a.hasOwnProperty(n)&&(a[n]=a[n].replace(d,function(a){var d='<a href="'+b(a)+'" target="',n=i.config.vars.chat_does_not_follow_external_links?
!0:!1,j=hbl.hwindow_util.refers_to_local_domain(a)?!1:!0;return d+(n&&j?"_blank":c)+'" >'+a.replace(/</,"&lt;").replace(/>/,"&gt")+"</a>"}));return a.join(" ")}function e(a){return hbl.hwindow_util.get_habla_url(a,i)}var i=b;return function(a){a=a.replace(/<\/*body[^>]*>/ig,"");a=a.replace(/<((\/[^a]|[^\/a])[^>]*)>/ig,"<wbr>&lt;$1&gt;<wbr>");i.config.vars.parse_links&&(a=d(a,i.config.vars.url_handler_target_window,e));var b=document.createElement("div");b.innerHTML=a;b=c(b);return b.innerHTML}(a)};
hbl.hwindow_util.refers_to_local_domain=function(a){a=a.replace("http://","");a=a.replace("https://","");return a.indexOf(document.domain)==0?!0:!1};
hbl.hwindow_util.get_habla_url=function(a,b){var c=/^\s*(ftp|file|telnet|ldap|irc|nntp|news|irc).*/,d=/^\s*(\/).*/,e=/^\s*(https?)\:\/\/.+/,i=function(a){if(b.config.vars.url_handler){for(var c=window.location.search.replace(/^\?/,"").split(/&/),d=c.length-1;d>=0;d--)c[d].split(/=/);return b.config.vars.url_handler+"?_ok="+hbl.siteid+"&wcsid="+b.client.sid+"&hblid="+b.client.hblid+"&olfsk="+olark._.cookieManager.get("olfsk")+"&url="+hbl.util.encode_base64(a)+"&host="+window.location.host}else return a};
return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)?"mailto:"+a:c.test(a)?a:d.test(a)?document.location.protocol+"//"+document.domain+a:(c=null,c=e.test(a)?a:hbl.hwindow_util.refers_to_local_domain(a)?document.location.protocol+"//"+a:"http://"+a,b.config.vars.chat_does_not_follow_external_links||hbl.hwindow_util.refers_to_local_domain(c)?c:i(c))};
hbl.pipelines.nickname=function(a,b){if(a.substr(0,6)=="/nick "){var c=a.substr(6);b.client.setnickname(c);hmpmetrics.track("window_slash_nick_called",{site_id:hbl.siteid,page:hbl.get_current_page()})}else return a};hbl.pipelines.wrap_text=function(a,b){return hbl.hwindow_util.wrap_and_create_links(a,b)};hbl.pipelines.emoticons=function(a){a=a.replace(/\;\-\)/,"<code><big>;-)</big></code>");return a=a.replace(/\:\-\)/,"<code><big>:-)</big></code>")};
hbl.pipelines.push_url=function(a){msg_t=a;a=a[1];if(a.substr(0,6)=="!push "){var b="";a=a.replace(/&lt;/i,"[");a=a.replace(/\/*&gt;/i,"]");a.match(/<a/)?(a=a.match(/src\s*=\s*"*([^\"]+)\"*/i),a.length>1&&(b=a[1])):a.match(/\[(http[^\]]+)\s*\]/i)?(a=a.match(/\[(http[^\]]+)\]/i),b=a[1]):b=a.substr(6,a.length-6);b=b.split(" ")[0];b=b.split("%20")[0];if(b!=""){hmpmetrics.track("window_push_url",{site_id:hbl.siteid,page:hbl.get_current_page()});document.location=hbl.hwindow_util.get_habla_url(b,habla_window);
return}}return msg_t};hbl.client.incoming_pipeline.add(hbl.pipelines.push_url,999);hbl.plugins.incoming_notification_vars={};
hbl.plugins.incoming_notification=function(){this.name="incoming_notification";this.load=function(a){var b=this;hbl.plugins.incoming_notification_vars.freq=3E3;hbl.plugins.incoming_notification_vars.flashicon=!1;hbl.plugins.incoming_notification_vars.flashing=!1;hbl.plugins.incoming_notification_vars.original_favicon=!1;habla_wcsend_input=hbl.util.find_or_create_el("habla_wcsend_input","textarea");hbl.plugins.incoming_notification_vars.windowTextCleared=!0;a.hwindow.config.vars.flash_titlebar&&(a.hwindow.eventmgr.register("receive_message",
this.onReceiveMessage),a.hwindow.eventmgr.register("send_message",this.onWindowFocus),a.hwindow.eventmgr.register("window_focus",this.onWindowFocus),a.hwindow.eventmgr.register("window_click",this.onWindowFocus));if(a.hwindow.config.vars.flash_icons){hbl.plugins.incoming_notification_vars.default_flash_on_icon=a.hwindow.config.vars.default_flash_off_icon;if(!hbl.oldtitle)hbl.oldtitle=/Message Received/i.test(document.title)?"":document.title||"";if(!hbl.plugins.incoming_notification_vars.originalFavicon)hbl.plugins.incoming_notification_vars.originalFavicon=
hbl.plugins.incoming_notification_vars.remove_current_icon(!0)||a.hwindow.config.vars.default_flash_on_icon;hbl.plugins.incoming_notification_vars.default_flash_off_icon=hbl.plugins.incoming_notification_vars.originalFavicon;habla_wcsend_input.onkeypress=function(){b.onWindowFocus({window:a.hwindow});hbl.plugins.incoming_notification_vars.windowTextCleared=!0}}};this.onReceiveMessage=function(a){if(!/^\s*!/.test(a.msg[a.msg.length-1][1])&&a.type=="remote_update"){a.window.highlight();hbl.plugins.incoming_notification_vars.last_msg=
"";if(hbl.client.buffer&&hbl.client.buffer[hbl.client.buffer.length-1])hbl.plugins.incoming_notification_vars.last_msg=hbl.client.buffer[hbl.client.buffer.length-1][1].substr(0,10),a.window.setHeader(".."+hbl.plugins.incoming_notification_vars.last_msg+"..");hbl.plugins.incoming_notification_vars.windowTextCleared=!1;hbl.plugins.incoming_notification_vars.flashOlarkFavicon()}};this.onWindowFocus=function(a){hbl.plugins.incoming_notification_vars.resetFavicon();if(!hbl.plugins.incoming_notification_vars.windowTextCleared)a.window.setWindowText(),
hbl.plugins.incoming_notification_vars.windowTextCleared=!0,a=document.getElementById("habla_topbar_div"),a.className=a.className.replace(/habla_topbar_div_highlighted/,"habla_topbar_div_normal")};hbl.plugins.incoming_notification_vars.flashOlarkFavicon=function(){document.title="(Message Received: "+hbl.plugins.incoming_notification_vars.last_msg+") "+hbl.oldtitle;hbl.plugins.incoming_notification_vars.set_icon(hbl.plugins.incoming_notification_vars.default_flash_on_icon);var a=!0;hbl.plugins.incoming_notification_vars.flashingInterval=
setInterval(function(){a?hbl.plugins.incoming_notification_vars.set_icon(hbl.plugins.incoming_notification_vars.originalFavicon):hbl.plugins.incoming_notification_vars.set_icon(hbl.plugins.incoming_notification_vars.default_flash_on_icon);a=!a},hbl.plugins.incoming_notification_vars.freq)};hbl.plugins.incoming_notification_vars.resetFavicon=function(){document.title=hbl.oldtitle;clearInterval(hbl.plugins.incoming_notification_vars.flashingInterval);var a=hbl.plugins.incoming_notification_vars.originalFavicon||
"";hbl.plugins.incoming_notification_vars.remove_current_icon();hbl.plugins.incoming_notification_vars.set_icon(a);hbl.plugins.incoming_notification_vars.flashing=!1};hbl.plugins.incoming_notification_vars.remove_current_icon=function(a){if(document.getElementsByTagName("head")&&document.getElementsByTagName("head").length!=0)for(var b=document.getElementsByTagName("head")[0].getElementsByTagName("link"),c=0;c<b.length;c++){var d=b[c];if(d.type=="image/x-icon"&&/favicon|favico|shortcut|icon|shortcut\s*icon/i.test(d.rel))return b=
d.href,a||document.getElementsByTagName("head")[0].removeChild(d),b}};hbl.plugins.incoming_notification_vars.set_icon=function(a){var b=document.createElement("link");b.type="image/x-icon";b.rel="shortcut icon";b.href=a;hbl.plugins.incoming_notification_vars.remove_current_icon();document.getElementsByTagName("head")&&document.getElementsByTagName("head").length!=0&&document.getElementsByTagName("head")[0].appendChild(b)}};hbl.plugins.messages_received=0;
hbl.plugins.expand_on_receive_message=function(){this.name="expand_on_receive_message";this.load=function(a){a.hwindow.eventmgr.register("receive_message",this.onReceiveMessage,-1)};this.onReceiveMessage=function(a){if(!/^\s*!/.test(a.msg[a.msg.length-1][1])&&(hbl.plugins.messages_received+=1,!a.window.pop_out))if(a.type!="start"&&(!a.window.config.vars.expandOnFirstMessageReceived||a.window.config.vars.expandOnMessageReceived||hbl.plugins.messages_received==1))hbl.client.eventmgr.handle("window_expanded"),
a.window.expand(),a.window.show();else if(a.type!="start"&&a.window.theme&&a.window.theme.state=="closed")a.window.theme.state="compressed",a.window.show()}};
hbl.plugins.away_div_handler=function(){this.name="away_div_handler";this.load=function(a){hbl.util.hide_div("habla_unavailable_div");hbl.util.hide_div("habla_available_div");hbl.util.show_div("habla_loading_div",a.hwindow.config.vars.habla_special_div_show_type)||hbl.util.show_div("habla_unavailable_div",a.hwindow.config.vars.habla_special_div_show_type);(document.getElementById("habla_available_div")!=void 0||document.getElementById("habla_unavailable_div")!=void 0)&&a.hwindow.eventmgr.register("operator_status_change",
this.onOperatorStatusChange)};this.onOperatorStatusChange=function(a){var b=a.status;a.available&&(!b||b=="chat"||!a.window.config.vars.hide_when_away)?(hbl.util.show_div("habla_available_div",a.window.config.vars.habla_special_div_show_type),hbl.util.hide_div("habla_unavailable_div")):(hbl.util.hide_div("habla_available_div"),hbl.util.show_div("habla_unavailable_div",a.window.config.vars.habla_special_div_show_type));hbl.util.hide_div("habla_loading_div")}};
hbl.plugins.auto_initiate=function(){this.load=function(a){a.hwindow.config.vars.auto_initiate_allowed&&a.hwindow.config.vars.auto_initiate&&a.hwindow.eventmgr.register("chat_loaded",this.onChatLoad)};this.onChatLoad=function(a){if(a.session_start&&!a.opbusy&&a.opavailable)habla_window.auto_initiated=!1,setTimeout(function(){if(hbl.client.buffer.length==0&&hbl.client.opavailable){habla_window.show();habla_window.expand();habla_window.auto_initiated=!0;var b=a.window.config.vars.auto_initiate_message;
habla_window.theme.appendNiceMessage(a.window.config.vars.auto_initiate_name,b[Math.floor(Math.random()*b.length)],!0,!1,!0);habla_window.highlight();hbl.client.buffer=[" "];habla_window.send_pipeline.add(function(a){if(habla_window.auto_initiated)hbl.client.sendmessage(habla_window.config.vars.auto_initiate_response_notify,!0),habla_window.auto_initiated=!1;return a},1E4);habla_window.config.vars.auto_initiate_notify&&hbl.client.sendmessage(habla_window.config.vars.auto_initiate_notify_msg,!0)}},
parseInt(a.window.config.vars.auto_initiate_period*1E3))}};hbl.plugins.google_translate=function(){this.name="googletranslate";this.load=function(){}};hbl.plugins.sounds=function(){this.name="sounds";this.load=function(a){a.conf.vars.enableSounds==1&&hbl.util.simple_load_js_async(a.conf.vars.plugin_path+"contributed/sounds.js")}};hbl.plugins.smileys=function(){this.name="smileys";this.load=function(a){a.conf.vars.enableSmileys==1&&hbl.util.simple_load_js_async(a.conf.vars.plugin_path+"contributed/smileys.js")}};
hbl.themes.default_theme=function(){this.appended=!0;this.last_msg=-1;this.highlighted=this.visible=!1;this.state="compressed";this.ready=this.pre_chat_sent=this.offline_window=this.message_sent=!1;this.position="BR";this.build=function(a,b,e){this.client=b;this.config=a;this.set_config();this.load_styles();this.div=void 0;this.divid=a.vars.divid;this.build_dom(e);this.set_dom_event_handlers();this.config.init_from_config(this);this.palette_hack();this.render_styles();!this.config.vars.disableJSStyles&&
!this.config.vars.no_palette&&this.render_palette();this.set_default_text();this.register_handlers();this.ready=!0;this.config.vars.disableJSStyles&&!this.config.vars.start_hidden&&this.show();hbl.eventmgr.handle("post_theme_loaded")};this.palette_hack=function(){if(hbl.need_ugly_backwards_palette_hack){var a={},b;for(b in this.config.style_classes_map)if(this.config.style_classes_map.hasOwnProperty(b))for(var e in this.config.style_classes_map[b])if(this.config.style_classes_map[b].hasOwnProperty(e))for(var i in this.config.palette)this.config.palette.hasOwnProperty(i)&&
"hbl_pal_"+i==this.config.style_classes_map[b][e]&&(this.config.style_classes_map[b][e]="hbl_pal_"+i+"_local",a[i+"_local"]=this.config.palette[i]);this.config.palette=a}};this.set_config=function(){var a=new hbl.hconfig;a.style_classes={};a.style_classes_map={habla_window_div:["habla_window_div_position","habla_window_div_base","hbl_pal_main_width"],habla_closebutton_a:["habla_button","habla_button_a_normal","hbl_pal_header_font_size","hbl_pal_main_font_family","hbl_pal_button_bg","hbl_pal_button_fg"],
habla_sizebutton_a:["habla_button","habla_button_a_normal","hbl_pal_header_font_size","hbl_pal_main_font_family","hbl_pal_button_bg","hbl_pal_button_fg"],habla_popout_a:["habla_button","habla_button_a_normal","hbl_pal_header_font_size","hbl_pal_main_font_family","hbl_pal_button_bg","hbl_pal_button_fg"],habla_end_popout_a:["habla_button","habla_button_a_normal","hbl_pal_header_font_size","hbl_pal_main_font_family","hbl_pal_button_bg","hbl_pal_button_fg"],habla_button_normal:["habla_button","habla_button_a_normal",
"hbl_pal_header_font_size","hbl_pal_button_bg","hbl_pal_button_fg"],habla_button_highlighted:["habla_button","habla_button_a_highlighted","hbl_pal_header_font_size","hbl_pal_button_bg_highlight","hbl_pal_button_fg_highlight"],habla_button_hover:["habla_button","habla_button_a_hover","hbl_pal_header_font_size","hbl_pal_button_bg_hover","hbl_pal_button_fg_hover"],habla_panel_div:["habla_panel_border","hbl_pal_main_bg","hbl_pal_panel_border","hbl_pal_main_font_family","hbl_pal_main_font_size"],habla_oplink_a:["habla_oplink_a_normal",
"hbl_pal_header_font_size","hbl_pal_title_fg"],habla_oplink_hover:["habla_oplink_a_hover","hbl_pal_header_font_size","hbl_pal_title_fg"],habla_wcsend_input_pre:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_input_pre_fg","hbl_pal_main_font_family","hbl_pal_input_font_size","hbl_pal_control_border"],habla_wcsend_input_post:["habla_wcsend_field","habla_wcsend_input_post","habla_wcsend_input_normal","hbl_pal_main_fg","hbl_pal_main_font_family","hbl_pal_input_font_size"],
habla_wcsend_input:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_control_border","hbl_pal_main_font_family","hbl_pal_input_font_size"],habla_wcsend_input_highlighted:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_highlighted","hbl_pal_control_highlight_border","hbl_pal_main_font_family","hbl_pal_input_font_size"],habla_name_input:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border",
"hbl_pal_input_font_size"],habla_wcsend_input:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border","hbl_pal_input_font_size"],habla_offline_email_input:["habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border","hbl_pal_input_font_size"],habla_offline_body_input:["habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border",
"hbl_pal_input_font_size"],habla_offline_clear_div:["clear_style"],habla_chatform_form:["habla_chatform_form"],habla_input_div:["habla_input_div"],habla_pre_chat_email_input:["habla_pre_chat_form_field","habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border","hbl_pal_input_font_size"],habla_pre_chat_name_input:["habla_pre_chat_form_field","habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family",
"hbl_pal_control_border","hbl_pal_input_font_size"],habla_pre_chat_phone_input:["habla_pre_chat_form_field","habla_wcsend_field","habla_wcsend_input_pre","habla_wcsend_input_normal","hbl_pal_main_font_family","hbl_pal_control_border","hbl_pal_input_font_size"],habla_offline_message_sent_div:["hbl_panel","habla_offline_message_sent_div","hbl_pal_main_height","hbl_pal_control_border","hbl_pal_main_fg"],habla_pre_chat_div:["hbl_panel","habla_pre_chat_div","hbl_pal_main_height","hbl_pal_main_fg"],habla_offline_message_div:["hbl_panel",
"habla_offline_message_div","hbl_pal_control_border","hbl_pal_main_fg"],habla_conversation_div:["hbl_panel","habla_conversation_div","hbl_pal_main_height","hbl_pal_control_border","hbl_pal_main_fg","hbl_pal_main_bg"],habla_say_text_span:["habla_say_text_span","hbl_pal_main_fg"],habla_submit_button:["habla_submit_button"],habla_offline_submit_input:["habla_offline_submit_input","hbl_pal_offline_submit_fg","hbl_pal_control_border","hbl_pal_offline_submit_bg"],habla_pre_chat_submit_input:["habla_pre_chat_form_field",
"habla_offline_submit_input","hbl_pal_offline_submit_fg","hbl_pal_control_border","hbl_pal_offline_submit_bg"],habla_offline_error_span:["habla_offline_error_span"],habla_pre_chat_clear_div:["clear_style"],habla_conversation_p_item:["habla_conversation_p_item","hbl_pal_main_fg"],habla_conversation_person1:["habla_conversation_person1","hbl_pal_local_fg"],habla_conversation_person2:["habla_conversation_person2","hbl_pal_remote_fg"],habla_conversation_text_span:["habla_conversation_text_span","hbl_pal_main_fg"],
habla_topbar_div_compressed:["habla_topbar_div_normal","hbl_pal_title_fg","hbl_pal_title_bg","habla_topbar_div_compressed"],habla_topbar_div:["habla_topbar_div_normal","hbl_pal_title_fg","hbl_pal_title_bg","habla_topbar_div_expanded"],habla_topbar_div_highlighted:["habla_topbar_div_highlighted","hbl_pal_title_fg_highlight","hbl_pal_title_bg_highlight","habla_topbar_div_expanded"]};a.vars={habla_sizebutton_text_expanded:"_",habla_sizebutton_text_compressed:"^",habla_closebutton_text:"x",habla_popout_text:">",
habla_end_popout_text:"&lt;&lt;",_habla_link_div:"padding: 3px 0 5px 0 !important; font-family: helvetica, sans-serif; text-align: center; text-transform: uppercase; font-size: 9px; letter-spacing: 2px; font-weight: bold; color: #aaa !important;",_habla_link_a:"font-family: helvetica, sans-serif; text-transform: uppercase; font-size: 9px !important; letter-spacing: 2px; font-weight: bold; color: #e75917 !important;"};this.config.merge(a);a=new hbl.hconfig;a.load_defaults();this.config.merge(a);hbl.client.pollingmanager.setLongPoll(!this.config.vars.poll);
this.config.remap_palette();this.config.remap_palette();if(this.config.vars.right_to_left)this.config.vars.local_user_display_name="&larr;";this.config.vars.enable_buttons&&(this.config.style_classes_map.habla_topbar_div=["habla_topbar_div_normal","habla_topbar_clickable","hbl_pal_title_fg","hbl_pal_title_bg","habla_topbar_div_expanded"]);if(this.config.vars.corner_position)this.config.vars.corner_position=this.__getAdjustedPosition(this.config.vars.corner_position)};this.build_dom=function(a,b){if(document.getElementById(this.divid))this.appended=
!1;this.habla_container=hbl.util.find_or_create_div(this.divid,this.config.vars.not_append==void 0?hbl.util.get_body():void 0);this.habla_container.id="habla_beta_container_do_not_rely_on_div_classes_or_names";this.habla_container.className=this.__get_browser_class()+" "+this.__get_mobile_class()+" "+(document.compatMode=="BackCompat"?"olrk-quirks":"olrk-noquirks");var e=hbl.util.find_or_create_div("hbl_operator_state_div",this.habla_container);e.className="olrk-unknown";olark("api.chat.onOperatorsAvailable",
function(){e.className="olrk-available"});olark("api.chat.onOperatorsAway",function(){e.className="olrk-away"});var i=hbl.util.find_or_create_div("hbl_region",e);i.className=this.config.vars.right_to_left?"olrk-rtl":"olrk-normal";this.window_state_div=hbl.util.find_or_create_div("habla_window_state_div",i);this.window_state_div.className=this.config.vars.show_end_popout?"olrk-state-popout":" olrk-state-compressed";this.habla_window_div=hbl.util.find_or_create_div(this.divid,this.window_state_div);
b||hbl.util.hide_div(this.habla_window_div);if(i=this.config.vars.corner_position&&this.config.vars.corner_position.match(/B/))this.habla_compressed_div=hbl.util.find_or_create_div("habla_compressed_div",this.habla_window_div);this.habla_panel_div=hbl.util.find_or_create_div("habla_panel_div",this.habla_window_div);this.habla_both_div=hbl.util.find_or_create_div("habla_both_div",this.habla_panel_div);hbl.util.hide_div(this.habla_panel_div);this.habla_topbar_div=hbl.util.find_or_create_div("habla_topbar_div",
this.habla_both_div);if(this.config.vars.add_tab_closure_span)this.olrk_tab_closure_span=hbl.util.find_or_create_el("olrk_tab_closure_span","span"),this.habla_both_div.appendChild(this.olrk_tab_closure_span);this.habla_expanded_div=hbl.util.find_or_create_div("habla_expanded_div",this.habla_panel_div);if(!i)this.habla_compressed_div=hbl.util.find_or_create_div("habla_compressed_div",this.habla_window_div);if(this.config.vars.left_align_widget)this.habla_compressed_div.className="olrk-left-align";
this.habla_closed_div=hbl.util.find_or_create_div("habla_closed_div",this.habla_window_div);a||this.hide();this.habla_oplink_a=hbl.util.find_or_create_el("habla_oplink_a","a");this.config.vars.append_oplink_before_buttons&&this.habla_topbar_div.appendChild(this.habla_oplink_a);if(this.config.vars.show_end_popout)this.habla_end_popout_a=hbl.util.find_or_create_el("habla_end_popout_a","a"),this.habla_topbar_div.appendChild(this.habla_end_popout_a);else if(this.config.vars.show_popout)this.habla_popout_a=
hbl.util.find_or_create_el("habla_popout_a","a"),this.habla_topbar_div.appendChild(this.habla_popout_a);if(this.config.vars.enable_buttons&&!this.config.vars.hide_min_max_buttons)this.habla_closebutton_a=hbl.util.find_or_create_el("habla_closebutton_a","a"),this.config.vars.close_hides_window&&this.habla_topbar_div.appendChild(this.habla_closebutton_a),this.habla_sizebutton_a=hbl.util.find_or_create_el("habla_sizebutton_a","a"),this.habla_topbar_div.appendChild(this.habla_sizebutton_a);this.config.vars.append_oplink_before_buttons||
this.habla_topbar_div.appendChild(this.habla_oplink_a);i=function(a){var c=document.createElement("div");c.className="hbl_txt_wrapper";c.appendChild(a);return c};this.habla_middle_div=hbl.util.find_or_create_div("habla_middle_div",this.habla_expanded_div);var l=hbl.util.find_or_create_div("habla_middle_wrapper_div",this.habla_middle_div);this.habla_conversation_div=hbl.util.find_or_create_div("habla_conversation_div",l);this.habla_offline_message_sent_div=hbl.util.find_or_create_div("habla_offline_message_sent_div",
l);this.habla_offline_message_sent_div.style.display="none";this.habla_offline_message_span=hbl.util.find_or_create_el("habla_offline_message_span","span");this.habla_offline_message_div=hbl.util.find_or_create_div("habla_offline_message_div",l);this.habla_offline_message_div.style.display="none";this.habla_name_input=hbl.util.find_or_create_el("habla_name_input","textarea");this.habla_offline_email_input=hbl.util.find_or_create_el("habla_offline_email_input","textarea");this.habla_offline_body_input=
hbl.util.find_or_create_el("habla_offline_body_input","textarea");this.habla_offline_clear_div=hbl.util.find_or_create_el("habla_offline_clear_div","div");this.habla_offline_submit_input=hbl.util.find_or_create_el("habla_offline_submit_input","input");try{this.habla_offline_submit_input.setAttribute("type","submit")}catch(f){}this.habla_offline_error_span=hbl.util.find_or_create_el("habla_offline_error_span","span");this.habla_offline_message_div.appendChild(this.habla_offline_message_span);this.habla_offline_message_div.appendChild(i(this.habla_name_input));
this.habla_offline_message_div.appendChild(i(this.habla_offline_email_input));this.habla_offline_message_div.appendChild(i(this.habla_offline_body_input));hbl.config.vars.disable_extra_br||this.habla_offline_message_div.appendChild(hbl.util.find_or_create_el("habla_br","br"));this.habla_offline_message_div.appendChild(this.habla_offline_error_span);this.habla_offline_message_div.appendChild(this.habla_offline_submit_input);this.habla_offline_message_div.appendChild(this.habla_offline_clear_div);this.habla_pre_chat_span=
hbl.util.find_or_create_el("habla_pre_chat_span","span");this.habla_pre_chat_div=hbl.util.find_or_create_div("habla_pre_chat_div",l);this.habla_pre_chat_div.style.display="none";this.habla_pre_chat_name_input=hbl.util.find_or_create_el("habla_pre_chat_name_input","textarea");this.habla_pre_chat_clear_div=hbl.util.find_or_create_el("habla_pre_chat_clear_div","div");this.habla_pre_chat_email_input=hbl.util.find_or_create_el("habla_pre_chat_email_input","textarea");this.habla_pre_chat_phone_input=hbl.util.find_or_create_el("habla_pre_chat_phone_input",
"textarea");this.habla_pre_chat_submit_input=hbl.util.find_or_create_el("habla_pre_chat_submit_input","input");try{this.habla_pre_chat_submit_input.setAttribute("type","submit")}catch(g){}this.habla_pre_chat_error_span=hbl.util.find_or_create_el("habla_pre_chat_error_span","span");this.habla_pre_chat_div.appendChild(this.habla_pre_chat_span);this.habla_pre_chat_div.appendChild(i(this.habla_pre_chat_name_input));this.habla_pre_chat_div.appendChild(i(this.habla_pre_chat_email_input));this.habla_pre_chat_div.appendChild(i(this.habla_pre_chat_phone_input));
hbl.config.vars.disable_extra_br||this.habla_pre_chat_div.appendChild(hbl.util.find_or_create_el("habla_br_2","br"));this.habla_pre_chat_div.appendChild(this.habla_pre_chat_error_span);this.habla_pre_chat_div.appendChild(this.habla_pre_chat_submit_input);this.habla_pre_chat_div.appendChild(this.habla_pre_chat_clear_div);this.habla_chatform_form=hbl.util.find_or_create_el("habla_chatform_form","form");this.habla_chatform_form.setAttribute("action","#");this.habla_chatform_form.setAttribute("method",
"GET");this.habla_chatform_form.setAttribute("autocomplete","off");this.habla_input_div=hbl.util.find_or_create_el("habla_input_div","div");this.habla_wcsend_input=hbl.util.find_or_create_el("habla_wcsend_input","textarea");this.habla_wcsend_input.setAttribute("size",this.config.vars.input_box_size);this.habla_input_div.appendChild(i(this.habla_wcsend_input));if(hbl.util.BrowserDetect.need_submit_button){this.habla_submit_button=hbl.util.find_or_create_el("habla_submit_button","input");try{this.habla_submit_button.setAttribute("type",
"button")}catch(v){}this.habla_input_div.appendChild(this.habla_submit_button)}this.habla_chatform_form.appendChild(this.habla_input_div);this.habla_middle_div.appendChild(this.habla_chatform_form)};this.set_events=function(a,b){if(typeof a!="undefined"){var e=function(b,d,f){return function(g){var e;if(!g)g=window.event;if(g.target)e=g.target;else if(g.srcElement)e=g.srcElement;if(e.nodeType==3)e=e.parentNode;if(e==a&&(habla_window.eventmgr.handle(b+"_"+d,{target:e,event:g}),f&&(g.cancelBubble=!0,
g.stopPropagation)))return g.stopPropagation(),!1}};a.onblur=e(b,"onblur");a.onfocus=e(b,"onfocus");a.onclick=e(b,"onclick",!0);a.onmouseover=e(b,"onmouseover");a.onmouseout=e(b,"onmouseout")}};this.set_dom_event_handlers=function(){if(this.habla_submit_button)this.habla_submit_button.onclick=function(){habla_window.eventmgr.handle("window_form_submit",{event:void 0})};this.set_events(this.habla_wcsend_input,"habla_wcsend_input",!0);this.set_events(this.habla_name_input,"habla_name_input");this.set_events(this.habla_offline_email_input,
"habla_offline_email_input");this.set_events(this.habla_offline_body_input,"habla_offline_body_input");this.set_events(this.habla_offline_submit_input,"habla_offline_submit_input");this.set_events(this.habla_pre_chat_email_input,"habla_pre_chat_email_input");this.set_events(this.habla_pre_chat_name_input,"habla_pre_chat_phone_input");this.set_events(this.habla_pre_chat_name_input,"habla_pre_chat_name_input");this.set_events(this.habla_pre_chat_submit_input,"habla_pre_chat_submit_input");this.habla_conversation_div.onclick=
function(){return habla_window.eventmgr.handle("habla_conversation_div_onclick")};this.habla_chatform_form.onfocus=function(){habla_window.eventmgr.handle("habla_chatform_form_onfocus")};this.habla_chatform_form.onsubmit=function(a){habla_window.eventmgr.handle("window_form_submit",{event:a});return!1};this.habla_pre_chat_phone_input.onkeypress=function(a){if(!a)a=window.event;keynum=void 0;if(window.event)a=window.event,keynum=a.keyCode;else if(a.which)keynum=a.which;if(keynum==13||keynum==10)return habla_window.eventmgr.handle("habla_pre_chat_submit_input_onclick"),
!1};this.habla_pre_chat_email_input.onkeypress=function(a){if(!a)a=window.event;keynum=void 0;if(window.event)a=window.event,keynum=a.keyCode;else if(a.which)keynum=a.which;if(keynum==13||keynum==10)return habla_window.eventmgr.handle("habla_pre_chat_submit_input_onclick"),!1};this.habla_pre_chat_name_input.onkeypress=function(a){if(!a)a=window.event;keynum=void 0;if(window.event)a=window.event,keynum=a.keyCode;else if(a.which)keynum=a.which;if(keynum==13||keynum==10)return habla_window.eventmgr.handle("habla_pre_chat_submit_input_onclick"),
!1};this.habla_wcsend_input.onkeydown=function(a){if(!a)a=window.event;(function(b){function e(a){hbl.client.sendcommand("send_compose_state",a)}function i(){clearTimeout(b.visitorHasPausedTyping);b.visitorHasPausedTyping=setTimeout(function(){l();e(f.PAUSED)},g)}function l(){clearTimeout(b.visitorHasPausedTyping);e(f.ACTIVE);b.visitorHasStartedTyping=!1}var f={ACTIVE:"active",INACTIVE:"inactive",COMPOSING:"composing",PAUSED:"paused"},g=3E3;b.visitorHasStartedTyping=b.visitorHasStartedTyping||!1;
b.visitorHasPausedTyping=b.visitorHasPausedTyping||-1;switch(a.keyCode){case 10:case 13:l();break;default:if(habla_window.theme.habla_wcsend_input.value=="")l();else{if(!b.visitorHasStartedTyping)b.visitorHasStartedTyping=!0,e(f.COMPOSING);i()}}})(this);if(!habla_window.theme.habla_wcsend_input.has_typed)return a.keyCode!=13&&a.keyCode!=10?habla_window.setInputBox(habla_window.theme.habla_wcsend_input,String.fromCharCode(a.keyCode),"highlight"):habla_window.setInputBox(habla_window.theme.habla_wcsend_input,
"","highlight"),habla_window.theme.habla_wcsend_input.has_typed=!0,!1;(function(){function a(c,b){function d(){this.timeout_set=!1}if(this.timeout_set)return!1;else{this.timeout_set=!0;setTimeout(d,600);if(typeof this.div=="undefined")this.div=document.createElement("div"),this.div.style.visibility="hidden",this.div.style.position="absolute",(document.body||document.documentElement).appendChild(this.div);this.div.innerHTML=c;return parseInt(this.div.offsetWidth)>=parseInt(b.offsetWidth)}}if(!habla_window.config.vars.disable_expand_text_input&&
!habla_window.expanded_textbox&&a(habla_window.theme.getMessageInputFieldValue(),habla_window.theme.getMessageInputField())){habla_window.expanded_textbox=!0;habla_window.setInputHeight(habla_window.config.vars.resize_input_height);var c=habla_window.theme.habla_wcsend_input.parentNode;c.className=c.className.replace("hbl_long_text_entered","")+" hbl_long_text_entered"}if(!habla_window.config.vars.disable_expand_text_input&&habla_window.expanded_textbox&&habla_window.theme.getMessageInputFieldValue().length<
habla_window.config.vars.resize_length)habla_window.expanded_textbox=!1,habla_window.setInputHeight(habla_window.config.vars.input_height),c=habla_window.theme.habla_wcsend_input.parentNode,c.className=c.className.replace("hbl_long_text_entered","")+" hbl_long_text_entered"})();if(a.keyCode==13||a.keyCode==10){if(habla_window.theme.getMessageInputFieldValue().replace(/^\s*|\s*$/g,"")=="")return;habla_window.expanded_textbox=!1;habla_window.setInputHeight(habla_window.config.vars.input_height);habla_window.eventmgr.handle("window_submit",
{event:a});return!1}return!0};this.set_events(this.habla_oplink_a,"habla_oplink_a");this.config.vars.show_end_popout?this.set_events(this.habla_end_popout_a,"habla_end_popout_a"):this.config.vars.show_popout&&this.set_events(this.habla_popout_a,"habla_popout_a");this.config.vars.enable_buttons?(this.habla_topbar_div.onclick=function(a){habla_window.eventmgr.handle("window_topbar_clicked");if(!a)a=window.event;a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation();return!1},this.config.vars.hide_min_max_buttons||
(this.set_events(this.habla_closebutton_a,"habla_closebutton_a"),this.set_events(this.habla_sizebutton_a,"habla_sizebutton_a"))):this.habla_oplink_a.onclick=function(){return!1}};this.styles=[];this.set_css_style=function(a){if(a)if(a=a.replace("static.olark.com",hbl_static_hostname),/^\s*http/i.test(a)||(a=hbl_ext+"://"+a),a+="?"+hbl_ext,this.style_div){var b=hbl.util.find_or_create_el("habla_style_div_alternative","link");b.setAttribute("type","text/css");b.setAttribute("rel","alternative stylesheet");
hbl.util.get_head().appendChild(b);b.setAttribute("href",a);a=document.getElementById("habla_style_div");b=document.getElementById("habla_style_div_alternative");a.setAttribute("rel","alternative stylesheet");b.setAttribute("rel","stylesheet");a.id="habla_style_div_alternative";b.id="habla_style_div"}else this.style_div=hbl.util.find_or_create_el("habla_style_div","link"),this.style_div.setAttribute("type","text/css"),this.style_div.setAttribute("rel","stylesheet"),hbl.util.get_head().appendChild(this.style_div),
this.style_div.setAttribute("href",a)};this.load_styles=function(){if(!this.config.vars.disableJSStyles||this.config.vars.force_olark_css){var a;a=hbl.util.BrowserDetect.backwards_position;var b=document.compatMode=="BackCompat"?!0:!1,e=void 0;e=window.__olark_popout?this.config.vars.popout_css_url?this.config.vars.popout_css_url:hbl_static_hostname+"/themes/azul_popout/preview_theme.css?"+hblCacheConstant:this.config.vars.inline_css_url?a?b&&this.config.vars.inline_css_url_quirks?this.config.vars.inline_css_url_quirks:
this.config.vars.inline_css_url_ie?this.config.vars.inline_css_url_ie:this.config.vars.inline_css_url:b&&this.config.vars.inline_css_url_quirks?this.config.vars.inline_css_url_quirks:this.config.vars.inline_css_url:a?hbl_static_hostname+"/themes/defaults/base.ie.css?"+hblCacheConstant:hbl_static_hostname+"/themes/defaults/base.css?"+hblCacheConstant;this.set_css_style(e)}};this.render_styles=function(){if(!this.config.vars.require_name)this.habla_pre_chat_name_input.style.display="none",this.habla_pre_chat_name_input.parentNode.style.display=
"none";if(!this.config.vars.require_phone)this.habla_pre_chat_phone_input.style.display="none",this.habla_pre_chat_phone_input.parentNode.style.display="none";if(!this.config.vars.require_email)this.habla_pre_chat_email_input.style.display="none",this.habla_pre_chat_email_input.parentNode.style.display="none";this.config.render_all_styles(this)};this.setInputBox=function(a,b,e,i){a.value=b;this.setInputBoxStyle(a,e,i)};this.setInputBoxStyle=function(a,b,e){e?this.config.set_element_classes(a,"habla_wcsend_input_post"):
this.config.set_element_classes(a,"habla_wcsend_input_pre");b=="normal"?this.config.set_element_classes(a,"habla_wcsend_input"):b=="highlight"&&this.config.set_element_classes(a,"habla_wcsend_input_highlighted")};this.set_default_text=function(){this.set_default_text_event(this.habla_name_input,"habla_name_input",this.config.vars.habla_name_input_text);this.set_default_text_event(this.habla_offline_email_input,"habla_offline_email_input",this.config.vars.habla_offline_email_text);this.set_default_text_event(this.habla_offline_body_input,
"habla_offline_body_input",this.config.vars.habla_offline_body_text);this.set_default_text_event(this.habla_pre_chat_name_input,"habla_pre_chat_name_input",this.config.vars.habla_name_input_text);this.set_default_text_event(this.habla_pre_chat_email_input,"habla_pre_chat_email_input",this.config.vars.habla_offline_email_text);this.set_default_text_event(this.habla_pre_chat_phone_input,"habla_pre_chat_phone_input",this.config.vars.habla_offline_phone_text);this.set_default_text_event(this.habla_wcsend_input,
"habla_wcsend_input",this.config.vars.textbox_message||this.config.vars.say_text);this.habla_offline_submit_input.value=this.config.vars.habla_offline_submit_value;this.set_events(this.habla_wcsend_input,"habla_wcsend_input");this.set_events(this.habla_offline_email_input,"habla_offline_email_input");this.set_events(this.habla_offline_body_input,"habla_offline_body_input");this.set_events(this.habla_offline_submit_input,"habla_offline_submit_input");this.habla_offline_message_sent_div.innerHTML=this.config.vars.habla_offline_sent_text;
if(this.habla_closebutton_a)this.habla_closebutton_a.innerHTML=this.config.vars.habla_closebutton_text;if(this.habla_sizebutton_a)this.habla_sizebutton_a.innerHTML=this.config.vars.habla_sizebutton_text_compressed;if(this.habla_popout_a)this.habla_popout_a.innerHTML=this.config.vars.habla_popout_text;if(this.habla_end_popout_a)this.habla_end_popout_a.innerHTML=this.config.vars.habla_end_popout_text;if(this.habla_submit_button)this.habla_submit_button.value=this.config.vars.send_text;if(this.habla_pre_chat_submit_input)this.habla_pre_chat_submit_input.value=
this.config.vars.pre_chat_submit;this.habla_pre_chat_span.innerHTML=this.config.vars.pre_chat_message;this.setHeader(this.config.vars.check_for_status);window.olark.__legacy_shim.has_messages_in_history!=!0&&this.setBody(this.config.vars.welcome_msg)};this.set_default_text_event=function(a,b,e){this.setInputBox(a,e);a.default_text=e;a.has_typed=!1;hbl.eventmgr.register(b+"_onblur",function(a){a.window.theme.setInputBoxStyle(a.target,"normal");if(a.target.value=="")a.target.value=a.target.default_text,
a.target.has_typed=!1},0);hbl.eventmgr.register(b+"_onclick",function(a){if(!a.target.has_typed)a.target.has_typed=!0,a.window.setInputBox(a.target,"","highlight");a.window.theme.setInputBoxStyle(a.target,"highlight")},0);hbl.eventmgr.register(b+"_onfocus",function(a){if(!a.target.has_typed)a.target.has_typed=!0,a.window.setInputBox(a.target,"","highlight");a.window.theme.setInputBoxStyle(a.target,"highlight")},0)};this.set_rollover_event=function(a,b,e,i){if(a)a.on_class=i,a.off_class=e,hbl.eventmgr.register(b+
"_onmouseover",function(a){a.window.config.set_element_classes(a.target,a.target.on_class)},0),hbl.eventmgr.register(b+"_onmouseout",function(a){a.window.config.set_element_classes(a.target,a.target.off_class)},0),hbl.eventmgr.register(b+"_onclick",function(a){a.window.config.set_element_classes(a.target,a.target.off_class)},0)};this.register_handlers=function(){this.set_rollover_event(this.habla_popout_a,"habla_popout_a","habla_button_normal","habla_button_hover");this.set_rollover_event(this.habla_end_popout_a,
"habla_end_popout_a","habla_button_normal","habla_button_hover");this.set_rollover_event(this.habla_sizebutton_a,"habla_sizebutton_a","habla_button_normal","habla_button_hover");this.set_rollover_event(this.habla_closebutton_a,"habla_closebutton_a","habla_button_normal","habla_button_hover");this.set_rollover_event(this.habla_oplink_a,"habla_oplink_a","habla_oplink_a","habla_oplink_hover");hbl.eventmgr.register("habla_conversation_div_onclick",function(){habla_window.eventmgr.handle("window_click")},
0);hbl.eventmgr.register("habla_chatform_form_onfocus",function(){habla_window.eventmgr.handle("window_focus")},0);hbl.eventmgr.register("habla_popout_a_onclick",function(a){a.window.popout()},0);hbl.eventmgr.register("habla_end_popout_a_onclick",function(a){a.window.end_popout();setTimeout(function(){window.close()},2)},0);hbl.eventmgr.register("habla_wcsend_input_onclick",function(a){a.window.eventmgr.handle("window_focus")},0);hbl.eventmgr.register("habla_pre_chat_submit_input_onclick",function(a){var b=
a.window.config,e=a.window.theme.habla_pre_chat_email_input,i=a.window.theme.habla_pre_chat_name_input,l=a.window.theme.habla_pre_chat_phone_input;(b.vars.require_name<1||i.has_typed)&&(b.vars.require_phone<1||l.has_typed)&&(b.vars.require_email<1||e.has_typed&&hbl.util.is_valid_email(e.value))?(a.window.theme.habla_pre_chat_error_span.innerHTML="",a.window.client.setnickname(i.value||e.value),b="",i.value&&i.value!=void 0&&(b+="name: "+i.value),e.value&&e.value!=void 0&&(b+="\nemail: "+e.value),
l.value&&l.value!=void 0&&(b+="\nphone: "+l.value),window.olark&&window.olark.__legacy_shim&&window.olark.__legacy_shim.send_prechat_info?window.olark.__legacy_shim.send_prechat_info({name:i.value,email:e.value,phone:l.value}):a.window.client.sendmessage(b,!0),a.window.theme.pre_chat_sent=!0,a.window.setShowPreChat(!1)):a.window.theme.habla_pre_chat_error_span.innerHTML=a.window.config.vars.pre_chat_error_text},0);hbl.eventmgr.register("habla_offline_submit_input_onclick",function(a){var b=a.window.theme.habla_offline_body_input,
e=a.window.theme.habla_offline_email_input,i=a.window.theme.habla_name_input;if(a.window.theme.message_sent)a.window.theme.setOfflineWindow(a.window.theme.config.vars.habla_offline_sent_text||" ");else{var l=e.value;b.has_typed&&e.has_typed&&hbl.util.is_valid_email(l)?(a.window.theme.message_sent=!0,tocall=hblPostURL+"?site_id="+hbl.siteid+"&"+hbl.util.urlencode({body:b.value,email:e.value,name:i.value,location:document.location,referrer:document.referrer}),a.window.theme.habla_offline_error_span.innerHTML=
a.window.config.vars.sending_text,hbl.util.load_js_async(tocall),olark("api.visitor.updateEmailAddress",e.value),olark("api.visitor.updateFullName",i.value),hbl.client.sendofflinemessage(b.value,{email:e.value,name:i.value,location:document.location,referrer:document.referrer}),a.window.theme.setOfflineWindow(a.window.theme.config.vars.habla_offline_sent_text||" "),hmpmetrics.track("sent_offline_message",{site_id:hbl.siteid,page:hbl.get_current_page()})):a.window.theme.habla_offline_error_span.innerHTML=
a.window.config.vars.email_body_error_text}},0);hbl.eventmgr.register("habla_wcsend_input_onmouseover",function(a){a.window.eventmgr.handle("window_focus")},0)};this.remove=function(){this.appended&&hbl.util.remove_element(this.divid)};this.setShowPreChat=function(a){if(!window.olark||!window.olark.__legacy_shim||!window.olark.__legacy_shim.ignore_prechat_status)a?this.showOnlyThisDiv(this.habla_pre_chat_div):this.showOnlyThisDiv(this.habla_conversation_div)};this.showOnlyThisDiv=function(a){var b=
this.habla_conversation_div,e=this.habla_offline_message_div,i=this.habla_offline_message_sent_div,l=this.habla_pre_chat_div,f=this.habla_chatform_form,g=this.habla_wcsend_input;if(a==b)b.style.display="block",e.style.display="none",i.style.display="none",l.style.display="none",f.style.display="block",g.style.display="block";else if(a==e)b.style.display="none",e.style.display="block",i.style.display="none",l.style.display="none",f.style.display="none",g.style.display="none";else if(a==i)b.style.display=
"none",e.style.display="none",i.style.display="block",l.style.display="none",f.style.display="none",g.style.display="none";else if(a==l)b.style.display="none",e.style.display="none",i.style.display="none",l.style.display="block",f.style.display="none",g.style.display="none";olark._.needsFirstTimeOperatorLogin?(this.habla_name_input.style.display="none",this.habla_offline_email_input.style.display="none",this.habla_offline_body_input.style.display="none",this.habla_offline_submit_input.style.display=
"none"):(this.habla_name_input.style.display="block",this.habla_offline_email_input.style.display="block",this.habla_offline_body_input.style.display="block",this.habla_offline_submit_input.style.display="block")};this.setOfflineWindow=function(a){if(!window.olark||!window.olark.__legacy_shim||!window.olark.__legacy_shim.ignore_prechat_status){var b=this.config.vars.show_pre_chat&&this.config.vars.disable_offline_messaging_fallback!=!0&&habla_window.get_operator_state()=="notavailable";!a&&!b?(this.offline_window=
!1,this.showOnlyThisDiv(this.habla_conversation_div)):(this.habla_offline_message_span.innerHTML=a||"You just missed us",this.message_sent?(this.showOnlyThisDiv(this.habla_offline_message_sent_div),this.offline_window=!1):(this.offline_window=!0,this.showOnlyThisDiv(this.habla_offline_message_div)))}};this.scroll_conversation_history_to_most_recent=function(){var a=this;setTimeout(function(){a.habla_conversation_div.scrollTop=a.habla_conversation_div.scrollHeight},10)};this.setBody=function(a){if(!hbl.client.buffer.length||
!hbl.client.is_conversation()){this.habla_conversation_div.innerHTML="";this.config.render_class(this.habla_conversation_div,"habla_conversation_message_off","habla_conversation_message_on");if(a!="")a=hbl.util.as_dom(a),this.config.render_class(this.habla_conversation_div,"habla_conversation_message_on","habla_conversation_message_off"),this.habla_conversation_div.appendChild(a),a.id="hbl_body_message";this.scroll_conversation_history_to_most_recent()}};this.disableMessageInput=function(a){this.habla_wcsend_input.disabled=
!0;this.habla_wcsend_input.value=a||""};this.getBody=function(){return this.habla_conversation_div.innerHTML};var a={},b=null;this.appendNiceMessage=function(c,d,e,i){if(!(d==void 0||c==void 0)){i||(d=this.display_pipeline.run(d));if(d){window.olark&&window.olark.__legacy_shim&&window.habla_window&&(d=hbl.hwindow_util.wrap_and_create_links(d,window.habla_window));i=hbl.client.op_nickname_map[c];var l=null;if(hbl.config.vars.operators&&i&&hbl.config.vars.operators[i.toString()])l=hbl.config.vars.operators[i.toString()].avatar_url;
document.location.protocol==="https:"&&typeof l=="string"&&(l=l.replace("http://","https://"));i=document.createElement("p");if(l&&!a[c]){a[c]=!0;var f=document.createElement("img");f.className="olrk_avatar";f.src=l;i.appendChild(f)}this.config.set_element_classes(i,"habla_conversation_p_item");b!=null&&b!=c&&(i.className+=" olrk_new_sender");b=c;l=document.createElement("span");c==this.config.vars.myname?(l.innerHTML=this.config.vars.local_user_display_name,this.config.set_element_classes(l,"habla_conversation_person1")):
(c=this.config.vars.local_name_override?this.config.vars.local_name_override:c,l.innerHTML=c&&!/^\s*$/.test(c)?c+": ":c,this.config.set_element_classes(l,"habla_conversation_person2"));c=document.createElement("span");this.config.set_element_classes(c,"habla_conversation_text_span");c.innerHTML=d;i.appendChild(l);i.appendChild(c);this.appendMessage(i,e)}window.habla_window.theme.scroll_conversation_history_to_most_recent()}};this.appendMessage=function(a,b){this.last_msg==-1&&b&&this.setBody("");
a=hbl.util.as_dom(a);this.last_msg+=1;a.setAttribute("id","habla_msg_"+this.last_msg);this.habla_conversation_div.appendChild(a);this.scroll_conversation_history_to_most_recent()};this.setHeader=function(a){this.habla_oplink_a.innerHTML=a};this.getHeader=function(){return this.habla_oplink_a.innerHTML};this.hide=function(){this.visible=!1;if(this.habla_conversation_div)this.habla_conversation_div.style.overflow="hidden";hbl.util.hide_div(this.habla_window_div);hbl.util.hide_div(this.habla_panel_div);
hbl.util.hide_div(this.habla_both_div);hbl.util.hide_div(this.habla_closed_div);hbl.util.hide_div(this.habla_expanded_div);hbl.util.hide_div(this.habla_compressed_div)};this.focus_on_the_input_box=function(){var a=this;(!window.olark||!window.olark.__legacy_shim||!window.olark.__legacy_shim.disable_input_focusing)&&!a.config.vars.is_inline&&!a.config.vars.disableFocus&&a.habla_wcsend_input&&a.habla_chatform_form.style.display!="none"&&setTimeout(function(){if(a.habla_chatform_form.style.display!=
"none")try{a.habla_wcsend_input.focus()}catch(b){}},20)};this.expand=function(){this.__set_css_window_state("expanded");if(this.habla_sizebutton_a&&this.config.vars.habla_sizebutton_text_expanded)this.habla_sizebutton_a.innerHTML=this.config.vars.habla_sizebutton_text_expanded;this.show();this.focus_on_the_input_box()};this.compress=function(){this.__set_css_window_state("compressed");if(this.habla_sizebutton_a&&this.config.vars.habla_sizebutton_text_compressed)this.habla_sizebutton_a.innerHTML=this.config.vars.habla_sizebutton_text_compressed;
this.show()};this.show=function(){if(this.ready)if(this.visible=!0,this.config.vars.disableJSStyles&&hbl.util.show_div(this.habla_window_div),this.state=="closed")hbl.util.hide_div(this.habla_expanded_div),hbl.util.hide_div(this.habla_panel_div),hbl.util.hide_div(this.habla_compressed_div),this.habla_conversation_div.style.overflow="hidden",hbl.util.show_div(this.habla_closed_div);else if(this.state=="expanded"){hbl.util.hide_div(this.habla_compressed_div);hbl.util.hide_div(this.habla_closed_div);
hbl.util.show_div(this.habla_panel_div);hbl.util.show_div(this.habla_expanded_div);hbl.util.show_div(this.habla_both_div);this.habla_conversation_div.style.overflow="auto";this.scroll_conversation_history_to_most_recent();if(this.habla_sizebutton_a)this.habla_sizebutton_a.innerHTML=this.config.vars.habla_sizebutton_text_expanded;this.focus_on_the_input_box();this.normal()}else if(this.state=="compressed"&&(hbl.util.hide_div(this.habla_expanded_div),hbl.util.hide_div(this.habla_closed_div),hbl.util.show_div(this.habla_panel_div),
hbl.util.show_div(this.habla_both_div),hbl.util.show_div(this.habla_compressed_div),this.habla_conversation_div.style.overflow="hidden",this.config.set_element_classes(this.habla_topbar_div,"habla_topbar_div_compressed"),this.habla_sizebutton_div))this.habla_sizebutton_div.innerHTML=this.config.vars.habla_sizebutton_text_compressed};this.close=function(){this.__set_css_window_state("closed");this.show()};this.__set_css_window_state=function(a){this.state=a;this.window_state_div.className=(this.config.vars.show_end_popout?
"olrk-state-popout":"")+"olrk-state-"+a};this.__get_browser_class=function(){return"habla-browser-"+hbl.util.BrowserDetect.browser.toLowerCase()};this.__get_mobile_class=function(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)?"habla-mobile":navigator.userAgent.match(/iPad/)?"habla-ipad":"habla-desktop"};this.setWidth=function(a){if(!this.config.vars.disable_width){var b=a;this.habla_panel_div.style.width=
a+"px";b=hbl.util.BrowserDetect.backwards_dimension||hbl.util.BrowserDetect.browser=="Explorer"&&hbl.util.BrowserDetect.backwards_dimension?a-this.config.vars.input_width_offset_compat+"px":hbl.util.BrowserDetect.browser=="Explorer"?a-this.config.vars.input_width_offset_ie+"px":a-this.config.vars.input_width_offset_normal+"px";this.habla_wcsend_input.style.width=b;this.habla_name_input.style.width=b;this.habla_offline_body_input.style.width=b;this.habla_offline_email_input.style.width=b;this.habla_pre_chat_name_input.style.width=
b;this.habla_pre_chat_email_input.style.width=b;this.habla_pre_chat_phone_input.style.width=b}};this.setInputHeight=function(a){if(!hbl.config.vars.disable_height){a=a>18?a:18;hbl.util.BrowserDetect.backwards_dimension&&(a=a>24?a:24);if(typeof this.originalHeight=="undefined")this.originalHeight=a,this.habla_wcsend_input.style.lineHeight=a+"px";this.habla_wcsend_input.style.height=a+"px"}};this.setFormInputHeight=function(a){if(!hbl.config.vars.disable_height)a=a>18?a:18,hbl.util.BrowserDetect.backwards_dimension&&
(a=a>24?a:24),a+="px",this.habla_name_input.style.height=a,this.habla_offline_email_input.style.height=a,this.habla_pre_chat_name_input.style.height=a,this.habla_pre_chat_name_input.style.lineHeight=a,this.habla_pre_chat_email_input.style.height=a,this.habla_pre_chat_email_input.style.lineHeight=a,this.habla_pre_chat_phone_input.style.height=a,this.habla_pre_chat_phone_input.style.lineHeight=a};this.render_palette=function(){var a=this.config.palette;this.config.vars.limited_palette&&(a=this.config.vars.limited_palette);
for(var b in a)if(a.hasOwnProperty(b)&&typeof this.config.palette[b]=="string"){var e=hbl.util.getElementsByClass(this.habla_window_div,"hbl_pal_"+b),i;for(i in e)if(e.hasOwnProperty(i)&&e[i]&&e[i].style)if(b.match("_fg"))e[i].style.color=this.config.palette[b];else if(b.match("_bg"))e[i].style.backgroundColor=this.config.palette[b];else if(b.match("_border"))e[i].style.borderColor=this.config.palette[b]}};this.getX=function(){return this.habla_window_div.style.left.match(/\d\d*/)};this.getY=function(){return this.habla_window_div.style.top.match(/\d\d*/)};
this.setXY=function(a,b){this.habla_window_div.style.top=b;this.habla_window_div.style.left=a};this.setHeight=function(a){if(!hbl.config.vars.disable_height){a=parseInt(a);var b=function(a,b){if(a)a.style.height=b+"px"};b(this.habla_conversation_div,a);b(this.habla_pre_chat_div,a);b(this.habla_offline_body_input,a-85>0?a-85:0)}};this.setMargins=function(a,b,e,i){if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.marginTop=b+"px",this.habla_window_div.style.marginLeft=a+"px",
this.habla_window_div.style.marginRight=e+"px",this.habla_window_div.style.marginBottom=i+"px"};this.setInline=function(a){a?(a=this.habla_window_div.style.display,this.habla_window_div.setAttribute("style",""),this.config.style_classes_map.habla_window_div=["habla_window_div_position_inline","habla_window_div_base","hbl_pal_main_width"],this.habla_window_div.style.display=a,this.config.render_element_classes(this,"habla_window_div")):this.setPosition(this.config.vars.corner_position)};this.__getAdjustedPosition=
function(a){a=a.toUpperCase();this.config.vars.theme_requires_position&&(this.config.vars.theme_requires_position.match(/B/)?a=a.replace("T","B")+"B":this.config.vars.theme_requires_position.match(/T/)&&(a=a.replace("B","T")),this.config.vars.theme_requires_position.match(/R/)?a=a.replace("L","R")+"R":this.config.vars.theme_requires_position.match(/L/)&&(a=a.replace("R","L")));return a};this.setPosition=function(a){var b=this.habla_window_div.style.display;this.config.style_classes_map.habla_window_div=
["habla_window_div_base","hbl_pal_main_width"];a=this.__getAdjustedPosition(a);this.habla_window_div.setAttribute("style","");if(a.match(/B/)){if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.marginBottom=this.config.vars.bottom_margin+"px",this.habla_window_div.style.bottom="0px";this.config.style_classes_map.habla_window_div.push("olrk-fixed-bottom")}else{if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.marginTop=this.config.vars.top_margin+
"px",this.habla_window_div.style.top="0px";this.config.style_classes_map.habla_window_div.push("olrk-fixed-top")}if(a.match(/R/)){if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.marginRight=this.config.vars.right_margin+"px",this.habla_window_div.style.right="0px";this.config.style_classes_map.habla_window_div.push("olrk-fixed-right")}else{if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.marginLeft=this.config.vars.left_margin+"px",this.habla_window_div.style.left=
"0px";this.config.style_classes_map.habla_window_div.push("olrk-fixed-left")}this.habla_window_div.style.display=b;if(!this.config.vars.disable_javascript_position)this.habla_window_div.style.position=hbl.util.BrowserDetect.backwards_position?"absolute":"fixed";this.config.render_element_classes(this,"habla_window_div");this.position=a};this.highlight=function(){if(!this.highlighted)this.config.set_element_classes(this.habla_closebutton_a,"habla_button_highlighted"),this.config.set_element_classes(this.habla_sizebutton_a,
"habla_button_highlighted"),this.config.set_element_classes(this.habla_topbar_div,"habla_topbar_div_highlighted"),this.config.set_element_classes(this.habla_wcsend_input,"habla_wcsend_input_highlighted"),this.highlighted=!0};this.normal=function(){if(this.highlighted)this.config.set_element_classes(this.habla_closebutton_a,"habla_button_normal"),this.config.set_element_classes(this.habla_sizebutton_a,"habla_button_normal"),this.config.set_element_classes(this.habla_topbar_div,"habla_button_normal"),
this.config.set_element_classes(this.habla_topbar_div,"habla_topbar_div"),this.config.set_element_classes(this.habla_wcsend_input,"habla_wcsend_input"),this.highlighted=!1};this.getMessageInputField=function(){return this.habla_wcsend_input};this.getMessageInputFieldValue=function(){return this.habla_wcsend_input.value};this.setMessageInputFieldValue=function(a){this.habla_wcsend_input.value=a};this.display_pipeline=new hbl.util.pipeline(this);this.display_pipeline.add(hbl.pipelines.wrap_text,999);
this.display_pipeline.add(hbl.pipelines.emoticons,1E3);window.olark&&window.olark.__legacy_shim&&window.olark.__legacy_shim.pipeline_disabler&&this.display_pipeline.add(window.olark.__legacy_shim.pipeline_disabler,1001)};hbl.eventmgr.register("habla_preload_done",function(){!hbl.config.vars.theme_path&&!hbl.config.vars.theme_obj&&(hbl.config.vars.theme_obj=new hbl.themes.default_theme)},0);var hmpmetrics={};hmpmetrics.track=function(){};
function habla_start_func(){if(!hbl.post_started){hbl.post_started=1;if(hbl.siteid){if(hbl.siteid=="missing-site-id")hbl.siteid=window.__get_olark_key()}else hbl.siteid=window.__get_olark_key();window.habla_window||(habla_window=new hbl._hwindow(hbl.client,hbl.config,hbl.eventmgr),hbl.eventmgr.setWindow(habla_window),habla_window.register_handlers());hbl.config.vars.local_mode?(hbl.client.start(hbl.wcsid,hbl.hblid,hbl.siteid,hbl.eventmgr,hbl.config),habla_window.setTheme(hbl.config.vars.theme_obj),
habla_window.config.vars.welcome_msg="Hab.la is in testing mode. set <em>config.vars['local_mode'] = false;</em> to go back to normal.",habla_window.config.vars.in_chat_text="Hab.la Local Mode",habla_window.config.vars.before_chat_text="Hab.la Local Mode",habla_window.config.vars.not_available_text="Hab.la Local Mode",habla_window.setHeader(habla_window.config.vars.not_available_text),habla_window.show(1)):hbl.siteid&&(hbl.siteid.match(/(olark|\@)/i)||!hbl.siteid.match(/\d\d*\-\d/))&&hbl.config.vars.theme_obj?
habla_error({etype:"invalid_site_id"}):!hbl.siteid&&hbl.config.vars.theme_obj?habla_error({etype:"invalid_site_link"}):(hbl.eventmgr.register("habla_error",habla_error,10),hbl.client.start(hbl.wcsid,hbl.hblid,hbl.siteid,hbl.eventmgr,hbl.config),hbl.eventmgr.handle("habla_started"))}}
function habla_error(a){if(a.etype=="invalid_site_id")hbl.client.eventmgr=new hbl.util.eventmanager,habla_window.setTheme(hbl.config.vars.theme_obj),habla_window.config.vars.offline_message="<em>"+hbl.siteid+"</em> is not a valid <a href='"+hblInstallUrl+"'>"+hblName+"</a> site ID.<p> Your "+hblName+" Site ID is in the format '###-##-###-##' and can be found on your <a href='"+hblInstallUrl+"' target='_blank'>Dashboard</a>.</p>",habla_window.config.vars.not_available_text=hblName+": Site ID Error",
habla_window.setHeader(habla_window.config.vars.not_available_text),habla_window.show(1),habla_window.theme.habla_conversation_div.scrollTop=0;else if(a.etype=="invalid_site_link")hbl.client.eventmgr=new hbl.util.eventmanager,habla_window.setTheme(hbl.config.vars.theme_obj),habla_window.config.vars.offline_message="Unable to determine your site-id.  Please make sure you have copied and pasted all the code as it appears on your <a href='"+hblInstallUrl+"' target='_blank'>"+hblName+" Dashboard</a>.",
habla_window.config.vars.not_available_text=hblName+": Site ID Error",habla_window.setHeader(habla_window.config.vars.not_available_text),habla_window.show(1),habla_window.theme.habla_conversation_div.scrollTop=0;else if(a.etype=="operator_is_busy")hbl.client.opbusy=!0,habla_window.opbusy=!0,habla_window.setWindowText()}
function wc_init_post(a){window.olark&&window.olark.__legacy_shim&&hbl.util.BrowserDetect.init();hbl.config=hbl.config||new hbl.hconfig;if(!hbl.config.merge){var b=hbl.config;hbl.config=new hbl.hconfig;hbl.config.merge(b,!0)}b=window.olark?window.olark._||{}:{};hbl.wcsid=hbl.config.vars.wcsid||b.conversationId||"";hbl.hblid=hbl.config.vars.hblid||b.visitorId||"";if(!hbl.config.vars.disable_get_cookies&&!hbl.config.vars.wcsid)hbl.wcsid=b.conversationId||olark._.cookieManager.get("wcsid")||"",hbl.hblid=
b.visitorId||olark._.cookieManager.get("hblid")||"";if(!hbl.config.plugins)hbl.config.plugins=new hbl.util.pluginlist;a=a||["incoming_notification","away_div_handler","expand_on_receive_message","google_translate","auto_initiate"];for(b=0;b<a.length;b++){var c=new hbl.plugins[a[b]];hbl.config.plugins.add(c)}hbl.eventmgr.handle("habla_preload_done");habla_start_func();hbl.util.monitor_wcsid_changes_from_another_tab_periodically()}
if(!window.olark||window.olark&&!window.olark.__legacy_shim)if(!window.olark||!window.olark.__internal||!window.olark.__internal.skip_wc_init_post)hblJSInline?hbl.eventmgr.register("habla_called_wc_init",function(){wc_init_post()}):wc_init_post();window.olark&&window.olark.__internal&&window.olark.__internal.declare("__internal.legacy",function(){});if(window.olark&&window.olark.__legacy_shim)window.olark.__legacy_shim.legacy_post_stub_is_loaded=!0;
window.olark.__core.framestorewithjson=function(a,b,c,d,e){a=function(){function a(b){return b<10?"0"+b:b}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=q[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var g,j,i,e,m=n,v,t=d[a];t&&typeof t==="object"&&typeof t.__jsonlib_toJSON==="function"&&(t=t.__jsonlib_toJSON(a));typeof r==="function"&&(t=r.call(d,a,t));switch(typeof t){case "string":return b(t);
case "number":return isFinite(t)?String(t):"null";case "boolean":case "null":return String(t);case "object":if(!t)return"null";n+=k;v=[];if(Object.prototype.toString.apply(t)==="[object Array]"){e=t.length;for(g=0;g<e;g+=1)v[g]=c(g,t)||"null";i=v.length===0?"[]":n?"[\n"+n+v.join(",\n"+n)+"\n"+m+"]":"["+v.join(",")+"]";n=m;return i}if(r&&typeof r==="object"){e=r.length;for(g=0;g<e;g+=1)j=r[g],typeof j==="string"&&(i=c(j,t))&&v.push(b(j)+(n?": ":":")+i)}else for(j in t)Object.hasOwnProperty.call(t,
j)&&(i=c(j,t))&&v.push(b(j)+(n?": ":":")+i);i=v.length===0?"{}":n?"{\n"+n+v.join(",\n"+n)+"\n"+m+"}":"{"+v.join(",")+"}";n=m;return i}}if(typeof Date.prototype.__jsonlib_toJSON!=="function")Date.prototype.__jsonlib_toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.__jsonlib_toJSON=Number.prototype.__jsonlib_toJSON=Boolean.prototype.__jsonlib_toJSON=
function(){return this.valueOf()};var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,k,q={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},r,j=null;typeof j!=="function"&&(j=function(a,b,d){var g;k=n="";if(typeof d==="number")for(g=0;g<d;g+=1)k+=" ";else typeof d==="string"&&
(k=d);if((r=b)&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number"))throw Error("stringify failed");return c("",{"":a})});var m=null;typeof m!=="function"&&(m=function(a,b){function c(a,h){var d,g,j=a[h];if(j&&typeof j==="object")for(d in j)Object.hasOwnProperty.call(j,d)&&(g=c(j,d),g!==void 0?j[d]=g:delete j[d]);return b.call(a,h,j)}var j;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+a+")"),typeof b==="function"?c({"":j},""):j;throw new SyntaxError("JSON parse error: "+a);});return{encode:j,decode:m}}(window,document);b=function(){function a(){function h(a){(a=a.key)?b(a):c()}window.addEventListener?window.addEventListener("storage",h,!1):window.attachEvent("onstorage",h)}function b(a){var c=q[a],h=r(a);k[a]=k[a]||[];q[a]=h;if(c!=h)for(c=0;c<
k[a].length;c++)try{k[a][c]({newValue:h})}catch(d){window.console&&window.console.error&&window.console.error(d)}}function c(){for(var a in k)k.hasOwnProperty(a)&&b(a)}var d={},e=window,n=e.document,k={},q={},r,j;d.set=function(){};d.get=function(){};d.remove=function(){};d.clear=function(){};d.transact=function(a,b){var c=d.get(a);typeof c=="undefined"&&(c={});b(c);d.set(a,c)};d.listen=function(a,b){q[a]=r(a);k[a]=k[a]||[];k[a].push(b)};d.serialize=function(a){return JSON.stringify(a)};d.deserialize=
function(a){if(typeof a=="string")return JSON.parse(a)};var m;try{m="localStorage"in e&&e.localStorage}catch(h){m=!1}if(m)j=e.localStorage,d.set=function(a,b){j.setItem(a,d.serialize(b))},d.get=function(a){return d.deserialize(j.getItem(a))},d.remove=function(a){j.removeItem(a)},d.clear=function(){j.clear()},r=function(a){return j.getItem(a)},a();else{var o;try{o="globalStorage"in e&&e.globalStorage&&e.globalStorage[e.location.hostname]}catch(z){o=!1}if(o)j=e.globalStorage[e.location.hostname],d.set=
function(a,b){j[a]=d.serialize(b)},d.get=function(a){return d.deserialize(j[a]&&j[a].value)},d.remove=function(a){delete j[a]},d.clear=function(){for(var a in j)delete j[a]},r=function(a){return j[a]},setInterval(c,750);else if(n.documentElement.addBehavior){j=n.createElement("div");var p={},u={},s={},x=function(a){return function(){var b=Array.prototype.slice.call(arguments||[],0);b.unshift(j);n.body.appendChild(j);j.addBehavior("#default#userData");j.load("localStorage");b=a.apply(d,b);n.body.removeChild(j);
return b}},w=function(){var a=Array.prototype.slice.call(arguments||[],0),b=a.shift();try{return u[b].apply(u,a),s[b].apply(s,a)}catch(c){return u[b].apply(u,a)}};s.set=x(function(a,b,c){a.setAttribute(b,d.serialize(c));a.save("localStorage")});s.get=x(function(a,b){return d.deserialize(a.getAttribute(b))});s.remove=x(function(a,b){a.removeAttribute(b);a.save("localStorage")});s.clear=x(function(a){var b=a.XMLDocument.documentElement.attributes;a.load("localStorage");for(var c=0,h;h=b[c];c++)a.removeAttribute(h.name);
a.save("localStorage")});u.set=function(a,b){p[a]=b};u.get=function(a){return p[a]};u.remove=function(a){delete p[a]};u.clear=function(){p={}};d.set=function(a,b){return w("set",a,b)};d.get=function(a){return w("get",a)};d.remove=function(a){return w("remove",a)};d.clear=function(){return w("clear")};r=function(a){try{return x(function(a,b){return a.getAttribute(b)})(a)}catch(b){return p[a]}};setInterval(c,750)}else{var t="; path="+document.location.pathname,B=function(){for(var a=document.cookie.split(";"),
b=0;b<a.length;b++){var c=a[b].replace(/^\s*/,"").replace(/\s*$/,"");if(c.indexOf("storejs=")==0)return d.deserialize(unescape(c.slice(8)))}return{}},y=function(a){document.cookie="storejs="+escape(d.serialize(a))+t;document.cookie.length>4E3&&(window.console&&window.console.warn&&window.console.warn("cookie is too large, clearing storejs"),y({}))};d.set=function(a,b){var c=B();c[a]=b;y(c)};d.get=function(a){return B()[a]};d.remove=function(a){var b=B();try{delete b[a]}catch(c){b[a]=void 0}y(b)};
d.clear=function(){y({})};r=function(a){return d.serialize(B()[a])}}}return d}();c=function(a,b){function c(){if(a.console&&a.console.error)try{a.console.error.apply(a.console,arguments)}catch(b){try{a.console.error(Array.prototype.slice.call(arguments||[]).join(" "))}catch(h){}}}function d(){if(a.console&&a.console.warn)try{a.console.warn.apply(a.console.warn,arguments)}catch(b){try{a.console.warn(Array.prototype.slice.call(arguments||[]).join(" "))}catch(c){}}}function e(){if(a.ActiveXObject)try{var b=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),c;return b?(c=b.GetVariable("$version"),parseInt(/([0-9]+)/.exec(c)[1])):-1}catch(h){return-1}else return-1}function n(a){return/^\s*(file\:|[a-zA-Z]\:).*/.test(a)}function k(a){return a?a.length==""?null:n(a)?"file:":(a=a.split("//"),a.length>1?a[0]+"//"+a[1].split("/")[0]:a[0]):null}function q(c,h){var d=Math.floor(Math.random()*99999).toString(),g,j=b.createElement("span"),k="framesocket"+d;d="framesocket"+d;var o=b.getElementsByTagName("body")[0],
f,e=!1,n="try{window."+d+"()}catch(e){"+d+"()}";o?f=function(){o.appendChild(j)}:(o=b.getElementsByTagName("script")[0],f=function(){o.parentNode.insertBefore(j,o)});a[d]=function(){h&&!e&&(e=!0,h(g))};j.style.display="none";/(Firefox)/.test(navigator.userAgent)?(j.innerHTML='<iframe style="display: none !important" id="'+k+'" onload="'+n+'"></iframe>',f(),g=b.getElementById(k),g.src=c):(j.innerHTML='<iframe style="display: none !important" id="'+k+'" src="'+c+'" onload="'+n+'"></iframe>',f(),g=b.getElementById(k));
return g}function r(a){setTimeout(a,0)}function j(a){return k(a=="file:"?null:a)}function m(a,b){function c(){if(a()){var g=h.shift();d=!1;typeof g!="undefined"&&b(g);h.length>0&&!d&&(d=!0,r(c))}}var h=[],d=!1,g=null;return g={queuedSend:function(a){h.push(a);c()},attemptDequeue:c}}function h(){function c(){var b,h,d;d=m(function(){return typeof b!="undefined"&&typeof h!="undefined"?!0:!1},function(c){if(h==null||n(h))a.postMessage?b.postMessage(c,"*"):b.document.postMessage(c,"*");else{var d=k(h);
a.postMessage?b.postMessage(c,d):b.document.postMessage(c,d)}});return{setPostMessageTargetWindow:function(a){b=a;d.attemptDequeue()},setPostMessageTargetOrigin:function(a){h=a;d.attemptDequeue()},send:function(a){d.queuedSend(a)}}}function h(c){function d(a){var h=k(a.origin||a.uri);a.origin=="null"&&(h="file:");h&&!n(h)&&(a.uri&&a.uri.toString().indexOf(h)==0?a.uri.toString().slice(h.length):b.referrer&&b.referrer.toString().indexOf(h)==0&&b.referrer.toString().slice(h.length));h=j(h);if(typeof o==
"undefined"||o==h)(typeof f=="undefined"||f==a.source)&&c({data:a.data,origin:h})}var g={},o,f;a.addEventListener?a.addEventListener("message",d,!1):a.attachEvent("onmessage",d);g.setExpectedOrigin=function(a){o=j(a)};g.setExpectedWindow=function(a){f=a};return g}p.connect=function(a,b){function d(a){o.send(e+u+a)}var g=a.server||a,j=null,o=c(),f,e=Math.random().toString().replace("0.","TK"),i=g.replace(/\#[^?]*/,"")+"#"+e;b=b||function(){};o.setPostMessageTargetOrigin(g);q(i,function(a){a=a.contentWindow?
a.contentWindow:a.contentDocument.window;f=h(b);f.setExpectedOrigin(k(i));f.setExpectedWindow(a);o.setPostMessageTargetWindow(a)});d(s);return j={send:d}};p.accept=function(b){var j=null,k=c(),o,f=(a.location.hash||"").slice(1),e=!1;b=b||function(){};k.setPostMessageTargetWindow(a.parent);o=h(function(a){var c=a.data.split(u),h=c[1];c[0]==f?h==s?e||(e=!0,o.setExpectedOrigin(a.origin),k.setPostMessageTargetOrigin(a.origin)):r(function(){b({data:h,origin:a.origin})}):d("[framesocket] received a message from an origin with an invalid identity")});
o.setExpectedWindow(a.parent);return j={send:k.send}}}function o(){p.connect=function(b,c){function h(b,c){if(b==f)c();else return a.console&&a.console.warn&&a.console.warn("[framesocket] invalid security token given to client in frameElement transport"),null}var d=b.server||b,g,k,o=!1,f=Math.random().toString().replace("0.","TK"),e=d.replace(/\#[^?]*/,"")+"#"+f;c=c||function(){};g=m(function(){return o},function(a){k.frameElementContext.sendToChild(a,f)});k=q(e);k.frameElementContext=function(){};
k.frameElementContext.markChildAsReady=function(a){h(a,function(){r(function(){o=!0;g.attemptDequeue()})})};k.frameElementContext.sendToParent=function(a,b){h(b,function(){c({data:a,origin:j(d)})})};return{send:function(a){g.queuedSend(a)}}};p.accept=function(c){function h(b,c){if(b==d)c();else return a.console&&a.console.warn&&a.console.warn("[framesocket] invalid security token given to server in frameElement transport"),null}var d=(a.location.hash||"").slice(1),g;c=c||function(){};a.frameElement.frameElementContext();
a.frameElement.frameElementContext.sendToChild=function(a,d){h(d,function(){c({data:a,origin:j(b.referrer)})})};a.frameElement.frameElementContext.markChildAsReady(d);g=m(function(){return!0},function(b){a.frameElement.frameElementContext.sendToParent(b,d)});return{send:function(a){g.queuedSend(a)}}}}function z(){function c(){for(;f.length;)f.shift()(d())}function h(a){var c=b.getElementsByTagName("script")[0],d=b.createElement("script");d.type="text/javascript";d.async=!0;d.src=a;c.parentNode.insertBefore(d,
c)}function d(){var b=null;if(a.minixdm)b=a.minixdm.easyXDM;return b||a.easyXDM}function g(a,b){f.push(b);d()?c():j||(j=!0,h(a),o=setInterval(function(){d()&&(c(),clearInterval(o))},100))}var j=!1,o=null,f=[];p.connect=function(b,c){var h=b.server||b,d=h.replace(/(\/[^\/]+)$/,""),j=d+"/minixdm.swf",o=d+"/minixdm.js",f;a.location.protocol=="http:"&&(j=j.replace("https","http"));g(o,function(a){f=new a.Socket({protocol:x,lazy:!1,swf:j,remote:h.replace(/\#[^?]*/,"")+"#basepath="+encodeURIComponent(d),
onMessage:function(a,b){c({data:a,origin:k(b)})}})});return newSocket={send:function(a){g(o,function(){f.postMessage(a)})}}};p.accept=function(b){var c=decodeURIComponent(/basepath=([^?&]+)/.exec(a.location.href.slice(1))[1]),h=c+"/minixdm.swf",d=c+"/minixdm.js",j;a.location.protocol=="http:"&&(h=h.replace("https","http"));g(d,function(a){j=new a.Socket({protocol:x,swf:h,onMessage:function(a,c){b({data:a,origin:k(c)})}})});return newSocket={send:function(a){g(d,function(){j.postMessage(a)})}}}}var p=
{},u="~:DATA:~",s="~:INIT:~",x="6";if(a.postMessage||b.postMessage)h();else if(navigator.product=="Gecko"&&"frameElement"in a&&navigator.userAgent.indexOf("WebKit")==-1)o();else if(e()>6)z();else{var w=function(){c("[framesocket] unsupported browser")};p.connect=function(){w();return{send:w}};p.accept=function(){w();return{send:w}};p.isCompatible=function(){return!1}}p.isCompatible=p.isCompatible||function(){return!0};return p}(window,document);d=function(a,b,c,d,e){function n(){if(a.console&&a.console.error)try{a.console.error.apply(a.console,
arguments)}catch(b){try{a.console.error(Array.prototype.slice.call(arguments||[]).join(" "))}catch(c){}}}function k(){if(a.console&&a.console.warn)try{a.console.warn.apply(a.console.warn,arguments)}catch(b){try{a.console.warn(Array.prototype.slice.call(arguments||[]).join(" "))}catch(c){}}}function q(){this.name="ReadTimeoutError"}function r(){this.name="WriteTimeoutError"}function j(a,b){for(var d=Array.prototype.slice.call(arguments||[]).slice(2),h=b.toString(),g=0;g<d.length;g++)h+=typeof d[g]==
"undefined"?","+escape(B):","+escape(c.encode(d[g]));a.send(h)}function m(a,b){var d=a.split(t),h=d[0];d=d.slice(1);for(var g=b[h],j=[],o,e=0;e<d.length;e++)o=unescape(d[e]),o==B?j.push({}.undefinedValue):j.push(c.decode(unescape(o)));g?g.apply(g,j):k("[framestore] unknown command type:",h)}function h(a,b){try{d.remove("__framestore__.locks."+a)}catch(c){}b(function(){})}function o(){try{return d.get("__framestore__.index")||{}}catch(a){return k("[framestore] index capture failed, resetting"),d.set("__framestore__.index",
{}),{}}}function z(a){try{return d.set("__framestore__.index",a)}catch(b){k("[framestore] index capture failed, clearing entire storage"),d.clear(),d.set("__framestore__.index",a)}}function p(a){var b=o();d.remove(s(a));delete b[a];z(b)}function u(a){var b=o();b[a]=(new Date).getTime();z(b)}function s(a){return"__framestore__.stores."+a}function x(a,c,j){u(a);h("stores."+a,function(h){var k=s(a),o={metadata:{creator:b.referrer,lastUpdated:(new Date).getTime()},data:{}},f;try{f=d.get(k)||o}catch(e){if(j)f=
o;else throw e;}c(f.data,f.metadata,function(a,b){if(a||b){if(a)f.data=a;if(b)f.metadata=b;f.metadata.lastUpdated=(new Date).getTime();d.set(k,f)}h()})})}var w={},t=",",B="~UNDEFINED",y=100;w.connect=function(b,c){function d(){u||(u=setTimeout(h,y))}function h(){o.flush()}function g(a){a.code===22||/QUOTA/.test(a.name||"")?n?B&&B():t&&t():a instanceof r?R&&R():a instanceof q?Q&&Q():!n&&!z?(k("[framestore] failed to boot, trying to dump storage"),z=!0,o.dump(),o.pull()):w&&w(a)}var o={},f=b.key,n=
!1,z=!1,p={},s=[],l,u=null,x=!1,w=b.onFailure,t=b.onDisabled,B=b.onOverflow,Q=b.onReadTimeout,R=b.onWriteTimeout,P=!1,J=null,K=null,H=null,S=b.maxMillisecondsForResponse||2100;l=e.connect(b.server,function(b){m(b.data,{FLUSHDONE:function(a){J==a&&(x=!1,s=[],P&&h())},FLUSHFAIL:function(a,b){J==a&&(x=!1,g(b))},PULLFAIL:function(a){H&&(clearTimeout(H),H=null);g(a)},PUSH:function(b,d,g){var j;if(g)b=d;else{b=d;for(d=0;d<s.length;d++)g=s[d],j=p[g],b[g]=j}p=b;H&&(clearTimeout(H),H=null);n||(n=!0,a.addEventListener?
a.addEventListener("beforeunload",h,!1):a.attachEvent("onbeforeunload",h),c(o))}})});o.pull=function(){H=setTimeout(function(){k("[framesocket] timed out while pulling from persistent storage");g(new q)},S);j(l,"PULL",f)};o.flush=function(){if(x)P=!0;else if(u&&(clearTimeout(u),u=null),K&&(clearTimeout(K),K=null),P=!1,n&&s.length>0){var a={},b,c,d;for(b=0;b<s.length;b++)c=s[b],d=p[c],a[c]=typeof d=="undefined"?"~DELETEDKEY":d;J=(+new Date).toString();x=!0;K=setTimeout(function(){if(x){k("[framesocket] timed out while flushing to persistent storage");
var a=new r;x=!1;g(a)}},S);j(l,"FLUSH",f,a,J)}};o.get=function(a){return p[a]};o.set=function(a,b){p[a]=b;s.push(a);d()};o.remove=function(a){try{p[a]=void 0,delete p[a]}catch(b){}s.push(a);d()};o.clear=function(){p={};u&&(clearTimeout(u),u=null);j(l,"CLEAR",f)};o.dump=function(){j(l,"DUMP",f,p)};o.reclaim=function(a){j(l,"RECLAIM",f,a)};o.reject=function(a){for(var b in p){var c;try{c=a(b)?!0:!1}catch(h){c=!1}if(p.hasOwnProperty(b)&&c){try{p[b]=void 0,delete p[b]}catch(g){}s.push(b)}}d()};o.pull();
return o};w.accept=function(){function a(b,d){k("[framestore] unable to flush to persistent storage");n(b);j(c,"FLUSHFAIL",d,b)}function b(a){k("[framestore] unable to pull from persistent storage");n(a);j(c,"PULLFAIL",a)}var c,h={};c=e.accept(function(f){m(f.data,{PULL:function(a){function f(d){try{x(a,function(b,h,g){j(c,"PUSH",a,b,d);g(null,null)})}catch(h){b(h)}}h[a]||(h[a]=!0,d.listen(s(a),f),d.listen("__framestore__.index",function(){var b=o(),c;for(c in b)if(c==a)return;k("[framestore] storage reclaimed, pushing cleared contents");
f(!0)}));f()},FLUSH:function(b,d,h){try{x(b,function(b,g,o){var k,f={};for(k in d)if(d.hasOwnProperty(k))if(g=d[k],f[k]=b[k],g=="~DELETEDKEY")try{b[k]=void 0,delete b[k]}catch(e){}else b[k]=g;try{o(b,null),j(c,"FLUSHDONE",h)}catch(n){for(var i in f)f.hasOwnProperty(i)&&(b[i]=f[i]);a(n,h)}})}catch(g){a(g,h)}},CLEAR:function(a){p(a)},DUMP:function(a,b){x(a,function(a,c,d){d(b,null)},!0)},RECLAIM:function(a,b){if(b&&b>0)for(var c=b;c;){c--;var d=a,h=o(),g=null,j=(new Date).getTime(),f=null,e=void 0;
for(e in h)if(e!=d&&h.hasOwnProperty(e)&&(f=h[e],g===null||f===!0||f<j))g=e,j=f===!0?0:f;g&&p(g)}else k("[framestore] number of reclaimed entries must be nonzero")}})})};d.serialize=function(a){return c.encode(a)};d.deserialize=function(a){if(typeof a=="string")return c.decode(a)};return w}(window,document,a,b,c);return e={framestore:d,json:a,framesocket:c}}();
(function(a,b){a.wait_for(function(){return a.framestorewithjson},function(){function c(c){function d(a){olark._.cookieManager.set("olfsk",a,63072E6)}var h=!1,g=olark._&&olark._.storage?olark._.storage:"https://static.olark.com/jsclient/storage.html?v=1";olark._.storage||olark._.hlog("no storage URL specified in loader, falling back #warn #no_storage_url");var k;if(!(k=olark._.cookieManager.get("olfsk")))olark._.isNewConversation||olark._.hlog("already booted once, but lost olfsk #warn #olfsk_regen"),
k=Math.random().toString().replace("0.","olfsk");(function(k){function f(b){if(!h)h=!0,a.data.forceDomain=function(){olark._.cookieManager.erase("olfsk");d(k)},a.data.forcePath=function(){olark._.cookieManager.erase("olfsk");d(k)},d(k),a.data.storejs=b,c()}var n=a.framestorewithjson.json,i=0;a.framestorewithjson.framestore.connect({server:g,key:k,onDisabled:function(){"localStorage"in window&&(b.warn("[olark] persistent storage disabled, chat will restart when crossing over into SSL or other subdomains"),
olark._.hlog("data persistence lowered due to #local_storage_disabled"),f({set:function(a,b){localStorage.setItem(a,n.encode(b))},get:function(a){return n.decode(localStorage.getItem(a)||"null")},remove:function(a){localStorage.removeItem(a)}}))},onOverflow:function(){var b=0;a.data.storejs.reject(function(a){return a=="vsession"||a==olark._.conversationId?!1:(b++,!0)});b==0?i<e?(a.data.storejs.reclaim(1),olark._.hlog("storage overflow, #reclaimed_shared_space ("+i+" entries)"),i++):olark._.hlog("storage overflow, #too_many_reclaims (total="+
i+")"):olark._.hlog("storage overflow, #eliminated_convo_data ("+b+" conversations cleared)");a.data.storejs.flush()},onReadTimeout:function(){olark._.hlog("reads taking too long #storage_read_timeout")},onWriteTimeout:function(){olark._.hlog("writes taking too long #storage_write_timeout")},onFailure:function(c){b.warn("[olark] dumping storage cache due to unexpected issue:",c);olark._.hlog("unable to persist storage #storage_failure");a.data.storejs.dump()}},f)})(k);setTimeout(function(){h||olark._.hlog("slow data connection (>8s) #slow_framestore_connection")},
8E3)}var d=/^\s*(__.*|chatNickname|chatStatus)\s*$/,e=5,i=function(a,b){a=a||{};for(var c=b.length;c--;){var d=b[c];if(typeof a[d]=="undefined")throw Error("[olark] '"+d+"' is a required argument");}return a},l=function(a){this.__key=a.key;this.__keystore=a.keystore;this.__link_to_conversation=a.link_to_conversation;this.__link_to_visitor=a.link_to_visitor;this.__initial_value=a.initial_value;this.__backup=a.backup;this.__backupTransform=a.backupTransform;if(this.__link_to_visitor&&this.__link_to_conversation)throw Error("cannot link object reference to both the visitor and conversation");
this.__event_object_string="PersistentObjectReference."+this.__key;typeof this.get()=="undefined"&&typeof this.__initial_value!="undefined"&&this.set(this.__initial_value);if(this.__link_to_conversation&&this.__keystore.isLinkedToVisitor({key:this.__key}))throw Error("this object is already linked to the visitor, cannot link it to the conversation");if(this.__link_to_visitor&&this.__keystore.isLinkedToConversation({key:this.__key}))throw Error("this object is already linked to the conversation, cannot link it to the visitor");
};l.prototype.get=function(){var b=this.__keystore.get({key:this.__key,backup:this.__backup,backupTransform:this.__backupTransform});return typeof b=="undefined"?(this.set(this.__initial_value),a.clone_object(this.__initial_value)):a.clone_object(b)};l.prototype.set=function(b){if(typeof b=="undefined")throw Error("'value' required for object set");var c=this.__keystore.get({key:this.__key,backup:this.__backup,backupTransform:this.__backupTransform});a.deep_equals(c,b)||(this.__keystore.set({key:this.__key,
value:b,link_to_conversation:this.__link_to_conversation,link_to_visitor:this.__link_to_visitor,backup:this.__backup}),a.trigger_event({namespace:this.__event_object_string,type:"keyChange",key:this.__key,newValue:b,oldValue:c}))};l.prototype.edit=function(a){var b=this.get();a(b);this.set(b)};l.prototype.change=function(a){b.warn("[olark] 'change' is deprecated, use __SPI_onChange instead");this.__SPI_onChange(a)};l.prototype.__SPI_onChange=function(b){a.listen_for_event({namespace:this.__event_object_string,
type:"keyChange",callback:b})};var f=function(){};f.prototype.get=function(){throw Error();};f.prototype.set=function(){throw Error();};f.prototype.clearConversationData=function(){throw Error();};f.prototype.clearVisitorData=function(){throw Error();};f.prototype.isLinkedToConversation=function(){throw Error();};f.prototype.isLinkedToVisitor=function(){throw Error();};var g=function(a){a=a||{};this.__csession_key=a.conversationId;if(typeof this.__csession_key=="undefined")throw Error("[olark] conversationId is required for storage");
this.__conversation_expiration_delta_in_days=0.1;this.__visitor_expiration_delta_in_days=365;q({key:this.__csession_key,defaultValue:null})||k({key:this.__csession_key,value:{},expiration_in_milliseconds:this.__conversation_expiration_delta_in_days*864E5});q({key:"vsession",defaultValue:null})||k({key:"vsession",value:{},expiration_in_milliseconds:this.__visitor_expiration_delta_in_days*864E5});this.set({key:"siteId",value:olark._.siteId,link_to_visitor:!0})};g.prototype=new f;g.prototype.constructor=
g;g.prototype.get=function(a){a=a||{};var c=a.key;a=a.backup;if(typeof c=="undefined")throw Error("'key' required");var d=q({key:"vsession",defaultValue:{}}),g=q({key:this.__csession_key,defaultValue:{}});d=d[c];g=g[c];var k;typeof g!="undefined"?typeof d!="undefined"?b.warn("[olark]",c,"was stored as associated with both the visitor and conversation, falling back to the conversation value"):k=g:k=d;if(typeof k=="undefined"&&a){c=(olark._.cookieManager.getAllowingNullAndUndefinedAndEmptyString("_okbk")||
"").split(",");var f;for(d=0;d<c.length;d++)f=c[d].split("="),g=f[0],f=unescape(f[1]),g==a&&(k=f)}return k};g.prototype.set=function(a){a=a||{};var b=a.key,c=a.value,d=a.link_to_visitor,g=a.link_to_conversation;a=a.backup;if(typeof b=="undefined")throw Error("'key' required");if(typeof c=="undefined")throw Error("'value' required for key store set");if(d&&g)throw Error("cannot link data to both a visitor and conversation");if(!d&&!g)throw Error("currently, you must link to either a conversation or visitor");
var f=q({key:"vsession",defaultValue:{}}),e=q({key:this.__csession_key,defaultValue:{}});if(d)if(e[b])throw Error("[error] cannot link "+b+" to the visitor, it is already associated with the conversation");else f[b]=c,k({key:"vsession",value:f,expiration_in_milliseconds:this.__visitor_expiration_delta_in_days*864E5});if(g)if(f[b])throw Error("cannot link this value to the conversation, it is already associated with the visitor");else e[b]=c,k({key:this.__csession_key,value:e,expiration_in_milliseconds:this.__conversation_expiration_delta_in_days*
864E5});if(a){b=(olark._.cookieManager.get("_okbk")||"").split(",");f=[a+"="+escape(c)];for(g=0;g<b.length;g++)c=b[g].split("="),d=c[0],unescape(c[1]),d!=a&&f.push(b[g]);olark._.cookieManager.setAllowingNullAndUndefinedAndEmptyString("_okbk",f.join(",")||null)}};g.prototype.clearConversationData=function(){r({key:this.__csession_key});olark._.cookieManager.erase("_okbk")};g.prototype.clearVisitorData=function(){r({key:"vsession"})};g.prototype.isLinkedToConversation=function(a){a=a||{};a=a.key;if(typeof a==
"undefined")throw Error("'key' required");return typeof q({key:this.__csession_key,defaultValue:{}})[a]!="undefined"};g.prototype.isLinkedToVisitor=function(a){a=a||{};a=a.key;if(typeof a=="undefined")throw Error("'key' required");return typeof q({key:"vsession",defaultValue:{}})[a]!="undefined"};var v=function(a){a=a||{};if(typeof a.namespace=="undefined")throw Error("'namespace' required");this.__namespace=a.namespace;this.__keystore=new g({conversationId:olark._.conversationId})};v.prototype.__SPI_clearVisitorAndConversationData=
function(){this.__keystore.clearVisitorData();this.__keystore.clearConversationData()};v.prototype.__SPI_clearOnlyConversationData=function(){this.__keystore.clearConversationData()};(function(){var a=v.prototype;a.declareConversationObject=function(a){b.warn("[olark] api.data.declareConversationObject is deprecated, please use api.data.getConversationObject instead");return this.getConversationObject(a)};a.declareVisitorObject=function(a){b.warn("[olark] api.data.declareVisitorObject is deprecated, please use api.data.getVisitorObject instead");
return this.getVisitorObject(a)}})();v.prototype.getConversationObject=function(a){a=a||{};if(typeof a.key=="undefined")throw Error("'key' required for getConversationObject");if(typeof a.initialValue=="undefined")a.initialValue=null;if(d.test(a.key))throw Error("[olark] '"+a.key+"' is a protected key name, please choose something else");return new l({key:(a.__SPI_forceNamespace||this.__namespace)+"."+a.key,keystore:this.__keystore,initial_value:a.initialValue,link_to_conversation:!0,backup:a.backup,
backupTransform:a.backupTransform})};v.prototype.getVisitorObject=function(a){a=a||{};if(typeof a.key=="undefined")throw Error("'key' required for getVisitorObject");if(typeof a.initialValue=="undefined")a.initialValue=null;if(d.test(a.key))throw Error("[olark] '"+a.key+"' is a protected key name, please choose something else");return new l({key:(a.__SPI_forceNamespace||this.__namespace)+"."+a.key,keystore:this.__keystore,initial_value:a.initialValue,link_to_visitor:!0,backup:a.backup,backupTransform:a.backupTransform})};
var n=null;(function(){var b={};n={get:function(c){var d=(new Date).getTime(),g=b[c];return g&&d-g.timestamp<900?g.val:(g=a.data.storejs.get(c),b[c]={val:g,timestamp:d},g)},set:function(c,d){var g=(new Date).getTime();g={val:d,timestamp:g};a.data.storejs.set(c,d);b[c]=g},remove:function(c){a.data.storejs.remove(c);b[c]=void 0;try{delete b[c]}catch(d){}}}})();var k=function(a){a=i(a,["key","value","expiration_in_milliseconds"]);var b=(new Date).getTime();n.set(a.key,{value:a.value,unix_timestamp:b,
expiration_in_milliseconds:a.expiration_in_milliseconds})},q=function(c){c=i(c,["key"]);return a.try_and_optionally_catch(function(){var a=n.get(c.key);return a?(new Date).getTime()-a.unix_timestamp<a.expiration_in_milliseconds?a.value:(r({key:c.key}),c.defaultValue):c.defaultValue},function(a){b.error("[olark] problem retrieving '"+c.key+"' from storejs: "+a.toString());b.showErrorBacktrace(a)})},r=function(a){a=i(a,["key"]);n.remove(a.key)};a.data={AbstractKeyStore:f,StorejsKeyStore:g,DataApi:v,
prepare:function(a,b){c(b)},storejs:null}})})(window.olark.__core,window.olark.__core.logger);
(function(a,b){a.wait_for(function(){return a.data&&window.olark.__legacy_shim.legacy_post_stub_is_loaded},function(){var c=null,d=null,e=!1,i=!1,l=!1,f=function(b){var c=this;c.__conf=b.conf;if(typeof c.__conf=="undefined")throw Error("'conf' required");c.__chat_api=b.chat_api;if(typeof c.__chat_api=="undefined")throw Error("'chat_api' required");c.__initialize_legacy_event_handlers();c.__setup_chat_history_handling();c.__conf.box.behave_like_popout&&c.__setup_popout_behavior();c.__keystore=new a.data.StorejsKeyStore({conversationId:olark._.conversationId});
c.__renderWelcomeMessage();c.__SPI_onPrechatWelcomeMessage(function(){c.__renderWelcomeMessage()})};f.prototype.listen=function(c,d){var f=string.charAt(0).toUpperCase()+string.slice(1);b.warn("[olark] api.box.listen is deprecated, please use api.box.on"+f+" instead");a.listen_for_event({namespace:"box",type:c,callback:d})};f.prototype.expand=function(){this.__SPI_whenRendered(function(){habla_window.expand()})};f.prototype.onExpand=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;
a.listen_for_event({namespace:"box",type:"expand",callback:b})};f.prototype.shrink=function(){this.__SPI_whenRendered(function(){habla_window.compress()})};f.prototype.onShrink=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;a.listen_for_event({namespace:"box",type:"shrink",callback:b})};f.prototype.show=function(){this.__SPI_whenRendered(function(){habla_window.show()})};f.prototype.onShow=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;a.listen_for_event({namespace:"box",
type:"show",callback:b})};f.prototype.overlay=function(){this.__SPI_whenRendered(function(){habla_window.theme.setInline(0);habla_window.end_popout()})};f.prototype.onOverlay=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;a.listen_for_event({namespace:"box",type:"overlay",callback:b})};f.prototype.hide=function(){this.__SPI_whenRendered(function(){habla_window.hide()})};f.prototype.onHide=function(b){window.olark.__legacy_shim.disable_input_focusing=!0;a.listen_for_event({namespace:"box",
type:"hide",callback:b})};f.prototype.popout=function(){habla_window.popout()};f.prototype.onPopout=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;a.listen_for_event({namespace:"box",type:"popout",callback:b})};f.prototype.dismiss=function(){this.__SPI_whenRendered(function(){habla_window.close()})};f.prototype.onDismiss=function(b){window.olark.__legacy_shim.disable_input_focusing=!0;a.listen_for_event({namespace:"box",type:"dismiss",callback:b})};f.prototype.__SPI_inline=function(){this.__SPI_whenRendered(function(){habla_window.theme.setInline(1)})};
f.prototype.__SPI_onInline=function(b){window.olark.__legacy_shim.disable_input_focusing=!1;a.listen_for_event({namespace:"box",type:"inline",callback:b})};f.prototype.__clear_message_history=function(){this.__SPI_whenRendered(function(){a.run_legacy_code(function(a){a.habla_window.setBody("")})})};f.prototype.__renderWelcomeMessage=function(){function a(){return b.__keystore.get({key:"__box.welcomeMessage"})}var b=this;if(a()){var c=function(){var c=a();c&&(window.habla_window.theme.setBody(""),
b.__chat_api.__SPI_setMessageHistory([{nickname:" ",body:c}]),b.__populate_message_history_from_chat_api());b.__keystore.set({key:"__box.welcomeMessage",value:null,link_to_conversation:!0})};b.__chat_api.onReady(function(){window.hbl.config.vars.show_pre_chat?b.__chat_api.__SPI_onPrechatInfoReceived(c):c()});b.__SPI_whenRendered(function(){var b=a();if(b)window.habla_window.theme.habla_pre_chat_span.innerHTML=b})}};f.prototype.__SPI_setPrechatWelcomeMessage=function(b){this.__keystore.set({key:"__box.welcomeMessage",
value:b,link_to_conversation:!0});a.trigger_event({namespace:"box",type:"prechatWelcomeMessage",body:b})};f.prototype.__SPI_onPrechatWelcomeMessage=function(b){a.listen_for_event({namespace:"box",type:"prechatWelcomeMessage",callback:b})};f.prototype.__SPI_showMessageHistory=function(){var a=this;a.__SPI_whenRendered(function(){habla_window.config.vars.show_pre_chat?habla_window.theme.habla_offline_message_div.style.display="none":(window.olark.__legacy_shim.ignore_prechat_status=!1,a.__toggle_divs_by_id({show:["habla_chatform_form",
"habla_conversation_div"],hide:["olark-api-panel","habla_pre_chat_div","habla_offline_message_div"]}))})};f.prototype.__SPI_getLegacyState=function(a){var b=this.__keystore.get({key:"__box.legacyState"})||{box_open:!1,box_visible:!0};a(b)};f.prototype.__SPI_setLegacyState=function(a){this.__keystore.set({key:"__box.legacyState",value:a,link_to_conversation:!0})};f.prototype.__hide_dom=function(a){typeof a=="string"&&(a=document.getElementById(a));if(typeof a=="object"&&a!==null)return a.style.display=
"none",!0;return!1};f.prototype.__show_dom=function(a){typeof a=="string"&&(a=document.getElementById(a));if(typeof a=="object"&&a!==null)return a.style.display="block",!0;return!1};f.prototype.__toggle_divs_by_id=function(a){var b=a.show;a=a.hide;for(var c in b)typeof b[c]!="function"&&this.__show_dom(document.getElementById(b[c]));for(var d in a)typeof a[d]!="function"&&this.__hide_dom(document.getElementById(a[d]))};f.prototype.__SPI_whenRendered=function(a){olark("api.chat.onReady",a)};f.prototype.__SPI_hideBoxForThisPageOnly=
function(){this.__SPI_whenRendered(function(){a.run_legacy_code(function(a){try{a.habla_window.theme.habla_window_div.style.visibility="hidden"}catch(c){b.warn("[olark] unable to hide the chatbox for this page",c)}})})};f.prototype.__SPI_setThemeTextField=function(b,c){c&&olark("api.chat.onReady",function(){a.run_legacy_code(function(a){a=a.habla_window.theme[b];a.has_typed=!0;a.value=c})})};f.prototype.__setup_popout_behavior=function(){var b=this;window.onbeforeunload=function(){return!1};var c=
function(){var c=300,d=500;if(parseInt(navigator.appVersion,10)>3)navigator.appName.indexOf("Microsoft")!=-1?(c=document.body.offsetWidth,d=document.body.offsetHeight):(c=window.innerWidth,d=window.innerHeight);c&&d&&b.__SPI_whenRendered(function(){a.run_legacy_code(function(a){a.habla_window.config.setHeight(parseInt(d,10)-85);a.habla_window.setHeight(parseInt(d,10)-85);a.habla_window.setWidth(parseInt(c,10))})})};c();window.onresize=c};f.prototype.__initialize_legacy_event_handlers=function(){if(!i){i=
!0;var b=function(){habla_window.theme.habla_wcsend_input.disabled=!0;habla_window.theme.habla_wcsend_input.style.display="none"};this.__chat_api.onOperatorsAway(b);this.__chat_api.onOperatorsBusy(b);this.__chat_api.onOperatorsAvailable(function(){habla_window.theme.habla_wcsend_input.disabled=!1;habla_window.theme.habla_wcsend_input.style.display="block"});this.__SPI_whenRendered(function(){olark._.P("box")});hbl.eventmgr.register("chat_loaded",function(){e=!0},0);hbl.eventmgr.register("habla_window_changed",
function(b){if(e)switch(b.type){case "popout":a.trigger_event({namespace:"box",type:"popout"});break;case "endpop_out":a.trigger_event({namespace:"box",type:"popin"});break;case "show":d||(d=!0,a.trigger_event({namespace:"box",type:"show"}));break;case "hide":d=!1;a.trigger_event({namespace:"box",type:"hide"});break;case "compress":c=!1;a.trigger_event({namespace:"box",type:"shrink"});break;case "expand":c||(c=!0,a.trigger_event({namespace:"box",type:"expand"}))}},0);hbl.eventmgr.register("habla_closebutton_a_onclick",
function(){a.trigger_event({namespace:"box",type:"dismiss"})},0)}};f.prototype.__populate_message_history_from_chat_api=function(){var b=this;b.__SPI_whenRendered(function(){var c=b.__chat_api.__SPI_getMessageHistory(),d=0;for(c.length>0&&a.run_legacy_code(function(a){a.habla_window.theme.setBody("")});d<c.length;){var f=c[d++],e=f.nickname||"you",i=f.body;a.run_legacy_code(function(a){/^\s+$/.test(i)||a.habla_window.theme.appendNiceMessage(e,i,!0,!0)})}c=window.habla_window.theme.habla_window_div;
c.scrollTop=c.scrollHeight})};f.prototype.__setup_chat_history_handling=function(){var b=this;l||(l=!0,b.__chat_api.onReady(function(){b.__populate_message_history_from_chat_api();b.__chat_api.__SPI_populatedLocalChatHistoryFromRpcServer()&&b.expand()}),b.__chat_api.__SPI_onDeliveryOfMessageFromVisitor(function(b){a.run_legacy_code(function(a){a.habla_window.theme.appendNiceMessage(a.hbl.config.vars.myname||"you",b.message.body,!0,!0)})}),b.__chat_api.__SPI_onDeliveryOfMessageFromOperator(function(b){a.run_legacy_code(function(a){a.habla_window.theme.appendNiceMessage(b.message.nickname,
b.message.body,!0,!0)})}))};olark.declare({name:"__BoxApiHelper",startup:function(b,c){var d=b.data.getConversationObject({key:"visible",initialValue:c.box.start_hidden?!1:null}),f=b.data.getConversationObject({key:"state",initialValue:null}),e=b.data.getConversationObject({key:"close_hides_window",initialValue:!1}),i=function(){window.olark.__legacy_shim.box_visible=d.get();window.olark.__legacy_shim.box_state=f.get()};f.get()=="closed"&&e.get()===!0&&(b.box.hide(),i());b.chat.onReady(function(){a.run_legacy_code(function(a){a.hbl.config.vars.close_hides_window?
e.set(!0):e.set(!1)})});b.box.onDismiss(function(){d.set(!1);f.set("closed");i()});b.box.onExpand(function(){d.set(!0);f.set("expanded");i()});b.box.onShrink(function(){d.set(!0);f.set("compressed");i()});b.box.onOverlay(function(){d.set(!0);i()});b.box.onPopout(function(){d.set(!1);f.set("closed");i()});b.box.onHide(function(){d.set(!1);i()});b.chat.onOperatorsAway(function(){c.system.hide_when_offline&&b.box.hide()});b.chat.onOperatorsAvailable(function(){c.system.hide_when_offline&&b.box.show()});
b.box.__SPI_onInline(function(){d.set(!0);i()});i();b.chat.onMessageToVisitor(function(){b.box.expand()});b.chat.onOperatorsAvailable(function(){b.box.__SPI_showMessageHistory()});window.olark.__legacy_shim.populate_message_history_from_chat_api=function(){b.box.__populate_message_history_from_chat_api()}}});olark.extend("__BoxApiHelper");a.box={BoxApi:f}})})(window.olark.__core,window.olark.__core.logger);
(function(a,b){a.wait_for(function(){return a.framestorewithjson&&a.data&&window.olark.__legacy_shim.legacy_post_stub_is_loaded},function(){function c(a){return function(a){var b=typeof a;b==="object"&&(a?typeof a.length==="number"&&!a.propertyIsEnumerable("length")&&typeof a.splice==="function"&&(b="array"):b="null");return b}(a)=="array"}var d=/^\s*\!\s*([^\s]+)\s*((.*)\s*)?/,e=["VisitorImportance","Shopify","CartSaver"],i=!1,l=!1,f=!1,g=null,v=!1,n=!1,k=!1,q={},r=function(){this.__message_sending_failsafe_timeout=
null;this.__status_update_pending=this.__nickname_update_pending=!1;this.__message_queue=[];this.__notification_queue=[];this.__keystore=new a.data.StorejsKeyStore({conversationId:olark._.conversationId});this.__connection_wrapper=null;this.__all_extensions_have_run_their_startup_method=!1};(function(c){var d=null;r.get_instance=function(){d||(d=new r);return d};var f=!1,g=function(b){f?b():a.listen_for_event({namespace:"SessionConnection",type:"afterReady",callback:function(){f=!0;b()}})};c.get_local_data=
function(a){return this.__local_get(a)};c.put_local_data=function(a){return this.__local_set(a)};c.send_message=function(b){var c=this;if(typeof b.body=="undefined")throw Error("[olark] 'body' required");c.__message_queue.push(b.body);c.__message_queue.length==1&&a.do_async_call({delay:270},function(){c.__synchronize_with_jabber()})};c.send_notification=function(b){var c=this;if(typeof b.body=="undefined")throw Error("[olark] 'body' required");c.__notification_queue.push(b.body);c.__notification_queue.length==
1&&a.do_async_call({delay:300},function(){c.__synchronize_with_jabber()})};c.update_nickname_for_extension=function(a){if(typeof a.extension_name=="undefined")throw Error("[olark] 'extension_name' required");if(typeof a.snippet=="undefined")throw Error("[olark] 'snippet' required");var b=a.extension_name,c=a.snippet,d=a.hides_default_nickname,h=this.__local_get({key:"nickname_lookup"})||{};h[b]={snippet:c,hides_default_nickname:d,secureTimestamp:a.secureTimestamp,secureSignature:a.secureSignature};
this.__local_set({key:"nickname_lookup",value:h});this.__mark_nickname_update_pending()};c.__mark_nickname_update_pending=function(b){var c=this;if(!c.__nickname_update_pending)c.__nickname_update_pending=!0,a.do_async_call({delay:250},function(){c.__synchronize_with_jabber(b)})};c.update_status_for_extension=function(a){if(typeof a.extension_name=="undefined")throw Error("[olark] 'extension_name' required");if(typeof a.snippet=="undefined")throw Error("[olark] 'snippet' required");var b=this.__local_get({key:"status_lookup"})||
{};b[a.extension_name]={snippet:a.snippet,secureTimestamp:a.secureTimestamp,secureSignature:a.secureSignature};this.__local_set({key:"status_lookup",value:b});this.__mark_status_update_pending()};c.__mark_status_update_pending=function(b){var c=this;if(!c.__status_update_pending)c.__status_update_pending=!0,a.do_async_call({delay:260},function(){c.__synchronize_with_jabber(void 0,b)})};c.disconnect=function(){var b=this;a.run_legacy_code(function(a){a.hbl.client.sendcommand&&a.hbl.client.sendcommand("disconnectchat",
b.__enableMessageToBeRoutedToGroupIfNecessary(""))})};c.getGroupForThisPage=function(){return this.__groupIdString};c.lockToGroupForThisPage=function(a){olark.__legacy_shim.currentGroupIdstring=this.__groupIdString=a};c.unlockFromGroupForThisPage=function(){olark.__legacy_shim.currentGroupIdstring=this.__groupIdString={}.undefinedValue};c.__TMP_set_connection_wrapper=function(a){var b=this;b.__connection_wrapper=a;b.__with_open_connection(function(){b.__all_extensions_have_run_their_startup_method=
!0;b.__synchronize_with_jabber()})};c.__TMP_get_current_combined_nickname=function(){var b=this.__local_get({key:"nickname_lookup"})||{},c=[],d=!0,h=function(a){return{v:a.snippet,t:a.secureTimestamp,s:a.secureSignature}};a.for_each_extension_name_starting_with_most_recent(function(a){var f=b[a];f&&typeof f!="function"&&f.snippet&&f.snippet.length>0&&(f.hides_default_nickname&&(d=!1),function(b){var d;a:{for(d=0;d<e.length;d++)if(e[d]==a){d=!0;break a}d=!1}d?c.unshift(b):c.push(b)}(h(f)))});(d||c.length===
0)&&c.push(h({snippet:this.__get_default_nickname_snippet()}));return a.framestorewithjson.json.encode(c)};c.__TMP_get_current_combined_status=function(){var c=this.__local_get({key:"status_lookup"})||{},d=[];a.for_each_extension_name_starting_with_most_recent(function(a){try{var h=c[a];h&&typeof h!="function"&&d.unshift({v:h.snippet,t:h.secureTimestamp,s:h.secureSignature})}catch(f){b.error("[olark] problem setting status: "+f.toString()),b.showErrorBacktrace(f)}});d.length==0&&(d=[{v:"There is no status information available right now.\n Add custom information using the Javascript API (www.olark.com/docs)."}]);
d.unshift({v:"{nickname}"});return a.framestorewithjson.json.encode(d)};c.__enableMessageToBeRoutedToGroupIfNecessary=function(a){if(typeof a!="string")throw Error("[olark] message must be a string");return a};c.__get_default_nickname_snippet=function(){var a=this.__local_get({key:"default_nickname"})||null;a||(a="{geolocation} #"+Math.floor(Math.random()*1E4).toString(),this.__local_set({key:"default_nickname",value:a}));return a};c.__local_get=function(a){if(typeof a.key=="undefined")throw Error("'key' required");
return(this.__keystore.get({key:"sessconn"})||{})[a.key]||null};c.__local_set=function(a){if(typeof a.key=="undefined")throw Error("'key' required");var b=this.__keystore.get({key:"sessconn"})||{};b[a.key]=a.value;this.__keystore.set({key:"sessconn",value:b,link_to_conversation:!0})};c.__update_nickname_in_jabber=function(b){var c=this;g(function(){c.__local_set({key:"has_sent_initial_nickname",value:!0});c.__nickname_update_pending=!1;var d=c.__TMP_get_current_combined_nickname(),h=c.__local_get({key:"previous_nickname"})!=
d;c.__local_set({key:"previous_nickname",value:d});(h||b)&&a.run_legacy_code(function(a){a.hbl.client.setnickname(c.__enableMessageToBeRoutedToGroupIfNecessary(d))})})};c.__update_status_in_jabber=function(b){var c=this;g(function(){c.__local_set({key:"has_sent_initial_status",value:!0});c.__status_update_pending=!1;var d=c.__TMP_get_current_combined_status(),h=c.__local_get({key:"previous_status"})!=d;c.__local_set({key:"previous_status",value:d});(h||b)&&a.run_legacy_code(function(a){a.hbl.client.sendpresence(c.__enableMessageToBeRoutedToGroupIfNecessary(d),
"chat")})})};var k=function(a){if(typeof a.list=="undefined")throw Error("'list' required");var b={};a=a.list;for(var c=[],d=0;d<a.length;d++){var h=a[d];b[h]||(b[h]=!0,c.push(h))}return c};c.__dequeue_messages_into_jabber=function(){var c=this;g(function(){var d=c.__message_queue;c.__message_queue=[];var h=k({list:d});h.length!=d.length&&b.warn("[olark] message batch contains",d.length-h.length,"duplicate messages");var f=null;d.length>0&&(f=a.join_string_list({list:h,separator:"\n"}));f&&c.__sendmessage(f,
!1)})};c.__dequeue_notifications_into_jabber=function(){var c=this,d=c.__notification_queue;c.__notification_queue=[];a.run_legacy_code(function(){var h=k({list:d});h.length!=d.length&&b.warn("[olark] notification batch contains",d.length-h.length,"duplicate notifications");var f=null;d.length>1?f="[info]\n  - "+a.join_string_list({list:h,separator:"\n  - "}):d.length==1&&(f="[info] "+d[0]);f&&c.__sendmessage(f,!0)})};c.__sendmessage=function(b,c){var d=this,h=d.__local_get({key:"sentmessage"})?!1:
!0;a.run_legacy_code(function(a){a.hbl.client.sendmessage(d.__enableMessageToBeRoutedToGroupIfNecessary(b),c?!0:!1,c?!0:{}.undefinedValue,h,d.__TMP_get_current_combined_nickname(),d.__TMP_get_current_combined_status())});d.__local_set({key:"sentmessage",value:!0})};c.__synchronize_with_jabber=function(c,d){var h=this,f=h.__nickname_update_pending,g=h.__status_update_pending,k=h.__notification_queue.length>0?!0:!1,e=h.__message_queue.length>0?!0:!1,o=h.__local_get({key:"has_sent_initial_nickname"}),
i=h.__local_get({key:"has_sent_initial_status"});h.__all_extensions_have_run_their_startup_method&&(o||(f=!0),i||(g=!0));var j=[];f&&(o=!0,j.push(function(){h.__update_nickname_in_jabber(c)}));g&&(o?(i=!0,j.push(function(){h.__update_status_in_jabber(d)})):h.__trigger_message_sending_failsafe());k&&(i?j.push(function(){h.__dequeue_notifications_into_jabber()}):h.__trigger_message_sending_failsafe());e&&(i?j.push(function(){h.__dequeue_messages_into_jabber()}):h.__trigger_message_sending_failsafe());
var n=function(){if(j.length>0){var c=j.shift();a.try_and_optionally_catch(function(){c()},function(a){b.error("[olark] problem servicing SessionConnection pipeline: "+a.toString());b.showErrorBacktrace(a)})}j.length>0&&a.do_async_call({delay:250},n)};n()};c.__with_open_connection=function(a){this.__connection_wrapper(a)};c.__trigger_message_sending_failsafe=function(){var b=this,c=b.__local_get({key:"has_sent_initial_nickname"}),d=b.__local_get({key:"has_sent_initial_status"});if(!b.__message_sending_failsafe_timeout)b.__message_sending_failsafe_timeout=
a.do_async_call({delay:3E3},function(){if(!c||!d)d=c=!0,b.__synchronize_with_jabber()})}})(r.prototype);var j=function(a){var c=this;c.__legacy_message_tuple=a.legacy_message_tuple;if(typeof c.__legacy_message_tuple=="undefined")throw Error("'legacy_message_tuple' required");if(typeof a.send_event_type=="undefined")throw Error("'send_event_type' required");if(typeof a.deliver_event_type=="undefined")throw Error("'send_event_type' required");if(typeof a.final_delivery_action=="undefined")throw Error("'final_delivery_action' required");
c.__send_event_type=a.send_event_type;c.__deliver_event_type=a.deliver_event_type;c.__final_delivery_action=a.final_delivery_action;c.__delivered=!1;c.__predelivery_actions=[];c.__new_body=null;c.__message_event={namespace:"chat",type:c.__send_event_type,automated:a.is_automated?!0:!1,nickname:c.__legacy_message_tuple[0],body:c.__legacy_message_tuple[1],__legacy_sequence_id:parseFloat(c.__legacy_message_tuple[2]),__SPI_deferMessageDelivery:function(a){c.__predelivery_actions.push(a)},updateBody:function(a){c.__new_body&&
b.warn("[olark] two handlers tried to modify the body of the same message, allowing the second one to override");c.__new_body=a}};c.__original_body=window.olark.__core.clone_object(c.__message_event.body)};(function(c){c.get_processed_body=function(){return this.__new_body||this.__message_event.body};c.send=function(){a.trigger_event(this.__message_event)};c.deliver=function(){for(var b=this,c=[],d=function(){c[h]=!0;for(var a=c.length,d=!0;a--;)c[a]||(d=!1);d&&b.__trigger_delivery()},h=b.__predelivery_actions.length;h--;)c.push(!1);
h=b.__predelivery_actions.length;for(a.listen_for_event({namespace:"chat::Message",type:"doneDeferringMessageDelivery",callback:d});h--;)(function(b,d){d({deliverMessage:function(){c[b]=!0;a.trigger_event({namespace:"chat::Message",type:"doneDeferringMessageDelivery"})}})})(h,b.__predelivery_actions[h]);d()};c.__trigger_delivery=function(){if(!this.__delivered)this.__delivered=!0,this.__original_body!=this.__message_event.body&&b.warn("[olark] you cannot modify the 'body' attribute of messages directly, please use message.updateBody() to modify the body"),
a.trigger_event({namespace:"chat",type:this.__deliver_event_type,automated:this.__message_event.automated,nickname:this.__message_event.nickname,body:this.get_processed_body(),__legacy_sequence_id:parseFloat(this.__message_event.__legacy_sequence_id)}),this.__final_delivery_action()}})(j.prototype);var m=function(a){function b(a){return a=="true"?!0:!1}function c(a){return a=="null"?null:a}var d=this;d.__conf=a.conf;if(typeof d.__conf=="undefined")throw Error("'conf' required");d.__extension_name=
a.extension_name;if(typeof d.__extension_name=="undefined")throw Error("'extension_name' required");d.__data=new window.olark.__core.data.DataApi({namespace:"__chatd"});d.__last_incr_seq_id=d.__data.getConversationObject({key:"last_incr_seq_id",initialValue:0,backup:"cd1",backupTransform:parseFloat});d.__last_leg_seq_id=d.__data.getConversationObject({key:"last_leg_seq_id",initialValue:0,backup:"cd2",backupTransform:parseFloat});d.__is_conversing=d.__data.getConversationObject({key:"is_conversing",
initialValue:!1,backup:"cd3",backupTransform:b});d.__hasconnected=d.__data.getConversationObject({key:"hasconnected",initialValue:!1,backup:"cd4",backupTransform:b});d.__data_history=d.__data.getConversationObject({key:"data_history",initialValue:!1});d.__last_op_presence=d.__data.getConversationObject({key:"last_op_presence",initialValue:"away",backup:"cd5",backupTransform:c});d.__last_cmd_seq_id=d.__data.getConversationObject({key:"last_cmd_seq_id",initialValue:0,backup:"cd6",backupTransform:parseFloat});
d.__last_presence=d.__data.getConversationObject({key:"last_presence",initialValue:"chat",backup:"cd8",backupTransform:c});d.__initialize_legacy_connection_and_messaging_handlers();d.__initialize_legacy_history_tracking();d.__initialize_conversation_tracking();d.__has_local_history=!0;d.__conversation_message_history=[];d.__session_connection=r.get_instance();d.__session_connection.__TMP_set_connection_wrapper(function(a){d.__wait_for_chat_to_connect(a)})};(function(){var c=m.prototype;m.prototype.listen=
function(c,d){var h=string.charAt(0).toUpperCase()+string.slice(1);b.warn("[olark] api.chat.listen is deprecated, please use api.chat.on"+h+" instead");a.listen_for_event({namespace:"chat",type:c,callback:d})};c.onMessageFromVisitor=function(a){b.warn("[olark] api.chat.onMessageFromVisitor is deprecated, please use api.chat.onMessageToOperator instead");return this.onMessageToOperator(a)};c.onMessageFromOperator=function(a){b.warn("[olark] api.chat.onMessageFromOperator is deprecated, please use api.chat.onMessageToVisitor instead");
return this.onMessageToVisitor(a)};c.getNickname=function(){b.warn("[olark] api.chat.getNickname is deprecated, please use api.chat.getVisitorNickname instead");return this.getVisitorNickname()};c.sendAutomatedMessageToVisitor=function(a){b.warn("[olark] api.chat.sendAutomatedMessageToVisitor is deprecated, please use api.chat.sendMessageToVisitor instead");return this.sendMessageToVisitor(a)};c.updateNickname=function(a){b.warn("[olark] api.chat.updateNickname is deprecated, please use api.chat.updateVisitorNickname instead");
return this.updateVisitorNickname(a)};c.onConnectComplete=function(a){b.warn("[olark] api.chat.onConnectComplete is deprecated, please use api.chat.onReady instead");return this.onReady(a)}})();m.prototype.updateVisitorNickname=function(a){a=a||{};if(a.nickname)a.snippet=a.nickname,b.warn("[olark] giving 'nickname' as an argument to updateVisitorNickname is now deprecated, use 'snippet' instead");typeof a=="string"&&(a={snippet:a});if(typeof a.snippet=="undefined")throw Error("'snippet' required");
if(c(a.snippet))if(a.secureTimestamp||a.secureSignature)throw Error("[olark] you cannot give a list of snippets and also security information, please join the snippets yourself before signing them");else a.snippet=a.snippet.join(" | ");this.__session_connection.update_nickname_for_extension({extension_name:this.__extension_name,snippet:a.snippet,hides_default_nickname:a.hidesDefault?!0:!1,secureTimestamp:a.secureTimestamp,secureSignature:a.secureSignature})};m.prototype.getVisitorNickname=function(c){c=
c||{};c.other&&b.warn("[olark] giving 'other' as an argument to getVisitorNickname is now deprecated, this method only returns the entire nickname");c.combined&&b.warn("[olark] giving 'combined' as an argument to getVisitorNickname is now deprecated, this method only returns the entire nickname");c=this.__session_connection.__TMP_get_current_combined_nickname();c=a.framestorewithjson.json.decode(c);for(var d=[],f=0;f<c.length;f++)d.push(c[f].v);return d.length?d.join(" | "):null};m.prototype.updateVisitorStatus=
function(a){a=a||{};if(a.status)a.snippet=a.status,b.warn("[olark] giving 'status' as an argument to updateVisitorStatus is now deprecated, use 'snippet' instead");typeof a=="string"&&(a={snippet:a});if(typeof a.snippet=="undefined")throw Error("[olark] 'snippet' required");if(c(a.snippet))if(a.secureTimestamp||a.secureSignature)throw Error("[olark] you cannot give a list of snippets and also security information, please join the snippets yourself before signing them");else a.snippet=a.snippet.join("\n| ");
this.__session_connection.update_status_for_extension({extension_name:this.__extension_name,snippet:a.snippet,secureTimestamp:a.secureTimestamp,secureSignature:a.secureSignature})};m.prototype.getVisitorStatus=function(c){c=c||{};c.other&&b.warn("[olark] giving 'other' as an argument to getVisitorStatus is now deprecated, this method only returns the entire status");c.combined&&b.warn("[olark] giving 'combined' as an argument to getVisitorStatus is now deprecated, this method only returns the entire status");
c=this.__session_connection.__TMP_get_current_combined_status();c=a.framestorewithjson.json.decode(c);for(var d=[],f=0;f<c.length;f++)d.push(c[f].v);return d.length?d.join("\n| "):null};m.prototype.sendNotificationToOperator=function(b){var c=this,d=null;d=typeof b=="string"?b:b.body;if(!d)throw Error("body required");c.__wait_for_chat_to_connect(function(){a.trigger_event({namespace:"chat",type:"notificationToOperator",body:d,after:function(){c.__session_connection.send_notification({body:d})}})})};
m.prototype.sendMessageFromVisitor=function(b){var c=this,d=null;d=typeof b=="string"?b:b.body;if(!d)throw Error("body required");c.__wait_for_chat_to_connect(function(){a.trigger_event({namespace:"chat",type:"messageFromVisitor",body:d,after:function(){c.__session_connection.send_message({body:d})}})})};m.prototype.onNotificationToOperator=function(b){a.listen_for_event({namespace:"chat",type:"notificationToOperator",callback:function(a){b({notification:{body:a.body}})}})};m.prototype.sendNotificationToVisitor=
function(a){this.sendMessageToVisitor({nickname:"#",body:a.body})};m.prototype.__get_next_message_sequence_id_that_is_server_safe=function(){var a=this.__last_leg_seq_id.get(),b=parseFloat(a),c=this.__last_incr_seq_id.get(),d=parseFloat(c),f=null;a!=b&&(olark._.hlog("last_legacy_sequence_id was not a float:",a,"#non_int_legseq_id #warn"),a=b||0);c!=d&&(olark._.hlog("last_incremented_sequence_id was not a float:",c,"#non_int_incrseq_id #warn"),c=d||0);f=c<=a?a+0.25:c+0.25;this.__last_incr_seq_id.set(f);
return f};m.prototype.onNotificationToVisitor=function(b){a.listen_for_event({namespace:"chat",type:"messageFromOperator",callback:function(a){a.nickname=="#"&&b({notification:{body:a.body}})}})};m.prototype.sendMessageToVisitor=function(b){var c=this,d=b.nickname||"",f=b.body;if(!f)throw Error("body required");c.__wait_for_chat_to_connect(function(){a.run_legacy_code(function(a){d||(d=a.hbl.client.current_operator());c.__send_and_deliver_message_from_operator({legacy_message_tuple:[d,f,c.__get_next_message_sequence_id_that_is_server_safe()],
is_automated:!0})})})};m.prototype.onMessageToVisitor=function(b){a.listen_for_event({namespace:"chat",type:"messageFromOperator",callback:function(a){b({message:{nickname:a.nickname,body:a.body,updateBody:function(b){a.updateBody(b)},__SPI_deferMessageDelivery:function(b){a.__SPI_deferMessageDelivery(b)},automated:a.automated}})}})};m.prototype.onMessageToOperator=function(b){a.listen_for_event({namespace:"chat",type:"messageFromVisitor",callback:function(a){b({message:{nickname:a.nickname,body:a.body,
updateBody:function(b){a.updateBody(b)},__SPI_deferMessageDelivery:function(b){a.__SPI_deferMessageDelivery(b)}}})}})};m.prototype.onCommandFromOperator=function(b){a.listen_for_event({namespace:"chat",type:"commandFromOperator",callback:function(a){b({command:{name:a.name,body:a.body,nickname:a.nickname}})}})};m.prototype.__SPI_onDeliveryOfMessageFromVisitor=function(b){a.listen_for_event({namespace:"chat",type:"deliveryOfMessageFromVisitor",callback:function(a){b({__legacy_sequence_id:parseFloat(a.__legacy_sequence_id),
message:{nickname:a.nickname,body:a.body}})}})};m.prototype.__SPI_onDeliveryOfMessageFromOperator=function(b){a.listen_for_event({namespace:"chat",type:"deliveryOfMessageFromOperator",callback:function(a){b({__legacy_sequence_id:parseFloat(a.__legacy_sequence_id),message:{nickname:a.nickname,body:a.body}})}})};m.prototype.operatorsAreAvailable=function(){return g=="available"};m.prototype.onOperatorsAvailable=function(b){a.listen_for_event({namespace:"chat",type:"operatorsAvailable",callback:b})};
m.prototype.operatorsAreBusy=function(){return g=="busy"};m.prototype.onOperatorsBusy=function(b){a.listen_for_event({namespace:"chat",type:"operatorsBusy",callback:b})};m.prototype.operatorsAreAway=function(){return g=="away"};m.prototype.onOperatorsAway=function(b){a.listen_for_event({namespace:"chat",type:"operatorsAway",callback:b})};m.prototype.__SPI_onConnectBegin=function(b){a.listen_for_event({namespace:"chat",type:"connectBegin",callback:b})};m.prototype.__SPI_lockToOperatorGroup=function(a){olark._.cookieManager.setAllowingNullAndUndefinedAndEmptyString("_okgid",
a);this.__session_connection.lockToGroupForThisPage(a)};m.prototype.__SPI_lockToExistingOperatorGroupIfGiven=function(a){var b=olark._.cookieManager.getAllowingNullAndUndefinedAndEmptyString("_okgid");b||b===null?this.__session_connection.lockToGroupForThisPage(b):this.__session_connection.lockToGroupForThisPage(a)};m.prototype.__SPI_unlockFromCurrentGroup=function(){olark._.cookieManager.erase("_okgid");this.__session_connection.unlockFromGroupForThisPage()};m.prototype.onReady=function(a){this.__wait_for_chat_to_connect(a)};
m.prototype.connect=function(){this.__SPI_connectToRpcServers()};m.prototype.__SPI_onConnectFailure=function(b){a.listen_for_event({namespace:"chat",type:"connectFailure",callback:b})};m.prototype.__wait_for_chat_to_connect=function(b){l?b():(b=a.create_idempotent_callback(b),a.listen_for_event({namespace:"chat",type:"onReady",callback:b}))};m.prototype.__SPI_visitorIsAvailable=function(){return this.__last_presence.get()=="chat"};m.prototype.__SPI_visitorIsBusy=function(){return this.__last_presence.get()==
"dnd"};m.prototype.__SPI_visitorIsAway=function(){return this.__last_presence.get()=="away"};m.prototype.__SPI_isConversing=function(){return this.__is_conversing.get()===!0?!0:!1};m.prototype.__SPI_beginConversation=function(){this.__is_conversing.get()!=!0&&(this.__is_conversing.set(!0),a.trigger_event({namespace:"chat",type:"beginConversation"}))};m.prototype.__SPI_onConversationBegin=function(b){a.listen_for_event({namespace:"chat",type:"beginConversation",callback:b})};m.prototype.__SPI_endConversation=
function(){this.__is_conversing.set(!1)};m.prototype.onBeginConversation=function(b){a.listen_for_event({namespace:"chat",type:"beginConversation",callback:b})};m.prototype.__initialize_conversation_tracking=function(){var a=this;a.onMessageToOperator(function(){a.__SPI_beginConversation()});a.onMessageToVisitor(function(){a.__SPI_beginConversation()})};m.prototype.__SPI_getConversationUUID=function(){return a.run_legacy_code(function(a){return a.hbl.client.wcsid})};m.prototype.__SPI_getVisitorUUID=
function(){return a.run_legacy_code(function(a){return a.hbl.client.hblid})};m.prototype.__SPI_getLegacyConfig=function(){return a.run_legacy_code(function(a){return a.hbl.config})};m.prototype.__SPI_queryCurrentGroup=function(a){a({group:this.__session_connection.getGroupForThisPage()})};m.prototype.__SPI_disableEventConnection=function(){k=!0};m.prototype.__SPI_enableEventConnection=function(){k=!1};m.prototype.__SPI_getLegacySiteId=function(){var b=null;a.run_legacy_code(function(a){b=a.hbl.siteid});
return b};m.prototype.__SPI_sendRawMessageToVisitor=function(b){var c=[b.nickname,b.body,this.__get_next_message_sequence_id_that_is_server_safe()];a.run_legacy_code(function(a){a.hbl.client.incoming_pipeline.run(c)})};m.prototype.__SPI_sendRawMessageToOperator=function(a){this.__send_and_deliver_message_from_visitor({legacy_message_tuple:[null,a.body,0]})};m.prototype.__handleHighTrafficConfiguration=function(a){a.system&&a.system.forced_polling_in_seconds_when_online_but_not_chatting&&hbl.client.pollingmanager.setMinAvailablePollTime(a.system.forced_polling_in_seconds_when_online_but_not_chatting*
1E3)};m.prototype.__SPI_connectToRpcServers=function(a){a=a||{};var c=this,d=c.__conf;if(f!=!0&&(f=!0,c.__hasconnected.set(!0),olark._.P("getconnection"),c.onReady(function(){olark._.P("connection")}),!k)){window.hblJavaScriptVersion="api-1.2.1";window.hbl_hostname=d.system.legacy_rpc_server||window.hbl_hostname||"olark.com/rpc";window.hbl.config=window.wc_config();var g=window.hbl.config;g.vars.no_system_messages=!0;g.vars.disable_rpc_state=!0;if(d.system.show_in_buddy_list=="chatting")d.system.forced_polling_in_seconds_when_online_but_not_chatting=
300;c.__handleHighTrafficConfiguration(d);if(d.system.path)g.vars.cookie_path=d.system.path,g.vars.hbl_cookie_path=d.system.path;for(var e in d.system)typeof d.system[e]!="function"&&(g.vars[e]=d.system[e]);for(var j in d.box)typeof d.box[j]!="function"&&(g.vars[j]=d.box[j]);if(/AppleWebKit/.test(navigator.appVersion)){e=document.getElementsByTagName("object");for(j=0;j<e.length;j++)if(/\.swf/.test(e[j].data||"")){g.vars.disable_expand_text_input=!0;break}}e=function(a,b){return typeof a=="undefined"?
b:a};g.vars.top_margin=e(d.box.vertical_offset,g.vars.top_margin);g.vars.bottom_margin=e(d.box.vertical_offset,g.vars.bottom_margin);g.vars.right_margin=e(d.box.horizontal_offset,g.vars.right_margin);g.vars.left_margin=e(d.box.horizontal_offset,g.vars.left_margin);e=function(a,b){g.vars[a]=b||d.system[a]};e("before_chat_text",d.locale.welcome_title||d.box.welcome_title);e("in_chat_text",d.locale.chatting_title);e("not_available_text",d.locale.unavailable_title||d.box.unavailable_title);e("busy_text",
d.locale.busy_title);e("away_text",d.locale.unavailable_title);e("offline_message",d.locale.away_message);e("welcome_msg",d.locale.welcome_message||d.box.welcome_message);e("busy_message",d.locale.busy_message);e("say_text",d.locale.chat_input_text);e("habla_name_input_text",d.locale.name_input_text||d.system.field_text_for_name);e("habla_offline_email_text",d.locale.email_input_text||d.system.field_text_for_email);e("habla_offline_body_text",d.locale.offline_note_message||d.system.field_for_offline_message_body||
d.system.information_text_when_offline);e("habla_offline_submit_value",d.locale.send_button_text||d.system.button_text_for_send);e("habla_offline_sent_text",d.locale.offline_note_thankyou_text||d.system.offline_message_thankyou_text);e("email_body_error_text",d.locale.offline_note_error_text||d.system.offline_message_validation_error_text);e("sending_text",d.locale.offline_note_sending_text||d.system.offline_message_sending_text);e("operator_is_typing_text",d.locale.operator_is_typing_text);e("operator_has_stopped_typing_text",
d.locale.operator_has_stopped_typing_text);e("pre_chat_error_text",d.locale.introduction_error_text);e("pre_chat_message",d.locale.introduction_messages);e("pre_chat_submit",d.locale.introduction_submit_button_text);e("check_for_status",d.locale.loading_title);e("send_text",d.locale.send_button_text);if(d.system.always_create_new_session)g.vars.disable_set_cookies=!0,g.vars.disable_get_cookies=!0;g.vars.start_passive&&b.warn("[olark] start_passive mode is not enabled in the new Javascript");g.vars.max_milliseconds_conversation_can_be_idle=
g.vars.max_milliseconds_conversation_can_be_idle||olark._.maxMillisecondsConversationCanBeIdle;if(d.box.inline&&(g.setInline(1),g.vars.start_expanded=typeof d.box.start_expanded=="undefined"?1:d.box.start_expanded,g.vars.enable_buttons=!1,e=document.getElementById("olark-box-container")))e.id="habla_window_div";var n=function(){var b=a.__legacy_site_id||c.__conf.system.olark_key;window.hblHasinit=1;window.hbl.post_started=void 0;window.hbl.siteid=b||window.hbl.siteid||"missing-site-id";window.hbl.config=
window.hbl.config||window.wc_config();b=["expand_on_receive_message"];d.Notify&&b.push("incoming_notification");(d.StatusElements||d.CalloutBubble)&&b.push("away_div_handler");(function(a){var b=olark._.cookieManager.get("_ok"),h=c.__SPI_isConversing(),f=d.system.high_priority_site?!0:!1;if(b){if(b!=a&&(!h||f))window.hbl.config.vars.disable_get_cookies=!0,olark._.cookieManager.set("_ok",a)}else olark._.cookieManager.set("_ok",a)})(window.hbl.siteid);window.wc_init_post(b)};i||l?c.__wait_for_chat_to_connect(function(){c.__SPI_disconnect();
n()}):n()}};m.prototype.__get_message_history=function(){return this.__data_history.get()||this.__conversation_message_history};m.prototype.__SPI_setMessageHistory=function(b){this.__conversation_message_history=b;a.run_legacy_code(function(a){if(a.hbl.client.buffer.length==0)a.hbl.client.buffer=[[null,"",0.2]]});this.__data_history.set(b)};m.prototype.__SPI_disconnect=function(){this.__session_connection.disconnect();this.__SPI_setMessageHistory([]);window.hblHasinit=void 0;window.hbl.client.sid=
void 0;window.hbl.client.messageq=[];window.hbl.client.jsonthrottle_locked=!1;olark._.cookieManager.erase("wcsid");window.hbl.client.wcsid=void 0;window.hbl.client.pollingmanager.stop();window.hbl.client.pollingmanager.reset();window.hbl.config=window.wc_config();window.hbl.config.merge({vars:{habla_sizebutton_text_expanded:"_",habla_sizebutton_text_compressed:"^",habla_closebutton_text:"x",habla_popout_text:">",habla_end_popout_text:"&lt;&lt;",corner_position:"BR",bottom_margin:10,right_margin:10,
left_margin:10,top_margin:10}});window.hbl.config.vars.poll=!0;window.habla_window.config=hbl.config;window.habla_window.theme.config=hbl.config;l=i=!1;a.trigger_event({namespace:"chat",type:"disconnect"})};m.prototype.__SPI_getVisitorGeolocation=function(){return q.geolocation||null};m.prototype.__SPI_getVisitorIP=function(){return q.browser_ip||null};m.prototype.__SPI_isPremiumUser=function(){return hbl.client.ssl?!0:!1};m.prototype.__SPI_hasConnectedAlready=function(){return this.__hasconnected.get()?
!0:!1};m.prototype.__SPI_getLastOperatorPresence=function(a){var b=self.__last_op_presence.get();setTimeout(function(){a(b)},0);return b};m.prototype.__send_and_deliver_message_from_visitor=function(a){var b=this;a=a.legacy_message_tuple;if(typeof a=="undefined")throw Error("'legacy_message_tuple' required");a[2]=a[2]||b.__get_next_message_sequence_id_that_is_server_safe();var c=new j({legacy_message_tuple:a,send_event_type:"messageFromVisitor",deliver_event_type:"deliveryOfMessageFromVisitor",final_delivery_action:function(){b.__session_connection.send_message({body:c.get_processed_body()})}});
c.send();c.deliver()};m.prototype.__send_and_deliver_message_from_operator=function(b){var c=b.legacy_message_tuple;b=b.is_automated;var d=c&&c[1]&&/^\s*$/.test(c[1])?!0:!1;if(typeof c=="undefined")throw Error("'legacy_message_tuple' required");if(typeof b=="undefined")throw Error("'is_automated' required");if(!d){c[2]=c[2]||this.__get_next_message_sequence_id_that_is_server_safe();var f=new j({legacy_message_tuple:c,is_automated:b,send_event_type:"messageFromOperator",deliver_event_type:"deliveryOfMessageFromOperator",
final_delivery_action:function(){a.run_legacy_code(function(a){var b=[c[0],f.get_processed_body(),c[2]];a.hbl.client.append([b])})}});f.send();f.deliver()}};m.prototype.__initialize_legacy_connection_and_messaging_handlers=function(){var b=this;if(!n)g=b.__last_op_presence.get()||"away",n=!0,hbl.eventmgr.register("chat_started",function(b){i=!0;a.trigger_event({namespace:"chat",type:"connectBegin"});q={browser_ip:b.browser_ip,geolocation:b.geolocation}},0),hbl.eventmgr.register("resend_nickname",
function(){b.__session_connection.__mark_nickname_update_pending(!0)},0),hbl.eventmgr.register("resend_status",function(){b.__session_connection.__mark_status_update_pending(!0)},0),hbl.eventmgr.register("operator_composing",function(a){function c(a){this.composingMessage&&d();var b=document.createElement("p");b.className="habla_conversation_p_item hbl_pal_main_fg";b.innerHTML='<span class="olark-composing-message habla_conversation_person2 hbl_pal_local_fg">'+a+"</span>";if(b.children)b.children[0].style.color=
"rgb(200,200,200)",this.composingMessage=b,f.appendChild(this.composingMessage);f.scrollTop=f.scrollHeight}function d(){if(this.composingMessage){clearTimeout(this.composingMessageRemovalTimeout);var a=this.composingMessage.parentNode||this.composingMessage.parent;a&&a.removeChild(this.composingMessage);this.composingMessage=!1}}var f=document.getElementById("habla_conversation_div");this.composingMessage=this.composingMessage||!1;if(!this.composingMessageRemovalHandlerSet)b.__SPI_onDeliveryOfMessageFromOperator(function(){d()}),
this.composingMessageRemovalHandlerSet=!0;var g={active:function(){d()},composing:function(){c((a.operator_nickname||"operator")+" "+hbl.config.vars.operator_is_typing_text)},paused:function(){c((a.operator_nickname||"operator")+" "+hbl.config.vars.operator_has_stopped_typing_text);this.composingMessageRemovalTimeout=setTimeout(d,3E4)}};g.hasOwnProperty(a.composing_type)&&(clearTimeout(this.composingMessageRemovalTimeout),g[a.composing_type]())}),hbl.eventmgr.register("operator_status_change",function(c){var d=
null;if(c.opavailable)switch(c.status){case "available":case "chat":d="available";a.trigger_event({namespace:"chat",type:"operatorsAvailable",previously:g});break;default:d="away",a.trigger_event({namespace:"chat",type:"operatorsAway",previously:g})}else d="away",a.trigger_event({namespace:"chat",type:"operatorsAway",previously:g});g=d;b.__last_op_presence.set(g);l||(i=!1,l=!0,a.trigger_event({namespace:"chat",type:"onReady",after:function(){a.trigger_event({namespace:"SessionConnection",type:"afterReady"})}}))},
9999),b.__wait_for_chat_to_connect(function(){a.run_legacy_code(function(){window.habla_window.send_pipeline.add(function(a){b.__send_and_deliver_message_from_visitor({legacy_message_tuple:[null,a,null]})},1001)})}),window.olark.__legacy_shim.pipeline_disabler=function(){},b.__wait_for_chat_to_connect(function(){window.hbl.client.incoming_pipeline.add(function(c){var f=c[0],g=c[1],e=parseFloat(c[2]||-1),k=b.__last_cmd_seq_id.get();(g=d.exec(g))?(parseFloat(k)!=k&&(olark._.hlog("resetting last_command_index to 0, found a string instead #reset_string_command_index #warn"),
k=0,b.__last_cmd_seq_id.set(k)),e>k?(b.__last_cmd_seq_id.set(e),e=g[1],(k=g[2])&&k.length===0&&(k=null),a.trigger_event({namespace:"chat",type:"commandFromOperator",nickname:f,name:e,body:k})):olark._.hlog("dropping command",g[1],"due to sequence ID mismatch",e,"<=",k,"#warn #dropped_command")):b.__send_and_deliver_message_from_operator({legacy_message_tuple:c,is_automated:!1});return c},1001)})};m.prototype.__SPI_getMessageHistory=function(a){var b=this.__get_message_history();a&&a(b);return b};
m.prototype.__SPI_populatedLocalChatHistoryFromRpcServer=function(){return!this.__has_local_history};m.prototype.__SPI_onPrechatInfoReceived=function(b){a.listen_for_event({namespace:"chat",type:"prechatInfoReceived",callback:b})};m.prototype.__initialize_legacy_history_tracking=function(){var f=this;if(!v){v=!0;var g=function(a){var g=parseFloat(f.__last_leg_seq_id.get());if(!a.__legacy_sequence_id)a.__legacy_sequence_id=f.__get_next_message_sequence_id_that_is_server_safe();if(g<a.__legacy_sequence_id){f.__last_leg_seq_id.set(a.__legacy_sequence_id);
var e=f.__get_message_history();c(e)||(b.error("[olark] expected message_history to be a list:",e),e=[]);d.test(a.message.body)||e.push({nickname:a.message.nickname,body:a.message.body});var k=function(){e=e.slice(1,e.length);b.warn("[olark] trying to shrink message history, now has",e.length,"entries");e.length>0?f.__SPI_setMessageHistory(e,k):f.__SPI_setMessageHistory([])};f.__SPI_setMessageHistory(e,k)}};f.__SPI_onDeliveryOfMessageFromOperator(g);f.__SPI_onDeliveryOfMessageFromVisitor(g);hbl.eventmgr.register("chat_loaded",
a.create_idempotent_callback(function(){a.trigger_event({namespace:"chat",type:"legacyChatLoaded"})}));window.olark.__legacy_shim.load_missed_messages=a.create_idempotent_callback(function(a){f.__has_local_history=a.length!=0&&f.__last_leg_seq_id.get();for(var b=0;b<a.length;){var c=a[b],e=c[0],k=c[1],i=c[2],j=f.__last_leg_seq_id.get();d.test(c[1])||(f.__has_local_history?i>j&&f.__send_and_deliver_message_from_operator({legacy_message_tuple:c,is_automated:!1}):g({__legacy_sequence_id:parseFloat(i),
message:{nickname:e,body:k}}));b++}});var e=f.__SPI_getMessageHistory();window.olark.__legacy_shim.has_messages_in_history=e&&e.length>0?!0:!1}};olark.declare({name:"__ChatApiHelper",startup:function(b,c){function d(){setTimeout(function(){try{var a=window.hbl.client.buffer.length>0,b=habla_window.getHeader()==c.system.before_chat_text;a&&b&&habla_window.setHeader(c.system.in_chat_text)}catch(d){}},900)}var f=!1;window.olark.__legacy_shim.send_prechat_info=function(c){if(!f){f=!0;var d="";c.name&&
c.name.length&&c.name!="undefined"&&(b.visitor.addFullName(c.name),d+="\n    name: "+c.name);c.email&&c.email.length&&c.email!="undefined"&&(b.visitor.addEmailAddress(c.email),d+="\n    email: "+c.email);c.phone&&c.phone.length&&c.phone!="undefined"&&(b.visitor.addPhoneNumber(c.phone),d+="\n    phone: "+c.phone);b.chat.sendNotificationToOperator({body:d});a.trigger_event({namespace:"chat",type:"prechatInfoReceived"})}};b.chat.onMessageToVisitor(d);b.chat.onMessageToOperator(d);var g=b.data.getConversationObject({key:"lock",
initialValue:!1}),e=null,k=null,i=function(){e||(e=setInterval(function(){n()},12E4),k=setInterval(function(){b.chat.sendNotificationToOperator({body:"this visitor is still locked into chat, to unlock this visitor type !unlock"})},6E5))},j=function(){e&&(clearInterval(e),clearInterval(k),k=e=null)},n=function(){a.run_legacy_code(function(a){a.hbl.client.sendcommand("return_long_poll_now","")})};b.chat.onReady(function(){g.get()==!0?i():j()});b.chat.onCommandFromOperator(function(a){switch(a.command.name){case "lock":g.set(!0);
b.chat.sendNotificationToOperator({body:"visitor has been locked into this chat, to unlock this visitor type !unlock"});i();break;case "unlock":g.set(!1),b.chat.sendNotificationToOperator({body:"visitor has been unlocked from this chat"}),j()}});b.chat.onCommandFromOperator(function(a){a.command.name=="transfer"&&b.chat.__SPI_unlockFromCurrentGroup()});b.chat.onCommandFromOperator(function(a){a.command.name=="help"&&b.chat.sendNotificationToOperator({body:"quick reference for the commands you can type at any time...\n\n!tag\n     tag this conversation, like '!tag followup' or '!tag important'\n\n!transfer\n     transfer this visitor to another operator.  Optionally give a note, like '!transfer This guy needs help with billing'\n\n!unfollow\n     stop receiving page-change notifications for this visitor\n\n!push\n     push this visitor to a URL, like '!push www.google.com'\n\n!block\n     block this visitor\n"})});
b.box.onDismiss(function(){b.chat.__SPI_endConversation()});b.chat.onBeginConversation(function(){b.chat.__SPI_lockToOperatorGroup(c.system.group||c.system.olark_group||null)});b.chat.__SPI_lockToExistingOperatorGroupIfGiven(c.system.group||c.system.olark_group||null);if(c.system.forced_rpc_server)window.hbl_hostname=c.system.forced_rpc_server,window.hblrpcTrick=0}});olark.extend("__ChatApiHelper");a.chat={ChatApi:m,SessionConnection:r}})})(window.olark.__core,window.olark.__core.logger);
(function(a){a.wait_for(function(){return!0},function(){var b={},c=function(a){this.__namespace=a.namespace;if(typeof this.__namespace=="undefined")throw Error("'namespace' required");this.__methods=b[this.__namespace]={}};c.prototype.exportMethods=function(a){a(this.__methods)};c.prototype.importMethods=function(c,e){if(!a.is_extension_required({extension_name:c}))throw Error("extension '"+c+"' is required for "+this.__namespace);var i=b[c];if(i)e(i);else{var l=!1;a.listen_for_event({namespace:"Extension",
type:"extensionActivated",callback:function(){if((i=b[c])&&!l)l=!0,e(i)}})}};a.extensions={ExtensionsApi:c}})})(window.olark.__core,window.olark.__core.logger);
(function(a){a.wait_for(function(){return a.chat},function(){var b={encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var l=a.charCodeAt(c);l<128?b+=String.fromCharCode(l):(l>127&&l<2048?b+=String.fromCharCode(l>>6|192):(b+=String.fromCharCode(l>>12|224),b+=String.fromCharCode(l>>6&63|128)),b+=String.fromCharCode(l&63|128))}return b},decode:function(a){for(var b="",c=0,l=c1=c2=0;c<a.length;)l=a.charCodeAt(c),l<128?(b+=String.fromCharCode(l),c++):l>191&&l<224?(c2=a.charCodeAt(c+
1),b+=String.fromCharCode((l&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((l&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}},c=function(b){var c=this;c.__namespace=b.namespace;if(typeof c.__namespace=="undefined")throw Error("'namespace' required");c.__session_connection=a.chat.SessionConnection.get_instance();a.after_extensions_are_activated(function(){var b=c.__session_connection.get_local_data({key:"BrowserApi::last_page_visited"}),d=document.location.href.toString();
b!=d&&(a.trigger_event({namespace:"BrowserApi",type:"locationChange",previousUrl:b,currentUrl:d}),c.__session_connection.put_local_data({key:"BrowserApi::last_page_visited",value:d}))})};c.prototype.onPageChange=function(b){a.listen_for_event({namespace:"BrowserApi",type:"locationChange",callback:function(a){b({newPage:a.currentUrl,oldPage:a.previousUrl})}})};c.prototype.__SPI_getSafeUrl=function(a){/webkit/.test(navigator.userAgent.toString().toLowerCase())&&(a=b.decode(unescape(a)));return a.replace(/ /g,
"%20")};a.browser={BrowserApi:c}})})(window.olark.__core,window.olark.__core.logger);
(function(a,b){a.wait_for(function(){return a.data},function(){function c(a){try{var b=/(q|p|query|queryTerms?)\=([^&\#]+)/i.exec(a)[2],c=decodeURIComponent(b).replace(/\+/g," ");a=/(?:\((.+?)\)|"(.+?)"|'(.+?)'|([^\s]+))/g;b=[];for(var d;d=a.exec(c);)b.push(d[2]||d[3]||d[4]);return{text:/^\s*$/.test(c)?null:c,terms:b}}catch(k){return{text:null,terms:[]}}}function d(a){try{for(var b={},c;c=rawQuery.exec(a);)try{b[c[1]]=decodeURIComponent(c[2]).replace(/\+/g," ")}catch(d){}return b}catch(k){return{}}}
var e=!1,i=function(b){var c=this;c.__namespace=b.namespace;if(typeof c.__namespace=="undefined")throw Error("'namespace' required");b=b.data;c.__fullNameObject=b.getVisitorObject({key:"visFullName",initialValue:null,__SPI_forceNamespace:"__api"});c.__emailAddressObject=b.getVisitorObject({key:"visEmailAddress",initialValue:null,__SPI_forceNamespace:"__api"});c.__phoneNumberObject=b.getVisitorObject({key:"visPhoneNumber",initialValue:null,__SPI_forceNamespace:"__api"});c.__recentPageHistory=b.getVisitorObject({key:"rph",
initialValue:[],__SPI_forceNamespace:"__vis"});c.__visitHistory=b.getVisitorObject({key:"vh",initialValue:[],__SPI_forceNamespace:"__vis"});c.__isNewVisit=b.getConversationObject({key:"inv",initialValue:!0,__SPI_forceNamespace:"__vis"});c.__importance=b.getVisitorObject({key:"imp",initialValue:0,__SPI_forceNamespace:"__vis"});c.__notes=b.getVisitorObject({key:"nts",initialValue:[],__SPI_forceNamespace:"__vis"});c.__mostRecentMessage=b.getConversationObject({key:"mrcm",initialValue:void 0,__SPI_forceNamespace:"__vis"});
c.__mostRecentNotificationToOperator=b.getConversationObject({key:"mrno",initialValue:void 0,__SPI_forceNamespace:"__vis"});c.__visitFields=b.getConversationObject({key:"vf",initialValue:{},__SPI_forceNamespace:"__vis"});if(!e){e=!0;b=c.__recentPageHistory.get();b.push({title:document.title.length?document.title:null,url:document.location.href,timestamp:+new Date});b.length>10&&(b=b.slice(b.length-10));c.__recentPageHistory.set(b);c.__isNewVisit.get()&&(c.__isNewVisit.set(!1),b=c.__visitHistory.get(),
b.push({didChat:!1,pageCount:0,referrer:document.referrer.toString(),createdAt:+new Date,updatedAt:+new Date}),c.__visitHistory.set(b));var d=function(){c.__SPI_bumpVisitHistoryTimestamp();setTimeout(d,9E3)};d();b=c.__visitHistory.get();b=c.__updateMostRecentTimestampOnHistory(b);b[b.length-1].pageCount+=1;c.__visitHistory.set(b);olark("api.chat.onBeginConversation",function(){var a=c.__visitHistory.get(),b=a[a.length-1];if(b&&b.didChat!==!0)b.didChat=!0,c.__visitHistory.set(a)});olark("api.chat.onMessageToOperator",
function(){c.__mostRecentMessage.set(+new Date)});olark("api.chat.onMessageToVisitor",function(){c.__mostRecentMessage.set(+new Date)});olark("api.chat.onNotificationToOperator",function(){c.__mostRecentNotificationToOperator.set(+new Date)});c.__SPI_prepopulateEmailFields();c.__SPI_prepopulateFullNameFields();c.__SPI_prepopulateChatNicknameFromBestVisitorInformation();this.__emailAddressObject.__SPI_onChange(function(){c.__SPI_prepopulateEmailFields()});this.__fullNameObject.__SPI_onChange(function(){c.__SPI_prepopulateFullNameFields()});
this.__emailAddressObject.__SPI_onChange(function(b){c.__SPI_prepopulateChatNicknameFromBestVisitorInformation();b=["visitor_id="+encodeURIComponent(olark._.visitorId),"email_address="+encodeURIComponent(b.newValue),"cache="+encodeURIComponent(Math.random())];a.async_script_load({url:olark._.apiHost+"/1.0/visitor/addEmailAddress?"+b.join("&")})});this.__fullNameObject.__SPI_onChange(function(b){c.__SPI_prepopulateChatNicknameFromBestVisitorInformation();b=["visitor_id="+encodeURIComponent(olark._.visitorId),
"full_name="+encodeURIComponent(b.newValue),"cache="+encodeURIComponent(Math.random())];a.async_script_load({url:olark._.apiHost+"/1.0/visitor/addFullName?"+b.join("&")})})}};(function(f){function g(a,b){var c;olark("api.chat.onReady",function(){c=(olark._.geoip||{})[a];b&&b(c)});return c}function e(a,b){var c=b();a&&a(c);return c}f.__SPI_getBrowser=function(){var a=l.parse(window.navigator.userAgent);return a.family+" "+a.toVersionString()};f.__SPI_getOs=function(){var a=navigator.platform;if(/Mac/.test(a))return"Mac OSX";
else if(/Linux/.test(a))return"Linux";else if(/Win/.test(a))return"Windows"};f.__SPI_getIp=function(){return olark._.ipaddress||null};f.__SPI_getRecentPageHistory=function(){return this.__recentPageHistory.get()||[]};f.__SPI_prepopulateEmailFields=function(){var a=this.__emailAddressObject.get();olark("api.box.__SPI_setThemeTextField","habla_pre_chat_email_input",a);olark("api.box.__SPI_setThemeTextField","habla_offline_email_input",a)};f.__SPI_prepopulateFullNameFields=function(){var a=this.__fullNameObject.get();
olark("api.box.__SPI_setThemeTextField","habla_pre_chat_name_input",a);olark("api.box.__SPI_setThemeTextField","habla_name_input",a)};f.__SPI_prepopulateChatNicknameFromBestVisitorInformation=function(){var a=this.__fullNameObject.get(),b=this.__emailAddressObject.get(),c;a&&b?c=a+" ("+b+")":a?c=a:b&&(c=b);c&&olark("api.chat.updateVisitorNickname",{snippet:c,hidesDefault:!0})};f.__SPI_getIsInspecting=function(a){return e(a,function(){return olark._.cookieManager.get("_okinspect")?!0:!1})};f.__SPI_setIsInspecting=
function(a){a?olark._.cookieManager.set("_okinspect",a):olark._.cookieManager.erase("_okinspect")};f.__SPI_bumpVisitHistoryTimestamp=function(){var a=this.__visitHistory.get();a=this.__updateMostRecentTimestampOnHistory(a);this.__visitHistory.set(a)};f.__updateMostRecentTimestampOnHistory=function(a){var b=a[a.length-1];if(b)b.updatedAt=+new Date;return a};f.addEmailAddress=function(a){this.updateEmailAddress(a)};f.updateEmailAddress=function(a){a=a.emailAddress||a;if(typeof a!="string")throw Error("[olark] emailAddress string expected");
this.__emailAddressObject.set(a)};f.addFullName=function(a){this.updateFullName(a)};f.updateFullName=function(a){a=a.fullName||a;if(typeof a!="string")throw Error("[olark] fullName string expected");this.__fullNameObject.set(a)};f.updatePhoneNumber=function(a){a=a.phoneNumber||a;if(typeof a!="string")throw Error("[olark] phoneNumber string expected");this.__phoneNumberObject.set(a)};f.getFullName=function(a){var b=this;return e(a,function(){return b.__fullNameObject.get()})};f.getEmailAddress=function(a){var b=
this;return e(a,function(){return b.__emailAddressObject.get()})};f.getPhoneNumber=function(a){var b=this;return e(a,function(){return b.__phoneNumberObject.get()})};f.onChange=function(a){this.__fullNameObject.__SPI_onChange(a);this.__emailAddressObject.__SPI_onChange(a);this.__phoneNumberObject.__SPI_onChange(a);this.__visitHistory.__SPI_onChange(a);this.__recentPageHistory.__SPI_onChange(a);this.__importance.__SPI_onChange(a);this.__notes.__SPI_onChange(a)};f.getCity=function(a){return g("city",
a)};f.getRegion=function(a){return g("state",a)};f.getCountry=function(a){return g("country",a)};f.getCountryCode=function(a){return g("country_code",a)};f.getOrganization=function(a){var b;g("isp",function(c){g("organization",function(d){b=c!=d?d:{}.undefinedValue;a&&a(b)})});return b};f.updateImportance=function(a){try{var b=parseInt(a.value||a)}catch(c){b=-1}if(b<0||b>3)throw Error("[olark] visitor importance must be an integer between 0-3");else this.__importance.set(b)};f.addNote=function(a){a=
a.body||a;var b=this.__notes.get();if(typeof a!="string")throw Error("[olark] visitor notes must be strings");for(var c=!1,d=0;d<b.length;d++)if(b[d]==a){c=!0;break}c||(b.push(a),this.__notes.set(b))};f.updateDetailsForThisVisit=function(b){var c=a.framestorewithjson.json,d=c.encode(this.__visitFields.get());c=c.encode(b);d!=c&&(this.__visitFields.set(b),b=["conversation_id="+encodeURIComponent(olark._.conversationId),"custom_fields_json="+encodeURIComponent(c),"cache="+encodeURIComponent(Math.random())],
a.async_script_load({url:olark._.apiHost+"/1.0/visitor/updateDetailsForThisVisit?"+b.join("&")}))};f.getDetailsForThisVisit=function(a){a(this.__visitFields.get())};f.getDetails=function(a){var f=this,e=null;f.getCity(function(g){try{var j=f.getRegion(),i=f.getCountry(),h=f.getCountryCode(),l=f.getOrganization(),v=f.__recentPageHistory.get(),p=f.__visitHistory.get();p.length==0&&(p.push({}),b.error("#history_is_empty in getDetails"));v.length==0&&(v.push({}),b.error("#page_history_is_empty in getDetails"));
var u=p[p.length-1].referrer;u&&u.indexOf(" ")>0&&(u=encodeURI(u));for(var s=0,x=0,w=0,t=!1,B=!1,y=!1,D=!1,C="",E=[],A=0;A<p.length;A++){var F=A==p.length-1;s+=p[A].pageCount;p[A].didChat&&x++;w+=p[A].updatedAt-p[A].createdAt;var G=d(p[A].referrer);G.campaign&&(y=!0,F&&(D=!0));var L=/(cpc|ppc)/i.test(G.medium||""),I=G.term,M=/gclid\=/.test(p[A].referrer);if(I||M||L)t=!0,F&&(B=!0);var N=c(p[A].referrer);if(N.text)F?C=N.text:E.push(N.text)}A=function(a){return a?(+new Date-a)/1E3:{}.undefinedValue};
e={recentPageHistory:v,currentPage:v[v.length-1],referrer:u,referredByPaidAdvertisingEver:t,referredByPaidAdvertisingThisVisit:B,referredByCampaignEver:y,referredByCampaignThisVisit:D,searchTextForThisVisit:C,searchTextForPreviousVisits:E,pageCountForThisVisit:p[p.length-1].pageCount,pageCountAcrossAllVisits:s,visitCount:p.length,conversationCount:x,isConversing:p[p.length-1].didChat,secondsSpentForThisVisit:Math.round((+new Date-p[p.length-1].createdAt)/1E3),secondsSpentAcrossAllVisits:Math.round(w/
1E3),city:g,region:j,country:i,countryCode:h,organization:l,fullName:f.getFullName(),emailAddress:f.getEmailAddress(),phoneNumber:f.getPhoneNumber(),importance:f.__importance.get(),notes:f.__notes.get(),browser:f.__SPI_getBrowser(),operatingSystem:f.__SPI_getOs(),ip:f.__SPI_getIp(),secondsSinceLastMessage:A(f.__mostRecentMessage.get()),secondsSinceLastNotificationToOperator:A(f.__mostRecentNotificationToOperator.get())}}catch(O){b.error("#error - getDetails",O.message),e={}}a&&a(e)});return e};f.__SPI_getNotes=
function(a){var b=this;return e(a,function(){return b.__notes.get()})};f.__SPI_getVisitHistory=function(a){var b=this;return e(a,function(){return b.__visitHistory.get()})}})(i.prototype);var l=function(){function a(b){this.family=b||"Other"}var b=[{p:"^(Opera)/(\\d+)\\.(\\d+) \\(Nintendo Wii",f:"Wii"},{p:"(Namoroka|Shiretoko|Minefield)/(\\d+)\\.(\\d+)\\.(\\d+(?:pre)?)",f:"Firefox ($1)"},{p:"(Namoroka|Shiretoko|Minefield)/(\\d+)\\.(\\d+)([ab]\\d+[a-z]*)?",f:"Firefox ($1)"},{p:"(SeaMonkey|Fennec|Camino)/(\\d+)\\.(\\d+)([ab]?\\d+[a-z]*)"},
{p:"(Flock)/(\\d+)\\.(\\d+)(b\\d+?)"},{p:"(Fennec)/(\\d+)\\.(\\d+)(pre)"},{p:"(Navigator)/(\\d+)\\.(\\d+)\\.(\\d+)",f:"Netscape"},{p:"(Navigator)/(\\d+)\\.(\\d+)([ab]\\d+)",f:"Netscape"},{p:"(Netscape6)/(\\d+)\\.(\\d+)\\.(\\d+)",f:"Netscape"},{p:"(MyIBrow)/(\\d+)\\.(\\d+)",f:"My Internet Browser"},{p:"(Firefox).*Tablet browser (\\d+)\\.(\\d+)\\.(\\d+)",f:"MicroB"},{p:"(Opera)/9.80.*Version\\/(\\d+)\\.(\\d+)(?:\\.(\\d+))?"},{p:"(Firefox)/(\\d+)\\.(\\d+)\\.(\\d+(?:pre)?) \\(Swiftfox\\)",f:"Swiftfox"},
{p:"(Firefox)/(\\d+)\\.(\\d+)([ab]\\d+[a-z]*)? \\(Swiftfox\\)",f:"Swiftfox"},{p:"(konqueror)/(\\d+)\\.(\\d+)\\.(\\d+)",f:"Konqueror"},{p:"(Jasmine|ANTGalio|Midori|Fresco|Lobo|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Shiira|Sunrise|Chrome|Flock|Netscape|Lunascape|Epiphany|WebPilot|Vodafone|NetFront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|Iron|Iris)/(\\d+)\\.(\\d+)\\.(\\d+)"},{p:"(Bolt|Jasmine|Maxthon|Lynx|Arora|IBrowse|Dillo|Camino|Shiira|Fennec|Phoenix|Chrome|Flock|Netscape|Lunascape|Epiphany|WebPilot|Opera Mini|Opera|Vodafone|NetFront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|iCab|NetNewsWire|Iron|Space Bison|Stainless|Orca)/(\\d+)\\.(\\d+)"},
{p:"(iRider|Crazy Browser|SkipStone|iCab|Lunascape|Sleipnir|Maemo Browser) (\\d+)\\.(\\d+)\\.(\\d+)"},{p:"(iCab|Lunascape|Opera|Android) (\\d+)\\.(\\d+)"},{p:"(IEMobile) (\\d+)\\.(\\d+)",f:"IE Mobile"},{p:"(Firefox)/(\\d+)\\.(\\d+)\\.(\\d+)"},{p:"(Firefox)/(\\d+)\\.(\\d+)(pre|[ab]\\d+[a-z]*)?"},{p:"(Obigo|OBIGO)[^\\d]*(\\d+)(?:.(\\d+))?",f:"Obigo"},{p:"(MAXTHON|Maxthon) (\\d+)\\.(\\d+)",f:"Maxthon"},{p:"(Maxthon|MyIE2|Uzbl|Shiira)",r:"0"},{p:"(PLAYSTATION) (\\d+)",f:"PlayStation"},{p:"(PlayStation Portable)[^\\d]+(\\d+).(\\d+)"},
{p:"(BrowseX) \\((\\d+)\\.(\\d+)\\.(\\d+)"},{p:"(Opera)/(\\d+)\\.(\\d+).*Opera Mobi",f:"Opera Mobile"},{p:"(POLARIS)/(\\d+)\\.(\\d+)",f:"Polaris"},{p:"(BonEcho)/(\\d+)\\.(\\d+)\\.(\\d+)",f:"Bon Echo"},{p:"(iPhone) OS (\\d+)_(\\d+)(?:_(\\d+))?"},{p:"(Avant)",r:"1"},{p:"(Nokia)[EN]?(\\d+)"},{p:"(Black[bB]erry)(\\d+)",f:"Blackberry"},{p:"(OmniWeb)/v(\\d+)\\.(\\d+)"},{p:"(Blazer)/(\\d+)\\.(\\d+)",f:"Palm Blazer"},{p:"(Pre)/(\\d+)\\.(\\d+)",f:"Palm Pre"},{p:"(Links) \\((\\d+)\\.(\\d+)"},{p:"(QtWeb) Internet Browser/(\\d+)\\.(\\d+)"},
{p:"(Version)/(\\d+)\\.(\\d+)(?:\\.(\\d+))?.*Safari/",f:"Safari"},{p:"(OLPC)/Update(\\d+)\\.(\\d+)"},{p:"(OLPC)/Update()\\.(\\d+)",r:"0"},{p:"(SamsungSGHi560)",f:"Samsung SGHi560"},{p:"^(SonyEricssonK800i)",f:"Sony Ericsson K800i"},{p:"(Teleca Q7)"},{p:"(MSIE) (\\d+)\\.(\\d+)",f:"Internet Explorer"}],c=[],d;for(d=0;d<b.length;d++)(function(b){var d=RegExp(b.p),e=b.f||null,g=b.r||null;c.push(function(b){b=b.match(d);var c;if(!b)return null;c=e?e.replace("$1",b[1]):b[1];c=new a(c);c.major=parseInt(g?
g:b[2]);c.minor=b[3]?parseInt(b[3]):null;c.patch=b[4]?parseInt(b[4]):null;return c})})(b[d]);a.prototype.toVersionString=function(){var a="";this.major!=null&&(a+=this.major,this.minor!=null&&(a+="."+this.minor,this.patch!=null&&(a+="."+this.patch)));return a};a.prototype.toString=function(){var a=this.toVersionString();a&&(a=" "+a);return this.family+a};return{parse:function(b){var d,e;for(d=0;d<c.length;d++)if(e=c[d](b))return e;return new a}}}();a.visitor={VisitorApi:i}})})(window.olark.__core,
window.olark.__core.logger);
(function(a){a.wait_for(function(){return a.data},function(){var b=900,c=function(a){a=a.data;this.__didActionForVisitor=a.getVisitorObject({key:"dafv",initialValue:{},__SPI_forceNamespace:"__rul"});this.__didActionForConversation=a.getConversationObject({key:"dafc",initialValue:{},__SPI_forceNamespace:"__rul"})};(function(a){function c(a,b,d,e){function v(){e.set(!0);d()}e.get()!==!0&&b(v)}a.defineRule=function(a){function d(){m||(m=setTimeout(function(){m=null;c(g,v,n,j)},b))}var f=this,g=a.id,
v=a.condition,n=a.action,k=a.perVisit,q=a.perVisitor,r=a.perPage,j={get:function(){return k||q?(k?f.__didActionForConversation:f.__didActionForVisitor).get()[g]:r?j.value:!1},set:function(a){if(k||q){var b=k?f.__didActionForConversation:f.__didActionForVisitor,c=b.get();c[g]=a;b.set(c)}else if(r)j.value=a}},m=null;olark("api.boot.onIdentityReady",d);olark("api.visitor.onChange",d);olark("api.chat.onReady",d);olark("api.chat.onOperatorsAway",d);olark("api.chat.onOperatorsBusy",d);olark("api.chat.onOperatorsAvailable",
d)}})(c.prototype);a.rules={RulesApi:c}})})(window.olark.__core,window.olark.__core.logger);
(function(a,b){a.wait_for(function(){return!0},function(){var c=["callback"],d=["jsonp","callback","cb"],e=function(a){for(var c="",d=0;d<a.length;d++){var e=a.charAt(d);e==" "?c+="+":"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()".indexOf(e)!=-1?c+=e:(e=e.charCodeAt(0),e>255?(b.error("[olark] unicode character cannot be URL encoded, attempting to substitute plus sign"),c+="+"):(c+="%",c+="0123456789ABCDEF".charAt(e>>4&15),c+="0123456789ABCDEF".charAt(e&15)))}return c},i=
function(a){for(var c=d.length;c--;){var e=d[c];if(typeof a[e]=="function")return{name:e,callback:a[e]}}var i=function(){b.warn("[olark] no callback handler given for JSONP request")},k=null,l;for(l in kwargs)typeof kwargs[l]=="function"&&function(a,c){k=a;i=function(){b.warn("[olark] you may be using a nonstandard jsonp callback '",a,"'");c.apply(c,arguments)}}(l,kwargs[l]);return{name:k,callback:i}},l=function(){};l.prototype.requestJson=function(a,b){var d=a.url;if(typeof d!="string")throw Error("[olark] string 'url' is required");
var l=a.params;if(typeof l!="object")throw Error("[olark] dictionary 'params' is required");var k=c,q=b;if(typeof q=="undefined"){var r=i(l);k=r.name;q=r.callback}var j="cb"+Math.floor(Math.random()*1E6);l[k]=j;k="";r=!0;for(var m in l)if(typeof l[m]!="function"){var h=l[m];r||(k+="&");k+=m+"="+e(h);r=!1}d=d.replace("http://","");d=d.replace("https://","");d+="?"+k;d=("https:"==document.location.protocol?"https://":"http://")+d;var o=document.createElement("script");o.type="text/javascript";o.src=
d;var z=document.getElementsByTagName("head")[0]||document.documentElement;window[j]=function(){q.apply(q,arguments);window[j]=void 0;try{delete window[j]}catch(a){}z.removeChild(o)};this.withConnectionCompatibility(function(){z.insertBefore(o,z.firstChild)})};l.prototype.withConnectionCompatibility=function(b){a.run_legacy_code(function(a){a.hbl.client.sendcommand("return_long_poll_now","");b()})};a.remote={RemoteApi:l}})})(window.olark.__core,window.olark.__core.logger);
(function(a,b){a.wait_for(function(){return window.olark.__core.box&&window.olark.__core.chat&&window.olark.__core.data&&window.olark.__core.visitor&&window.olark.__core.rules&&window.olark.__core.extensions&&window.olark.__core.browser&&window.olark.__core.remote},function(){a.api={ApiInstance:function(a){a=a||{};var d=a.namespace;if(typeof d=="undefined")throw Error("'namespace' is required");var e=a.conf;if(typeof e=="undefined")throw Error("'conf' is required");a=a.extension_name;if(typeof a==
"undefined")throw Error("'extension_name' is required");this.chat=new window.olark.__core.chat.ChatApi({conf:e,extension_name:a});this.box=new window.olark.__core.box.BoxApi({conf:e,chat_api:this.chat});this.data=new window.olark.__core.data.DataApi({namespace:d});this.visitor=new window.olark.__core.visitor.VisitorApi({namespace:d,data:this.data});this.rules=new window.olark.__core.rules.RulesApi({data:this.data});this.logger=b;this.__SPI_browser=new window.olark.__core.browser.BrowserApi({namespace:d});
this.__SPI_extensions=new window.olark.__core.extensions.ExtensionsApi({namespace:d});this.__SPI_remote=new window.olark.__core.remote.RemoteApi;this.boot={onIdentityReady:function(a){a(olark._.siteId,olark._.visitorId,olark._.conversationId)},onWindowLoad:function(a){a()}}}}})})(window.olark.__core,window.olark.__core.logger);
olark("api.boot.onIdentityReady",function(){function a(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function b(){var a=document.location.href,b=a.split("#"),c="__olarkpg__="+Math.random(),d=/__olarkpg__=[^&]+/;return d.test(a)?a.replace(d,c):/\?/.test(a)?b[0]+"&"+c+(b[1]||""):b[0]+"?"+c+(b[1]||"")}function c(b){var c=document.createElement("a");c.style.display="block";c.id="olark-inspector-"+b.id;c.href=b.href||"#";a(c,"click",b.onclick);c.innerHTML=
b.content;return c}function d(a,b){var c=document.createElement("div");c.id="olark-inspector-"+a;c.innerHTML=b;return c}function e(){if(!i){i=document.createElement("div");var e=document.createElement("ul"),f=function(){g(function(b){e.innerHTML="";for(var c=0;c<b.length;c++)e.appendChild(b[c]);b=document.createElement("a");b.innerHTML="close";(function(a){a.display="block";a.position="absolute";a.top="0px";a.right="0px";a["text-decoration"]="none";a.color="#ccc"})(b.style);b.href="#";a(b,"click",
function(){olark("api.visitor.__SPI_setIsInspecting",!1);i.style.display="none";i=null;return!1});e.appendChild(b)})},g=function(a){olark("api.visitor.getDetails",function(e){a([d("olark-header","<strong style='color: #aaa'>OLARK INSPECTOR</strong>"),d("olark-page-count",["visitor from <strong>"+e.city+", "+e.region+", "+e.country+"</strong>","viewed <strong>"+e.pageCountForThisVisit+"</strong> pages","in <strong>"+e.secondsSpentForThisVisit+"</strong> seconds,","and has chatted <strong>"+e.conversationCount+
"</strong> times in the past,","and <strong>"+(e.isConversing?"is conversing now":"has not conversed")+"</strong>"].join(" ")),c({id:"start-new-visitor",content:"pretend to be a brand-new visitor",href:b(),onclick:function(){olark._.cookieManager.erase("hblid");olark._.cookieManager.erase("olfsk");olark._.cookieManager.erase("wcsid")}}),c({id:"start-new-conversation",content:"pretend this is a new visit to the site",href:b(),onclick:function(){olark._.cookieManager.erase("wcsid")}}),c({id:"visit-another-page",
content:"pretend to change pages",href:b()})])})};(function(a){a.position="relative";a.width="400px";a.margin="0px";a.marginLeft=a.marginRight="auto";a.padding="10px";a.fontFamily="monospace";a.color="black";a.background="white";a.opacity="0.90";a["list-style-type"]="none";a["-moz-box-shadow"]=a["-webkit-box-shadow"]=a["box-shadow"]="0px 2px 25px #999"})(e.style);(function(a){a.position="fixed";a.bottom="0px";a.width="98%"})(i.style);i.appendChild(e);document.body.appendChild(i);f();olark("api.visitor.onChange",
f)}}var i=null;olark("api.visitor.__SPI_getIsInspecting",function(a){a?e():olark("api.chat.onCommandFromOperator",function(a){a.command.name=="develop"&&(olark("api.visitor.__SPI_setIsInspecting",!0),e())})})});
olark.declare({name:"GoogleAnalytics",version:"1.1",startup:function(a,b){function c(a,b){if(x&&window.console&&window.console[a])window.console[a](b)}function d(a){return a.replace(/[^\w\)\(\d]/g,"_").replace(/\_[\_]*/,"_")}function e(a){c("log",a);window._gaq.push(a)}function i(a){window._gaq=window._gaq||[];a&&(e([y+"_setAccount",a]),j!=null&&e([y+"_setAllowLinker",j]),m!=null&&e([y+"_setAllowHash",m]),h!=null&&e([y+"_setDomainName",h]),o!=null&&e(o))}function l(a){if(a._getAccount)return a._getAccount();
var b=void 0,c;for(c in a)typeof a[c]=="string"&&a[c].match(/UA\-/)&&(b=a[c]);return b}function f(){var a=window._gat&&window._gat._getTrackerByName,b=window.pageTracker,d=!a&&window._gaq,f=n&&!a&&!d;v&&(y="olark.");if(f)r?(function(){var a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}(),
i(r),e([y+"_trackPageview"])):c("error","Cannot load Google Analytics Tracking without Tracking ID");else if(v)r?i(r):c("error","Cannot create Custom Google Analytics Tracker without Tracking ID");else if(b)a=l(window.pageTracker),a!="UA-XXXXX-X"&&a&&k?i(a):c("error","Cannot determine Tracking ID for Google Analytics legacy tracker id is: "+a);else if(a)l(window._gat._getTrackerByName())=="UA-XXXXX-X"&&c("error","Cannot determine Tracking ID for Google Analytics, _gat is loaded");else if(d){a=!1;
for(b=0;b<window._gaq.length;b++)if((d=window._gaq[b])&&d[0]=="_setAccount"){a=d[1];break}a||c("error","Cannot determine Tracking ID for Google Analytics _gaq")}}function g(){var a=G.get(),b=C.get(),c=E.get(),f=b>c?!0:!1,h="";h=f?a+" initiated":"Visitor initiated with "+a;z&&(s!=null&&e([y+"_setCustomVar",s,d(d(D)+":(Visitor) Had Conversation"),d(h),w]),p!=null&&e([y+"_setCustomVar",p,d(d(D)+":(Session)_Had_Conversation"),d(h),t]),u!=null&&e([y+"_setCustomVar",u,d(d(D)+":(Page) Had Conversation"),
d(h),B]),q&&e([y+"_trackPageview"]));a=f?parseInt((b-c)/1E3):parseInt((c-b)/1E3);e([y+"_trackEvent",d(d(D)),"Conversation",d(h),a])}var v=b.GoogleAnalytics.create_custom_tracker||null,n=b.GoogleAnalytics.load_ga_if_misisng||null,k=b.GoogleAnalytics.legacy_compatibility===void 0?!0:b.GoogleAnalytics.legacy_compatibility,q=b.GoogleAnalytics.track_chat_start_page||null,r=b.GoogleAnalytics.tracking_id||null,j=b.GoogleAnalytics.allow_linker||null,m=b.GoogleAnalytics.allow_hash||null,h=b.GoogleAnalytics.domain||
null,o=b.GoogleAnalytics.custom_config||null,z=b.GoogleAnalytics.enable_custom_variables||null,p=b.GoogleAnalytics.had_conversation_session_slot_number||null,u=b.GoogleAnalytics.had_conversation_page_slot_number||null,s=b.GoogleAnalytics.had_conversation_visitor_slot_number||null,x=b.GoogleAnalytics.debug||document.location.toString().match(/__debug_ga/)||null,w=1,t=2,B=3,y="",D=window.hblName||"Olark",C=a.data.getConversationObject({key:"lastMessageToOperatorSent",initialValue:null}),E=a.data.getConversationObject({key:"lastMessageToVisitorSent",
initialValue:null}),A=a.data.getConversationObject({key:"lastMessageSent",initialValue:null}),F=a.data.getConversationObject({key:"isConversation",initialValue:null}),G=a.data.getConversationObject({key:"lastOperatorNickname",initialValue:""});if(x)window.olark._.ga_debug=this;a.chat.onReady(function(){f();a.chat.onMessageToVisitor(function(a){var b=C.get();a=a.message.nickname;if(A.get()=="visitor"||E.get()==null){var c=0;C.get()&&(c=parseInt((+new Date-C.get())/1E3),c>1200&&(c=0));e([y+"_trackEvent",
d(D),d("Operator Sent a Message"),d(a),c]);E.set(+new Date)}E.get()==null&&E.set(+new Date);G.set(a);b&&!F.get()&&g();F.set(b);A.set("operator")});a.chat.onMessageToOperator(function(){var a=E.get();if(A.get()=="operator"||C.get()==null){var b=0;E.get()&&(b=parseInt((+new Date-E.get())/1E3),b>1200&&(b=0));e([y+"_trackEvent",d(D),d("Visitor Sent a Message"),d("true"),b]);C.set(+new Date)}C.get()==null&&C.set(+new Date);a&&!F.get()&&g();F.set(a);A.set("visitor")})})}});
olark.declare({name:"VisitorInsight",version:"1.0",startup:function(a,b){function c(b){return b?a.__SPI_browser.__SPI_getSafeUrl(b):null}function d(a){return a=="true"?!0:!1}var e=b.chat.visitor_nickname||b.system.force_nickname||null,i=!0;if(b.VisitorInsight.prechat_contains_referrer===!1||b.chat.notify_operator_of_referrer===!1)i=!1;var l=!0;if(b.VisitorInsight.prechat_contains_location===!1||b.chat.notify_operator_of_location===!1)l=!1;var f=b.system.disable_default_visitor_information?!0:!1,g=
b.VisitorInsight.status_contains_referrer===!1?!1:!0,v=b.VisitorInsight.status_contains_location===!1?!1:!0,n=b.VisitorInsight.give_location_to_operator===!1?!1:!0,k=b.VisitorInsight.max_location_notifs_when_not_conversing||2,q=b.VisitorInsight.max_idle_milliseconds_for_location_notifs||6E4,r=b.VisitorInsight.custom_visitor_ip||null,j=typeof b.VisitorInsight.clickpath_entries=="undefined"?5:b.VisitorInsight.clickpath_entries,m=null,h=+new Date,o=a.data.getConversationObject({key:"didGivePrechatInsight",
initialValue:!1,backup:"vi1",backupTransform:d}),z=a.data.getConversationObject({key:"isConversation",initialValue:!1,backup:"vi2",backupTransform:d}),p=a.data.getConversationObject({key:"referrer",initialValue:document.referrer&&document.referrer!==""?document.referrer:null}),u=a.data.getConversationObject({key:"locationNotificationState",initialValue:"active",backup:"vi3",backupTransform:d}),s=a.data.getConversationObject({key:"locationNotifsWithoutConversing",initialValue:0}),x=a.data.getConversationObject({key:"timestampOfLastActivity",
initialValue:(new Date).getTime(),backup:"vi4",backupTransform:parseInt}),w=a.data.getConversationObject({key:"pagesCount",initialValue:0}),t=a.data.getVisitorObject({key:"visitCount",initialValue:0}),B=a.data.getVisitorObject({key:"conversationCount",initialValue:0}),y=a.data.getConversationObject({key:"visitorMessageCount",initialValue:0}),D=a.data.getConversationObject({key:"operatorMessageCount",initialValue:0}),C=a.data.getConversationObject({key:"operatorNotificationCount",initialValue:0,backup:"vi5",
backupTransform:parseInt}),E=a.data.getConversationObject({key:"initialArrivalTimestamp",initialValue:(new Date).getTime()});e&&a.chat.updateVisitorNickname({snippet:e,hidesDefault:!0});(function(){a.chat.onMessageToOperator(function(){y.set(y.get()+1)});a.chat.onMessageToVisitor(function(){D.set(D.get()+1)});a.chat.onNotificationToOperator(function(){C.set(C.get()+1)});a.__SPI_browser.onPageChange(function(){w.set(w.get()+1)});w.__SPI_onChange(function(a){a.newValue==1&&t.set(t.get()+1)})})();(function(){var a=
function(){y.get()>0&&D.get()>0&&z.set(!0)};y.__SPI_onChange(a);D.__SPI_onChange(a)})();(function(){var b=function(){x.set((new Date).getTime());s.set(0);u.get()!="disabled"&&u.set("active")};a.chat.onMessageToVisitor(function(){b()});a.chat.onMessageToOperator(function(){b()});s.__SPI_onChange(function(a){a.newValue>=k&&u.set("inactive")});a.box.onDismiss(function(){u.set("inactive")});a.chat.onCommandFromOperator(function(a){a=a.command;if(a.name=="unfollow"||a.name=="nofollow")u.set("disabled"),
olark("api.chat.sendNotificationToOperator",{body:"turned off URL notifications from this visitor"})})})();(function(){var b=!1,d=function(d){if(d||n&&!((new Date).getTime()-x.get()>q)&&u.get()=="active"&&!b)b=!0,a.chat.sendNotificationToOperator({body:"looking at "+c(document.location.href)}),s.set(s.get()+1)},e=function(){if(o.get()===!1&&!f){o.set(!0);var b=a.chat.getVisitorNickname();a.chat.sendNotificationToOperator({body:"talking to "+b});l&&d(!0);if(i){var e=c(p.get());e&&a.chat.sendNotificationToOperator({body:"referred from "+
e})}/{\s*geolocation\s*}/.test(b)||a.chat.sendNotificationToOperator({body:"located in {geolocation}"});if(b=A())for(e=0;e<b.length;e++)a.chat.sendNotificationToOperator({body:b[e]});a.chat.sendNotificationToOperator({body:"to see additional options, simply type !help"})}};a.__SPI_browser.onPageChange(function(){o.get()===!0&&d()});y.__SPI_onChange(function(a){a.newValue==1&&e()});C.__SPI_onChange(function(a){a.newValue==1&&e()})})();var A=function(){var b=[],c=a.visitor.getOrganization();c&&b.push("might be affiliated with "+
c);return b},F=function(){if(!(+new Date-h>18E5)){var b=function(a){return a>=864E5?"one day":a>=36E5?Math.floor(a/36E5)+" hours":a>=6E4?Math.floor(a/6E4)+" minutes":a>=1E3?Math.floor(a/1E3)+" seconds":null},d=c(document.location.href.toString()),e=c(p.get()),f=w.get(),i=B.get(),k=t.get();r||a.chat.__SPI_getVisitorIP();var l=(new Date).getTime()-E.get(),o=b(l),n=a.visitor.getFullName(),u=a.visitor.getEmailAddress(),s=a.visitor.__SPI_getNotes(),q=a.visitor.__SPI_getRecentPageHistory();m=s;s=s.slice(0)||
[];n&&s.push("speaking with "+n);u&&s.push(u);d&&v&&s.push("looking at "+d);if(q&&q.length>1){n=q.length-1;d=q.length-1-j;d<1&&(d=1);for(s.push("already looked at:");n>=d;n--)u=q[n],u.url?s.push("  "+c(u.url)):u.title&&s.push("  "+u.title)}e&&g&&s.push("referred from "+e);s.push("located in {geolocation}");s.push("{num_pages} pages viewed".replace(/{num_pages}/,f));k>1?s.push(k+" visits"):s.push("first visit");i>1?s.push("has had "+i+" conversations"):i==1&&s.push("first conversation");s.push("using "+
a.visitor.__SPI_getBrowser()+" on "+a.visitor.__SPI_getOs());s.push(a.visitor.__SPI_getIp());o&&l>3E4?s.push("spent at least "+o+" so far"):(b=b(3E4))&&s.push("arrived within the last "+b);if(b=A())for(e=0;e<b.length;e++)s.push(b[e]);a.chat.updateVisitorStatus({snippet:s});l*=2;l<3E4&&(l=3E4);a.chat.__SPI_isConversing()||setTimeout(F,l)}};a.chat.onReady(F);a.visitor.onChange(function(){m!==null&&a.visitor.__SPI_getNotes().join("")!=m.join("")&&F()})}});
olark.declare({name:"VisitorImportance",version:"1.0",startup:function(a,b){function c(){olark("api.visitor.getDetails",function(b){for(var c="",d=0;d<3;d++)c+=b.importance>d?e:i;a.chat.updateVisitorNickname({snippet:c})})}var d=b.system.show_importance_in_nickname==!0?!0:!1,e=b.system.filled_icon||String.fromCharCode(9733),i=b.system.unfilled_icon||String.fromCharCode(9734);d&&(olark("api.visitor.onChange",c),c())}});
olark.declare({name:"Mixpanel",version:"1.0",startup:function(a,b){function c(c,d){function n(){f||(f=!0,ompq.push(["identify",a.chat.__SPI_getConversationUUID()]));ompq.push(["track",c,d]);q[c]=!0;l.set(q)}var k=(new Date).getTime()-i.get(),q=l.get();if(!q[c])d=d||{},d.bucket=b.system.olark_key,k>e?n():setTimeout(n,e-k)}function d(){var a;if(typeof ompq!="undefined"&&ompq&&ompq[0]&&ompq[0][0]=="init"){ompq.metrics=new function(a,b){var c={},d=!1;c.config={cross_subdomain_cookie:!1,cookie_name:"omp__super_properties",
test:!1,store_google:!1,debug:!1};c.super_properties={all:{},events:{},funnels:{}};c.funnels={};c.send_request=function(a,b){var d=c.callback_fn;a+=a.indexOf("?")>-1?"&callback=":"?callback=";a+=d+"&";b&&(a+=c.http_build_query(b));c.config.test&&(a+="&test=1");a+="&_="+(new Date).getTime().toString();d=document.createElement("script");d.setAttribute("src",a);d.setAttribute("type","text/javascript");var e=document.getElementsByTagName("head")[0]||document.documentElement;e.insertBefore(d,e.firstChild)};
c.track_funnel=function(a,b,d,e,f){e||(e={});e.funnel=a;e.step=parseInt(b,10);e.goal=d;e.step==1&&document.referrer.search("http://(.*)google.com")===0&&(a=c.get_query_param(document.referrer,"q"),a.length&&c.register({mp_keyword:a},"funnels"));c.track("mp_funnel",e,f,"funnels")};c.get_query_param=function(a,b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);return c===null||c&&typeof c[1]!="string"&&c[1].length?"":unescape(c[1]).replace(/\+/g," ")};c.track=
function(a,b,d,e){c.load_super_once();e||(e="events");b||(b={});if(!b.token)b.token=c.token;if(d)c.callback=d;b.time=c.get_unixtime();c.save_campaign_params();var f;if(e!="all")for(f in c.super_properties[e])b[f]||(b[f]=c.super_properties[e][f]);if(c.super_properties.all)for(f in c.super_properties.all)b[f]||(b[f]=c.super_properties.all[f]);d={event:a,properties:b};e=c.base64_encode(c.json_encode(d));c.config.debug&&window.console&&(window.console.log("-------------- REQUEST --------------"),window.console.log(d));
c.send_request(c.api_host+"/track/",{data:e,ip:1});c.track_predefined_funnels(a,b)};c.identify=function(a){c.register_once({distinct_id:a},"all",null,30)};c.register_once=function(a,b,d,e){c.load_super_once();if(!b||!c.super_properties[b])b="all";d||(d="None");e||(e=7);if(a)for(var f in a)if(a.hasOwnProperty(f)&&(!c.super_properties[b][f]||c.super_properties[b][f]==d))c.super_properties[b][f]=a[f];c.config.cross_subdomain_cookie&&c.clear_old_cookie();c.set_cookie(c.config.cookie_name,c.json_encode(c.super_properties),
e,c.config.cross_subdomain_cookie)};c.register=function(a,b,d){c.load_super_once();if(!b||!c.super_properties[b])b="all";d||(d=7);if(a)for(var e in a)a.hasOwnProperty(e)&&(c.super_properties[b][e]=a[e]);c.config.cross_subdomain_cookie&&c.clear_old_cookie();c.set_cookie(c.config.cookie_name,c.json_encode(c.super_properties),d,c.config.cross_subdomain_cookie)};c.http_build_query=function(a,b){var c,d,e,f=0,g=[];b||(b="&");for(c in a)c&&(d=encodeURIComponent(a[c].toString()),e=encodeURIComponent(c),
g[f++]=e+"="+d);return g.join(b)};c.get_unixtime=function(){return parseInt((new Date).getTime().toString().substring(0,10),10)};c.jsonp_callback=function(a){if(c.callback)c.callback(a),c.callback=!1};c.json_encode=function(a){var b=function(a){var b=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};b.lastIndex=0;return b.test(a)?'"'+a.replace(b,
function(a){var b=c[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'},c=function(a,d){var e="",f=0,g=f="";g=0;var i=e,j=[],k=d[a];k&&typeof k==="object"&&typeof k.toJSON==="function"&&(k=k.toJSON(a));switch(typeof k){case "string":return b(k);case "number":return isFinite(k)?String(k):"null";case "boolean":case "null":return String(k);case "object":if(!k)return"null";e+="    ";j=[];if(Object.prototype.toString.apply(k)==="[object Array]"){g=k.length;
for(f=0;f<g;f+=1)j[f]=c(f,k)||"null";return g=j.length===0?"[]":e?"[\n"+e+j.join(",\n"+e)+"\n"+i+"]":"["+j.join(",")+"]"}for(f in k)Object.hasOwnProperty.call(k,f)&&(g=c(f,k))&&j.push(b(f)+(e?": ":":")+g);return g=j.length===0?"{}":e?"{"+j.join(",")+""+i+"}":"{"+j.join(",")+"}"}};return c("",{"":a})};c.base64_encode=function(a){var b,d,e,f,g=0,i=0,l="";l=[];if(!a)return a;a=c.utf8_encode(a+"");do b=a.charCodeAt(g++),d=a.charCodeAt(g++),e=a.charCodeAt(g++),f=b<<16|d<<8|e,b=f>>18&63,d=f>>12&63,e=f>>
6&63,f&=63,l[i++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f);while(g<a.length);l=l.join("");switch(a.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l};c.utf8_encode=function(a){a=(a+"").replace(/\r\n/g,
"\n").replace(/\r/g,"\n");var b="",c,d,e=0;c=d=0;e=a.length;for(var f=0;f<e;f++){var g=a.charCodeAt(f),i=null;g<128?d++:i=g>127&&g<2048?String.fromCharCode(g>>6|192)+String.fromCharCode(g&63|128):String.fromCharCode(g>>12|224)+String.fromCharCode(g>>6&63|128)+String.fromCharCode(g&63|128);i!==null&&(d>c&&(b+=a.substring(c,d)),b+=i,c=d=f+1)}d>c&&(b+=a.substring(c,a.length));return b};c.set_cookie=function(a,b,c){c&&c>0&&(c*=864E5);olark._.cookieManager.set(a,b,c)};c.get_cookie=function(a){return(a=
olark._.cookieManager.get(a))?a:""};c.delete_cookie=function(a,b){c.set_cookie(a,"",-1,b)};c.get_super=function(){var a=eval("("+c.get_cookie(c.config.cookie_name)+")");if(a)for(var b in a)a.hasOwnProperty(b)&&(c.super_properties[b]=a[b]);return c.super_properties};c.load_super_once=function(){if(!d)try{c.get_super(),d=!0}catch(a){}};c.register_funnel=function(a,b){c.funnels[a]=b};c.track_predefined_funnels=function(a,b){if(a&&c.funnels)for(var d in c.funnels)if(c.funnels.hasOwnProperty(d))for(var e=
0;e<c.funnels[d].length;++e)c.funnels[d][e]&&c.funnels[d][e]==a&&c.track_funnel(d,e+1,a,b)};c.save_campaign_params=function(){c.campaign_params_saved=c.campaign_params_saved||!1;if(c.config.store_google&&!c.campaign_params_saved){for(var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],b="",d={},e=0;e<a.length;e++)b=c.get_query_param(document.URL,a[e]),b.length&&(d[a[e]]=b);c.register_once(d);c.campaign_params_saved=!0}};c.clear_old_cookie=function(){c.delete_cookie(c.config.cookie_name,
!1);c.set_cookie(c.config.cookie_name,c.json_encode(c.super_properties),7,!0)};c.set_config=function(a){for(var b in a)a.hasOwnProperty(b)&&(c.config[b]=a[b])};var e="https:"==document.location.protocol?"https://":"http://";c.token=a;c.api_host=e+"stats.olark.com";c.callback_fn=b?b+".jsonp_callback":"mmetrics.jsonp_callback";return c}(ompq[0][1],"ompq.metrics");ompq.push=function(a){if(a)if(typeof a=="function")a();else if(a.constructor==Array){var b=ompq.metrics[a[0]];typeof b=="function"&&b.apply(ompq.metrics,
a.slice(1))}};for(a=1;a<ompq.length;a++)ompq.push(ompq[a]);ompq.length=0}}var e=6E3,i=a.data.getConversationObject({key:"initialLandingTimestamp",initialValue:(new Date).getTime()}),l=a.data.getConversationObject({key:"sentEvents",initialValue:{}}),f=!1;window.ompq=window.ompq||[];ompq.push(["init","0908d20dfe9d3ea7c81e64bb4ffd7d36"]);a.chat.onReady(function(){d();c("visitorAvailable")});a.chat.onOperatorsAvailable(function(){c("operatorsAvailable")});a.chat.onMessageToOperator(function(){c("messageToOperator")});
a.chat.onMessageToVisitor(function(a){c("messageToVisitor",{operator:a.nickname})})}});olark.declare({name:"OfflineWarning",version:"1.0",startup:function(a,b){var c=b.system.offlineResponse||"Operator has gone away try again later";a.chat.onMessageToOperator(function(){setTimeout(function(){hbl.client.opavailable||olark("api.chat.sendMessageToVisitor",{body:c,nickname:" "})},1)})}});

