window._roost||(window._roost=[]),_roost.init||!function(e){function i(){t.appkey="c072e8af58b447bc83060053e3696812",s();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=b("_rdt")),t.rid=b("_rid"),(!t.rid||t.rid=="")&&h()&&(t.rid=u(),y("_rid",t.rid)),c("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),o=new easyXDM.Socket({remote:i,props:{style:{height:0,width:0}},onMessage:function(n,i){if(i.indexOf("goroost.com")!=-1||i.indexOf("roost.me")!=-1||i.indexOf(":8080")!=-1||i.indexOf(":8081")!=-1||i.indexOf("localtunnel.com")!=-1){var s=JSON.parse(n);t.enabled=s.enabled,t.tags=s.tags,t.alias=s.alias;for(var o=0;o<_roost.length;o++)r.push(_roost[o]);_roost=r,_roost._o=t;var u=t.onload;u&&typeof u=="function"&&u({promptable:_roost.promptable()}),e&&e(!0)}}})}function s(){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 o(){return location.protocol=="https:"}function u(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function c(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 h(){var e="cc"+Math.random(),t=!1;return y(e,"true"),b(e)&&(t=!0),y(e,"",-1),t}function p(n){v({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:b("_rdt")}})}function d(e){E(document.getElementById("roost_modal"),e),document.getElementById("roost_overlay").style.display="block",document.getElementById("roost_modal").style.display="block",navigator.userAgent.indexOf("Nexus")!=-1&&window.scrollTo(0,0)}function v(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 m(e){t[e[0]]=typeof e[1]=="undefined"?t[e[0]]:e[1]}function g(e){return function(n){if(!t.appkey)return!1;e(n)}}function y(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 b(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 E(e,t){var n=new easyXDM.Socket({remote:t,props:{style:{height:0,width:0}},container:e,onMessage:function(e,t){if(t.indexOf("goroost.com")!=-1||t.indexOf("roost.me")!=-1||t.indexOf(":8080")!=-1||t.indexOf("localtunnel.com")!=-1){var r=JSON.parse(e);if(r.action=="broadcast")for(var i=0;i1&&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/c072e8af58b447bc83060053e3696812",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"?i():document.addEventListener?window.addEventListener("load",i):document.attachEvent("onload",i)}var t={autoprompt:!0,appkey:null,host:(o()?"https://":"http://")+"go.goroost.com",rdt:"none",rid:null,tags:null,alias:null,enabled:!1},n=[];window.roost_queue=n;var 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())},showModal:d},a=g(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?v({url:t.host+"/Ping",vars:{action:s,appKey:t.appkey,tags:JSON.stringify(n),rdt:t.rdt},success:r._workFinished}):r._workFinished()})}),f=g(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?v({url:t.host+"/Ping",vars:{action:e[0],appKey:t.appkey,alias:n,rdt:t.rdt},success:r._workFinished}):r._workFinished()})}),l={appkey:function(){},onload:m,onresult:m,host:m,minvisits:m,tags:a,segments:a,segments_add:a,segments_remove:a,segments_clear:a,alias:f,alias_clear:f,autoprompt:m,prompt:function(){_roost.prompt&&_roost.prompt()},log:function(e){p(e[1])},social_action:g(function(e){v({url:t.host+"/Ping",vars:{action:"socialAction",appKey:t.appkey,useraction:e[1],rdt:b("_rdt")}})}),enable:g(function(e){r._enqueue(function(){v({url:t.host+"/Ping",vars:{action:"enable",appKey:t.appkey,enable:e[1],rdt:t.rdt},success:r._workFinished})})})},w=[],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)};!function(e,t,n){var r,i=e.getElementsByTagName(t)[0];e.getElementById(n)?N():(r=e.createElement(t),r.id=n,r.onload=function(){N()},r.src="//cdn.goroost.com/cdn/easyXDM-2.4.18.25.min.js",i.parentNode.insertBefore(r,i))}(document,"script","roost-easyxdm-js")}(window)