var _RT=null;var RT;(function(){var self=this;var hr=document.location.href;var rtm=0;var iframe_style='';_RT=makeClass();_RT.prototype.init=function(qs){var h=location.hash.replace('#','');this.root='https://app.rtrt.me/PBP-2019?oe=1&purl='+encodeURIComponent(document.location.href)+'&rf='+encodeURIComponent(document.referrer);if(window.screen){var w=window.screen.width;var he=window.screen.height;}else{var w=window.outerWidth;var he=window.outerHeight;} var im='';if(!h)h='/tracker';var source=this.root+'&loadpage='+encodeURIComponent(h)+'&event=PBP-2019'+im;var iheight="100%";var iwidth="100%";this.box=document.getElementById("rt-app");this.box.innerHTML='';var I=document.createElement("iframe");I.setAttribute("style",iframe_style);I.setAttribute("src",source);I.setAttribute("name","rtframe");I.setAttribute("allowfullscreen",true);I.setAttribute("id","rtframe");I.setAttribute("height",iheight);I.setAttribute("width",iwidth);I.setAttribute("onmousewheel",false);I.setAttribute("frameBorder","0");I.setAttribute("allow","camera;");I.setAttribute("allowtransparency","true");this.box.appendChild(I);this.ifrm=document.getElementById("rtframe");setTimeout(function(){fixwindow();},1000);if(typeof window.orientation!=="undefined"){window.addEventListener("orientationchange",function(){var torientation=(window.orientation==90||window.orientation==-90)?'landscape':'portrait';var y=(RT.ifrm.contentWindow||RT.ifrm.contentDocument);y.postMessage("orient="+torientation,RT.root);});} window.addEventListener('resize',function(){if(self.rstimeout)clearTimeout(self.rstimeout);self.rstimeout=setTimeout(fixwindow,200);});fixwindow();this.task=function(e){if(e.data){if(typeof e.data=='string'){switch(true){case(e.data.indexOf('getlocalstore')==0):var data={task:'getlocalstore',data:localStorage.getObject('stash')};document.getElementById('rtframe').contentWindow.postMessage(data,'*');break;case(e.data.indexOf('open')==0):window.open(e.data.replace(/^open=/,''),'_blank');break;case(e.data.indexOf('redir')==0):window.location.href=e.data.replace(/^redir=/,'');break;case(e.data.indexOf('resize')==0):var evt=window.document.createEvent('UIEvents');evt.initUIEvent('resize',true,false,window,0);window.dispatchEvent(evt);break;case(e.data.indexOf('reload')==0):window.location.reload(true);break;case(e.data.indexOf('scrollTo')==0):var top=parseInt(e.data.replace(/^scrollTo=/,''),10);var offset=getOffset(RT.box);if(offset.top)top+=offset.top;if(top<0)top=0;window.scrollTo(1,top);break;case(e.data.indexOf('height')==0):var height=parseInt(e.data.replace(/^height=/,''),10);RT.ifrm.height=height+'px';break;case(e.data.indexOf('width')==0):var width=e.data.replace(/^width=/,'');if(width=='auto')RT.ifrm.width='100%';else RT.ifrm.width=parseInt(width,10)+'px';document.getElementsByTagName("html")[0].style.width=parseInt(width,10)+'px';break;case(e.data.indexOf('setRTCookie')==0):var cookie=e.data.replace(/^setRTCookie=/,'');var c_value=escape(cookie)+';' document.cookie="rtcookie="+c_value;break;case(e.data.indexOf('twttr')>0):break;case(e.data.indexOf('hash')==0):var h=e.data.replace(/^hash=/,'');location.hash=h.replace(/^#/,'');break;case(e.data.indexOf('printframe')==0):window.open(RT.ifrm.src+'&print=1','_blank');break;default:break;}}else if(typeof e.data=='object'){switch(e.data.task){case'setObject':try{var obj=localStorage.getObject('stash');}catch(e){var obj={};} var key=e.data.data.key;var value=JSON.parse(e.data.data.value);obj[key]=value;localStorage.setObject('stash',obj);break;case'setVar':try{var obj=localStorage.getObject('stash');}catch(e){var obj={};} var key=e.data.data.key;var value=e.data.data.value;obj[key]=value;localStorage.setObject('stash',obj);break;}}}};if(window['postMessage']){if(window['addEventListener']){window.addEventListener("message",this.task,false);}else{window.attachEvent("onmessage",this.task,false);}}else{this.fbi=setInterval(function(){var hash=document.location.hash,re=/^#?\d+&/;if(hash!==RT.lasthash&&re.test(hash)){RT.lasthash=hash;RT.task({data:hash.replace(re,'')});}},100);}};function makeClass(){return function(args){if(this instanceof arguments.callee){if(typeof this.init=="function") if(args) this.init.apply(this,args.callee?args:arguments);else this.init();}else return new arguments.callee(arguments);};};function getCookie(c_name){var i,x,y,ARRcookies=document.cookie.split(";");for(i=0;i