window._roost||(window._roost=[]),_roost.init||!function(e){function s(e){if(!e||!e.origin)return;if(i.indexOf(e.origin)==-1)return;var n=JSON.parse(e.data);t.enabled=n.enabled,t.tags=n.tags,t.alias=n.alias;for(var s=0;s<_roost.length;s++)r.push(_roost[s]);_roost=r,_roost._o=t;var o=t.onload;o&&typeof o=="function"&&o({promptable:_roost.promptable()});var u;t.appkey!="DEMO"&&window&&typeof window.safari!="undefined"&&(u=T),u&&u(!0)}function o(){t.appkey="6aa094322b7e413789eba8400f0f643f",a();var e,n;t.appkey!="DEMO"&&window&&typeof window.safari!="undefined"&&(e=T,n=x),e&&(r.prompt=function(){e(!1)}),n&&(t.rdt=n()),t.rdt||(t.rdt=E("_rdt")),t.rid=E("_rid"),(!t.rid||t.rid=="")&&v()&&(t.rid=l(),w("_rid",t.rid)),d("host");var i=t.host+"/api/pageview?rdt="+encodeURIComponent(t.rdt)+"&rid="+encodeURIComponent(t.rid)+"&appKey="+encodeURIComponent(t.appkey)+"&url="+encodeURIComponent(document.URL)+"&referrer="+encodeURIComponent(document.referrer);u(i)}function u(e){var t=document.createElement("iframe");t.style.display="none",t.src=e,document.body.appendChild(t)}function a(){typeof twttr!="undefined"&&typeof twttr.events!="undefined"&&typeof twttr.events.bind!="undefined"&&twttr.events.bind("tweet",function(e){r.push(["social_action","TWEET"])}),typeof FB!="undefined"&&typeof FB.Event!="undefined"&&typeof FB.Event.subscribe!="undefined"&&(FB.Event.subscribe("edge.create",function(e){r.push(["social_action","FB_LIKE"])}),FB.Event.subscribe("edge.remove",function(e){r.push(["social_action","FB_UNLIKE"])}),FB.Event.subscribe("comment.create",function(e){r.push(["social_action","FB_COMMENT"])}),FB.Event.subscribe("comment.remove",function(e){r.push(["social_action","FB_UNCOMMENT"])}),FB.Event.subscribe("message.send",function(e){r.push(["social_action","FB_SHARE"])}))}function f(){return location.protocol=="https:"}function l(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function d(e){var t=[];for(var n=0;n<_roost.length;n++)_roost[n].length&&_roost[n][0]==e?r.push(_roost[n]):t.push(_roost[n]);_roost=t}function v(){var e="cc"+Math.random(),t=!1;return w(e,"true"),E(e)&&(t=!0),w(e,"",-1),t}function m(n){g({url:t.host+"/Ping",vars:{appKey:t.appkey,referrer:encodeURIComponent((document.referrer+"").split("'").join("%27")),page:encodeURIComponent((e.location+"").split("'").join("%27")),action:"log",details:n?JSON.stringify(n):"",rdt:E("_rdt")}})}function g(e){e=e||{},e.url=e.url||null,e.vars=e.vars||{},e.error=e.error||function(){},e.success=e.success||function(){};var t=[];for(var n in e.vars)t.push(n+"="+encodeURIComponent(e.vars[n]));var r=t.join("&");if(e.url){var i=e.url+"?"+r,s=new Image;e.error&&(s.onerror=e.error),e.success&&(s.onload=e.success),s.src=i}}function y(e){t[e[0]]=typeof e[1]=="undefined"?t[e[0]]:e[1]}function b(e){return function(n){if(!t.appkey)return!1;e(n)}}function w(e,t,n,r){n||(n=0);var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s=escape(t)+(n==null||n==0?"":"; expires="+i.toGMTString())+"; "+(r?" domain=."+r+"; ":"")+" path=/";document.cookie=e+"="+s}function E(e){if(document.cookie.length>0){c_start=document.cookie.indexOf(e+"=");if(c_start!=-1)return c_start=c_start+e.length+1,c_end=document.cookie.indexOf(";",c_start),c_end==-1&&(c_end=document.cookie.length),unescape(document.cookie.substring(c_start,c_end))}return""}function x(){var e="web.web.me.roost.auto611748cea0c3486c9dfe9fab77b386f4",t=window.safari.pushNotification.permission(e);if(t.permission=="granted")return t.deviceToken}function T(e){typeof e=="undefined"&&(e=!1);var t="web.web.me.roost.auto611748cea0c3486c9dfe9fab77b386f4",n=!1,r=location.host,i=location.host.split(".").reverse();i.length>1&&r.indexOf("blogger.com")==-1&&(r=i[1]+"."+i[0]),r=r.split(":")[0];var s=function(){n=!0;var e=_roost._getTags(),r=_roost._getAlias();window.safari.pushNotification.requestPermission("https://go.goroost.com/register/native/safari/6aa094322b7e413789eba8400f0f643f",t,{website:encodeURIComponent(location.href),data:"{'tags':'"+e+"','alias':'"+r+"'}"},S)},o=window.safari.pushNotification.permission(t);if(o.permission=="default"){var u=_roost._isAutoPrompt(),a=_roost._promptMinVisits();(!e||u||a)&&s()}else o.permission=="granted"?(_roost._fireRoostCallback({firstTime:!1,deviceToken:o.deviceToken,registered:!0,enabled:_roost._isEnabled(),tags:_roost._getTags(),alias:_roost._getAlias()}),o.deviceToken&&_roost.setCookie("_rdt",o.deviceToken,1825,r)):_roost._fireRoostCallback({firstTime:!1,deviceToken:o.deviceToken,registered:!1,enabled:_roost._isEnabled(),tags:_roost._getTags(),alias:_roost._getAlias()})}function N(){document.readyState==="interactive"||document.readyState==="complete"?o():document.addEventListener?window.addEventListener("load",o):document.attachEvent("onload",o)}var t={autoprompt:!0,appkey:null,host:(f()?"https://":"http://")+"go.goroost.com",rdt:"none",rid:null,tags:null,alias:null,enabled:!1},n=[],r={init:!0,push:function(){for(var t=0;t1&&e.indexOf("blogger.com")==-1&&(e=t[1]+"."+t[0]),e=e.split(":")[0],e},_cookiesEnabled:function(){var e="cc"+Math.random(),t=!1;return _roost.setCookie(e,"true"),_roost.getCookie(e)&&(t=!0),_roost.setCookie(e,"",-1),t},_promptMinVisits:function(){if(t.minvisits>-1){if(!_roost._cookiesEnabled())return!1;var e="_r_visits",n=_roost.getCookie(e);return n?n++:n=1,_roost.setCookie(e,n,30,_roost._domain()),t.minvisits<=n}return!1},_enqueue:function(e){n.push(e),n.length==1&&r._processQueue()},_processQueue:function(){if(n.length){var e=n[0];e()}},_workFinished:function(){n.length&&(n.shift(),r._processQueue())}};window&&window.addEventListener&&window.addEventListener("message",s,!1);var i=["http://localhost:8081","http://go.goroost.com","https://go.goroost.com","http://cdn.goroost.com","https://cdn.goroost.com"],c=b(function(e){var n=[];for(var i=1;i-1&&t.tags.splice(a,1)}t.tags=t.tags.concat(n)}r._enqueue(function(){t.rdt?g({url:t.host+"/Ping",vars:{action:s,appKey:t.appkey,tags:JSON.stringify(n),rdt:t.rdt},success:r._workFinished}):r._workFinished()})}),h=b(function(e){var n=null;e&&e.length==2&&(n=e[1]);var i=e[0];i=="alias"?t.alias=n:i=="alias_clear"&&(t.alias=null),r._enqueue(function(){t.rdt?g({url:t.host+"/Ping",vars:{action:e[0],appKey:t.appkey,alias:n,rdt:t.rdt},success:r._workFinished}):r._workFinished()})}),p={appkey:function(){},onload:y,onresult:y,host:y,minvisits:y,tags:c,segments:c,segments_add:c,segments_remove:c,segments_clear:c,alias:h,alias_clear:h,autoprompt:y,prompt:function(){_roost.prompt&&_roost.prompt()},log:function(e){m(e[1])},social_action:b(function(e){g({url:t.host+"/Ping",vars:{action:"socialAction",appKey:t.appkey,useraction:e[1],rdt:E("_rdt")}})}),enable:b(function(e){r._enqueue(function(){g({url:t.host+"/Ping",vars:{action:"enable",appKey:t.appkey,enable:e[1],rdt:t.rdt},success:r._workFinished})})})},S=function(e){t.rdt=e.deviceToken,_roost._fireRoostCallback({firstTime:!0,deviceToken:e.deviceToken,registered:e.permission!="denied",enabled:!0,tags:_roost._getTags(),alias:_roost._getAlias()}),e.permission=="granted"&&_roost.setCookie("_rdt",e.deviceToken,1825,domain)};N()}(window)