/* 0.4 */
function BOOMR_check_doc_domain(e){var t
if(!e){if(window.parent===window||!document.getElementById("boomr-if-as"))return
e=document.domain}if(-1!==e.indexOf(".")){try{return void(t=window.parent.document)}catch(n){document.domain=e}try{return void(t=window.parent.document)}catch(n){e=e.replace(/^[\w\-]+\./,"")}BOOMR_check_doc_domain(e)}}BOOMR_start=(new Date).getTime(),BOOMR_check_doc_domain(),function(e){var t,n,o,r,i,a
e.parent!==e&&document.getElementById("boomr-if-as")&&"script"===document.getElementById("boomr-if-as").nodeName.toLowerCase()&&(e=e.parent,r=document.getElementById("boomr-if-as").src),o=e.document,e.BOOMR||(e.BOOMR={}),BOOMR=e.BOOMR,BOOMR.version||(BOOMR.version="0.9",BOOMR.window=e,BOOMR.plugins||(BOOMR.plugins={}),function(){try{void 0!==new e.CustomEvent("CustomEvent")&&(i=function(t,n){return new e.CustomEvent(t,n)})}catch(t){}try{!i&&o.createEvent&&o.createEvent("CustomEvent")&&(i=function(e,t){var n=o.createEvent("CustomEvent")
return t=t||{cancelable:!1,bubbles:!1},n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n})}catch(t){}!i&&o.createEventObject&&(i=function(e,t){var n=o.createEventObject()
return n.type=n.propertyName=e,n.detail=t.detail,n}),i||(i=function(){return void 0})}(),a=function(e,t){var n=i(e,{detail:t})
n&&BOOMR.setImmediate(function(){o.dispatchEvent?o.dispatchEvent(n):o.fireEvent&&o.fireEvent("onpropertychange",n)})},t={beacon_url:"",beacon_type:"AUTO",site_domain:e.location.hostname.replace(/.*?([^.]+\.[^.]+)\.?$/,"$1").toLowerCase(),user_ip:"",strip_query_string:!1,onloadfired:!1,handlers_attached:!1,events:{page_ready:[],page_unload:[],dom_loaded:[],visibility_changed:[],before_beacon:[],onbeacon:[],xhr_load:[],click:[],form_submit:[]},public_events:{before_beacon:"onBeforeBoomerangBeacon",onbeacon:"onBoomerangBeacon",onboomerangloaded:"onBoomerangLoaded"},vars:{},errors:{},disabled_plugins:{},xb_handler:function(n){return function(o){var r
o||(o=e.event),o.target?r=o.target:o.srcElement&&(r=o.srcElement),3===r.nodeType&&(r=r.parentNode),r&&"OBJECT"===r.nodeName.toUpperCase()&&"application/x-shockwave-flash"===r.type||t.fireEvent(n,r)}},fireEvent:function(e,t){var n,o,r
if(e=e.toLowerCase(),!this.events.hasOwnProperty(e))return!1
for(this.public_events.hasOwnProperty(e)&&a(this.public_events[e],t),r=this.events[e],n=0;n<r.length;n++)try{o=r[n],o.fn.call(o.scope,t,o.cb_data)}catch(i){BOOMR.addError(i,"fireEvent."+e)}return!0}},n={t_lstart:null,t_start:BOOMR_start,t_end:null,url:r,utils:{objectToString:function(e,t,n){var o,r=[]
if(!e||"object"!=typeof e)return e
if(void 0===t&&(t="\n	"),n||(n=0),"[object Array]"===Object.prototype.toString.call(e)){for(o=0;o<e.length;o++)r.push(n>0&&null!==e[o]&&"object"==typeof e[o]?this.objectToString(e[o],t+("\n	"===t?"	":""),n-1):encodeURIComponent(e[o]))
t=","}else for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.push(n>0&&null!==e[o]&&"object"==typeof e[o]?encodeURIComponent(o)+"="+this.objectToString(e[o],t+("\n	"===t?"	":""),n-1):encodeURIComponent(o)+"="+encodeURIComponent(e[o]))
return r.join(t)},getCookie:function(e){if(!e)return null
e=" "+e+"="
var t,n
return n=" "+o.cookie+";",(t=n.indexOf(e))>=0?(t+=e.length,n=n.substring(t,n.indexOf(";",t))):null},setCookie:function(e,n,r){var i,a,s,d,l
if(!e||!t.site_domain)return BOOMR.debug("No cookie name or site domain: "+e+"/"+t.site_domain),!1
if(i=this.objectToString(n,"&"),a=e+"="+i,d=[a,"path%3d/index.html","domain="+t.site_domain],r&&(l=new Date,l.setTime(l.getTime()+1e3*r),l=l.toGMTString(),d.push("expires="+l)),a.length<500){if(o.cookie=d.join("; "),s=this.getCookie(e),i===s)return!0
BOOMR.warn("Saved cookie value doesn't match what we tried to set:\n"+i+"\n"+s)}else BOOMR.warn("Cookie too long: "+a.length+" "+a)
return!1},getSubCookies:function(e){var t,n,o,r,i=!1,a={}
if(!e)return null
if("string"!=typeof e)return BOOMR.debug("TypeError: cookie is not a string: "+typeof e),null
for(t=e.split("&"),n=0,o=t.length;o>n;n++)r=t[n].split("="),r[0]&&(r.push(""),a[decodeURIComponent(r[0])]=decodeURIComponent(r[1]),i=!0)
return i?a:null},removeCookie:function(e){return this.setCookie(e,{},-86400)},cleanupURL:function(e){return e?t.strip_query_string?e.replace(/\?.*/,"?qs-redacted"):e:""},hashQueryString:function(e,t){return e?(e.match(/^\/\//)&&(e=location.protocol+e),e.match(/^(https?|file):/)?(t&&(e=e.replace(/#.*/,"")),BOOMR.utils.MD5?e.replace(/\?([^#]*)/,function(e,t){return"?"+(t.length>10?BOOMR.utils.MD5(t):t)}):e):(BOOMR.error("Passed in URL is invalid: "+e),"")):e},pluginConfig:function(e,t,n,o){var r,i=0
if(!t||!t[n])return!1
for(r=0;r<o.length;r++)void 0!==t[n][o[r]]&&(e[o[r]]=t[n][o[r]],i++)
return i>0},addListener:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},pushVars:function(e,t,n){var o,r,i=0
for(o in t)if(t.hasOwnProperty(o))if("[object Array]"===Object.prototype.toString.call(t[o]))for(r=0;r<t[o].length;++r)i+=BOOMR.utils.pushVars(e,t[o][r],o+"["+r+"]")
else++i,e.push(encodeURIComponent(n?n+"["+o+"]":o)+"="+(void 0===t[o]||null===t[o]?"":encodeURIComponent(t[o])))
return i},postData:function(e){var n=document.createElement("iframe"),o=document.createElement("form"),r=document.createElement("input")
n.name="boomerang_post",n.style.display=o.style.display="none",o.method="POST",o.action=t.beacon_url,o.target=n.name,r.name="data",window.JSON?(o.enctype="text/plain",r.value=JSON.stringify(t.vars)):(o.enctype="application/x-www-form-urlencoded",r.value=e),document.body.appendChild(n),o.appendChild(r),document.body.appendChild(o),BOOMR.utils.addListener(n,"load",function(){document.body.removeChild(o),document.body.removeChild(n)}),o.submit()}},init:function(r){var i,a,s=["beacon_url","beacon_type","site_domain","user_ip","strip_query_string"]
for(BOOMR_check_doc_domain(),r||(r={}),i=0;i<s.length;i++)void 0!==r[s[i]]&&(t[s[i]]=r[s[i]])
void 0!==r.log&&(this.log=r.log),this.log||(this.log=function(){})
for(a in this.plugins)if(this.plugins.hasOwnProperty(a)){if(r[a]&&r[a].hasOwnProperty("enabled")&&r[a].enabled===!1){t.disabled_plugins[a]=1
continue}if(t.disabled_plugins[a]&&delete t.disabled_plugins[a],"function"==typeof this.plugins[a].init)try{this.plugins[a].init(r)}catch(d){BOOMR.addError(d,a+".init")}}return t.handlers_attached?this:(t.onloadfired||void 0!==r.autorun&&r.autorun===!1||(o.readyState&&"complete"===o.readyState?this.setImmediate(BOOMR.page_ready,null,null,BOOMR):e.onpagehide||null===e.onpagehide?n.utils.addListener(e,"pageshow",BOOMR.page_ready):n.utils.addListener(e,"load",BOOMR.page_ready)),n.utils.addListener(e,"DOMContentLoaded",function(){t.fireEvent("dom_loaded")}),function(){var r,i,a
for(r=function(){t.fireEvent("visibility_changed")},o.webkitVisibilityState?n.utils.addListener(o,"webkitvisibilitychange",r):o.msVisibilityState?n.utils.addListener(o,"msvisibilitychange",r):o.visibilityState&&n.utils.addListener(o,"visibilitychange",r),n.utils.addListener(o,"mouseup",t.xb_handler("click")),i=o.getElementsByTagName("form"),a=0;a<i.length;a++)n.utils.addListener(i[a],"submit",t.xb_handler("form_submit"))
e.onpagehide||null===e.onpagehide||n.utils.addListener(e,"unload",function(){BOOMR.window=e=null})}(),t.handlers_attached=!0,this)},page_ready:function(n){return n||(n=e.event),n||(n={name:"load"}),t.onloadfired?this:(t.fireEvent("page_ready",n),t.onloadfired=!0,this)},setImmediate:function(t,n,o,r){var i=function(){t.call(r||null,n,o||{}),i=null}
e.setImmediate?e.setImmediate(i):e.msSetImmediate?e.msSetImmediate(i):e.webkitSetImmediate?e.webkitSetImmediate(i):e.mozSetImmediate?e.mozSetImmediate(i):setTimeout(i,10)},subscribe:function(o,r,i,a){var s,d,l,u
if(o=o.toLowerCase(),!t.events.hasOwnProperty(o))return this
for(l=t.events[o],s=0;s<l.length;s++)if(d=l[s],d.fn===r&&d.cb_data===i&&d.scope===a)return this
return l.push({fn:r,cb_data:i||{},scope:a||null}),"page_ready"===o&&t.onloadfired&&this.setImmediate(r,null,i,a),"page_unload"===o&&(u=function(t){r&&r.call(a,t||e.event,i)},e.onpagehide||null===e.onpagehide?n.utils.addListener(e,"pagehide",u):n.utils.addListener(e,"unload",u),n.utils.addListener(e,"beforeunload",u)),this},addError:function(e,n){"string"!=typeof e&&(e+=""),void 0!==n&&(e="["+n+":"+(new Date).getTime()+"] "+e),t.errors[e]?t.errors[e]++:t.errors[e]=1},addVar:function(e,n){if("string"==typeof e)t.vars[e]=n
else if("object"==typeof e){var o,r=e
for(o in r)r.hasOwnProperty(o)&&(t.vars[o]=r[o])}return this},removeVar:function(e){var n,o
if(!arguments.length)return this
for(o=1===arguments.length&&"[object Array]"===Object.prototype.toString.apply(e)?e:arguments,n=0;n<o.length;n++)t.vars.hasOwnProperty(o[n])&&delete t.vars[o[n]]
return this},requestStart:function(e){var t=(new Date).getTime()
return BOOMR.plugins.RT.startTimer("xhr_"+e,t),{loaded:function(n){BOOMR.responseEnd(e,t,n)}}},responseEnd:function(e,n,o){BOOMR.plugins.RT.startTimer("xhr_"+e,n),t.fireEvent("xhr_load",{name:"xhr_"+e,data:o})},sendBeacon:function(){var n,r,i,a,s,d=[]
BOOMR.debug("Checking if we can send beacon")
for(n in this.plugins)if(this.plugins.hasOwnProperty(n)){if(t.disabled_plugins[n])continue
if(!this.plugins[n].is_complete())return BOOMR.debug("Plugin "+n+" is not complete, deferring beacon send"),!1}t.vars.v=BOOMR.version,t.vars.u=BOOMR.utils.cleanupURL(o.URL.replace(/#.*/,"")),e!==window&&(t.vars["if"]="")
for(n in t.errors)t.errors.hasOwnProperty(n)&&d.push(n+(t.errors[n]>1?" (*"+t.errors[n]+")":""))
return d.length>0&&(t.vars.errors=d.join("\n")),t.errors={},t.fireEvent("before_beacon",t.vars),t.beacon_url?(r=[],s=BOOMR.utils.pushVars(r,t.vars),this.setImmediate(t.fireEvent,"onbeacon",t.vars,t),s?(r=r.join("&"),"POST"===t.beacon_type?BOOMR.utils.postData(r):(i=t.beacon_url+(t.beacon_url.indexOf("?")>-1?"&":"?")+r,i.length>2e3&&"AUTO"===t.beacon_type?BOOMR.utils.postData(r):(BOOMR.debug("Sending url: "+i.replace(/&/g,"\n	")),a=new Image,a.src=i)),!0):this):(BOOMR.debug("No beacon_url, but would have sent: "+BOOMR.utils.objectToString(t.vars)),!0)}},delete BOOMR_start,"number"==typeof BOOMR_lstart?(n.t_lstart=BOOMR_lstart,delete BOOMR_lstart):"number"==typeof BOOMR.window.BOOMR_lstart&&(n.t_lstart=BOOMR.window.BOOMR_lstart),function(){var t
e.YAHOO&&e.YAHOO.widget&&e.YAHOO.widget.Logger?n.log=e.YAHOO.log:e.Y&&e.Y.log?n.log=e.Y.log:"object"==typeof console&&void 0!==console.log&&(n.log=function(e,t,n){console.log(n+": ["+t+"] "+e)}),t=function(e){return function(t,n){return this.log(t,e,"boomerang"+(n?"."+n:"")),this}},n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}(),function(){var e
for(e in n)n.hasOwnProperty(e)&&(BOOMR[e]=n[e])}(),BOOMR.plugins=BOOMR.plugins||{},a("onBoomerangLoaded",{BOOMR:BOOMR}))}(window)
!function(e){BOOMR=BOOMR||{},BOOMR.plugins=BOOMR.plugins||{}
var n={config:null,perf_t:null,previous_time:null,click:function(e){var t=e.target||e.srcElement
Object.keys(n.config).forEach(function(e){var i=RegExp(e)
t.className.match(i)&&n.ping(n.config[e]),n.config[e].check_parent&&t.parentNode.className.match(i)&&n.ping(n.config[e])})},ping:function(e){var t=n.perf_t.loadEventEnd-n.perf_t.navigationStart,i=(new Date).getTime()-n.perf_t.loadEventEnd
!e.include_page_load&&n.previous_time&&(i=(new Date).getTime()-n.previous_time)
var c={}
c.beacons=[],c.beacons.push(e.stat+":"+i+"|ms"),e.include_page_load&&c.beacons.push(e.stat.replace(/\.(\w+)$/,".page_load")+":"+t+"|ms"),n.previous_time=(new Date).getTime(),BOOMR.addVar({json:JSON.stringify(c)}),BOOMR.sendBeacon()}}
BOOMR.plugins.Click_A8C={init:function(t){if(!e.performance)return this
n.config=t.a8c_clicks,n.perf_t=e.performance.timing
for(var i=!1,c=[],a=Object.keys(t.a8c_clicks),r=0;r<a.length;r++){var o=e.document.getElementsByClassName(a[r]),s=o.length
if(0===s){i=!0
break}for(;s--;)c.push(o[s]),o[s].addEventListener("click",n.click,!1)}if(i){for(var r=0;r<c.length;r++)c[r].removeEventListener("click",n.click,!1)
e.document.addEventListener("click",n.click,!0)}return this},is_complete:function(){return!0}}}(window)
