forked from sent/waves
94 lines
113 KiB
HTML
94 lines
113 KiB
HTML
<!DOCTYPE html>
|
|
<html manifest="cache.manifest">
|
|
<head>
|
|
<title>Bouncy Flappy</title>
|
|
<meta name="description" content="Flappy Bird is back in Bouncy Flappy! Tap the screen to make Flappy jump from wall to wall, and avoid the deadly pipes on the wall for as long as possible! Sounds easy enough, right? Give it a try, and see how well you stack up against your friends.">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-title" content="Bouncy Flappy">
|
|
<meta name="viewport" content="width=device-width,target-densitydpi=medium-dpi,initial-scale=1,user-scalable=no,maximum-scale=1,minimum-scale=1,minimal-ui">
|
|
|
|
<meta name="kik-unsupported" content="android-2.2">
|
|
<link rel="kik-icon" href="/imgs/kik_icon.png" />
|
|
<link rel="terms" href="https://gamemix.com/tos/" />
|
|
<link rel="privacy" href="https://gamemix.com/crosspromotion/privacy/" />
|
|
|
|
<script src="http://code.jquery.com/jquery-1.2.2.min.js"></script>
|
|
<script src="https://code.jquery.com/jquery-1.2.2.min.js"></script>
|
|
<meta property="og:title" content="Bouncy Flappy" />
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:site_name" content="Bouncy Flappy"/>
|
|
<meta property="og:image" content="https://www.bouncyflappy.com/imgs/favicon-200.png" />
|
|
<meta property="og:description" content="Flappy Bird is back in Bouncy Flappy! Tap the screen to make Flappy jump from wall to wall, and avoid the deadly pipes on the wall for as long as possible! Sounds easy enough, right? Give it a try, and see how well you stack up against your friends." />
|
|
<meta property="og:url" content="https://www.bouncyflappy.com/" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="style/css.css">
|
|
|
|
<link rel="apple-touch-icon" href="imgs/favicon-105.png" sizes="105x105" />
|
|
<link rel="icon" type="image/png" href="imgs/favicon.png" />
|
|
<link rel="shortcut icon" type="image/png" href="imgs/favicon.png" />
|
|
|
|
<link rel="canonical" href="https://www.bouncyflappy.com/">
|
|
|
|
<script>
|
|
/**
|
|
* Kik Cards v1.0.12
|
|
* Copyright (c) 2014 Kik Interactive, http://kik.com
|
|
* All rights reserved
|
|
* http://dev.kik.com/terms.html
|
|
*/
|
|
(function(b){var a={};a.enabled=false;a.version="1.0.12";a._={};b.kik=b.cards=a})(window);(function(){if(!Object.keys){Object.keys=function(c){var b=[];for(var a in c){b.push(a)}return b}}if(!Array.isArray){Array.isArray=function(a){return Object.prototype.toString.call(a)=="[object Array]"}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,d){for(var b=d||0,a=this.length;b<a;b++){if((b in this)&&(this[b]===c)){return b}}return -1}}if(!Array.prototype.forEach){Array.prototype.forEach=function(d,b){for(var c=0,a=this.length;c<a;c++){if(c in this){d.call(b,this[c],c,this)}}}}if(!Array.prototype.map){Array.prototype.map=function(e,b){var a=this.length,c=new Array(a);for(var d=0;d<a;d++){if(d in this){c[d]=e.call(b,this[d],d,this)}}return c}}if(!Array.prototype.filter){Array.prototype.filter=function(e,c){var b=[];for(var f,d=0,a=this.length;d<a;d++){f=this[d];if((d in this)&&e.call(c,f,d,this)){b.push(f)}}return b}}if(!Array.prototype.reduce){Array.prototype.reduce=function(c,d){var b=0,a=this.length;if(typeof d=="undefined"){d=this[0];b=1}for(;b<a;b++){if(b in this){d=c(d,this[b],b,this)}}return d}}if(!String.prototype.trim){String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return String(this).replace(a,"")}}()}if(!Function.prototype.bind){Function.prototype.bind=function(a){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var e=Array.prototype.slice.call(arguments,1),d=this,b=function(){},c=function(){return d.apply(this instanceof b&&a?this:a,e.concat(Array.prototype.slice.call(arguments)))};b.prototype=this.prototype;c.prototype=new b();return c}}})();if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(s){var B="classList",w="prototype",p=(s.HTMLElement||s.Element)[w],A=Object,r=String[w].trim||function(){return this.replace(/^\s+|\s+$/g,"")},z=Array[w].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++){if(b in this&&this[b]===a){return b}}return -1},o=function(b,a){this.name=b;this.code=DOMException[b];this.message=a},v=function(a,b){if(b===""){throw new o("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(b)){throw new o("INVALID_CHARACTER_ERR","String contains an invalid character")}return z.call(a,b)},y=function(a){var b=r.call(a.className),c=b?b.split(/\s+/):[],d=0,e=c.length;for(;d<e;d++){this.push(c[d])}this._updateClassName=function(){a.className=this.toString()}},x=y[w]=[],t=function(){return new y(this)};o[w]=Error[w];x.item=function(a){return this[a]||null};x.contains=function(a){a+="";return v(this,a)!==-1};x.add=function(a){a+="";if(v(this,a)===-1){this.push(a);this._updateClassName()}};x.remove=function(a){a+="";var b=v(this,a);if(b!==-1){this.splice(b,1);this._updateClassName()}};x.toggle=function(a){a+="";if(v(this,a)===-1){this.add(a)}else{this.remove(a)}};x.toString=function(){return this.join(" ")};if(A.defineProperty){var q={get:t,enumerable:true,configurable:true};try{A.defineProperty(p,B,q)}catch(u){if(u.number===-2146823252){q.enumerable=false;A.defineProperty(p,B,q)}}}else{if(A[w].__defineGetter__){p.__defineGetter__(B,t)}}}(self))}(function(f,h,c){var j=false,g=[];d();c._.onLog=i;function i(k){if(typeof k!=="function"){throw TypeError("log listener must be a function, got "+k)}g.push(k)}function e(l,k){if(j){return}j=true;g.forEach(function(n){try{n(l,k)}catch(m){}});j=false}function d(){var k=f.console;if(typeof k!=="object"){k={}}k.log=b(k.log,"log");k.warn=b(k.warn,"warn");k.error=b(k.error,"error");a();f.console=k}function b(k,l){switch(typeof k){case"undefined":k=function(){};case"function":break;default:return k}return function(){var m=Array.prototype.map.call(arguments,function(n){if((typeof n==="object")&&(n!==null)&&f.JSON&&JSON.stringify){try{return JSON.stringify(n)}catch(o){}}return n+""}).join(" ");e(l,m);k.apply(this,arguments)}}function a(){if(!f.addEventListener){return}f.addEventListener("error",function(k){e("exception",k.message+"")},false)}})(window,document,kik);(function(d,a,c){var b={};c.utils=b;b.error=function(e){if(d.console&&d.console.error){if((typeof e==="object")&&e.stack){d.console.error(e.stack)}else{d.console.error(e+"")}}};b.platform={};b.platform.os=function(){var h=d.navigator.userAgent,g,f,e;if((e=/\bCPU.*OS (\d+(_\d+)?)/i.exec(h))){g="ios";f=e[1].replace("_",".")}else{if((e=/\bAndroid (\d+(\.\d+)?)/.exec(h))){g="android";f=e[1]}else{if((e=/\bWindows Phone OS (\d+(\.\d+)?)/.exec(h))){g="winphone";f=e[1]}else{if((e=/\bMac OS X (\d+(_\d+)?)/.exec(h))){g="osx";f=e[1].replace("_",".")}else{if((e=/\bWindows NT (\d+(.\d+)?)/.exec(h))){g="windows";f=e[1]}else{if((e=/\bLinux\b/.exec(h))){g="linux";f=null}else{if((e=/\b(Free|Net|Open)BSD\b/.exec(h))){g="bsd";f=null}}}}}}}var i={name:g,version:f&&d.parseFloat(f),versionString:f};i[g]=true;return i}();b.os=b.platform.os;b.platform.browser=function(){var h=d.navigator.userAgent,g,f,e;if((e=/\bMSIE (\d+(\.\d+)?)/i.exec(h))){g="msie";f=e[1]}else{if((e=/\bOpera\/(\d+(\.\d+)?)/i.exec(h))){g="opera";f=e[1];if((e=/\bVersion\/(\d+(\.\d+)?)/i.exec(h))){f=e[1]}}else{if((e=/\bChrome\/(\d+(\.\d+)?)/i.exec(h))){g="chrome";f=e[1]}else{if((h.indexOf("Safari/")!=-1)&&(e=/\bVersion\/(\d+(\.\d+)?)/i.exec(h))){if(b.platform.os.android){g="android"}else{g="safari"}f=e[1]}else{if((e=/\bFirefox\/(\d+(\.\d+)?)/i.exec(h))){g="firefox";f=e[1]}}}}}var i={name:g,version:f&&d.parseFloat(f),versionString:f};i[g]=true;return i}();b.browser=b.platform.browser;b.platform.engine=function(){var h=d.navigator.userAgent,g,f,e;if((e=/\bTrident\/(\d+(\.\d+)?)/i.exec(h))){g="trident";f=e[1]}else{if((e=/\bMSIE 7/i.exec(h))){g="trident";f="3.1"}else{if((e=/\bPresto\/(\d+(\.\d+)?)/i.exec(h))){g="presto";f=e[1]}else{if((e=/\bAppleWebKit\/(\d+(\.\d+)?)/i.exec(h))){g="webkit";f=e[1]}else{if((e=/\brv\:(\d+(\.\d+)?)/i.exec(h))){g="gecko";f=e[1]}}}}}var i={name:g,version:f&&d.parseFloat(f),versionString:f};i[g]=true;return i}();b.engine=b.platform.engine;b.random={};b.random.name=function(e){return("____"+(e||"")+"____"+Math.random()).replace(/\.|\-/g,"")};b.random.num=function(){return Math.floor((Math.random()*18014398509481984)-9007199254740992)};b.random.uuid=function(){var e=36,g=new Array(e),h="0123456789abcdef",f;for(f=0;f<e;f++){g[f]=Math.floor(Math.random()*16)}g[14]=4;g[19]=(g[19]&3)|8;for(f=0;f<e;f++){g[f]=h[g[f]]}g[8]=g[13]=g[18]=g[23]="-";return g.join("")};b.enumerate=function(f){if(typeof f!=="object"){f=Array.prototype.slice.call(arguments)}var h={};for(var g=0,e=f.length;g<e;g++){h[f[g]]=g}return h};b.preloadImage=function(){var f={};return e;function e(){var h=arguments;c.ready(function(){g.apply(b,h)})}function g(j,l){if(typeof j!="string"){b.asyncJoin(j.map(function(m){return function(n){b.preloadImage(m,n)}}),l||function(){});return}if(f[j]===true){if(l){setTimeout(function(){l(true)},0)}return}else{if(f[j]){f[j].push(l);return}}f[j]=[l];var h=false;function k(o){if(h){return}h=true;var q=f[j];f[j]=o;for(var n,p=0,m=q.length;p<m;p++){n=q[p];if(n){n(o)}}}var i=new Image();i.onload=function(){k(true)};i.onerror=function(){k(false)};i.src=j}}();b.url={};b.url.dir=function(){var e=/\/[^\/]*$/;return function(f){switch(typeof f){case"undefined":f=d.location.href;case"string":break;default:throw TypeError("url "+f+" must be string if defined")}f=((f.split("?")[0]||"").split("#")[0]||"");return f.replace(e,"/")}}();b.url.host=function(){var e=/^https?\:\/\/([^\/]+)\/.*$/;return function(g){switch(typeof g){case"undefined":return d.location.host;case"string":break;default:throw TypeError("url "+g+" must be string if defined")}var f=e.exec(g);return f&&f[1]}}();b.url.path=function(){var e=/^https?\:\/\/[^\/]+(\/.*)$/;return function(g){switch(typeof g){case"undefined":return d.location.pathname;case"string":break;default:throw TypeError("url "+g+" must be string if defined")}var f=e.exec(g);return f&&f[1]}}();b.url.dataToQuery=function(){var e=/%20/g;return function(k){var h=[],j,f,i;for(var g in k){j=k[g];if((j!==null)&&(j!==undefined)){f=encodeURIComponent(g);i=encodeURIComponent(j);h.push(f+"="+i)}}return h.join("&").replace(e,"+")}}();b.url.queryToData=function(){var f=/([^&=]+)=([^&]+)/g,e=/\+/g;return function(k){var h={},g,i,j;if(k){k=k.replace(e,"%20");while((g=f.exec(k))){i=decodeURIComponent(g[1]);j=decodeURIComponent(g[2]);h[i]=j}}return h}}();b.url.withQuery=function(e,f){if(!f){f=e;e=d.location.href}e=e.split("?")[0];var g=b.url.dataToQuery(f);if(g){e+="?"+g}return e};b.url.updateQuery=function(e,f){if(!f){f=e;e=d.location.href}var g=b.url.parseQuery(e);b.obj.extend(g,f);return b.url.withQuery(e,g)};b.url.parseQuery=function(e){e=e||d.location.href;return b.url.queryToData(e.split("?")[1])};b.url.query=b.url.parseQuery();b.jsonp=function(s){var q=false,l=function(){},h=b.random.name("PICARD_UTILS_JSONP_CALLBACK"),e=s.url,i=b.obj.copy(s.data),m=s.callbackName||"callback",p=s.callback||l,f=s.success||l,j=s.error||l,o=s.complete||l,r=a.getElementsByTagName("script")[0],k=a.createElement("script");i[m]="window."+h;k.type="text/javascript";k.async=true;k.onerror=g;k.src=b.url.updateQuery(e,i);function n(){d[h]=l;try{r.parentNode.removeChild(k)}catch(t){}}function g(){if(q){return}n();p=l;f=l;j();j=l;o();o=l}d[h]=function(){q=true;n();p.apply(this,arguments);p=l;f.apply(this,arguments);f=l;j=l;o();o=l};if(s.timeout){setTimeout(g,s.timeout)}r.parentNode.insertBefore(k,r)};b.asyncJoin=function(e,k){var g=true;if(!Array.isArray(e)){g=false;e=Array.prototype.slice.call(arguments);k=e.pop()}var f=false,j=e.length,i=new Array(j);if(j===0){h();return}e.forEach(function(m,l){setTimeout(function(){var n=false;m(function(){if(n){return}n=true;if(i[l]){return}var o=Array.prototype.slice.call(arguments);i[l]=o;j--;h()})},0)});function h(){if((j!==0)||f){return}f=true;setTimeout(function(){if(g){k.call(d,i)}else{k.apply(d,i)}},0)}};b.obj={};b.obj.extend=function(i,h){var g,f;for(var e in h){g=i[e];f=h[e];if(g!==f){i[e]=f}}return i};b.obj.copy=function(e){return b.obj.extend({},e)};b.obj.forEach=function(g,h,e){for(var f in g){h.call(e,f,g[f],g)}};b.obj.inverse=function(g){var e={};for(var f in g){e[g[f]]=f}return e};b.obj.values=function(g){var e=[];for(var f in g){e.push(g[f])}return e};b.obj.has=function(g,f){for(var e in g){if(g[e]===f){return true}}return false};b.windowReady=function(f){if(a.readyState==="complete"){setTimeout(function(){f()},0);return}d.addEventListener("load",e,false);function e(){d.removeEventListener("load",e);setTimeout(function(){f()},0)}};b.ready=function(){var g=false,f=[];function h(){if(g){return}g=true;for(var k;(k=f.shift());){try{k()}catch(j){b.error(j)}}}function e(k){try{a.documentElement.doScroll("left")}catch(j){setTimeout(function(){e(k)},1);return}if(k){k()}}function i(l){if(a.readyState==="complete"){setTimeout(l,0);return}if(a.addEventListener){a.addEventListener("DOMContentLoaded",l,false);d.addEventListener("load",l,false)}else{if(a.attachEvent){a.attachEvent("onreadystatechange",l);d.attachEvent("onload",l);var j=false;try{j=(d.frameElement===null)}catch(k){}if(a.documentElement.doScroll&&j){setTimeout(function(){e(l)},0)}}}}i(h);return function(j){if(typeof j!=="function"){throw TypeError("callback "+j+" must be a function")}if(g){setTimeout(function(){j()},0)}else{f.push(j)}}}()})(window,document,kik);(function(f,a,e){e.events=d;e.events.handlers=g;function b(){this.handlers={};this.onceHandlers={};this.globalHandlers=[];this.globalOnceHandlers=[]}b.prototype.insureNamespace=function(i){if(!this.handlers[i]){this.handlers[i]=[]}if(!this.onceHandlers[i]){this.onceHandlers[i]=[]}};b.prototype.bind=function(i,j){this.insureNamespace(i);this.handlers[i].push(j)};b.prototype.bindToAll=function(i){this.globalHandlers.push(i)};b.prototype.bindOnce=function(i,j){this.insureNamespace(i);this.onceHandlers[i].push(j)};b.prototype.bindToAllOnce=function(i){this.globalOnceHandlers.push(i)};b.prototype.unbind=function(i,j){this.insureNamespace(i);h(this.handlers[i],j);h(this.onceHandlers[i],j)};b.prototype.unbindFromAll=function(j){h(this.globalHandlers,j);h(this.globalOnceHandlers,j);for(var i in this.handlers){h(this.handlers[i],j);h(this.onceHandlers[i],j)}};b.prototype.trigger=function(j,k,i){this.insureNamespace(j);if(typeof i==="undefined"){i=this}function l(m){try{m.call(i,k,j)}catch(n){e.utils.error(n)}}this.handlers[j].forEach(l);this.globalHandlers.forEach(l);this.onceHandlers[j].forEach(l);this.globalOnceHandlers.forEach(l);this.onceHandlers[j].splice(0);this.globalOnceHandlers.splice(0)};function h(j,l){for(var k=j.length;k--;){if(j[k]===l){j.splice(k,1)}}}function d(j){if(typeof j==="undefined"){j={}}var i=new b();j.on=function(k,l){if(Array.isArray(k)){k.forEach(function(m){j.on(m,l)});return}if(typeof l==="undefined"){l=k;k=""}if(typeof k!=="string"){throw TypeError("name "+k+" must be a string")}if(typeof l!=="function"){throw TypeError("handler "+l+" must be a function")}if(k){i.bind(k,l)}else{i.bindToAll(l)}};j.off=function(k,l){if(Array.isArray(k)){k.forEach(function(m){j.off(m,l)});return}if(typeof l==="undefined"){l=k;k=""}if(typeof k!=="string"){throw TypeError("name "+k+" must be a string")}if(typeof l!=="function"){throw TypeError("handler "+l+" must be a function")}if(k){i.unbind(k,l)}else{i.unbindFromAll(l)}};j.once=function(k,l){if(Array.isArray(k)){k.forEach(function(m){j.once(m,l)});return}if(typeof l==="undefined"){l=k;k=""}if(typeof k!=="string"){throw TypeError("name "+k+" must be a string")}if(typeof l!=="function"){throw TypeError("handler "+l+" must be a function")}if(k){i.bindOnce(k,l)}else{i.bindToAllOnce(l)}};j.trigger=function(l,m,k){if(Array.isArray(l)){l.forEach(function(n){j.trigger(n,m,k)});return}if(typeof l!=="string"){throw TypeError("name "+l+" must be a string")}i.trigger(l,m,k)};return j}function c(){this.handlers=[];this.events=[]}c.prototype.addHandler=function(i){this.handlers.push(i);return this.processEvents()};c.prototype.triggerEvent=function(i){this.events.push(i);this.processEvents()};c.prototype.triggerEvents=function(i){this.events=this.events.concat(i);this.processEvents()};c.prototype.processEvents=function(){if(!this.events.length||!this.handlers.length){return false}var j=this.events.splice(0),i=this.handlers;j.forEach(function(k){i.forEach(function(l){l(k)})});return true};function g(){var i=new c();return{handler:function(j){return i.addHandler(j)},trigger:function(j){i.triggerEvent(j)},triggerMulti:function(j){i.triggerEvents(j)}}}d(e)})(window,document,kik);kik.ready=function(e,c){var b=[];a();return d;function d(g){if(b){b.push(g)}else{f(g)}}function a(){c.utils.windowReady(function(){setTimeout(function(){var g=b.slice();b=null;g.forEach(f)},3)})}function f(h){try{h()}catch(g){c.utils.error(g)}}}(window,kik);kik.open=function(e,d){var g=d.utils.platform.os,b=d.utils.platform.browser,a=e.open;e.open=function(j){var i=j.substr(0,7)==="card://",l=j.substr(0,8)==="cards://";if(i||l){f(j,true)}else{if(!d.enabled){return a.apply(e,arguments)}else{var m;try{m=d._.bridge("Browser")}catch(k){}if(m&&m.openExternal){m.openExternal({url:j})}else{e.location.href=j}}}};f.card=c;f.external=h;return f;function f(i,n,q){if(typeof i!=="string"){throw TypeError("url must be a string, got "+i)}switch(typeof n){case"boolean":q=n;n="";break;case"object":if(n!==null){n=JSON.stringify(n)}else{n=undefined}case"undefined":case"string":break;default:throw TypeError("linkData must be a string of JSON if defined, got "+n)}if(n){i=i.split("#")[0]+"#"+encodeURIComponent(n)}var j=i.substr(0,7)==="card://",p=i.substr(0,8)==="cards://",r=i.substr(0,7)==="http://",m=i.substr(0,8)==="https://",k=(!j&&!p&&!r&&!m),o;try{o=d._.bridge("Browser")}catch(l){}if(o&&o.openPage&&!k){if(j||p){i="http"+i.substr(4)}o.openPage({url:i,popup:!!q});return}if(j||p){if(o&&o.openCard){o.openCard({url:"http"+i.substr(4)})}else{c(i,"http"+i.substr(4))}}else{if(o&&o.openExternal){o.openExternal({url:i})}else{e.location.href=i}}}function h(i){var k;try{k=d._.bridge("Browser")}catch(j){}if(k&&k.openExternal){k.openExternal({url:i})}else{d.open(i)}}function c(k,i,j){if(!g.ios&&!g.android){if(i){e.location.href=i}return}if(g.ios){if(i){setTimeout(function(){if(!document.webkitHidden){e.location.href=i}},g.ios?25:1000)}if(j){d.ready(function(){setTimeout(function(){e.location.href=k},0)})}else{e.location.href=k}return}var m;if(i){m=setTimeout(function(){e.location=i},1000)}var l=document.createElement("iframe");l.style.position="fixed";l.style.top="0";l.style.left="0";l.style.width="1px";l.style.height="1px";l.style.border="none";l.style.opacity="0";l.onload=function(){if(i){clearTimeout(m)}try{document.documentElement.removeChild(l)}catch(n){}};l.src=k;document.documentElement.appendChild(l)}}(window,kik);(function(c,a){var b="__PICARD_ID__";if(!c.localStorage){return}if(!c.localStorage[b]){c.localStorage[b]=a.utils.random.uuid()}a._.id=c.localStorage[b]})(window,kik);(function(b,a){if(navigator.userAgent.indexOf("Kik/")===-1){return}if(!/\bandroid/i.test(navigator.userAgent)){return}if(!a||b.CardsBridge){return}var c=b.CardsBridge={};["invokeAsyncFunction","invokeFunction","poll"].forEach(function(d){c[d]=function(){var e=Array.prototype.slice.call(arguments);e.unshift(d);return a("CardsBridge",JSON.stringify(e))||""}})})(window,window.prompt);(function(window){if(!window.chrome){return}if(!window.chrome.app){return}if(window.shimsham){return}var shimshamMeta=document.getElementById("shimsham-meta");if(shimshamMeta&&(shimshamMeta.nodeName==="META")){var url=shimshamMeta.content;try{var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.send(null);if(xhr.status===200){eval(xhr.responseText)}else{console.log("Failed to load shimsham, extension not installed get it at dev.kik.com")}}catch(e){}}})(window);(function(window,document,kik){var BRIDGE_SIGNAL_URL=window.location.protocol+"//cardsbridge.kik.com/",PLUGIN_REQUEST_BATCH="batch-call",PLUGIN_REQUEST_NAME="requestPlugin",PLUGIN_REQUEST_VERSION="requestVersion",PLUGIN_LOG="log";var plugins={},os=kik.utils.platform.os,androidBridge=window.CardsBridge;function getBridge(){var bridgeInfo=getAndroidBridge();if(bridgeInfo){return bridgeInfo}if(os.ios&&!looksLikeChrome()){return getIPhoneBridge()}return false}function looksLikeChrome(){try{return(typeof window.chrome.send==="function")}catch(err){return false}}function getAndroidBridge(){if(!androidBridge){return false}if(typeof androidBridge.invokeFunction!=="function"){return false}if(typeof androidBridge.poll!=="function"){return false}try{return makeBridgeCall(PLUGIN_REQUEST_VERSION).data}catch(err){return false}}function getIPhoneBridge(){var bridgeInfo;try{bridgeInfo=makeBridgeCall(PLUGIN_REQUEST_VERSION).data}catch(err){}return bridgeInfo?bridgeInfo:false}function sendIFrameSignal(bridgeFunctionName,argData,asyncCallbackName){var callbackName=kik.utils.random.name("PICARD_BRIDGE_CALLBACK"),status,data;window[callbackName]=function(callbackStatus,callbackData){delete window[callbackName];status=callbackStatus;data=callbackData};var url=BRIDGE_SIGNAL_URL+bridgeFunctionName+"/"+callbackName+"?args="+encodeURIComponent(argData)+"&async="+(asyncCallbackName||"");var doc=document.documentElement,iframe=document.createElement("iframe");iframe.style.display="none";iframe.src=url;doc.appendChild(iframe);doc.removeChild(iframe);if(window[callbackName]){delete window[callbackName];throw Error("bridge call "+bridgeFunctionName+" failed to return")}return{status:status,data:data}}function sendBatchIFrameSignal(urls){var calls=urls.map(function(url){return encodeURIComponent(url)}).join(",");var url=BRIDGE_SIGNAL_URL+PLUGIN_REQUEST_BATCH+"?calls="+calls;var doc=document.documentElement,iframe=document.createElement("iframe");iframe.style.display="none";iframe.src=url;doc.appendChild(iframe);doc.removeChild(iframe)}function androidBridgeCall(bridgeFunctionName,argData,asyncCallbackName){var response,result;if(!asyncCallbackName){response=androidBridge.invokeFunction(bridgeFunctionName,argData)}else{if(androidBridge.invokeAsyncFunction){response=androidBridge.invokeAsyncFunction(bridgeFunctionName,argData,asyncCallbackName)}else{throw TypeError("bridge: android bridge does not support async callbacks")}}try{result=JSON.parse(response)}catch(err){throw TypeError("bridge call for "+bridgeFunctionName+" responded with invalid JSON")}return{status:result.status,data:result.data}}function makeBridgeCall(bridgeFunctionName,args,asyncCallback){if(typeof bridgeFunctionName!=="string"){throw TypeError("bridge call "+bridgeFunctionName+" must be a string")}switch(typeof args){case"function":asyncCallback=args;args=undefined;case"undefined":args={};case"object":break;default:throw TypeError("bridge call arguments "+args+" must be a JSON object if specified")}switch(typeof asyncCallback){case"undefined":case"function":break;default:throw TypeError("bridge async callback must be a function if defined, got "+asyncCallback)}var argData;try{argData=JSON.stringify(args)}catch(err){throw TypeError("bridge call arguments "+args+" must be a JSON object")}var asyncCallbackName;if(asyncCallback){asyncCallbackName=setupAsyncCallback(asyncCallback)}var result;if(androidBridge){result=androidBridgeCall(bridgeFunctionName,argData,asyncCallbackName)}else{result=sendIFrameSignal(bridgeFunctionName,argData,asyncCallbackName)}if(asyncCallbackName&&(!result||!result.status||(result.status!==202))){setTimeout(function(){if(!window[asyncCallbackName]){return}if(androidBridge){window[asyncCallbackName](JSON.stringify({status:500,data:null}))}else{window[asyncCallbackName](500,null)}},0);result={status:202,data:{}}}return result}function setupAsyncCallback(asyncCallback){var callbackName=kik.utils.random.name("PICARD_BRIDGE_ASYNC_CALLBACK");window[callbackName]=function(status,data){delete window[callbackName];if(androidBridge){try{var response=JSON.parse(status);status=response.status;data=response.data}catch(err){throw Error("bridge failed to parse android async data, "+status)}}if((typeof data!=="object")||(data===null)){asyncCallback()}else{if(!status||(status<200)||(status>=300)){asyncCallback()}else{asyncCallback(data)}}};return callbackName}function setupEventCallback(eventCallback){var callbackName=kik.utils.random.name("PICARD_BRIDGE_EVENT_CALLBACK");window[callbackName]=function(name,data){if(androidBridge){try{data=JSON.parse(data)}catch(err){throw Error("bridge failed to parse android event data, "+data)}}eventCallback(name,data)};return callbackName}function setupAndroidPoll(){window.addEventListener("keyup",function(e){if(e.which!==0){return}performAndroidPoll();return false})}function performAndroidPoll(){var result=androidBridge.poll();if(!result){return}var code=result+"";if(!code){return}try{eval(code)}catch(err){if(window.console&&window.console.error){window.console.error("android poll failed to evaluate "+code+", "+err)}}performAndroidPoll()}function setupIOSLogging(){kik._.onLog(function(level,message){try{makeBridgeCall(PLUGIN_LOG,{level:level,message:message})}catch(err){}})}function bridgeFunctionCall(bridgeFunctionName,args,callback){var data=makeBridgeCall(bridgeFunctionName,args,callback);if(!data){throw Error("bridge call "+bridgeFunctionName+" did not return")}if(!data.status||(data.status<200)||(data.status>=300)){throw Error("bridge call "+bridgeFunctionName+" did not complete successfully, "+data.status)}if(typeof data.data!=="object"){throw TypeError("bridge call "+bridgeFunctionName+" did not return an object, "+data.data)}return data.data}function setupFunction(bridgeFunctionName){return function(args,callback){return bridgeFunctionCall(bridgeFunctionName,args,callback)}}function setupFunctions(namespace,functionNames,pluginObj){if(!Array.isArray(functionNames)){throw TypeError("functions "+functionNames+" must be an array")}if(typeof pluginObj==="undefined"){pluginObj={}}functionNames.forEach(function(functionName){if(typeof functionName!=="string"){throw TypeError("function "+functionName+" must be a string")}pluginObj[functionName]=setupFunction(namespace+"."+functionName)})}function setupPlugin(pluginName){var pluginObj=kik.events(),pluginData=makeBridgeCall(PLUGIN_REQUEST_NAME,{name:pluginName,eventCallback:setupEventCallback(pluginObj.trigger)});if(pluginData.status!==200){throw TypeError("plugin "+pluginName+" failed to initialize")}setupFunctions(pluginName,pluginData.data.functions,pluginObj);return pluginObj}function bridge(pluginName){if(typeof pluginName!=="string"){throw TypeError("plugin name must be a string, got "+pluginName)}if(!plugins[pluginName]){var plugin=setupPlugin(pluginName);plugins[pluginName]=plugin}return plugins[pluginName]}function batchRequest(calls){if(!Array.isArray(calls)){throw TypeError("batch calls must be an array, got "+calls)}calls.forEach(function(data){if(typeof data!=="object"){throw TypeError("batch call must be an object, got "+data)}if(typeof data.name!=="string"){throw TypeError("batch call name must be a string, got "+data.name)}switch(typeof data.args){case"undefined":case"object":break;default:throw TypeError("batch call args must be an object if defined, got "+data.args)}switch(typeof data.callback){case"function":case"undefined":break;default:throw TypeError("batch call callback must be a function if defined, got "+data.callback)}});if(androidBridge){return calls.map(function(data){try{if(data.name.indexOf(".")===-1){return bridge(data.name)}else{return bridgeFunctionCall(data.name,data.args,data.callback)}}catch(err){}})}var batchCalls=[],responses=new Array(calls.length);calls.forEach(function(data,index){var isPluginRequest=(data.name.indexOf(".")===-1);if(!isPluginRequest){batchCalls.push(generateBatchSegment(data,function(responseData){responses[index]=responseData}))}else{if(plugins[data.name]){responses[index]=plugins[data.name]}else{batchCalls.push(generatePluginBatchSegment(data,function(responseData){responses[index]=responseData}))}}});sendBatchIFrameSignal(batchCalls);return responses}function generateBatchSegment(data,callback){var argData=JSON.stringify(data.args);var asyncCallbackName;if(data.callback){asyncCallbackName=setupAsyncCallback(data.callback)}var callbackName=kik.utils.random.name("PICARD_BRIDGE_CALLBACK");setTimeout(function(){delete window[callbackName]},0);window[callbackName]=function(callbackStatus,callbackData){delete window[callbackName];if(asyncCallbackName&&callbackStatus!==202){delete window[asyncCallbackName]}if(callbackStatus>=200&&callbackStatus<300){callback(callbackData)}};var url=BRIDGE_SIGNAL_URL+data.name+"/"+callbackName+"?args="+encodeURIComponent(argData)+"&async="+(asyncCallbackName||"");return url}function generatePluginBatchSegment(data,callback){var pluginObj=kik.events(),argData=JSON.stringify({name:data.name,eventCallback:setupEventCallback(pluginObj.trigger)});var callbackName=kik.utils.random.name("PICARD_BRIDGE_CALLBACK");setTimeout(function(){delete window[callbackName]},0);window[callbackName]=function(callbackStatus,callbackData){delete window[callbackName];if(callbackStatus===200){setupFunctions(data.name,callbackData.functions,pluginObj);plugins[data.name]=pluginObj;callback(pluginObj)}};var url=BRIDGE_SIGNAL_URL+PLUGIN_REQUEST_NAME+"/"+callbackName+"?args="+encodeURIComponent(argData)+"&async=";return url}function redirectToCards(){var os=kik.utils.platform.os,urllib=kik.utils.url;if(!urllib.query.kikme||(!os.ios&&!os.android)){return}try{var iframe=document.createElement("iframe");iframe.src="card"+urllib.updateQuery({kikme:null}).substr(4);iframe.style.display="none";var cleanup=function(){try{document.documentElement.removeChild(iframe)}catch(err){}};iframe.onload=cleanup;iframe.onerror=cleanup;setTimeout(cleanup,1000);document.documentElement.appendChild(iframe)}catch(err){}}function main(){var bridgeInfo=getBridge();if(!bridgeInfo){redirectToCards();return}kik._.bridge=bridge;kik._.bridge.batch=batchRequest;if(androidBridge){setupAndroidPoll();kik._.bridge.forceAndroidPoll=performAndroidPoll}else{setupIOSLogging()}kik.enabled=true;bridge.info=bridgeInfo;bridge.version=bridgeInfo.version;kik.utils.platform.browser.name="kik";kik.utils.platform.browser.cards=true;kik.utils.platform.browser.kik=true;kik.utils.platform.browser.version=window.parseFloat(bridge.version);kik.utils.platform.browser.versionString=bridge.version}main()})(window,document,kik);(function(b,d){var c="kik-transform-fix";if(a()){e()}function a(){var h=true;if(!d.enabled){h=false}else{if(!d.utils.platform.os.android){h=false}else{Array.prototype.forEach.call(b.getElementsByTagName("meta"),function(i){if((i.name===c)&&(i.content==="false")){h=false}})}}return h}function e(){var h=b.documentElement;f(h,"translate3d(0,0,0)");setTimeout(function(){g(h,"transform 10ms linear");setTimeout(function(){f(h,"translate3d(0,0,1px)");setTimeout(function(){g(h,"");setTimeout(function(){f(h,"")},0)},10)},0)},0)}function f(i,h){i.style["-webkit-transform"]=h;i.style["-moz-transform"]=h;i.style["-ms-transform"]=h;i.style["-o-transform"]=h;i.style.transform=h}function g(h,i){if(i){h.style["-webkit-transition"]="-webkit-"+i;h.style["-moz-transition"]="-moz-"+i;h.style["-ms-transition"]="-ms-"+i;h.style["-o-transition"]="-o-"+i;h.style.transition=i}else{h.style["-webkit-transition"]="";h.style["-moz-transition"]="";h.style["-ms-transition"]="";h.style["-o-transition"]="";h.style.transition=""}}})(document,kik);(function(b,c){try{var a=b.querySelector('meta[name="viewport"]');if(c.enabled&&a&&/\bipad\b/i.test(navigator.userAgent)){a.setAttribute("content","initial-scale=1.0, maximum-scale=1.0, user-scalable=no")}}catch(d){}})(document,kik);(function(b,a){if(a._.bridge){b.alert=function(){};b.confirm=function(){};b.prompt=function(){}}})(window,kik);(function(d,a,c){var e=c.utils.platform.os,b=c.utils.platform.browser;if(d.navigator&&b.kik&&(b.version<6.7)&&e.android){d.navigator.geolocation=undefined}})(window,document,kik);(function(d){var b={};d._.firstBatch=b;if(!d._.bridge||!d.utils.platform.os.ios||(d.utils.platform.browser.version<6.5)){return}var a=[{name:"Metrics"},{name:"Browser"},{name:"Media"},{name:"Kik"},{name:"Profile"},{name:"UserData"},{name:"Auth"},{name:"Photo"},{name:"Keyboard"},{name:"Push"},{name:"Picker"}];var c=[{name:"Browser.getLastLinkData",args:{}},{name:"Browser.isPopupMode",args:{}},{name:"Kik.getLastMessage",args:{}},{name:"Push.getNotificationList",args:{}},{name:"Picker.getRequest",args:{}}];d._.bridge.batch(a.concat(c)).slice(a.length).forEach(function(e,g){var f=c[g];b[f.name]=e;if(!e){}else{if(!d._.secondBatch){d._.secondBatch=[]}}})})(kik);(function(i,a){var f;try{f=a._.bridge("Metrics")}catch(e){}var k=a.events(),h=[];a.metrics=k;k.loadTime=null;k.coverTime=null;if(f){f.on("loadData",function(o){if(typeof o.loadTime==="number"){k.loadTime=o.loadTime;k.trigger("loadTime",o.loadTime)}if(typeof o.coverTime==="number"){k.coverTime=o.coverTime;k.trigger("coverTime",o.coverTime)}})}var n=false;k.enableGoogleAnalytics=m;k.event=j;k._cardsEvent=c;function m(q,o,p){if(n){return}n=true;if(q){if(!p){d(q,o)}else{l(q)}}g()}function d(p,o){if(typeof p!=="string"){throw TypeError("google analytics ID must be a string, got "+p)}if(typeof o!=="string"){throw TypeError("google analytics host must be a string, got "+o)}i.GoogleAnalyticsObject="ga";i.ga=i.ga||function(){(i.ga.q=i.ga.q||[]).push(arguments)},i.ga.l=+new Date();a.ready(function(){var q=document.createElement("script"),r=document.getElementsByTagName("script")[0];q.async=1;q.src="//www.google-analytics.com/analytics.js";r.parentNode.insertBefore(q,r)});i.ga("create",p,o);i.ga("send","pageview")}function l(o){if(typeof o!=="string"){throw TypeError("google analytics ID must be a string, got "+o)}var p=i._gaq=[];p.push(["_setAccount",o]);p.push(["_trackPageview"]);a.ready(function(){var r=document.createElement("script");r.async=true;r.defer=true;r.id="ga";r.src="//www.google-analytics.com/ga.js";var q=document.getElementsByTagName("script")[0];q.parentNode.insertBefore(r,q)})}function g(){i.addEventListener("error",function(q){var p=q.message||"";p+=" ("+(q.filename||i.location.href);if(q.lineno){p+=":"+q.lineno}p+=")";c("error",p)},false);if((typeof App==="object")&&(typeof App.enableGoogleAnalytics==="function")){App.enableGoogleAnalytics()}if(f){b("loadTime");b("coverTime")}var o=h.slice();h=null;o.forEach(function(p){j(p[0],p[1],p[2],p[3])})}function j(q,p,o,r){if(typeof q!=="string"){throw TypeError("event category must be a string, got "+q)}if(typeof p!=="string"){throw TypeError("event name must be a string, got "+p)}switch(typeof o){case"string":break;case"number":r=o;default:o=""}switch(typeof r){case"number":r=Math.floor(r);break;default:r=0}if(h){h.push([q,p,o,r]);return}if(typeof i.ga==="function"){i.ga("send","event",q,p,o,r)}else{if(!i._gaq){i._gaq=[]}if(typeof i._gaq.push==="function"){i._gaq.push(["_trackEvent",q,p,o,r,true])}}}function c(p,o,q){j("Cards",p,o,q)}function b(o){if(k[o]){c(o,k[o])}else{k.once(o,function(){c(o,k[o])})}}})(window,kik);(function(k,q,r){function v(F,J){var E=k.applicationCache,I=false;if(!E||!E.addEventListener||!E.swapCache||!E.update){J(false);return}if(E.status===E.UPDATEREADY){D();return}if((E.status!==E.IDLE)&&(E.status!==E.CHECKING)&&(E.status!==E.DOWNLOADING)){J(false);return}E.addEventListener("noupdate",G,false);E.addEventListener("updateready",D,false);E.addEventListener("error",D,false);E.addEventListener("obsolete",D,false);setTimeout(D,30*1000);if(E.status===E.IDLE){try{E.update()}catch(H){D()}}function G(){if(I){return}I=true;if(!F&&k.console&&k.console.log){k.console.log("refresh requested but no update to manifest found");k.console.log("** update your manifest to see changes reflected")}setTimeout(function(){J(true)},1000)}function D(){if(I){return}I=true;var K=false;if(E.status===E.UPDATEREADY){try{E.swapCache();K=true}catch(L){}}J(K)}}if(r.utils.platform.os.ios){setTimeout(function(){v(true,function(D){})},5000)}k.ZERVER_REFRESH=function(){d();v(true,function(){k.location.reload()})};function d(){try{k.ZERVER_KILL_STREAM()}catch(D){}}function j(F){if(typeof F!=="string"){return undefined}F=decodeURIComponent(F);var D;try{D=JSON.parse(F)}catch(E){}if((typeof D==="object")&&(D!==null)){return D}else{return F||undefined}}if(k.location.hash){r.linkData=j(k.location.hash.substr(1))}var o=/(^|\s)icon(\s|$)/i,y,A,x,m,h,C,i;Array.prototype.forEach.call(q.getElementsByTagName("link"),function(D){if(o.test(D.rel)){A=D.href}else{if(D.rel==="kik-icon"){m=D.href}else{if(D.rel==="kik-icon-fallback"){x=D.href}else{if(D.rel==="kik-tray-icon"){h=D.href}else{if(D.rel==="privacy"){C=D.href}else{if(D.rel==="terms"){i=D.href}}}}}}});y=(x||m||h||A);var n={title:q.title,icon:y,squareIcon:m||h||x||A,mediaTrayIcon:m||h||x||A,privacy:C,terms:i};var b;try{b=r._.bridge("Browser")}catch(e){}a();function a(){var F=false;Array.prototype.forEach.call(q.getElementsByTagName("meta"),function(G){if(G.name==="kik-https"){F=G.content}});if(F===k.location.host){if(k.location.protocol==="https:"){try{b.performHttpsUpgradeCleanup()}catch(E){}}else{var D=k.location.href.split("#")[0].replace(/^http\:/,"https:");try{b.openCard({url:D,title:q.title,icon:n.icon,clearHistory:true})}catch(E){k.location.href=D}}}}if(!b){return}var B=r.events();r.browser=B;if(b.setCardInfo){if(r._.secondBatch){r._.secondBatch.push({name:"Browser.setCardInfo",args:n})}else{b.setCardInfo(n)}}if(b.pageLoaded){r.utils.windowReady(function(){if(q.body){var D=q.body.offsetWidth;(function(E){return E})(D)}setTimeout(function(){b.pageLoaded()},1)})}k.addEventListener("unload",function(){try{b.navigationAttempted()}catch(D){}},false);var t=true;if(b.setStatusBarVisible){var l=false;B.statusBar=function(D){l=true;b.setStatusBarVisible({visible:!!D});t=!!D}}if(b.setStatusBarTransparent){B.statusBarTransparent=function(E){var D;if(E==="black"){D=false}else{if(E){D=true}}try{if(b.setStatusBarTransparent({transparent:!!E,light:D})){return true}}catch(F){}return false};var u;Array.prototype.forEach.call(q.getElementsByTagName("meta"),function(D){if(D.name==="kik-transparent-statusbar"){u=(D.content||"").trim()}});if(u&&(u!=="false")&&B.statusBarTransparent(u)){k.APP_ENABLE_IOS_STATUSBAR=true;try{if(typeof App._enableIOSStatusBar==="function"){App._enableIOSStatusBar()}}catch(e){}}}if(b.getOrientationLock&&b.setOrientationLock){B.getOrientationLock=function(){var D=b.getOrientationLock().position;return(D==="free")?null:D};B.setOrientationLock=function(D){switch(D){case"free":case"portrait":case"landscape":break;default:if(!D){D="free";break}throw TypeError("if defined, position "+D+' must be one of "free", "portrait", or "landscape"')}try{b.setOrientationLock({position:D});if(!l&&b.setStatusBarVisible&&(t!==(D!=="landscape"))){b.setStatusBarVisible({visible:(D!=="landscape")});t=(D!=="landscape")}return true}catch(E){return false}}}b.on("orientationChanged",function(){try{k.App._layout()}catch(D){}});if(b.setBacklightTimeoutEnabled){B.backlightTimeout=function(D){b.setBacklightTimeoutEnabled({enabled:!!D})}}if(b.forceRepaint){B.paint=function(){if(q.body){var D=q.body.offsetWidth;(function(E){return E})(D)}b.forceRepaint()}}var f=[];B.back=function(D){if(typeof D!=="function"){throw TypeError("back handler "+D+" must be a function")}f.push(D)};B.unbindBack=function(E){if(typeof E!=="function"){throw TypeError("back handler "+E+" must be a function")}for(var D=f.length;D--;){if(f[D]===E){f.splice(D,1)}}};b.on("back",function(G){var E=false;for(var D=f.length;D--;){try{if(f[D]()===false){E=true;break}}catch(F){r.utils.error(F)}}b.handleBack({requestToken:G.requestToken,override:E})});B.back(function(){if(k.App&&(typeof k.App.back==="function")){try{if(App.back()!==false){return false}}catch(D){}}});if(b.refresh&&b.refreshPlanned){B.refresh=function(){var D=k.applicationCache;d();if(!D||(D.status===D.UNCACHED)){b.refresh({withCache:false});return}v(false,function(E){b.refresh({withCache:true})})};b.on("refresh",function(){setTimeout(function(){b.refreshPlanned();B.refresh()},0)});k.ZERVER_REFRESH=function(){B.refresh()}}B.open=r.open;function s(E,D){B.linkData=j(E&&E.data);r.linkData=B.linkData;if((D!==false)&&B.linkData){B.trigger("linkData",B.linkData);r.trigger("linkData",B.linkData)}}B._processLinkData=s;if(b.getLastLinkData){s(r._.firstBatch["Browser.getLastLinkData"]||b.getLastLinkData(),false)}b.on("linkData",s);b.on("statusBarTap",function(){B.trigger("statusBarTap")});var p=true,z=false,w=true;B.background=p;b.on("pause",function(D){z=true;g()});b.on("unpause",function(D){z=false;g()});b.on("conceal",function(D){w=true;g()});b.on("reveal",function(D){w=false;g()});function c(){return z||w}function g(){var D=p;p=c();B.background=p;if(D!==p){B.trigger(p?"background":"foreground")}}})(window,document,kik);(function(g,c,e){var d;try{d=e._.bridge("Media")}catch(f){}if(!d||!d.setMediaCategory||!d.unsetMediaCategory){e._mediaEnabled=function(){}}else{e._mediaEnabled=a;b()}function b(){var h=false;Array.prototype.forEach.call(c.getElementsByTagName("meta"),function(i){if((i.name==="kik-media-enabled")&&(i.content==="true")){h=true}});a(h)}function a(h){if(e._.secondBatch){e._.secondBatch.push({name:"Media."+(h?"":"un")+"setMediaCategory",args:{}})}else{try{if(h){d.setMediaCategory()}else{d.unsetMediaCategory()}}catch(i){}}}})(window,document,kik);(function(i,j,b){var c;try{c=b._.bridge("Kik")}catch(f){return}b.kik=b;b._formatMessage=e;function e(n){var l;if(typeof n!=="object"){throw TypeError("message "+n+" must be an object")}switch(typeof n.big){case"undefined":case"boolean":break;default:throw TypeError("message size (big) "+n.big+" must be a boolean if defined")}switch(typeof n.title){case"undefined":case"string":if(!n.big&&!n.title){throw TypeError("message title must be a string")}n.title=n.title||"";break;default:throw TypeError("message title "+n.title+" must be a string")}switch(typeof n.text){case"string":case"undefined":break;default:throw TypeError("message text "+n.text+" must be a string")}switch(typeof n.pic){case"undefined":case"string":break;default:throw TypeError("message pic "+n.pic+" must be a string if defined")}switch(typeof n.noForward){case"undefined":case"boolean":break;default:throw TypeError("message noForward flag must be a boolean if defined, got "+n.noForward)}switch(typeof n.fallback){case"undefined":case"string":break;default:throw TypeError("message fallback URL must be a string if defined, got "+n.fallback)}switch(typeof n.linkData){case"undefined":case"string":break;case"object":try{l=JSON.stringify(n.linkData)}catch(m){throw TypeError("message linkData must be a string or JSON if defined, got "+n.linkData)}break;default:throw TypeError("message linkData must be a string or JSON if defined, got "+n.linkData)}var o=l||n.linkData;if(typeof o==="string"){o=encodeURIComponent(o)}var l;switch(typeof n.data){case"object":if(n.data!==null){try{l=JSON.stringify(n.data)}catch(m){throw TypeError("message data must be a json object if defined, got "+n.data)}}case"undefined":break;default:throw TypeError("message data must be a json object if defined, got "+n.data)}var k;if((typeof n.data==="object")&&(n.data!==null)&&n.data.id){k=n.data.id+""}b.metrics._cardsEvent("kikSend",k);return{title:n.title,text:n.text,image:n.pic,forwardable:!n.noForward,fallbackUrl:n.fallback,layout:n.big?"photo":"article",extras:{sender:b._.id,dataID:k,messageID:b.utils.random.uuid(),linkData:o||"",jsonData:l||""}}}b.send=function(l,k){if(typeof l!=="string"){k=l;l=undefined}k=e(k);k.targetUser=l;if(l&&c.sendKikToUser){c.sendKikToUser(k)}else{c.sendKik(k)}};var g=b.events.handlers();b.handler=function(k){return g.handler(k)};function h(n,k){a();if(!n.extras.sender||(n.extras.sender!==b._.id)){b.metrics._cardsEvent("kikReceive",n.extras.dataID)}if(n.extras.jsonData){var l;try{l=JSON.parse(n.extras.jsonData)}catch(m){}if((typeof l==="object")&&(l!==null)){b.message=l;g.trigger(l);b.trigger("message",l)}}if(n.extras&&n.extras.linkData&&b.browser&&b.browser._processLinkData){b.browser._processLinkData({data:n.extras.linkData},k)}}if(c.getLastMessage){var d=b._.firstBatch["Kik.getLastMessage"]||c.getLastMessage();if(d&&d.message){h(d.message,false)}}c.on("message",h);if(c.openConversationWithUser){b.openConversation=function(l,k){c.openConversationWithUser({username:l},function(m){k&&k(m)})}}function a(){if(!c.openConversation){return}b.returnToConversation=function(k){b.returnToConversation=null;if(!k){c.openConversation({returnToSender:true});return}k=e(k);k.returnToSender=true;c.sendKik(k)}}})(window,document,kik);(function(e,a,c){var b;try{b=c._.bridge("Profile")}catch(d){return}c.kik=c;if(b.openProfile){c.showProfile=function(g){if(typeof g!=="string"){throw TypeError("username must be a string, got "+g)}try{b.openProfile({username:g})}catch(f){}}}})(window,document,kik);(function(g,h,b){var j;try{j=b._.bridge("UserData")}catch(d){b.hasPermission=function(){return false};return}b.kik=b;function i(k){if(!k){return undefined}k.fullName=(k.displayName||"");var l=k.fullName.indexOf(" ");if(l===-1){k.firstName=k.fullName;k.lastName=""}else{k.firstName=k.fullName.substr(0,l);k.lastName=k.fullName.substr(l+1)}delete k.displayName;k.pic=e(k.pic);k.thumbnail=e(k.thumbnail);return k}function e(k){if(typeof k!=="string"){return k}var l=k.replace(/^https?\:\/\/[^\/]*/,"");return"//d33vud085sp3wg.cloudfront.net"+l}var f;if(j.getUserData){b.getUser=function(p,k){switch(typeof p){case"undefined":p=function(){};case"function":break;default:throw TypeError("callback must be a function if defined, got "+p)}if(f){p(f);return}var o=b.hasPermission(),n=b.utils.platform.os,l=b.utils.platform.browser,m={fields:["profile"],skipPrompt:!!k};if(k&&n.android&&l.kik&&l.version<7.2){m.fields.push("skipPrompt")}j.getUserData(m,function(r){var q=i(r&&r.userData);if(q){f=q;if(!o){b.trigger("permission")}}if(n.ios&&!o){setTimeout(function(){p(q)},600)}else{p(q)}})}}b.hasPermission=function(){try{return !!j.checkPermissions({fields:["profile"]}).permitted}catch(k){return false}};if(j.pickUsers||j.pickFilteredUsers){b.pickUsers=function(k,l){switch(typeof k){case"function":l=k;case"undefined":k={};case"object":break;default:throw TypeError("options must be an object if defined, got "+k)}if(typeof l!=="function"){throw TypeError("callback must be a function, got "+l)}switch(typeof k.preselected){case"undefined":k.preselected=[];break;default:if(!Array.isArray(k.preselected)){throw TypeError("preselected users must be an array of users if defined, got "+k.preselected)}k.preselected=k.preselected.map(function(m){switch(typeof m){case"string":return{username:m};case"object":if(m!==null&&typeof m.username==="string"){return m}default:throw TypeError("preselected user didnt have a username, got "+m)}});break}switch(typeof k.filtered){case"undefined":k.filtered=[];break;default:if(!Array.isArray(k.filtered)){throw TypeError("filtered users must be an array of users if defined, got "+k.filtered)}k.filtered=k.filtered.map(function(m){switch(typeof m){case"string":return m;case"object":if(m!==null&&typeof m.username==="string"){return m.username}default:throw TypeError("filtered user didnt have a username, got "+m)}});break}switch(typeof k.filterSelf){case"undefined":k.filterSelf=true;case"boolean":break;default:throw TypeError("filterSelf must be a boolean if defined, got "+k.filterSelf)}switch(typeof k.minResults){case"undefined":break;case"number":if(k.minResults<0){throw TypeError("minResults must be non-negative if defined, got "+k.minResults)}break;default:throw TypeError("minResults must be a number if defined, got "+k.minResults)}switch(typeof k.maxResults){case"undefined":break;case"number":if(k.maxResults<1){throw TypeError("maxResults must be greater than 1 if defined, got "+k.maxResults)}break;default:throw TypeError("maxResults must be a number if defined, got "+k.maxResults)}switch(typeof l){case"undefined":l=function(){};break;case"function":break;default:throw TypeError("callback must be a function if defined, got "+l)}if(k.preselected.length&&k.filtered.length){throw TypeError("can only preselect or filter users, not both")}if(j.pickFilteredUsers&&!k.preselected.length){c(k,l)}else{a(k,l)}}}function c(k,l){k.minResults=k.minResults||1;j.pickFilteredUsers({minResults:k.minResults,maxResults:k.maxResults,filtered:k.filtered,filterSelf:k.filterSelf},function(m){if(!m||!m.userDataList){l();return}var n=m.userDataList.map(i);if(k.filtered){n=n.filter(function(o){return k.filtered.indexOf(o.username)===-1})}l(n)})}function a(m,q){var o=false;if(!m.preselected||!m.preselected.length){m.minResults=m.minResults||1}var k={},n=[];m.preselected.forEach(function(r){k[r.username]=r;n.push(r.username)});j.pickUsers({minResults:m.minResults,maxResults:m.maxResults,preselected:n,filterSelf:m.filterSelf},function(r){if(o){return}if(!r||!r.userDataList){o=true;q();return}var s=r.userDataList.map(function(t){if(t.username in k){return k[t.username]}else{return i(t)}});if(m.filtered){s=s.filter(function(t){return m.filtered.indexOf(t.username)===-1})}o=true;q(s)});var p=b.utils.platform.os,l=b.utils.platform.browser;if(p.ios&&l.kik&&l.version<6.5){b.browser.once("foreground",function(){setTimeout(function(){if(!o){o=true;q()}},0)})}}})(window,document,kik);(function(e,a,c){var b;try{b=c._.bridge("Auth")}catch(d){}if(!b||!b.signRequest){return}c.kik=c;c.sign=function(i,k,g){if(typeof i!=="string"){throw TypeError("data to be signed must be a string, got "+i)}if(typeof k!=="function"){throw TypeError("callback must be a function, got "+k)}g=!!g;var j=c.utils.platform.os,h=c.utils.platform.browser;if(j.android&&h.version<6.5){c.ready(function(){f(i,k,g)})}else{f(i,k,g)}};function f(h,j,g){var i=c.hasPermission();b.signRequest({request:h,skipPrompt:g},function(l){if(!l||!l.signedRequest){j()}else{if(!i){c.trigger("permission")}var k=e.location.host;if(l.host){k=l.host.split("/")[0]}j(l.signedRequest,l.username,k)}})}if(b.getAnonymousId){c.getAnonymousUser=function(g){b.getAnonymousId(function(h){if(h&&h.anonymousId){g(h.anonymousId)}else{g()}})}}if(b.signAnonymousRequest){c.anonymousSign=function(g,h){if(typeof g!=="string"){throw TypeError("data to be signed must be a string, got "+g)}if(typeof h!=="function"){throw TypeError("callback must be a function, got "+h)}b.signAnonymousRequest({request:g},function(i){if(!i||!i.signedRequest){h()}else{h(i.signedRequest,i.anonymousId,i.host)}})}}})(window,document,kik);(function(f,h,a){var i;try{i=a._.bridge("Photo")}catch(c){return}var b=a.events();a.photo=b;if(i.getPhoto){b.get=function(j,k){e(j,k)};b.getFromCamera=function(j,k){e("camera",j,k)};b.getFromGallery=function(j,k){e("gallery",j,k)}}function d(j,k){switch(typeof k){case"undefined":case"function":break;default:throw TypeError(j+" must be a function if defined, got "+k)}}function g(j,l,k,m){switch(typeof l){case"undefined":break;case"number":if(l<k||l>m){throw TypeError(j+" must be within "+k+" and "+m+" if defined, got "+l)}break;default:throw TypeError(j+" must be a number if defined, got "+l)}}function e(j,y,x){if(typeof j!=="string"){x=y;y=j;j=undefined}switch(typeof y){case"function":x=y;y={};case"object":break;default:throw TypeError("options must be an object, got "+y)}d("callback",x);d("onCancel",y.onCancel);d("onSelect",y.onSelect);d("onPhoto",y.onPhoto);d("onComplete",y.onComplete);g("quality",y.quality,0,1);g("minResults",y.minResults,0,25);g("maxResults",y.maxResults,1,25);g("maxHeight",y.maxHeight,0,1280);g("maxWidth",y.maxWidth,0,1280);var r=y.onSelect,t=y.onCancel,v=y.onPhoto,l=y.onComplete,s=false,m=a.utils.platform.os,o=a.utils.platform.browser,q,u;if(y.minResults===0){y.minResults=1}i.getPhoto({source:j,quality:y.quality,minResults:y.minResults,maxResults:y.maxResults,maxHeight:y.maxHeight,maxWidth:y.maxWidth,autoSave:y.saveToGallery},n);if(m.android&&(o.version<6.7)){a.browser.once("foreground",function(){setTimeout(function(){if(s){return}s=true;p(t);p(x)},0)})}function n(z){if(s){return}s=true;q=z&&z.photoIds;var A=q&&q.length;if(!A){p(t);p(x);return}p(r,A);u=new Array(A);i.on("photo",w)}function w(D){if(!D){return}var B=q.indexOf(D.id);if(B===-1){return}D.url=D.url||null;q[B]=null;u[B]=D.url;var A=0;for(var C=0,z=q.length;C<z;C++){if(q[C]!==null){A++}}p(v,D.url,B);if(A===0){k()}}function k(){i.off("photo",w);p(l,u);p(x,u)}function p(C,A,z){if(!C){return}try{C(A,z)}catch(B){a.utils.error(B)}}}if(i.savePhoto){b.saveToGallery=function(j,m){switch(typeof m){case"undefined":m=function(){};case"function":break;default:throw TypeError("callback must be a function, got "+m)}try{i.savePhoto({url:j},function(n){k(!!n)})}catch(l){k(false)}function k(n){k=function(){};m(n)}}}})(window,document,kik);(function(i,j,a){var b;try{b=a._.bridge("Keyboard")}catch(f){}var k="kik-hide-form-helpers";var h=a.utils.platform.browser;l();a.formHelpers={show:g,hide:e,isEnabled:c};function l(){var m;Array.prototype.forEach.call(j.getElementsByTagName("meta"),function(n){if(n.name===k){m=(n.content||"").trim()}});if(m!=="true"){return}if(h.kik&&h.version<=6.5){a.ready(function(){d(false)})}else{d(false)}}function e(){d(false)}function g(){d(true)}function d(m){if(a._.secondBatch){a._.secondBatch.push({name:"Keyboard.setFormNavigationEnabled",args:{enabled:m}})}else{try{b.setFormNavigationEnabled({enabled:m})}catch(n){}}}function c(){try{return !!b.isFormNavigationEnabled().enabled}catch(m){return !!a.utils.platform.os.ios}}})(window,document,kik);(function(e,f,a){var h;try{h=a._.bridge("Picker")}catch(b){return}if(!h.startRequest){return}var d=a.events(i);a.picker=d;function i(l,k,m){if(typeof l!=="string"){throw TypeError("picker url must be a string, got "+l)}switch(typeof k){case"function":m=k;case"undefined":k={};case"object":break;default:throw TypeError("picker options must be an object if defined, got "+k)}if(typeof m!=="function"){throw TypeError("picker callback must be a function, got "+m)}h.startRequest({requestUrl:l,requestData:k},function(n){m(n&&n.responseData)})}if(h.getRequest&&h.completeRequest){var c,j;try{c=(a._.secondBatch?a._.firstBatch["Picker.getRequest"]:h.getRequest()).requestData}catch(b){}if(c){var g=f.referrer||"";j=!!(c.kik&&(g.split("?")[0]==="https://kik.com/"));d.url=g.split("#")[0];d.data=c;d.fromKik=j;d.reply=function(l){if(j&&l){l=a._formatMessage(l)}try{h.completeRequest({responseData:l})}catch(k){}};d.cancel=function(){try{h.cancelRequest()}catch(k){}if(!d.isPopup){d.url=undefined;d.data=undefined;d.reply=undefined;d.cancel=undefined;d.trigger("cancel")}}}else{}}else{}try{if(a._.firstBatch&&a._.firstBatch["Browser.isPopupMode"]){d.isPopup=a._.firstBatch["Browser.isPopupMode"].popup}else{d.isPopup=a._.bridge("Browser").isPopupMode().popup}}catch(b){d.isPopup=false}})(window,document,kik);(function(h,b,e){var a;try{a=e._.bridge("Push")}catch(g){return}var c=e.events();e.push=c;if(a.setBadgeVisibility){c.badge=function(i){a.setBadgeVisibility({visible:!!i,blue:true});c.trigger("badge",!!i)}}if(a.getPushToken){c.getToken=function(i){if(typeof i!=="function"){throw TypeError("callback must be a function, got "+i)}a.getPushToken(function(j){i(j&&j.token)})}}if(a.getNotificationList){var d=e.events.handlers();var f=function(){var p;try{if(e._.firstBatch&&e._.firstBatch["Push.getNotificationList"]){p=e._.firstBatch["Push.getNotificationList"]}else{p=a.getNotificationList()}}catch(o){}var k=(e.picker&&e.picker.isPopup),r=true;if(!k){r=false;try{a.setBadgeVisibility({visible:false});c.trigger("badge",false)}catch(o){}}else{c.once("badge",function(){r=false})}var n=[];if(p&&p.notifications){for(var m=0,j=p.notifications.length;m<j;m++){if(typeof p.notifications[m]==="object"){switch(typeof p.notifications[m].data){case"object":n.push(p.notifications[m].data);break;case"string":try{var q=JSON.parse(p.notifications[m].data);if(typeof q==="object"){n.push(q)}else{}}catch(o){}break;default:break}}}}if(n.length){d.triggerMulti(n);n.forEach(function(i){c.trigger("push",i)})}else{r=false}if(r){try{a.setBadgeVisibility({visible:true,blue:true});c.trigger("badge",true)}catch(o){}}};c.handler=function(i){return d.handler(i)};a.on("notificationReceived",function(){var i=e.utils.platform;if(i.os.ios&&i.browser.version<6.4){setTimeout(f,0)}else{f()}});f()}})(window,document,kik);(function(f,g,b){var h;try{h=b._.bridge("IAP")}catch(d){return}if(!h.purchase||!h.markTransactionStored||!h.getTransactionList){return}var c=b.events(a);c.init=i;b.purchase=c;function i(j,n){if(typeof arguments[0]==="string"){j=Array.prototype.slice.call(arguments)}if(!Array.isArray(j)){throw TypeError("list of SKUs must be an array")}j.forEach(function(o){if(typeof o!=="string"){throw TypeError("SKU must be a string, got "+o)}});if(typeof n==="function"){if(!h.getAvailableItemsAsynchronously){var m;try{m=h.getAvailableItems({skus:j})}catch(k){}l(m)}else{h.getAvailableItemsAsynchronously({skus:j},l)}}else{if(!h.getAvailableItems){l()}else{var m;try{m=h.getAvailableItems({skus:j})}catch(k){}l(m)}}function l(q){var o;try{o=q.items}catch(p){}if(!o||!Array.isArray(o)){o=[]}var r;try{r=h.getTransactionList({skus:j}).transactions}catch(p){r=[]}r.forEach(function(t){if(!t.sku){try{t.sku=JSON.parse(f.atob(t.content.split(".")[1])).item.sku}catch(s){}}});c.init=null;c.complete=e;c.items=o;c.pending=r;if(typeof n==="function"){n()}}}function a(n,l,m,j){switch(typeof n){case"object":if(n===null){throw TypeError("SKU must be a string, got "+n)}if(typeof n.sku!=="string"){throw TypeError("SKU must be a string, got "+n.sku)}n=n.sku;case"string":break;default:throw TypeError("SKU must be a string, got "+n)}var k=c.items.map(function(o){return o.sku}).indexOf(n);if(k===-1){throw TypeError("SKU not available, got "+n)}switch(typeof l){case"boolean":m=l;l=undefined;case"function":j=m;m=l;case"undefined":l={};case"object":break;default:throw TypeError("purchase data must be a JSON object if defined, got "+l)}switch(typeof m){case"boolean":j=m;case"undefined":m=function(){};case"function":break;default:throw TypeError("purchase callback must be a function if defined, got "+m)}switch(typeof j){case"undefined":j=false;case"boolean":break;default:throw TypeError("skipPrompt must be a boolean if defined, got "+j)}h.purchase({sku:n,data:l,skipPrompt:j},function(o){if(!o){m(undefined,true);return}if(!o.transaction){m();return}c.pending.push(o.transaction);m(o.transaction)})}function e(k){if(typeof k!=="string"){throw TypeError("transactionId must be a string, got "+k)}h.markTransactionStored({transactionId:k});for(var j=c.pending.length;j--;){if(c.pending[j].transactionId===k){c.pending.splice(j,1)}}}})(window,document,kik);(function(d,a,c){if(b()){e()}function b(){var g=c.utils.platform.os,f=c.utils.platform.browser;return(g.ios&&f.kik&&(f.version<6.5))}function e(){a.documentElement.addEventListener("click",function(g){if(!g.defaultPrevented&&g.target&&g.target.nodeName==="A"&&g.target.href&&!g.target._clickable){var f=c.browser;if(f){f.open(g.target.href);g.preventDefault();return false}}})}})(window,document,kik);(function(a){delete a._.firstBatch;if(a._.secondBatch){a._.bridge.batch(a._.secondBatch);delete a._.secondBatch}})(kik);(function(g,h,a){var c="kik-prefer",d="kik-unsupported";b();j();function b(){if(a.enabled){return}var l=a.utils.url;if(l.query._app_platform){return}var m="card"+l.updateQuery({kikme:null}).substr(4),k=!!l.query.kikme;if(!k){Array.prototype.forEach.call(h.getElementsByTagName("meta"),function(n){if((n.name===c)&&(n.content||"").trim()){k=true}})}if(k){a.ready(function(){a.open.card(m,undefined,true)})}}function e(){var r=a.utils.platform.os,n;Array.prototype.forEach.call(h.getElementsByTagName("meta"),function(l){if(l.name===d){n=(l.content||"").trim()}});if(!n){return true}var k=true;var s=n.split(",");for(var p=0,m=s.length;p<m;p++){var q=s[p].trim();var o=f(q);if(q&&o){if(o.ios&&r.ios){if(r.version<(o.version+1)){k=false}}else{if(o.android&&r.android){if(r.version<=o.version){k=false}}}}}return k}function f(k){var n=-1,m=false,l=false;if(k.indexOf("android-")===0){l=true;n=parseFloat(k.replace("android-",""));if(n>=2.3){return i(k)}}else{if(k.indexOf("ios-")===0){m=true;n=parseFloat(k.replace("ios-",""));if(n>=6){return i(k)}}else{return i(k)}}return{ios:m,android:l,version:n}}function i(k){if(g.console&&g.console.error){g.console.error('"'+k+'" is an unsupported value for the "'+d+'" meta tag')}return false}function j(){if(e()){return}var l=a.utils.platform.os,s=h.documentElement;Array.prototype.forEach.call(s.childNodes,function(v){s.removeChild(v)});s.style["min-height"]="0";s.style["min-width"]="0";s.style.height="0";s.style.width="0";s.style.padding="0";s.style.border="none";s.style.margin="0";s.style.overflow="hidden";var q=h.createElement("head"),u=h.createElement("meta");u.name="viewport";u.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no";q.appendChild(u);s.appendChild(q);var m=h.createElement("body");m.style.margin="0";m.style.padding="0";var k=h.createElement("div");k.style.position="absolute";k.style.top="0";k.style.left="0";k.style.height="0";k.style.width="0";k.style.background="#31333B";k.style.zIndex="100000000000";k.style.fontFamily='"Helvetica Neue", Helvetica, Arial, sans-serif';if(l.android){k.style.fontFamily='"Roboto", sans-serif'}var n=h.createElement("div");n.style.position="fixed";n.style.left="0";n.style.zIndex="100000000000";var p=h.createElement("div");p.style.backgroundImage="url('http://cdn.kik.com/cards/unsupported_icon.png')";p.style["background-size"]="100%";p.style.width="100px";p.style.height="100px";p.style.margin="0 auto";var r=h.createElement("div");r.style.color="#E0E0E0";r.style.padding="20px";r.style.textAlign="center";r.style.margin="0 auto";r.style.fontSize="16px";r.innerHTML="Oh no! This website isn't supported on your phone.";var t=h.createElement("div");t.style.color="#979799";t.style.padding="0 20px";t.style.textAlign="center";t.style.margin="0 auto";t.innerHTML="This website is not available for your phone. But don't worry! You can still use the Kik Messenger you know and love :)";n.appendChild(p);n.appendChild(r);n.appendChild(t);k.appendChild(n);if(l.android&&l.version<2.3){Array.prototype.forEach.call(s.childNodes,function(v){s.removeChild(v)})}m.appendChild(k);s.appendChild(m);s.style["-webkit-user-select"]="none";s.style["user-select"]="none";s.style.background="#31333B";function o(){s.style.height=screen.height+"px";s.style.width=screen.width+"px";s.style["max-height"]=screen.height+"px";s.style["max-width"]=screen.width+"px";m.style.height=screen.height+"px";m.style.width=screen.width+"px";k.style.height=screen.height+"px";k.style.width=screen.width+"px";n.style.width=screen.width+"px";n.style.top=screen.height*0.15+"px";r.style.width=screen.width*0.65+"px";t.style.width=screen.width*0.65+"px"}g.onorientationchange=function(v){if(v.stopImmediatePropagation){v.stopImmediatePropagation()}v.preventDefault();v.stopPropagation();v.cancelBubble=true;v.returnValue=false;return false};setTimeout(o,50);if(s.addEventListener){s.addEventListener("resize",o,false)}delete g.kik;throw TypeError("OS Version is not supported.")}})(window,document,kik);
|
|
|
|
|
|
</script>
|
|
|
|
<!-- commented out until internet archive comes back online
|
|
<script src="http://points.kik.com/points.js"></script>
|
|
<script src="https://points.kik.com/points.js"></script>
|
|
-->
|
|
<script>
|
|
window.crossPromoSettings = {
|
|
currentGame : 'bouncyflappy'
|
|
};
|
|
</script>
|
|
<script>
|
|
var Ajax={send:function(url,method,params,success,fail){var xhr;if(window.XMLHttpRequest){xhr=new XMLHttpRequest}else if(window.ActiveXObject){try{xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP")}}else{console.log("AJAX not supported by your browser.");return false}success=success||new Function;fail=fail||new Function;method=method.toUpperCase();params=params||{};var paramsArray=[];for(var i in params){paramsArray.push(i+"="+params[i])}var paramsString=paramsArray.join("&");if(method=="GET"){url+="?"+paramsString}xhr.open(method,url,true);xhr.onreadystatechange=function(){if(xhr.readyState!=4)return;if(xhr.status<200||xhr.status>=300){fail(xhr.status,xhr.responseText)}else{success(xhr.status,xhr.responseText)}};if(method=="POST"){xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhr.send(paramsString)}else{xhr.send(null)}}};(function(isStorage){if(!isStorage){var data={},undef;window.localStorage={setItem:function(id,val){return data[id]=String(val)},getItem:function(id){return data.hasOwnProperty(id)?data[id]:undef},removeItem:function(id){return delete data[id]},clear:function(){return data={}}}}})(function(){try{return"localStorage"in window&&window.localStorage!=null}catch(e){return false}}());(function(window,document,Math){var rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)};var utils=function(){var me={};var _elementStyle=document.createElement("div").style;var _vendor=function(){var vendors=["t","webkitT","MozT","msT","OT"],transform,i=0,l=vendors.length;for(;i<l;i++){transform=vendors[i]+"ransform";if(transform in _elementStyle)return vendors[i].substr(0,vendors[i].length-1)}return false}();function _prefixStyle(style){if(_vendor===false)return false;if(_vendor==="")return style;return _vendor+style.charAt(0).toUpperCase()+style.substr(1)}me.getTime=Date.now||function getTime(){return(new Date).getTime()};me.extend=function(target,obj){for(var i in obj){target[i]=obj[i]}};me.addEvent=function(el,type,fn,capture){el.addEventListener(type,fn,!!capture)};me.removeEvent=function(el,type,fn,capture){el.removeEventListener(type,fn,!!capture)};me.momentum=function(current,start,time,lowerMargin,wrapperSize,deceleration){var distance=current-start,speed=Math.abs(distance)/time,destination,duration;deceleration=deceleration===undefined?6e-4:deceleration;destination=current+speed*speed/(2*deceleration)*(distance<0?-1:1);duration=speed/deceleration;if(destination<lowerMargin){destination=wrapperSize?lowerMargin-wrapperSize/2.5*(speed/8):lowerMargin;distance=Math.abs(destination-current);duration=distance/speed}else if(destination>0){destination=wrapperSize?wrapperSize/2.5*(speed/8):0;distance=Math.abs(current)+destination;duration=distance/speed}return{destination:Math.round(destination),duration:duration}};var _transform=_prefixStyle("transform");me.extend(me,{hasTransform:_transform!==false,hasPerspective:_prefixStyle("perspective")in _elementStyle,hasTouch:"ontouchstart"in window,hasPointer:navigator.msPointerEnabled,hasTransition:_prefixStyle("transition")in _elementStyle});me.isBadAndroid=/Android /.test(window.navigator.appVersion)&&!/Chrome\/\d/.test(window.navigator.appVersion);me.extend(me.style={},{transform:_transform,transitionTimingFunction:_prefixStyle("transitionTimingFunction"),transitionDuration:_prefixStyle("transitionDuration"),transitionDelay:_prefixStyle("transitionDelay"),transformOrigin:_prefixStyle("transformOrigin")});me.hasClass=function(e,c){var re=new RegExp("(^|\\s)"+c+"(\\s|$)");return re.test(e.className)};me.addClass=function(e,c){if(me.hasClass(e,c)){return}var newclass=e.className.split(" ");newclass.push(c);e.className=newclass.join(" ")};me.removeClass=function(e,c){if(!me.hasClass(e,c)){return}var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g");e.className=e.className.replace(re," ")};me.offset=function(el){var left=-el.offsetLeft,top=-el.offsetTop;while(el=el.offsetParent){left-=el.offsetLeft;top-=el.offsetTop}return{left:left,top:top}};me.preventDefaultException=function(el,exceptions){for(var i in exceptions){if(exceptions[i].test(el[i])){return true}}return false};me.extend(me.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3});me.extend(me.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(k){return k*(2-k)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(k){return Math.sqrt(1- --k*k)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(k){var b=4;return(k=k-1)*k*((b+1)*k+b)+1}},bounce:{style:"",fn:function(k){if((k/=1)<1/2.75){return 7.5625*k*k}else if(k<2/2.75){return 7.5625*(k-=1.5/2.75)*k+.75}else if(k<2.5/2.75){return 7.5625*(k-=2.25/2.75)*k+.9375}else{return 7.5625*(k-=2.625/2.75)*k+.984375}}},elastic:{style:"",fn:function(k){var f=.22,e=.4;if(k===0){return 0}if(k==1){return 1}return e*Math.pow(2,-10*k)*Math.sin((k-f/4)*2*Math.PI/f)+1}}});me.tap=function(e,eventName){var ev=document.createEvent("Event");ev.initEvent(eventName,true,true);ev.pageX=e.pageX;ev.pageY=e.pageY;e.target.dispatchEvent(ev)};me.click=function(e){var target=e.target,ev;if(!/(SELECT|INPUT|TEXTAREA)/i.test(target.tagName)){ev=document.createEvent("MouseEvents");ev.initMouseEvent("click",true,true,e.view,1,target.screenX,target.screenY,target.clientX,target.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null);ev._constructed=true;target.dispatchEvent(ev)}};return me}();function IScroll(el,options){this.wrapper=typeof el=="string"?document.querySelector(el):el;this.scroller=this.wrapper.children[0];this.scrollerStyle=this.scroller.style;this.options={resizeScrollbars:true,mouseWheelSpeed:20,snapThreshold:.334,startX:0,startY:0,scrollY:true,directionLockThreshold:5,momentum:true,bounce:true,bounceTime:600,bounceEasing:"",preventDefault:true,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:true,useTransition:true,useTransform:true};for(var i in options){this.options[i]=options[i]}this.translateZ=this.options.HWCompositing&&utils.hasPerspective?" translateZ(0)":"";this.options.useTransition=utils.hasTransition&&this.options.useTransition;this.options.useTransform=utils.hasTransform&&this.options.useTransform;this.options.eventPassthrough=this.options.eventPassthrough===true?"vertical":this.options.eventPassthrough;this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault;this.options.scrollY=this.options.eventPassthrough=="vertical"?false:this.options.scrollY;this.options.scrollX=this.options.eventPassthrough=="horizontal"?false:this.options.scrollX;this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough;this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold;this.options.bounceEasing=typeof this.options.bounceEasing=="string"?utils.ease[this.options.bounceEasing]||utils.ease.circular:this.options.bounceEasing;this.options.resizePolling=this.options.resizePolling===undefined?60:this.options.resizePolling;if(this.options.tap===true){this.options.tap="tap"}if(this.options.shrinkScrollbars=="scale"){this.options.useTransition=false}this.options.invertWheelDirection=this.options.invertWheelDirection?-1:1;this.x=0;this.y=0;this.directionX=0;this.directionY=0;this._events={};this._init();this.refresh();this.scrollTo(this.options.startX,this.options.startY);this.enable()}IScroll.prototype={version:"5.1.1",_init:function(){this._initEvents();if(this.options.scrollbars||this.options.indicators){this._initIndicators()}if(this.options.mouseWheel){this._initWheel()}if(this.options.snap){this._initSnap()}if(this.options.keyBindings){this._initKeys()}},destroy:function(){this._initEvents(true);this._execEvent("destroy")},_transitionEnd:function(e){if(e.target!=this.scroller||!this.isInTransition){return}this._transitionTime();if(!this.resetPosition(this.options.bounceTime)){this.isInTransition=false;this._execEvent("scrollEnd")}},_start:function(e){if(utils.eventType[e.type]!=1){if(e.button!==0){return}}if(!this.enabled||this.initiated&&utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault&&!utils.isBadAndroid&&!utils.preventDefaultException(e.target,this.options.preventDefaultException)){e.preventDefault()}var point=e.touches?e.touches[0]:e,pos;this.initiated=utils.eventType[e.type];this.moved=false;this.distX=0;this.distY=0;this.directionX=0;this.directionY=0;this.directionLocked=0;this._transitionTime();this.startTime=utils.getTime();if(this.options.useTransition&&this.isInTransition){this.isInTransition=false;pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this._execEvent("scrollEnd")}else if(!this.options.useTransition&&this.isAnimating){this.isAnimating=false;this._execEvent("scrollEnd")}this.startX=this.x;this.startY=this.y;this.absStartX=this.x;this.absStartY=this.y;this.pointX=point.pageX;this.pointY=point.pageY;this._execEvent("beforeScrollStart")},_move:function(e){if(!this.enabled||utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault){e.preventDefault()}var point=e.touches?e.touches[0]:e,deltaX=point.pageX-this.pointX,deltaY=point.pageY-this.pointY,timestamp=utils.getTime(),newX,newY,absDistX,absDistY;this.pointX=point.pageX;this.pointY=point.pageY;this.distX+=deltaX;this.distY+=deltaY;absDistX=Math.abs(this.distX);absDistY=Math.abs(this.distY);if(timestamp-this.endTime>300&&absDistX<10&&absDistY<10){return}if(!this.directionLocked&&!this.options.freeScroll){if(absDistX>absDistY+this.options.directionLockThreshold){this.directionLocked="h"}else if(absDistY>=absDistX+this.options.directionLockThreshold){this.directionLocked="v"}else{this.directionLocked="n"}}if(this.directionLocked=="h"){if(this.options.eventPassthrough=="vertical"){e.preventDefault()}else if(this.options.eventPassthrough=="horizontal"){this.initiated=false;return}deltaY=0}else if(this.directionLocked=="v"){if(this.options.eventPassthrough=="horizontal"){e.preventDefault()}else if(this.options.eventPassthrough=="vertical"){this.initiated=false;return}deltaX=0}deltaX=this.hasHorizontalScroll?deltaX:0;deltaY=this.hasVerticalScroll?deltaY:0;newX=this.x+deltaX;newY=this.y+deltaY;if(newX>0||newX<this.maxScrollX){newX=this.options.bounce?this.x+deltaX/3:newX>0?0:this.maxScrollX}if(newY>0||newY<this.maxScrollY){newY=this.options.bounce?this.y+deltaY/3:newY>0?0:this.maxScrollY}this.directionX=deltaX>0?-1:deltaX<0?1:0;this.directionY=deltaY>0?-1:deltaY<0?1:0;if(!this.moved){this._execEvent("scrollStart")}this.moved=true;this._translate(newX,newY);if(timestamp-this.startTime>300){this.startTime=timestamp;this.startX=this.x;this.startY=this.y}},_end:function(e){if(!this.enabled||utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault&&!utils.preventDefaultException(e.target,this.options.preventDefaultException)){e.preventDefault()}var point=e.changedTouches?e.changedTouches[0]:e,momentumX,momentumY,duration=utils.getTime()-this.startTime,newX=Math.round(this.x),newY=Math.round(this.y),distanceX=Math.abs(newX-this.startX),distanceY=Math.abs(newY-this.startY),time=0,easing="";this.isInTransition=0;this.initiated=0;this.endTime=utils.getTime();if(this.resetPosition(this.options.bounceTime)){return}this.scrollTo(newX,newY);if(!this.moved){if(this.options.tap){utils.tap(e,this.options.tap)}if(this.options.click){utils.click(e)}this._execEvent("scrollCancel");return}if(this._events.flick&&duration<200&&distanceX<100&&distanceY<100){this._execEvent("flick");return}if(this.options.momentum&&duration<300){momentumX=this.hasHorizontalScroll?utils.momentum(this.x,this.startX,duration,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:newX,duration:0};momentumY=this.hasVerticalScroll?utils.momentum(this.y,this.startY,duration,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:newY,duration:0};newX=momentumX.destination;newY=momentumY.destination;time=Math.max(momentumX.duration,momentumY.duration);this.isInTransition=1}if(this.options.snap){var snap=this._nearestSnap(newX,newY);this.currentPage=snap;time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(newX-snap.x),1e3),Math.min(Math.abs(newY-snap.y),1e3)),300);newX=snap.x;newY=snap.y;this.directionX=0;this.directionY=0;easing=this.options.bounceEasing}if(newX!=this.x||newY!=this.y){if(newX>0||newX<this.maxScrollX||newY>0||newY<this.maxScrollY){easing=utils.ease.quadratic}this.scrollTo(newX,newY,time,easing);return}this._execEvent("scrollEnd")},_resize:function(){var that=this;clearTimeout(this.resizeTimeout);this.resizeTimeout=setTimeout(function(){that.refresh()},this.options.resizePolling)},resetPosition:function(time){var x=this.x,y=this.y;time=time||0;if(!this.hasHorizontalScroll||this.x>0){x=0}else if(this.x<this.maxScrollX){x=this.maxScrollX}if(!this.hasVerticalScroll||this.y>0){y=0}else if(this.y<this.maxScrollY){y=this.maxScrollY}if(x==this.x&&y==this.y){return false}this.scrollTo(x,y,time,this.options.bounceEasing);return true},disable:function(){this.enabled=false},enable:function(){this.enabled=true},refresh:function(){var rf=this.wrapper.offsetHeight;this.wrapperWidth=this.wrapper.clientWidth;this.wrapperHeight=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth;this.scrollerHeight=this.scroller.offsetHeight;this.maxScrollX=this.wrapperWidth-this.scrollerWidth;this.maxScrollY=this.wrapperHeight-this.scrollerHeight;this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0;this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0;if(!this.hasHorizontalScroll){this.maxScrollX=0;this.scrollerWidth=this.wrapperWidth}if(!this.hasVerticalScroll){this.maxScrollY=0;this.scrollerHeight=this.wrapperHeight}this.endTime=0;this.directionX=0;this.directionY=0;this.wrapperOffset=utils.offset(this.wrapper);this._execEvent("refresh");this.resetPosition()},on:function(type,fn){if(!this._events[type]){this._events[type]=[]}this._events[type].push(fn)},off:function(type,fn){if(!this._events[type]){return}var index=this._events[type].indexOf(fn);if(index>-1){this._events[type].splice(index,1)}},_execEvent:function(type){if(!this._events[type]){return}var i=0,l=this._events[type].length;if(!l){return}for(;i<l;i++){this._events[type][i].apply(this,[].slice.call(arguments,1))}},scrollBy:function(x,y,time,easing){x=this.x+x;y=this.y+y;time=time||0;this.scrollTo(x,y,time,easing)},scrollTo:function(x,y,time,easing){easing=easing||utils.ease.circular;this.isInTransition=this.options.useTransition&&time>0;if(!time||this.options.useTransition&&easing.style){this._transitionTimingFunction(easing.style);this._transitionTime(time);this._translate(x,y)}else{this._animate(x,y,time,easing.fn)}},scrollToElement:function(el,time,offsetX,offsetY,easing){el=el.nodeType?el:this.scroller.querySelector(el);if(!el){return}var pos=utils.offset(el);pos.left-=this.wrapperOffset.left;pos.top-=this.wrapperOffset.top;if(offsetX===true){offsetX=Math.round(el.offsetWidth/2-this.wrapper.offsetWidth/2)}if(offsetY===true){offsetY=Math.round(el.offsetHeight/2-this.wrapper.offsetHeight/2)}pos.left-=offsetX||0;pos.top-=offsetY||0;pos.left=pos.left>0?0:pos.left<this.maxScrollX?this.maxScrollX:pos.left;pos.top=pos.top>0?0:pos.top<this.maxScrollY?this.maxScrollY:pos.top;time=time===undefined||time===null||time==="auto"?Math.max(Math.abs(this.x-pos.left),Math.abs(this.y-pos.top)):time;this.scrollTo(pos.left,pos.top,time,easing)},_transitionTime:function(time){time=time||0;this.scrollerStyle[utils.style.transitionDuration]=time+"ms";if(!time&&utils.isBadAndroid){this.scrollerStyle[utils.style.transitionDuration]="0.001s"}if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].transitionTime(time)}}},_transitionTimingFunction:function(easing){this.scrollerStyle[utils.style.transitionTimingFunction]=easing;if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].transitionTimingFunction(easing)}}},_translate:function(x,y){if(this.options.useTransform){this.scrollerStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.translateZ}else{x=Math.round(x);y=Math.round(y);this.scrollerStyle.left=x+"px";this.scrollerStyle.top=y+"px"}this.x=x;this.y=y;if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].updatePosition()}}},_initEvents:function(remove){var eventType=remove?utils.removeEvent:utils.addEvent,target=this.options.bindToWrapper?this.wrapper:window;eventType(window,"orientationchange",this);eventType(window,"resize",this);if(this.options.click){eventType(this.wrapper,"click",this,true)}if(!this.options.disableMouse){eventType(this.wrapper,"mousedown",this);eventType(target,"mousemove",this);eventType(target,"mousecancel",this);eventType(target,"mouseup",this)}if(utils.hasPointer&&!this.options.disablePointer){eventType(this.wrapper,"MSPointerDown",this);eventType(target,"MSPointerMove",this);eventType(target,"MSPointerCancel",this);eventType(target,"MSPointerUp",this)}if(utils.hasTouch&&!this.options.disableTouch){eventType(this.wrapper,"touchstart",this);eventType(target,"touchmove",this);eventType(target,"touchcancel",this);eventType(target,"touchend",this)}eventType(this.scroller,"transitionend",this);eventType(this.scroller,"webkitTransitionEnd",this);eventType(this.scroller,"oTransitionEnd",this);eventType(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var matrix=window.getComputedStyle(this.scroller,null),x,y;if(this.options.useTransform){matrix=matrix[utils.style.transform].split(")")[0].split(", ");x=+(matrix[12]||matrix[4]);y=+(matrix[13]||matrix[5])}else{x=+matrix.left.replace(/[^-\d.]/g,"");y=+matrix.top.replace(/[^-\d.]/g,"")}return{x:x,y:y}},_initIndicators:function(){var interactive=this.options.interactiveScrollbars,customStyle=typeof this.options.scrollbars!="string",indicators=[],indicator;var that=this;this.indicators=[];if(this.options.scrollbars){if(this.options.scrollY){indicator={el:createDefaultScrollbar("v",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true,customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenX:false};this.wrapper.appendChild(indicator.el);indicators.push(indicator)}if(this.options.scrollX){indicator={el:createDefaultScrollbar("h",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true,customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenY:false};this.wrapper.appendChild(indicator.el);indicators.push(indicator)}}if(this.options.indicators){indicators=indicators.concat(this.options.indicators)}for(var i=indicators.length;i--;){this.indicators.push(new Indicator(this,indicators[i]))}function _indicatorsMap(fn){for(var i=that.indicators.length;i--;){fn.call(that.indicators[i])}}if(this.options.fadeScrollbars){this.on("scrollEnd",function(){_indicatorsMap(function(){this.fade()})});this.on("scrollCancel",function(){_indicatorsMap(function(){this.fade()})});this.on("scrollStart",function(){_indicatorsMap(function(){this.fade(1)})});this.on("beforeScrollStart",function(){_indicatorsMap(function(){this.fade(1,true)})})}this.on("refresh",function(){_indicatorsMap(function(){this.refresh()})});this.on("destroy",function(){_indicatorsMap(function(){this.destroy()});delete this.indicators})},_initWheel:function(){utils.addEvent(this.wrapper,"wheel",this);utils.addEvent(this.wrapper,"mousewheel",this);utils.addEvent(this.wrapper,"DOMMouseScroll",this);this.on("destroy",function(){utils.removeEvent(this.wrapper,"wheel",this);utils.removeEvent(this.wrapper,"mousewheel",this);utils.removeEvent(this.wrapper,"DOMMouseScroll",this)})},_wheel:function(e){if(!this.enabled){return}e.preventDefault();e.stopPropagation();var wheelDeltaX,wheelDeltaY,newX,newY,that=this;if(this.wheelTimeout===undefined){that._execEvent("scrollStart")}clearTimeout(this.wheelTimeout);this.wheelTimeout=setTimeout(function(){that._execEvent("scrollEnd");that.wheelTimeout=undefined},400);if("deltaX"in e){wheelDeltaX=-e.deltaX;wheelDeltaY=-e.deltaY}else if("wheelDeltaX"in e){wheelDeltaX=e.wheelDeltaX/120*this.options.mouseWheelSpeed;wheelDeltaY=e.wheelDeltaY/120*this.options.mouseWheelSpeed}else if("wheelDelta"in e){wheelDeltaX=wheelDeltaY=e.wheelDelta/120*this.options.mouseWheelSpeed}else if("detail"in e){wheelDeltaX=wheelDeltaY=-e.detail/3*this.options.mouseWheelSpeed}else{return}wheelDeltaX*=this.options.invertWheelDirection;wheelDeltaY*=this.options.invertWheelDirection;if(!this.hasVerticalScroll){wheelDeltaX=wheelDeltaY;wheelDeltaY=0}if(this.options.snap){newX=this.currentPage.pageX;newY=this.currentPage.pageY;if(wheelDeltaX>0){newX--}else if(wheelDeltaX<0){newX++}if(wheelDeltaY>0){newY--}else if(wheelDeltaY<0){newY++}this.goToPage(newX,newY);return}newX=this.x+Math.round(this.hasHorizontalScroll?wheelDeltaX:0);newY=this.y+Math.round(this.hasVerticalScroll?wheelDeltaY:0);if(newX>0){newX=0}else if(newX<this.maxScrollX){newX=this.maxScrollX}if(newY>0){newY=0}else if(newY<this.maxScrollY){newY=this.maxScrollY}this.scrollTo(newX,newY,0)},_initSnap:function(){this.currentPage={};if(typeof this.options.snap=="string"){this.options.snap=this.scroller.querySelectorAll(this.options.snap)}this.on("refresh",function(){var i=0,l,m=0,n,cx,cy,x=0,y,stepX=this.options.snapStepX||this.wrapperWidth,stepY=this.options.snapStepY||this.wrapperHeight,el;this.pages=[];if(!this.wrapperWidth||!this.wrapperHeight||!this.scrollerWidth||!this.scrollerHeight){return}if(this.options.snap===true){cx=Math.round(stepX/2);cy=Math.round(stepY/2);while(x>-this.scrollerWidth){this.pages[i]=[];l=0;y=0;while(y>-this.scrollerHeight){this.pages[i][l]={x:Math.max(x,this.maxScrollX),y:Math.max(y,this.maxScrollY),width:stepX,height:stepY,cx:x-cx,cy:y-cy};y-=stepY;l++}x-=stepX;i++}}else{el=this.options.snap;l=el.length;n=-1;for(;i<l;i++){if(i===0||el[i].offsetLeft<=el[i-1].offsetLeft){m=0;n++}if(!this.pages[m]){this.pages[m]=[]}x=Math.max(-el[i].offsetLeft,this.maxScrollX);y=Math.max(-el[i].offsetTop,this.maxScrollY);cx=x-Math.round(el[i].offsetWidth/2);cy=y-Math.round(el[i].offsetHeight/2);this.pages[m][n]={x:x,y:y,width:el[i].offsetWidth,height:el[i].offsetHeight,cx:cx,cy:cy};if(x>this.maxScrollX){m++}}}this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0);if(this.options.snapThreshold%1===0){this.snapThresholdX=this.options.snapThreshold;this.snapThresholdY=this.options.snapThreshold}else{this.snapThresholdX=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold);this.snapThresholdY=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold)}});this.on("flick",function(){var time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(this.x-this.startX),1e3),Math.min(Math.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,time)})},_nearestSnap:function(x,y){if(!this.pages.length){return{x:0,y:0,pageX:0,pageY:0}}var i=0,l=this.pages.length,m=0;if(Math.abs(x-this.absStartX)<this.snapThresholdX&&Math.abs(y-this.absStartY)<this.snapThresholdY){return this.currentPage}if(x>0){x=0}else if(x<this.maxScrollX){x=this.maxScrollX}if(y>0){y=0}else if(y<this.maxScrollY){y=this.maxScrollY}for(;i<l;i++){if(x>=this.pages[i][0].cx){x=this.pages[i][0].x;break}}l=this.pages[i].length;for(;m<l;m++){if(y>=this.pages[0][m].cy){y=this.pages[0][m].y;break}}if(i==this.currentPage.pageX){i+=this.directionX;if(i<0){i=0}else if(i>=this.pages.length){i=this.pages.length-1}x=this.pages[i][0].x}if(m==this.currentPage.pageY){m+=this.directionY;if(m<0){m=0}else if(m>=this.pages[0].length){m=this.pages[0].length-1}y=this.pages[0][m].y}return{x:x,y:y,pageX:i,pageY:m}},goToPage:function(x,y,time,easing){easing=easing||this.options.bounceEasing;if(x>=this.pages.length){x=this.pages.length-1}else if(x<0){x=0}if(y>=this.pages[x].length){y=this.pages[x].length-1}else if(y<0){y=0}var posX=this.pages[x][y].x,posY=this.pages[x][y].y;time=time===undefined?this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(posX-this.x),1e3),Math.min(Math.abs(posY-this.y),1e3)),300):time;this.currentPage={x:posX,y:posY,pageX:x,pageY:y};this.scrollTo(posX,posY,time,easing)},next:function(time,easing){var x=this.currentPage.pageX,y=this.currentPage.pageY;x++;if(x>=this.pages.length&&this.hasVerticalScroll){x=0;y++}this.goToPage(x,y,time,easing)},prev:function(time,easing){var x=this.currentPage.pageX,y=this.currentPage.pageY;x--;if(x<0&&this.hasVerticalScroll){x=0;y--}this.goToPage(x,y,time,easing)},_initKeys:function(e){var keys={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};var i;if(typeof this.options.keyBindings=="object"){for(i in this.options.keyBindings){if(typeof this.options.keyBindings[i]=="string"){this.options.keyBindings[i]=this.options.keyBindings[i].toUpperCase().charCodeAt(0)}}}else{this.options.keyBindings={}}for(i in keys){this.options.keyBindings[i]=this.options.keyBindings[i]||keys[i]}utils.addEvent(window,"keydown",this);this.on("destroy",function(){utils.removeEvent(window,"keydown",this)})},_key:function(e){if(!this.enabled){return}var snap=this.options.snap,newX=snap?this.currentPage.pageX:this.x,newY=snap?this.currentPage.pageY:this.y,now=utils.getTime(),prevTime=this.keyTime||0,acceleration=.25,pos;if(this.options.useTransition&&this.isInTransition){pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this.isInTransition=false}this.keyAcceleration=now-prevTime<200?Math.min(this.keyAcceleration+acceleration,50):0;switch(e.keyCode){case this.options.keyBindings.pageUp:if(this.hasHorizontalScroll&&!this.hasVerticalScroll){newX+=snap?1:this.wrapperWidth}else{newY+=snap?1:this.wrapperHeight}break;case this.options.keyBindings.pageDown:if(this.hasHorizontalScroll&&!this.hasVerticalScroll){newX-=snap?1:this.wrapperWidth}else{newY-=snap?1:this.wrapperHeight}break;case this.options.keyBindings.end:newX=snap?this.pages.length-1:this.maxScrollX;newY=snap?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:newX=0;newY=0;break;case this.options.keyBindings.left:newX+=snap?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:newY+=snap?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:newX-=snap?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:newY-=snap?1:5+this.keyAcceleration>>0;break;default:return}if(snap){this.goToPage(newX,newY);return}if(newX>0){newX=0;this.keyAcceleration=0}else if(newX<this.maxScrollX){newX=this.maxScrollX;this.keyAcceleration=0}if(newY>0){newY=0;this.keyAcceleration=0}else if(newY<this.maxScrollY){newY=this.maxScrollY;this.keyAcceleration=0}this.scrollTo(newX,newY,0);this.keyTime=now},_animate:function(destX,destY,duration,easingFn){var that=this,startX=this.x,startY=this.y,startTime=utils.getTime(),destTime=startTime+duration;function step(){var now=utils.getTime(),newX,newY,easing;if(now>=destTime){that.isAnimating=false;that._translate(destX,destY);if(!that.resetPosition(that.options.bounceTime)){that._execEvent("scrollEnd")}return}now=(now-startTime)/duration;easing=easingFn(now);newX=(destX-startX)*easing+startX;newY=(destY-startY)*easing+startY;that._translate(newX,newY);if(that.isAnimating){rAF(step)}}this.isAnimating=true;step()},handleEvent:function(e){switch(e.type){case"touchstart":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"MSPointerUp":case"mouseup":case"touchcancel":case"MSPointerCancel":case"mousecancel":this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(e);break;case"keydown":this._key(e);break;case"click":if(!e._constructed){e.preventDefault();e.stopPropagation()}break}}};function createDefaultScrollbar(direction,interactive,type){var scrollbar=document.createElement("div"),indicator=document.createElement("div");if(type===true){scrollbar.style.cssText="position:absolute;z-index:9999";indicator.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px"}indicator.className="iScrollIndicator";if(direction=="h"){if(type===true){scrollbar.style.cssText+=";height:7px;left:2px;right:2px;bottom:0";indicator.style.height="100%"}scrollbar.className="iScrollHorizontalScrollbar"}else{if(type===true){scrollbar.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px";indicator.style.width="100%"}scrollbar.className="iScrollVerticalScrollbar"}scrollbar.style.cssText+=";overflow:hidden";if(!interactive){scrollbar.style.pointerEvents="none"}scrollbar.appendChild(indicator);return scrollbar}function Indicator(scroller,options){this.wrapper=typeof options.el=="string"?document.querySelector(options.el):options.el;this.wrapperStyle=this.wrapper.style;this.indicator=this.wrapper.children[0];this.indicatorStyle=this.indicator.style;this.scroller=scroller;this.options={listenX:true,listenY:true,interactive:false,resize:true,defaultScrollbars:false,shrink:false,fade:false,speedRatioX:0,speedRatioY:0};for(var i in options){this.options[i]=options[i]}this.sizeRatioX=1;this.sizeRatioY=1;this.maxPosX=0;this.maxPosY=0;if(this.options.interactive){if(!this.options.disableTouch){utils.addEvent(this.indicator,"touchstart",this);utils.addEvent(window,"touchend",this)}if(!this.options.disablePointer){utils.addEvent(this.indicator,"MSPointerDown",this);utils.addEvent(window,"MSPointerUp",this)}if(!this.options.disableMouse){utils.addEvent(this.indicator,"mousedown",this);utils.addEvent(window,"mouseup",this)}}if(this.options.fade){this.wrapperStyle[utils.style.transform]=this.scroller.translateZ;this.wrapperStyle[utils.style.transitionDuration]=utils.isBadAndroid?"0.001s":"0ms";this.wrapperStyle.opacity="0"}}Indicator.prototype={handleEvent:function(e){switch(e.type){case"touchstart":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"MSPointerUp":case"mouseup":case"touchcancel":case"MSPointerCancel":case"mousecancel":this._end(e);break}},destroy:function(){if(this.options.interactive){utils.removeEvent(this.indicator,"touchstart",this);utils.removeEvent(this.indicator,"MSPointerDown",this);utils.removeEvent(this.indicator,"mousedown",this);utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,"MSPointerMove",this);utils.removeEvent(window,"mousemove",this);utils.removeEvent(window,"touchend",this);utils.removeEvent(window,"MSPointerUp",this);utils.removeEvent(window,"mouseup",this)}if(this.options.defaultScrollbars){this.wrapper.parentNode.removeChild(this.wrapper)}},_start:function(e){var point=e.touches?e.touches[0]:e;e.preventDefault();e.stopPropagation();this.transitionTime();this.initiated=true;this.moved=false;this.lastPointX=point.pageX;this.lastPointY=point.pageY;this.startTime=utils.getTime();if(!this.options.disableTouch){utils.addEvent(window,"touchmove",this)}if(!this.options.disablePointer){utils.addEvent(window,"MSPointerMove",this)}if(!this.options.disableMouse){utils.addEvent(window,"mousemove",this)}this.scroller._execEvent("beforeScrollStart")},_move:function(e){var point=e.touches?e.touches[0]:e,deltaX,deltaY,newX,newY,timestamp=utils.getTime();if(!this.moved){this.scroller._execEvent("scrollStart")
|
|
}this.moved=true;deltaX=point.pageX-this.lastPointX;this.lastPointX=point.pageX;deltaY=point.pageY-this.lastPointY;this.lastPointY=point.pageY;newX=this.x+deltaX;newY=this.y+deltaY;this._pos(newX,newY);e.preventDefault();e.stopPropagation()},_end:function(e){if(!this.initiated){return}this.initiated=false;e.preventDefault();e.stopPropagation();utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,"MSPointerMove",this);utils.removeEvent(window,"mousemove",this);if(this.scroller.options.snap){var snap=this.scroller._nearestSnap(this.scroller.x,this.scroller.y);var time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-snap.x),1e3),Math.min(Math.abs(this.scroller.y-snap.y),1e3)),300);if(this.scroller.x!=snap.x||this.scroller.y!=snap.y){this.scroller.directionX=0;this.scroller.directionY=0;this.scroller.currentPage=snap;this.scroller.scrollTo(snap.x,snap.y,time,this.scroller.options.bounceEasing)}}if(this.moved){this.scroller._execEvent("scrollEnd")}},transitionTime:function(time){time=time||0;this.indicatorStyle[utils.style.transitionDuration]=time+"ms";if(!time&&utils.isBadAndroid){this.indicatorStyle[utils.style.transitionDuration]="0.001s"}},transitionTimingFunction:function(easing){this.indicatorStyle[utils.style.transitionTimingFunction]=easing},refresh:function(){this.transitionTime();if(this.options.listenX&&!this.options.listenY){this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none"}else if(this.options.listenY&&!this.options.listenX){this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none"}else{this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none"}if(this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll){utils.addClass(this.wrapper,"iScrollBothScrollbars");utils.removeClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle){if(this.options.listenX){this.wrapper.style.right="8px"}else{this.wrapper.style.bottom="8px"}}}else{utils.removeClass(this.wrapper,"iScrollBothScrollbars");utils.addClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle){if(this.options.listenX){this.wrapper.style.right="2px"}else{this.wrapper.style.bottom="2px"}}}var r=this.wrapper.offsetHeight;if(this.options.listenX){this.wrapperWidth=this.wrapper.clientWidth;if(this.options.resize){this.indicatorWidth=Math.max(Math.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8);this.indicatorStyle.width=this.indicatorWidth+"px"}else{this.indicatorWidth=this.indicator.clientWidth}this.maxPosX=this.wrapperWidth-this.indicatorWidth;if(this.options.shrink=="clip"){this.minBoundaryX=-this.indicatorWidth+8;this.maxBoundaryX=this.wrapperWidth-8}else{this.minBoundaryX=0;this.maxBoundaryX=this.maxPosX}this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX}if(this.options.listenY){this.wrapperHeight=this.wrapper.clientHeight;if(this.options.resize){this.indicatorHeight=Math.max(Math.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8);this.indicatorStyle.height=this.indicatorHeight+"px"}else{this.indicatorHeight=this.indicator.clientHeight}this.maxPosY=this.wrapperHeight-this.indicatorHeight;if(this.options.shrink=="clip"){this.minBoundaryY=-this.indicatorHeight+8;this.maxBoundaryY=this.wrapperHeight-8}else{this.minBoundaryY=0;this.maxBoundaryY=this.maxPosY}this.maxPosY=this.wrapperHeight-this.indicatorHeight;this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY}this.updatePosition()},updatePosition:function(){var x=this.options.listenX&&Math.round(this.sizeRatioX*this.scroller.x)||0,y=this.options.listenY&&Math.round(this.sizeRatioY*this.scroller.y)||0;if(!this.options.ignoreBoundaries){if(x<this.minBoundaryX){if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth+x,8);this.indicatorStyle.width=this.width+"px"}x=this.minBoundaryX}else if(x>this.maxBoundaryX){if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth-(x-this.maxPosX),8);this.indicatorStyle.width=this.width+"px";x=this.maxPosX+this.indicatorWidth-this.width}else{x=this.maxBoundaryX}}else if(this.options.shrink=="scale"&&this.width!=this.indicatorWidth){this.width=this.indicatorWidth;this.indicatorStyle.width=this.width+"px"}if(y<this.minBoundaryY){if(this.options.shrink=="scale"){this.height=Math.max(this.indicatorHeight+y*3,8);this.indicatorStyle.height=this.height+"px"}y=this.minBoundaryY}else if(y>this.maxBoundaryY){if(this.options.shrink=="scale"){this.height=Math.max(this.indicatorHeight-(y-this.maxPosY)*3,8);this.indicatorStyle.height=this.height+"px";y=this.maxPosY+this.indicatorHeight-this.height}else{y=this.maxBoundaryY}}else if(this.options.shrink=="scale"&&this.height!=this.indicatorHeight){this.height=this.indicatorHeight;this.indicatorStyle.height=this.height+"px"}}this.x=x;this.y=y;if(this.scroller.options.useTransform){this.indicatorStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.scroller.translateZ}else{this.indicatorStyle.left=x+"px";this.indicatorStyle.top=y+"px"}},_pos:function(x,y){if(x<0){x=0}else if(x>this.maxPosX){x=this.maxPosX}if(y<0){y=0}else if(y>this.maxPosY){y=this.maxPosY}x=this.options.listenX?Math.round(x/this.sizeRatioX):this.scroller.x;y=this.options.listenY?Math.round(y/this.sizeRatioY):this.scroller.y;this.scroller.scrollTo(x,y)},fade:function(val,hold){if(hold&&!this.visible){return}clearTimeout(this.fadeTimeout);this.fadeTimeout=null;var time=val?250:500,delay=val?0:300;val=val?"1":"0";this.wrapperStyle[utils.style.transitionDuration]=time+"ms";this.fadeTimeout=setTimeout(function(val){this.wrapperStyle.opacity=val;this.visible=+val}.bind(this,val),delay)}};IScroll.utils=utils;if(typeof module!="undefined"&&module.exports){module.exports=IScroll}else{window.IScroll=IScroll}})(window,document,Math);(function(){var scripts=document.getElementsByTagName("script"),scriptLocation=scripts[scripts.length-1].src.replace(/\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+$/,"");window.addEventListener("load",function(){var defaultSettings={css:scriptLocation+"/crosspromo.css",utm_source:location.host,utm_medium:"icon-vertical",utm_campaign:"crosspromo",currentGame:null,gamesURL:scriptLocation+"/games.json",timeBetweenBounces:25e3,disableBounce:false,useCocoonWebviewOverlay:false,isCocoonWebviewOverlay:false,cocoonOverlayURL:"http://more.gamemix.com/cocoonoverlay.html",sessionsKey:"crosspromo-session",sessionsBeforeRate:2,askRate:true};var settings=window.crossPromoSettings||{};if(settings.isCocoonWebviewOverlay){console.log("CocoonJS cross promotion overlay");CocoonJS.App.proxifyConsole();var params=location.search.replace("?","").split("&"),split_param;for(var i=0;i<params.length;i++){split_param=params[i].split("=");if(split_param[0]=="currentGame"){settings.currentGame=split_param[1]}}settings.utm_source="cocoonnative-"+settings.currentGame}for(var i in defaultSettings){if(!(i in settings)){settings[i]=defaultSettings[i]}}var mainContainer,wrapper,scroller,shadow,tab,lastAction=0,lastBounce=0,ua=navigator.userAgent.toLowerCase(),isAndroid=ua.indexOf("android")>=0,isIOS=ua.indexOf("iphone")>=0||ua.indexOf("ipad")>=0||ua.indexOf("ipod")>=0,isFirefox=ua.indexOf("firefox")>=0,isNativeApp=window.cordova||window.P&&P.cocoon||navigator.isCocoonJS,sessionsData={},serverData=null;var preventDefault=function(e){e.preventDefault()};var stopPropagation=function(e){e.stopPropagation()};var preventClick=function(){lastAction=Date.now()};var isClickAllowed=function(){return Date.now()-lastAction>1500};var hasClass=function(elt,className){return elt.className.indexOf(className)>=0};var addClass=function(elt,className){if(!hasClass(elt,className)){elt.className+=" "+className}};var removeClass=function(elt,className){elt.className=elt.className.replace(className,"")};var show=function(){if(settings.useCocoonWebviewOverlay){CocoonJS.App.forwardAsync("window.crossPromo.show()")}else{close();addClass(document.body,"crosspromo-visible")}};var hide=function(){if(settings.useCocoonWebviewOverlay){CocoonJS.App.forwardAsync("window.crossPromo.hide()")}else{removeClass(document.body,"crosspromo-visible");close()}};var open=function(manual){addClass(document.body,"crosspromo-opened");scroller.refresh();scroller.scrollTo(0,0);if(typeof ga!=="undefined"){if(manual){ga("send","event","crosspromo","crosspromo-tab","crosspromo-open");if(Date.now()-lastBounce<5e3){ga("send","event","crosspromo","crosspromo-tab","crosspromo-open-bounce5")}}}};var close=function(manual){removeClass(document.body,"crosspromo-opened");if(typeof ga!=="undefined"&&manual){ga("send","event","crosspromo","crosspromo-tab","crosspromo-close")}};var isVisible=function(){return hasClass(document.body,"crosspromo-visible")};var isOpen=function(){return hasClass(document.body,"crosspromo-opened")};var toggleOpen=function(e){if(e){e.preventDefault()}if(!isOpen()){open(true)}else{close(true)}};var createGameItem=function(data,isCurrent){var item=document.createElement("div");item.setAttribute("title",data.title);item.className="crosspromo-vertical-item";var icon=new Image;icon.src=data.icon;icon.className="crosspromo-vertical-game-icon";item.appendChild(icon);var title=document.createElement("h3");title.className="crosspromo-vertical-game-title";title.innerHTML=data.title;item.appendChild(title);var description=document.createElement("p");description.className="crosspromo-vertical-game-description";description.innerHTML=data.description;item.appendChild(description);var url=document.createElement("span");url.innerHTML=data.url.replace("http://","").replace(/\/(.*)+/,"");url.className="crosspromo-vertical-game-url";var buttonsContainer=document.createElement("div");buttonsContainer.className="crosspromo-vertical-buttons-container";item.appendChild(buttonsContainer);if(!isCurrent){var tryButton=document.createElement("div");if(isIOS&&data.appStoreURL||isAndroid&&data.playStoreURL||isFirefox&&data.firefoxURL){tryButton.className="crosspromo-vertical-button-try"}else if(isIOS||isAndroid||isFirefox){tryButton.className="crosspromo-vertical-button-try-long"}else{tryButton.className="crosspromo-vertical-button-play-long"}buttonsContainer.appendChild(tryButton);tryButton.addEventListener("click",function(){openGame(data,"try")},false);icon.addEventListener("click",function(){openGame(data,"try")},false)}if((isIOS&&data.appStoreURL||isAndroid&&data.playStoreURL||isFirefox&&data.firefoxURL)&&!(isCurrent&&isNativeApp)){var dlButton=document.createElement("div");if(isCurrent){dlButton.className="crosspromo-vertical-button-download-long"}else{dlButton.className="crosspromo-vertical-button-download"}if(isIOS&&!data.appStoreURL||isAndroid&&!data.playStoreURL){dlButton.className+=" crosspromo-vertical-button-disabled"}buttonsContainer.appendChild(dlButton);dlButton.addEventListener("click",function(){openGame(data,"download")},false)}return item};var createTitle=function(t){var elt=document.createElement("h2");elt.className="crosspromo-vertical-title";elt.innerHTML=t;return elt};var setData=function(data){serverData=data;if(data.currentGame){wrapper.innerHTML="";wrapper.appendChild(createTitle("Now playing"));wrapper.appendChild(createGameItem(data.currentGame,true));var sep=document.createElement("hr");sep.className="crosspromo-vertical-separator";wrapper.appendChild(sep)}for(var i=0;i<data.others.length;i++){wrapper.appendChild(createGameItem(data.others[i]));var sep=document.createElement("hr");sep.className="crosspromo-vertical-separator";wrapper.appendChild(sep)}scroller.refresh()};var setCurrentGame=function(game){settings.currentGame=game;loadData()};var openGame=function(gameData,openType){if(isClickAllowed()){var url;if(openType=="try"){url=gameData.url;if(!window.kik||!kik.send){if(url.indexOf("?")==-1){url+="?"}else{url+="&"}url+="utm_source="+encodeURIComponent(settings.utm_source)+"&utm_medium="+encodeURIComponent(settings.utm_medium)+"&utm_campaign="+encodeURIComponent(settings.utm_campaign)}}else if(openType=="download"){if(isIOS){url=gameData.appStoreURL}else if(isAndroid){url=gameData.playStoreURL}else if(isFirefox){url=gameData.firefoxURL}}if(window.kik&&kik.send){kik.open(url)}else if("standalone"in navigator&&navigator.standalone){window.open(url,"_blank");var a=document.createElement("a");a.setAttribute("href",url);a.setAttribute("target","_blank");var dispatch=document.createEvent("HTMLEvents");dispatch.initEvent("click",true,true);a.dispatchEvent(dispatch)}else if(settings.isCocoonWebviewOverlay){CocoonJS.App.openURL(url)}else if(window.cordova){window.open(url,"_system")}else{location=url}lastAction=Date.now();var displayedURL=url.replace(/^https?:\/\//,"").replace(/\?.*/,"").replace(/(\/.*)+$/,"")}};var showLoaderModal=function(msg){var modal=document.createElement("div");modal.className="crosspromo-loading-modal";document.body.appendChild(modal);var inner=document.createElement("div");inner.className="crosspromo-loading-inner";modal.appendChild(inner);var message=document.createElement("div");message.className="crosspromo-loading-message";inner.appendChild(message);message.innerHTML=msg;var icon=document.createElement("div");icon.className="crosspromo-loading-icon";inner.appendChild(icon);setTimeout(function(){document.body.removeChild(modal)},3e3)};var loadData=function(){addClass(document.body,"crosspromo-loading");var params={currentGame:settings.currentGame,t:(new Date).getMinutes()};Ajax.send(settings.gamesURL,"get",params,loadDataSuccess,loadDataFail)};var loadDataSuccess=function(code,content){var parsed=JSON.parse(content);setData(parsed);removeClass(document.body,"crosspromo-loading");adjustTab();if(settings.askRate){checkRate()}};var loadDataFail=function(code,content){console.log("Error while loading data")};var adjustTab=function(){setTimeout(function(){var separator=document.querySelector(".crosspromo-vertical-separator");if(separator){var needsToBeOpened=!hasClass(document.body,"crosspromo-adjusting");if(needsToBeOpened){addClass(document.body,"crosspromo-adjusting")}var rect=separator.getBoundingClientRect();tab.style.top=rect.top+"px";if(needsToBeOpened){removeClass(document.body,"crosspromo-adjusting")}}},100)};var bounce=function(force){var now=Date.now();if(!settings.disableBounce&&isVisible()&&!isOpen()&&(now-lastBounce>settings.timeBetweenBounces||force)){lastBounce=now;addClass(document.body,"crosspromo-vertical-bouncing");setTimeout(function(){stopBouncing()},1400);if(typeof ga!=="undefined"){ga("send","event","crosspromo","crosspromo-tab","crosspromo-bounce")}}};var stopBouncing=function(){removeClass(document.body,"crosspromo-vertical-bouncing")};var enableBounce=function(){settings.disableBounce=false};var disableBounce=function(){settings.disableBounce=true;stopBouncing()};var init=function(){if(!settings.useCocoonWebviewOverlay){var link=document.createElement("link");link.href=settings.css;link.rel="stylesheet";document.head.appendChild(link);mainContainer=document.createElement("div");mainContainer.id="crosspromo-vertical-container";document.body.appendChild(mainContainer);tab=document.createElement("div");tab.id="crosspromo-vertical-tab";tab.addEventListener("click",toggleOpen,false);tab.addEventListener("click",stopPropagation,false);tab.addEventListener("touchstart",toggleOpen,false);tab.addEventListener("touchstart",preventClick,false);tab.addEventListener("touchend",preventClick,false);mainContainer.appendChild(tab);var menu=document.createElement("div");menu.id="crosspromo-vertical-menu";mainContainer.appendChild(menu);wrapper=document.createElement("div");wrapper.id="crosspromo-vertical-menu-wrapper";menu.appendChild(wrapper);shadow=document.createElement("div");shadow.id="crosspromo-shadow";shadow.addEventListener("click",close,false);shadow.addEventListener("touchstart",close,false);document.body.appendChild(shadow);scroller=new IScroll("#crosspromo-vertical-menu",{mouseWheel:true,bounce:false,click:true});window.addEventListener("resize",adjustTab);if(!isAndroid&&!isIOS){document.body.className+=" crosspromo-thin"}show();loadData();setInterval(bounce,5e3);loadSessionsData();addCurrentSession();if(settings.isCocoonWebviewOverlay){CocoonJS.App.forwardAsync("window.crossPromo.cocoonWebviewOverlayReady()");console.log("Overlay is ready")}}else{console.log("Creating overlay");CocoonJS.App.loadInTheWebView("http://more.gamemix.com/cocoonoverlay.html?currentGame="+settings.currentGame);CocoonJS.App.onLoadInTheWebViewSucceed.addEventListener(function(){CocoonJS.App.forward("CocoonJS.App.show(0, 0, "+window.innerWidth*window.devicePixelRatio+","+window.innerHeight*window.devicePixelRatio+");")})}console.log("Initialized cross promo")};var loadSessionsData=function(){var data=localStorage.getItem(settings.sessionsKey)||"";try{sessionsData=JSON.parse(data)||{}}catch(e){sessionsData={}}sessionsData.games=sessionsData.games||{}};var addCurrentSession=function(){sessionsData.games[settings.currentGame]=sessionsData.games[settings.currentGame]||{};sessionsData.games[settings.currentGame].sessions=sessionsData.games[settings.currentGame].sessions||[];sessionsData.games[settings.currentGame].ratePrompt=sessionsData.games[settings.currentGame].ratePrompt||false;sessionsData.games[settings.currentGame].sessions.push({timestamp:Date.now()});saveSessionsData();console.log("This is session #"+sessionsData.games[settings.currentGame].sessions.length)};var checkRate=function(){if(!sessionsData.games[settings.currentGame].ratePrompt&&sessionsData.games[settings.currentGame].sessions.length>=settings.sessionsBeforeRate&&serverData&&serverData.currentGame&&settings.isCocoonWebviewOverlay){var url;if(isAndroid){url=serverData.currentGame.playStoreURL}else if(isIOS){url=serverData.currentGame.appStoreURL}if(url){askRate(url)}}};var saveSessionsData=function(){localStorage.setItem(settings.sessionsKey,JSON.stringify(sessionsData))};var askRate=function(url){var store=isIOS?"in the App Store":"on Google Play",txt="Like "+serverData.currentGame.title+"? Please rate us "+store+".";if(confirm(txt)){CocoonJS.App.openURL(url)}sessionsData.games[settings.currentGame].ratePrompt=true;saveSessionsData()};var canBeRated=function(){checkRate()};init();window.crossPromo={settings:settings,show:show,hide:hide,open:open,close:close,adjust:adjustTab,bounce:bounce,disableBounce:disableBounce,enableBounce:enableBounce,setCurrentGame:setCurrentGame,showLoaderModal:showLoaderModal,canBeRated:canBeRated}})})();
|
|
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
window.gameVersion = '1.3.0';
|
|
window.G = {};
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div style="position: absolute; left: -1000px; font-family: 'Pixel5x5';"> </div>
|
|
<div id="mainCon">
|
|
<div id="limitCon">
|
|
<div id="centerDivWrapper">
|
|
<div id="centerDiv">
|
|
<div id="gameCanvasCon">
|
|
<canvas id="gameCanvas" width="480" height="690"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="adInterstitialScreen" class="screen dismissableArea">
|
|
<div class="screenContentWrapper dismissableArea">
|
|
<div class="screenContent dismissableArea">
|
|
<div id="adInterstitialWrapper" style="margin: 0 auto;">
|
|
<div id="div-gpt-ad" class="ad"></div>
|
|
<div id="div-leadbolt-ad" class="ad"></div>
|
|
<div id="div-mopub-ad" class="ad"></div>
|
|
<div id="adInterstitialClose"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" src="js/main-built.js"></script>
|
|
|
|
</body>
|
|
</html> |