(function(b){function p(){b.removeEventListener("load",p,!1);q?c.expire&&t&&b.localStorage.setItem("addToHome",Date.now()+6E4*c.expire):b.localStorage.setItem("addToHome",Date.now());if(x||y&&t&&!u&&!z&&q){var d="",r=f.platform.split(" ")[0],k=f.language.replace("-","_");a=document.createElement("div");a.id="addToHomeScreen";a.style.cssText+="left:-9999px;-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);position:"+(5>e?"absolute": "fixed");c.message in s&&(k=c.message,c.message="");""===c.message&&(c.message=k in s?s[k]:s.en_us);c.touchIcon&&(d=A?document.querySelector('head link[rel^=apple-touch-icon][sizes="114x114"],head link[rel^=apple-touch-icon][sizes="144x144"],head link[rel^=apple-touch-icon]'):document.querySelector('head link[rel^=apple-touch-icon][sizes="57x57"],head link[rel^=apple-touch-icon]'))&&(d='');a.className=(7<=e?"addToHomeIOS7 ": "")+(h?"addToHomeIpad":"addToHomeIphone")+(d?" addToHomeWide":"");a.innerHTML=d+c.message.replace("%DEVICE",r).replace("%ICON",4.2<=e?'':'+')+(c.arrow?'":"")+(c.closeButton?'\u00d7':"");document.body.appendChild(a);c.closeButton&&a.addEventListener("click",B,!1);!h&&6<=e&&window.addEventListener("orientationchange", C,!1);setTimeout(F,c.startDelay)}}function F(){var d;d=208;if(h)switch(5>e?(g=b.scrollY,l=b.scrollX):6>e?d=160:7<=e&&(d=143),a.style.top=g+c.bottomOffset+"px",a.style.left=Math.max(l+d-Math.round(a.offsetWidth/2),9)+"px",c.animationIn){case "drop":d="0.6s";a.style.webkitTransform="translate3d(0,"+-(b.scrollY+c.bottomOffset+a.offsetHeight)+"px,0)";break;case "bubble":d="0.6s";a.style.opacity="0";a.style.webkitTransform="translate3d(0,"+(g+50)+"px,0)";break;default:d="1s",a.style.opacity="0"}else switch(g= b.innerHeight+b.scrollY,5>e?(l=Math.round((b.innerWidth-a.offsetWidth)/2)+b.scrollX,a.style.left=l+"px",a.style.top=g-a.offsetHeight-c.bottomOffset+"px"):(a.style.left="50%",a.style.marginLeft=-Math.round(a.offsetWidth/2)-(b.orientation%180&&6<=e&&7>e?40:0)+"px",a.style.bottom=c.bottomOffset+"px"),c.animationIn){case "drop":d="1s";a.style.webkitTransform="translate3d(0,"+-(g+c.bottomOffset)+"px,0)";break;case "bubble":d="0.6s";a.style.webkitTransform="translate3d(0,"+(a.offsetHeight+c.bottomOffset+ 50)+"px,0)";break;default:d="1s",a.style.opacity="0"}a.offsetHeight;a.style.webkitTransitionDuration=d;a.style.opacity="1";a.style.webkitTransform="translate3d(0,0,0)";a.addEventListener("webkitTransitionEnd",v,!1);n=setTimeout(w,c.lifespan)}function w(){clearInterval(D);clearTimeout(n);n=null;if(a){var d=0,r=0,k="1",f="0";c.closeButton&&a.removeEventListener("click",B,!1);!h&&6<=e&&window.removeEventListener("orientationchange",C,!1);5>e&&(d=h?b.scrollY-g:b.scrollY+b.innerHeight-g,r=h?b.scrollX- l:b.scrollX+Math.round((b.innerWidth-a.offsetWidth)/2)-l);a.style.webkitTransitionProperty="-webkit-transform,opacity";switch(c.animationOut){case "drop":h?(f="0.4s",k="0",d+=50):(f="0.6s",d+=a.offsetHeight+c.bottomOffset+50);break;case "bubble":h?(f="0.8s",d-=a.offsetHeight+c.bottomOffset+50):(f="0.4s",k="0",d-=50);break;default:f="0.8s",k="0"}a.addEventListener("webkitTransitionEnd",v,!1);a.style.opacity=k;a.style.webkitTransitionDuration=f;a.style.webkitTransform="translate3d("+r+"px,"+d+"px,0)"}} function B(){b.sessionStorage.setItem("addToHomeSession","1");u=!0;w()}function v(){a.removeEventListener("webkitTransitionEnd",v,!1);a.style.webkitTransitionProperty="-webkit-transform";a.style.webkitTransitionDuration="0.2s";n?5>e&&n&&(D=setInterval(G,c.iterations)):(a.parentNode.removeChild(a),a=null)}function G(){var d=new WebKitCSSMatrix(b.getComputedStyle(a,null).webkitTransform),c=h?b.scrollY-g:b.scrollY+b.innerHeight-g,e=h?b.scrollX-l:b.scrollX+Math.round((b.innerWidth-a.offsetWidth)/2)-l; if(c!=d.m42||e!=d.m41)a.style.webkitTransform="translate3d("+e+"px,"+c+"px,0)"}function C(){a.style.marginLeft=-Math.round(a.offsetWidth/2)-(b.orientation%180&&6<=e&&7>e?40:0)+"px"}var f=b.navigator,E="platform"in f&&/iphone|ipod|ipad/gi.test(f.platform),h,A,y,z,e,l=0,g=0,m=0,t,u,q,a,x,D,n,c={autostart:!0,returningVisitor:!1,animationIn:"drop",animationOut:"fade",startDelay:2E3,lifespan:15E3,bottomOffset:14,expire:0,message:"",touchIcon:!1,arrow:!0,hookOnLoad:!1,closeButton:!0,iterations:100},s={en_us:"Install this web app on your %DEVICE: tap %ICON and then Add to Home Screen."}; (function(){if(E){var a=Date.now(),g;if(b.appConfig)for(g in b.appConfig)c[g]=b.appConfig[g];c.autostart||(c.hookOnLoad=!1);h=/ipad/gi.test(f.platform);A=b.devicePixelRatio&&1a:!0;m||(m=a);t=q&& m<=a;c.hookOnLoad?b.addEventListener("load",p,!1):!c.hookOnLoad&&c.autostart&&p()}})();return{show:function(b){E&&!a&&(x=b,p())},close:w,reset:function(){b.localStorage.removeItem("addToHome");b.sessionStorage.removeItem("addToHomeSession")}}})(window);