// Analytics.js 0.2.2 // (c) 2012 Segment.io Inc. // Analytics.js may be freely distributed under the MIT license. (function(){var e={userId:null,date:new Date,loaded:!1,initialized:!1,initializableProviders:{},providers:[],addProvider:function(e,t){this.initializableProviders[e]=t},initialize:function(e){this.providers=[],this.userId=null;for(var t in e){var n=this.initializableProviders[t],r=e[t];if(!n)throw new Error('Could not find a provider named "'+t+'"');n.initialize(r),this.providers.push(n)}this.initialized=!0;var i=this.utils.getUrlParameter(window.location.search,"ajs_uid");i&&this.identify(i);var s=this.utils.getUrlParameter(window.location.search,"ajs_event");s&&this.track(s)},identify:function(e,t){if(!this.initialized)return;this.utils.isObject(e)&&(t=e,e=null),e!==null?this.userId=e:e=this.userId;for(var n=0,r;r=this.providers[n];n++){if(!r.identify)continue;r.identify(e,this.utils.clone(t))}},track:function(e,t){if(!this.initialized)return;for(var n=0,r;r=this.providers[n];n++){if(!r.track)continue;r.track(e,this.utils.clone(t))}},pageview:function(){if(!this.initialized)return;for(var e=0,t;t=this.providers[e];e++){if(!t.pageview)continue;t.pageview()}},utils:{getSeconds:function(e){return Math.floor(new Date(e)/1e3)},clone:function(e){if(!e)return;var t={};for(var n in e)t[n]=e[n];return t},extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r;r=t[n];n++)for(var i in r)e[i]=r[i];return e},alias:function(e,t){for(var n in t){var r=t[n];e[n]!==undefined&&(e[r]=e[n],delete e[n])}},isObject:function(e){return e===Object(e)},isString:function(e){return Object.prototype.toString.call(e)==="[object String]"},isFunction:function(e){return Object.prototype.toString.call(e)==="[object Function]"},isNumber:function(e){return Object.prototype.toString.call(e)==="[object Number]"},isEmail:function(e){return/.+\@.+\..+/.test(e)},resolveSettings:function(e,t){if(!this.isString(e)&&!this.isObject(e))throw new Error("Could not resolve settings.");if(!t)throw new Error("You must provide an api key field name.");if(this.isString(e)){var n=e;e={},e[t]=n}return e},getUrlParameter:function(e,t){var n=e.replace("?","").split("&");for(var r=0;r<",s,' onload="var d=',y,";d.getElementsByTagName('head')[0].",a,"(d.",f,"('script')).",h,"='",r,"//",u.l,"'",'"',">"].join("")}var s="body",o=n[s];if(!o)return setTimeout(p,100);u.P(1);var a="appendChild",f="createElement",h="src",v=n[f]("div"),m=v[a](n[f](i)),g=n[f]("iframe"),y="document",b="domain",w;v.style.display="none",o.insertBefore(v,o.firstChild).id=i,g.frameBorder="0",g.id=i+"-loader",/MSIE[ ]+6/.test(navigator.userAgent)&&(g.src="javascript:false"),g.allowTransparency="true",m[a](g);try{g.contentWindow[y].open()}catch(E){e[b]=n[b],w="javascript:var d="+y+".open();d.domain='"+n.domain+"';",g[h]=w+"void(0);"}try{var S=g.contentWindow[y];S.write(t()),S.close()}catch(x){g[h]=w+'d.write("'+t().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}u.P(2)};p()};o()}({loader:"static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]}),window.olark.identify(this.settings.siteId)},identify:function(e,t){var n=e;t&&t.email&&(n=t.email),t&&t.name&&(n=t.name),t&&t.name&&t.email&&(n+=" ("+t.email+")");if(!n)return;window.olark("api.chat.updateVisitorNickname",{snippet:n})},track:function(e,t){if(!this.settings.track)return;window.olark("api.chat.sendNotificationToOperator",{body:'visitor triggered "'+e+'"'})},pageview:function(){if(!this.settings.pageview)return;window.olark("api.chat.sendNotificationToOperator",{body:"looking at "+window.location.href})}});