var GravityInsights=function(b){function h(a,d){var c,f=d||"beacon";c=document.getElementsByTagName("title")[0]===void 0?"":encodeURIComponent(document.getElementsByTagName("title")[0].innerHTML);var g=new Date,g=g.getMilliseconds()+"-"+g.getSeconds();c=["cbust="+g,"site_guid="+b.site_guid,"action="+f,"user_guid="+a,"referrer="+e(document.referrer),"browser_useragent="+e(navigator.userAgent),"OS="+e(j()),"href="+e(location.href),"url="+k(),b.thread_id!==void 0?"thread_id="+b.thread_id:"",b.post_id!== void 0?"post_id="+b.post_id:"",b.forum_id!==void 0?"forum_id="+b.forum_id:"",b.user_id!==void 0?"user_id="+b.user_id:"",b.username!==void 0?"user_name="+e(b.username):"",b.post_title!==void 0?"post_title="+e(b.post_title):"",b.thread_title!==void 0?"thread_title="+e(b.thread_title):"",b.forum_title!==void 0?"forum_title="+e(b.forum_title):"",c!==void 0?"article_title="+c:"",b.external_user_id!==void 0?"external_user_id="+b.external_user_id:"",b.article_id!==void 0?"article_id="+b.article_id:"",b.type!== void 0?"type="+b.type:"",b.board!==void 0?"board="+encodeURIComponent(b.board):""].join("&");f=document.createElement("script");f.src=i+"/log?"+c;f.type="text/javascript";c=document.getElementsByTagName("head")[0]||document.documentElement;c.insertBefore(f,c.firstChild)}function e(a){return window.encodeURIComponent?encodeURIComponent(a):escape(a)}function j(){var a="Unknown OS";navigator.appVersion.indexOf("Win")!==-1&&(a="Windows");navigator.appVersion.indexOf("Mac")!==-1&&(a="MacOS");navigator.appVersion.indexOf("X11")!== -1&&(a="UNIX");navigator.appVersion.indexOf("Linux")!==-1&&(a="Linux");return a}function k(){var a=document.getElementsByTagName("link"),b=a.length,c="";for(x=0;x<b;x++)if((c=a[x].getAttribute("rel"))&&c.indexOf("canonical")===0)return encodeURIComponent(a[x].getAttribute("href"));else if(x===b)break;return encodeURIComponent(location.href)}var i="http://rma-api.gravity.com/v1/beacons";(function(){var a;a=document.cookie;var d=a.indexOf("grvinsights");if(d===-1)a=" ";else{var c=a.indexOf(";",d);if(c=== -1)c=a.length;a=unescape(a.substring(d+11+1,c))}if(a===" "||a==="")d="?u="+b.user_id+"&sg="+b.site_guid,a=document.createElement("script"),a.src=i+"/initialize"+d,a.type="text/javascript",d=document.getElementsByTagName("head")[0]||document.documentElement,d.insertBefore(a,d.firstChild),a=!1;a!==void 0&&a&&h(a,"beacon")})();return{cc:function(a,b){if(a!==""){var c=new Date;c.setTime(c.getTime()+432E8);c="; expires="+c.toGMTString();document.cookie=a+"="+b+c+"; path=/";h(b,"beacon")}}}}(gravityInsightsParams);