function require(c,e){var b=document.getElementsByTagName("script")[0],d=document.createElement("script");var a=false;d.onreadystatechange=function(){if(a){return}if(d.readyState==="loaded"||d.readyState==="complete"){a=true;d.onreadystatechange=null;e()}};d.onload=function(){if(a){return}a=true;e()};d.src=c;b.parentNode.insertBefore(d,b)}var config={};config.server="";config.isLocal=false;config.disableTwitter=true;config.disableGA=false;var ua=navigator.userAgent.toLowerCase();config.isAndroid=ua.indexOf("android")>-1;config.isWindowsPhone=ua.indexOf("windows phone")>-1;if(document.location.protocol=="app:"||document.location.protocol=="file:"||document.location.pathname.indexOf("www/")>=0){config.server="http://pesislive.fi";config.isLocal=true}config.useToolbar=config.isLocal;if(config.isLocal){if(navigator.userAgent.search("IEMobile/9.0")!=-1){config.disableTwitter=true;config.disableGA=true;config.useToolbar=false}}$(document).on("mobileinit",function(){if(config.server!=""){$.support.cors=true;$.mobile.allowCrossDomainPages=true;$.mobile.defaultPageTransition="none"}});if(config.isLocal){require("static/ga.js",function(){console.log("ga loaded");ga_storage._setAccount("UA-39330701-1");ga_storage._setDomain("pesislive.fi");ga_storage._trackEvent("AppEvent","Start","value");ga_storage._setCustomVar(1,"appType","app",1)})}if(!config.isLocal){if(document.domain=="pesislive.fi"){window["ga-disable-UA-39330701-1"]=false}else{if(document.domain=="www.pesislive.fi"){window["ga-disable-UA-39330701-1"]=false}else{window["ga-disable-UA-39330701-1"]=true}}}$(document).delegate("[data-role=page],[data-role=dialog]","pageshow",function(b,c){try{if($.mobile.activePage.attr("id")){if(config.isLocal&&!config.disableGA){ga_storage._trackPageview($.mobile.activePage.attr("id"))}else{_gaq.push(["_trackPageview",$.mobile.activePage.attr("id")])}}else{if(!config.isLocal){_gaq.push(["_trackPageview"])}}}catch(a){}});$(document).ready(function(){if(!config.isLocal){$(".not-for-web").remove()}else{$(".not-for-local").remove();$(".ad-placeholder").css("margin",0);$(".show-for-local").css("visibility","visible")}if(!config.useToolbar){$('[data-role="footer"]').remove()}else{$(".header-navbar").remove();$("#score-map-button").remove()}if(config.disableTwitter){$('#gamePage a[href$="#twitterPanel"]').remove();$("#gamepage-navbar-twitter").remove()}else{$(".nav-map-button").remove();$("#gamepage-navbar-map").remove()}});$(document).one("pageshow",function(c){var e=$(c.target);var d=e.find(".ad-placeholder");var b=$("#adContainer").height();$(".ad-placeholder").css("height",b);var a=d.offset();if(a.top==0){a.top=112}$("#adContainer").css("margin-left",-$("#adContainer").width()/2);$("#adContainer").css("top",a.top);$("#adContainer").css("left","50%")});$(document).one("pagehide","#mainPage",function(){$("#mainPage .app-banner").remove()});