-
Notifications
You must be signed in to change notification settings - Fork 0
/
flappy.js
272 lines (272 loc) · 133 KB
/
flappy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
(function(ia){function h(a){a=a||{};this.left=a.left||0;this.top=a.top||0;this.right=a.right||0;this.bottom=a.bottom||0;a.hasOwnProperty("x")&&(this.left=a.x);a.hasOwnProperty("y")&&(this.top=a.y);a.hasOwnProperty("width")&&(this.right=this.left+a.width);a.hasOwnProperty("height")&&(this.bottom=this.top+a.height);this.checkDimensions()}function aa(){this.map={}}function C(){this.eventMap={}}function J(a){this.keyMap={};g.addEventListener("keydown",c.bindFnc(this,this.keyDown),!1);g.addEventListener("keyup",
c.bindFnc(this,this.keyUp),!1);g.addEventListener("keypress",c.bindFnc(this,this.keyPress),!1)}function n(a){this.element=(a||{}).element;this.element.addEventListener("mousedown",c.bindFnc(this,this.mouseDown),!1);this.element.addEventListener("mousemove",c.bindFnc(this,this.mouseMove),!1);this.element.addEventListener("mouseup",c.bindFnc(this,this.mouseUp),!1);this.element.addEventListener("click",c.bindFnc(this,this.mouseClick),!1);this.element.addEventListener("touchstart",c.bindFnc(this,this.touchStart),
!1);this.element.addEventListener("touchmove",c.bindFnc(this,this.touchMove),!1);this.element.addEventListener("touchend",c.bindFnc(this,this.touchEnd),!1);this.scaledMouseY=this.scaledMouseX=this.mouseY=this.mouseX=this.skipMouseUp=this.skipMouseDown=this.numTouch=0;this.scaleY=this.scaleX=1}function ba(a){this.cookieMap=this.parseCookies()}function D(a){a=a||{};this.appCache=a.appCache;this.reloadOnNewUpdate=a.reloadOnNewUpdate;this.finished=!1}function L(a){var b=a||{},d,f,p,O,e,A,S,h;a=c.paramStringToObject(g.location.search);
var q="1"===a["abtd-reset"]||"true"===a["abtd-reset"];this.tests=b.tests||{};this.testsMap={};for(b=0;b<this.tests.length;b+=1)if(p=this.tests[b],!p.shouldRun||p.shouldRun())if(A=p.testName,S=L.COOKIE_PREFIX+A,f=p.valueMap,h=p.expire,this.testsMap[A]=a[S]||H.getCookie(S,null),q||!this.testsMap[A]||!f.hasOwnProperty(this.testsMap[A])){e=0;p=[];O=[];for(d in f)f.hasOwnProperty(d)&&(p.push(d),O.push({min:e,max:e+f[d]}),e+=f[d]);f=Math.random();for(d=0;d<O.length;d+=1)if(f>=O[d].min&&f<O[d].max){this.testsMap[A]=
p[d];H.setCookie(S,p[d],h||L.COOKIE_TTL);break}}}function l(a){a=a||{};this.id=a.id||"anim-"+l.IDPOOL++;this.manager=a.manager;this.startValue=a.startValue||0;this.endValue=a.endValue||0;this.timeFunction=a.timeFunction||l.easingFunctions.linear;this.startCallback=a.startCallback||null;this.stepCallback=a.stepCallback||null;this.endCallback=a.endCallback||null;this.duration=a.hasOwnProperty("duration")?a.duration:0;this.prepared=!1;this.endTime=this.startTime=-1}function Z(a){var b=a||{},d=0;l.call(this,
a);this.anims=b.anims||[];for(a=0;a<this.anims.length;a+=1)d+=this.anims[a].duration;this.duration=d;this.currentIndex=this.anims.length}function T(a){var b=a||{},d=0;l.call(this,a);this.anims=b.anims||[];if(b.hasOwnProperty("applyDuration"))for(this.duration=b.applyDuration,a=0;a<this.anims.length;a+=1)this.anims[a].duration=this.duration;else{for(a=0;a<this.anims.length;a+=1)b=this.anims[a],b.duration>d&&(d=b.duration);this.duration=d}}function ca(a){a=a||{};var b;this.anims={};if(a.anims)for(b in a.anims)a.anims.hasOwnProperty(b)&&
(this.anims[b]=a.anims[b],this.anims[b].manager=this);this.activeAnims=[]}function U(){}function F(a){a=a||{};this.x=a.x||0;this.y=a.y||0;this.anchorX=a.anchorX||0;this.anchorY=a.anchorY||0;this.parent=null}function V(a){var b=a||{};F.call(this,a);h.call(this,a);this.fillStyle=b.fillStyle||"#000000";this.opacity=b.hasOwnProperty("opacity")?b.opacity:1;this.visible=!0}function B(a){var b=a||{};F.call(this,a);this.visible=b.hasOwnProperty("visible")?b.visible:!0;this.children=[];this.scaleX=b.hasOwnProperty("scaleX")?
b.scaleX:1;this.scaleY=b.hasOwnProperty("scaleY")?b.scaleY:1;this.opacity=b.hasOwnProperty("opacity")?b.opacity:1;b.hasOwnProperty("scale")&&(this.scaleX=this.scaleY=b.scale)}function M(a){var b=a||{};F.call(this,a);this.width=b.width||0;this.height=b.height||0;this.image=b.img||b.image||new Image;this.sourceRect=b.sourceRect||new h({x:b.sourceX||0,y:b.sourceY||0,width:b.sourceWidth||this.image.width,height:b.sourceHeight||this.image.height});this.angle=b.angle||0;this.scaleX=b.scaleX||1;this.scaleY=
b.scaleY||1;b.hasOwnProperty("scale")&&(this.scaleX=this.scaleY=b.scale);this.opacity=b.opacity||1;this.visible=b.hasOwnProperty("visible")?b.visible||!1:!0}function da(a){var b=a||{};F.call(this,a);this.width=b.width||0;this.height=b.height||0;this.scaleX=b.scaleX||1;this.scaleY=b.scaleY||1;this.angle=b.angle||0;this.pattern=b.pattern||null;this.offsetX=b.offsetX||0;this.offsetY=b.offsetY||0;this.imageWidth=b.imageWidth||0;this.imageHeight=b.imageHeight||0;this.imageScaleX=b.imageScaleX||1;this.imageScaleY=
b.imageScaleY||1;this.imageOffsetX=b.imageOffsetX||0;this.imageOffsetY=b.imageOffsetY||0;b.hasOwnProperty("imageScale")&&(this.imageScaleX=this.imageScaleY=b.imageScale)}function W(a){this.applyFromOptions(a)}function t(a){var b=a||{};this.applyFromOptions(a);this.eventMap={};this.id=b.id||"button-"+t.IDPOOL++;this.state=t.states.UP;this.enabled=!0;b.clickFunction&&this.addEventListener(t.events.CLICK,b.clickFunction)}function P(a){var b=a||{};F.call(this,a);this.textAlign=b.textAlign||"left";this.textBaseline=
b.textBaseline||"top";this.fillStyle=b.fillStyle||"#000000";this.text=b.text||"";this.angle=b.angle||0;this.scaleX=b.hasOwnProperty("scaleX")?b.scaleX:1;this.scaleY=b.hasOwnProperty("scaleY")?b.scaleY:1;this.opacity=b.hasOwnProperty("opacity")?b.opacity:1;this.visible=b.hasOwnProperty("visible")?b.visible:!0;b.hasOwnProperty("scale")&&(this.scaleX=this.scaleY=b.scale)}function w(a){this.game=(a||{}).game||null;this.pageObj={page:Q.pathname,title:y.title};this.init()}function X(a){a=a||{};this.context=
a.context||null;this.image=a.image||null;this.spriteMap=a.spriteMap||{};this.sprites={};this.canvases={}}function R(a){var b=new Image;b.preSrc=a;b.onload=R.imgOnLoad;b.onerror=R.imgOnError;b.alreadyLoaded=!1;b.load=function(a,b){this.onLoadFunction=a;this.onErrorFunction=b;this.src=this.preSrc;this.complete&&!this.alreadyLoaded&&(this.alreadyLoaded=!0,this.onLoadFunction(this))};return b}function Y(a){var b=a||{};B.call(this,a);this.horizontalAlign=b.horizontalAlign||"center";this.verticalAlign=
b.verticalAlign||"middle";this.width=b.width||0;this.height=b.height||0;this.number=Math.floor(b.number)||0;this.scaleX=b.scaleX||1;this.scaleY=b.scaleY||1;this.numberSpacing=b.numberSpacing||0;b.hasOwnProperty("scale")&&(this.scaleX=this.scaleY=b.scale);this.baseSprite=b.numberSprite;this.updateNumber()}function ea(a){var b=a||{};B.call(this,a);this.width=b.width||0;this.height=b.height||0;this.bestScore=b.bestScore||0;this.score=b.score||0;this.isBestScoreNew=!1;this.board=b.boardSprite;this.board.width=
this.width;this.board.height=this.height;this.addChild(this.board);this.newLabel=b.newLabelSprite;this.newLabel.x=360;this.newLabel.y=150;this.newLabel.width=60;this.newLabel.height=30;this.newLabel.visible=!1;this.addChild(this.newLabel);this.medalsSprite=b.medalsSprite||null;this.medalsSprite.x=67;this.medalsSprite.y=111;this.medalsSprite.width=110;this.medalsSprite.height=110;this.addChild(this.medalsSprite);this.flappyNumbersScore=new Y({x:520,y:105,horizontalAlign:"right",verticalAlign:"top",
number:this.score,numberSprite:b.numberSprite});this.addChild(this.flappyNumbersScore);this.flappyNumbersBestScore=new Y({x:520,y:210,horizontalAlign:"right",verticalAlign:"top",number:this.bestScore,numberSprite:b.numberSprite});this.addChild(this.flappyNumbersBestScore)}function E(a){a=a||{};this.imgs={};this.imgCount=this.imgLoaded=0;this.imgListObj=a.images}function N(a){var b=a||{};this.sounds={};this.soundMap=a.sounds;this.enabled=createjs.WebAudioPlugin.isSupported()?createjs.Sound.initializeDefaultPlugins():
!1;g.cordova&&(this.enabled=!0,this.cordovaSounds={});this.mute=b.hasOwnProperty("mute")?b.mute:!1;this.soundsError=this.soundsCount=this.soundsLoaded=0}function G(a){var b=(a||{}).buttons||[];this.buttons=[];this.hoveredButton=this.downedButton=null;for(a=0;a<b.length;a+=1)this.addButton(b[a])}function k(a){a=a||{};this.game=a.game||null;this.shouldShowFunction=a.shouldShowFunction||function(){return!1};this.enabled=a.hasOwnProperty("enabled")?a.enabled:!0;this.platforms=a.platforms||k.platforms.DESKTOP|
k.platforms.MOBILE|k.platforms.TABLET;this.started=this.initted=!1}function u(a){var b=a||{};k.call(this,a);this.adSlot=null;this.unitName=b.unitName||null;this.size=b.size||null;this.divId=b.divId||null;this.containerDivId=b.containerDivId||null;this.started=this.hasGoogleTag=!1;g.googletag?this.hasGoogleTag=!0:this.enabled=!1;u.slotsToDefine.push(this)}function v(a){a=a||{};this.interstitialScreen=a.interstitialScreen;this.interstitialClose=a.interstitialClose;this.gameOverAdScreen=a.gameOverAdScreen;
this.interstitialAds=a.interstitialAds||[];this.currentInterstitialAd=null;this.gameOverAds=a.gameOverAds||[];this.currentGameOverAd=null;this.lastGameOverAdRotate=0;this.enabled=!0;this.gameOverHideCallback=this.interestitialHideCallback=null;this.game=a.game||null;this.events=v.events;this.desktopPage=!1;this.init()}function r(a){var b=a||{};M.call(this,a);this.startY=this.y;this.rectWidth=b.rectWidth||this.width;this.rectHeight=b.rectHeight||this.height;this.rect=new h({x:this.x-this.rectWidth/
2,y:this.y-this.rectHeight/2,width:this.rectWidth,height:this.rectHeight});this.speedY=this.speedX=0;this.stallingIndex=b.stallingIndex||0;this.started=!1;this.imgs=b.birdImages||[];this.spriteSpeed=b.spriteSpeed||150;this.state=r.states.cruising;this.previousIndex=0}function fa(a){var b=a||{};B.call(this,a);this.gapRect=b.gapRect||new h;this.pipesticleHeight=b.pipesticleHeight||0;this.needsToBeDestroyed=this.passed=!1;this.rect=new h({left:this.x,top:this.y,right:this.x+this.gapRect.getWidth(),bottom:this.y+
this.gapRect.getHeight()});this.pipeTiteRect=new h({left:0,top:0,right:this.gapRect.getWidth(),bottom:this.gapRect.top});this.pipeMiteRect=new h({left:0,top:this.gapRect.bottom,right:this.gapRect.getWidth(),bottom:this.pipesticleHeight});this.pipeFullTopSprite=b.pipeFullTopSprite.copy();this.pipeFullTopSprite.x=this.pipeTiteRect.left;this.pipeFullTopSprite.y=this.pipeTiteRect.top;this.pipeFullTopSprite.width=this.pipeTiteRect.getWidth();this.pipeFullTopSprite.height=this.pipeTiteRect.getHeight();
this.pipeFullTopSprite.sourceRect.setY(this.pipeFullTopSprite.sourceRect.getHeight()-this.pipeTiteRect.getHeight());this.pipeFullTopSprite.sourceRect.setHeight(this.pipeTiteRect.getHeight());this.addChild(this.pipeFullTopSprite);this.pipeFullBottomSprite=b.pipeFullBottomSprite.copy();this.pipeFullBottomSprite.x=this.pipeMiteRect.left;this.pipeFullBottomSprite.y=this.pipeMiteRect.top;this.pipeFullBottomSprite.width=this.pipeMiteRect.getWidth();this.pipeFullBottomSprite.height=this.pipeMiteRect.getHeight();
this.pipeFullBottomSprite.sourceRect.setHeight(this.pipeMiteRect.getHeight());this.addChild(this.pipeFullBottomSprite)}function e(){this.canvas=x.get("gameCanvas");this.context=this.canvas.getContext("2d");this.startingWidth=this.canvas.width;this.startingHeight=this.canvas.height;this.aspectRatio=this.canvas.width/this.canvas.height;this.scaleY=this.scaleX=this.canvas.width/e.BASEWIDTH;this.animationFrameId=-1;this.fixedAccumulator=this.frameCount=this.lastMainLoopTime=0;this.initialUrlQuery=c.paramStringToObject(g.location.search);
this.customAdFrequency=this.initialUrlQuery.hasOwnProperty("adfreq")?parseInt(this.initialUrlQuery.adfreq,10):5;isNaN(this.customAdFrequency)?this.customAdFrequency=5:0>=this.customAdFrequency&&(this.customAdFrequency=5);this.numPlays=0;this.addToHome="undefined"!==typeof ga?ga:null;this.addToHomeShown=!1;this.addToHomeNumPlays=3;this.logicLooping=this.looping=this.started=!1;this.state=e.states.none;this.changingState=!1;this.score=0;this.bestScore=parseInt(H.getCookie(e.BESTSCORECOOKIE,"0"),10);
isNaN(this.bestScore)&&(this.bestScore=0);this.kikShareIdCreated=this.kikEnabled=this.allLoaded=this.ignoreMouseDown=!1;this.kikShareId=null;this.crazygames=this.initialUrlQuery.hasOwnProperty("crazygames")?"1"===this.initialUrlQuery.crazygames||"true"===this.initialUrlQuery.crazygames:!1;this.debug=!1;this.debugStuff={lastFrameCapture:0,lastFrameCaptureTime:0,output:null,frameCounter:null};this.patterns={};this.debug&&this.setupDebug();g.trace=c.bindFnc(this,this.trace);this.firstTap=!0;this.pipeDistance=
0;this.keyboardManager=new J;this.mouseManager=new n({element:x.get("touchOverlay")});this.buttonManager=new G;this.imgManager=new E({images:e.IMGS});this.soundManager=new N({sounds:e.SOUNDS,mute:"1"!==H.getCookie(e.SOUNDSETTINGCOOKIE,"1")});this.animManager=new ca;this.loadingStage=new B({x:0,y:0,scaleX:this.scaleX,scaleY:this.scaleY});this.progressBg=new V({x:0,y:e.BASEHEIGHT/2-25,width:e.BASEWIDTH,height:50,fillStyle:"#000000"});this.loadingStage.addChild(this.progressBg);this.progressText=new P({x:e.BASEWIDTH/
2,y:e.BASEHEIGHT/2-50,textAlign:"center",textBaseline:"middle",text:"0%"});this.loadingStage.addChild(this.progressText);this.progressBar=new V({x:0,y:e.BASEHEIGHT/2-25,width:0,height:50,fillStyle:"#00bb00"});this.loadingStage.addChild(this.progressBar);this.progressVersion=new P({x:e.BASEWIDTH,y:0,textAlign:"right",textBaseline:"top",text:"v"+g.FLAPPYLIVESVERSION});this.loadingStage.addChild(this.progressVersion);this.stage=new B({x:0,y:0,scaleX:this.scaleX,scaleY:this.scaleY,visible:!1});this.transitionOverlay=
new V({x:0,y:0,width:e.BASEWIDTH,height:e.BASEHEIGHT,opacity:0,fillStyle:"#000000"});this.abTestManager=new L({tests:[{testName:"desktopredirect20140321",valueMap:{redirect:0.01,stay:0.99},shouldRun:function(){if(!c.isMobile.any()&&"/game.html"!==g.location.pathname&&!H.hasCookie(e.BESTSCORECOOKIE))try{return g.top===g}catch(a){}return!1},expire:5184E3}]});if(this.abTestManager.isTestValue("desktopredirect20140321","redirect")){var a="/desktop.html";0<c.countProps(this.initialUrlQuery)&&(a+="?"+c.objectToParamString(this.initialUrlQuery));
g.location.href=a}this.appCacheManager=new D({appCache:g.applicationCache,reloadOnNewUpdate:!0});a=new v({interstitialScreen:x.get("adInterstitialScreen"),interstitialClose:x.get("adInterstitialClose"),gameOverAdScreen:x.get("adGameOverScreen"),game:this,interstitialAds:[new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,5)}),platforms:k.platforms.MOBILE,unitName:"/20973361/flappylives_mobile_300x250",size:[300,250],divId:"div-gpt-ad-1393968910515-0",
enabled:!1}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,5)}),platforms:k.platforms.MOBILE,unitName:"20973361/flappylives_mobile_300x250_v2",size:[300,250],divId:"div-gpt-ad-1396544776922-1",enabled:!0}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,4)}),platforms:k.platforms.MOBILE,unitName:"/20973361/flappylives_mobile_320x50",size:[320,50],divId:"div-gpt-ad-1394482035150-0",
enabled:!1}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,4)}),platforms:k.platforms.TABLET,unitName:"/20973361/iPad_Interstitial_Portrait_768x1024",size:[728,90],divId:"div-gpt-ad-1394485156180-0",enabled:!1}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,4)}),platforms:k.platforms.TABLET,unitName:"/20973361/flappylives_gameover_web_iPad_300x600",size:[300,
600],divId:"div-gpt-ad-1395705405426-0",enabled:!0}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,5)}),platforms:k.platforms.DESKTOP,unitName:"/20973361/flappylives_gameover_web_300x600",size:[300,600],divId:"div-gpt-ad-1393896859127-0",enabled:!1}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,5)}),platforms:k.platforms.DESKTOP,unitName:"/20973361/flappylives_gameover_web_300x600_v2",
size:[300,600],divId:"div-gpt-ad-1396544776922-0",enabled:3!==this.customAdFrequency&&4!==this.customAdFrequency}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,3)}),platforms:k.platforms.DESKTOP,unitName:"/20973361/flappylives_every3end_web_300x600",size:[300,600],divId:"div-gpt-ad-1396054232491-0",enabled:3===this.customAdFrequency}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return 0===this.numPlays%Math.min(this.customAdFrequency,
4)}),platforms:k.platforms.DESKTOP,unitName:"/20973361/flappylives_every4end_web_300x600",size:[300,600],divId:"div-gpt-ad-1396054328730-0",enabled:4===this.customAdFrequency})],gameOverAds:[new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return!0}),platforms:k.platforms.MOBILE,unitName:"/20973361/Banner_Portrait_top_320x50",size:[320,50],divId:"div-gpt-ad-1394432499237-0",enabled:!1}),new u({game:this,shouldShowFunction:c.bindFnc(this,function(){return!0}),platforms:k.platforms.TABLET,
unitName:"/20973361/Banner_Portrait_top_728x90",size:[728,90],divId:"div-gpt-ad-1394437615413-0",enabled:!1})]});try{g.top!==g&&"/desktop.html"===g.top.location.pathname?g.top.hasOwnProperty("adManager")?(this.adManager=g.top.adManager,this.adManager.setGame(this)):g.top.addEventListener("load",c.bindFnc(this,function(a){a.currentTarget.hasOwnProperty("adManager")&&(this.adManager=a.currentTarget.adManager,this.adManager.setGame(this),this.scouter.initAdManagerListeners())}),!1):this.adManager=a}catch(b){this.adManager=
a}this.updateContext={scrollSpeed:0};this.bindedMainLoop=c.bindFnc(this,this.mainLoop);this.bindedRequestAnimationFrame=c.bindFnc(this,function(){g.requestAnimationFrame(this.bindedMainLoop)});this.scouter=new w({game:this});(function(){for(var a=0,b=["webkit","moz"],p=0;p<b.length&&!g.requestAnimationFrame;++p)g.requestAnimationFrame=g[b[p]+"RequestAnimationFrame"],g.cancelAnimationFrame=g[b[p]+"CancelAnimationFrame"]||g[b[p]+"CancelRequestAnimationFrame"];g.requestAnimationFrame||(g.requestAnimationFrame=
function(b,p){var f=(new Date).getTime(),c=Math.max(0,16-(f-a)),e=g.setTimeout(function(){b(f+c)},c);a=f+c;return e});g.cancelAnimationFrame||(g.cancelAnimationFrame=function(a){I(a)})})();this.init()}var g=ia,z=g.navigator,y=g.document,Q=g.location,K=g.setTimeout,I=g.clearTimeout,ha=g.open,$=g.console||{log:function(){},warn:function(){},error:function(){}};this.createjs=this.createjs||{};(function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="0.5.2";a.buildDate="Thu, 12 Dec 2013 23:33:37 GMT"})();
this.createjs=this.createjs||{};(function(){var a=function(){},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener;a.on=b.on;a.removeEventListener=a.off=b.removeEventListener;a.removeAllEventListeners=b.removeAllEventListeners;a.hasEventListener=b.hasEventListener;a.dispatchEvent=b.dispatchEvent;a._dispatchEvent=b._dispatchEvent;a.willTrigger=b.willTrigger};b._listeners=null;b._captureListeners=null;b.initialize=function(){};b.addEventListener=function(a,b,p){var c;c=p?this._captureListeners=
this._captureListeners||{}:this._listeners=this._listeners||{};var e=c[a];return e&&this.removeEventListener(a,b,p),e=c[a],e?e.push(b):c[a]=[b],b};b.on=function(a,b,p,c,e,A){return b.handleEvent&&(p=p||b,b=b.handleEvent),p=p||this,this.addEventListener(a,function(a){b.call(p,a,e);c&&a.remove()},A)};b.removeEventListener=function(a,b,p){if(p=p?this._captureListeners:this._listeners){var c=p[a];if(c)for(var e=0,A=c.length;A>e;e++)if(c[e]==b){1==A?delete p[a]:c.splice(e,1);break}}};b.off=b.removeEventListener;
b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null};b.dispatchEvent=function(a,b){if("string"==typeof a){var p=this._listeners;if(!p||!p[a])return!1;a=new createjs.Event(a)}if(a.target=b||this,a.bubbles&&this.parent){for(var c=this,p=[c];c.parent;)p.push(c=c.parent);for(var e=p.length,c=e-1;0<=c&&!a.propagationStopped;c--)p[c]._dispatchEvent(a,1+(0==c));for(c=1;e>
c&&!a.propagationStopped;c++)p[c]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return a.defaultPrevented};b.hasEventListener=function(a){var b=this._listeners,p=this._captureListeners;return!!(b&&b[a]||p&&p[a])};b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1};b.toString=function(){return"[EventDispatcher]"};b._dispatchEvent=function(a,b){var p,c=1==b?this._captureListeners:this._listeners;if(a&&c&&(c=c[a.type])&&(p=c.length)){a.currentTarget=
this;a.eventPhase=b;a.removed=!1;for(var c=c.slice(),e=0;p>e&&!a.immediatePropagationStopped;e++){var A=c[e];A.handleEvent?A.handleEvent(a):A(a);a.removed&&(this.off(a.type,A,1==b),a.removed=!1)}}};createjs.EventDispatcher=a})();this.createjs=this.createjs||{};(function(){var a=function(a,b,p){this.initialize(a,b,p)},b=a.prototype;b.type=null;b.target=null;b.currentTarget=null;b.eventPhase=0;b.bubbles=!1;b.cancelable=!1;b.timeStamp=0;b.defaultPrevented=!1;b.propagationStopped=!1;b.immediatePropagationStopped=
!1;b.removed=!1;b.initialize=function(a,b,p){this.type=a;this.bubbles=b;this.cancelable=p;this.timeStamp=(new Date).getTime()};b.preventDefault=function(){this.defaultPrevented=!0};b.stopPropagation=function(){this.propagationStopped=!0};b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0};b.remove=function(){this.removed=!0};b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)};b.toString=function(){return"[Event (type="+this.type+
")]"};createjs.Event=a})();this.createjs=this.createjs||{};(function(){createjs.indexOf=function(a,b){for(var d=0,f=a.length;f>d;d++)if(b===a[d])return d;return-1}})();this.createjs=this.createjs||{};(function(){createjs.proxy=function(a,b){var d=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(d))}}})();this.createjs=this.createjs||{};(function(){function a(){throw"Sound cannot be instantiated";}function b(a,b){this.init(a,
b)}function d(){}a.DELIMITER="|";a.INTERRUPT_ANY="any";a.INTERRUPT_EARLY="early";a.INTERRUPT_LATE="late";a.INTERRUPT_NONE="none";a.PLAY_INITED="playInited";a.PLAY_SUCCEEDED="playSucceeded";a.PLAY_INTERRUPTED="playInterrupted";a.PLAY_FINISHED="playFinished";a.PLAY_FAILED="playFailed";a.SUPPORTED_EXTENSIONS="mp3 ogg mpeg wav m4a mp4 aiff wma mid".split(" ");a.EXTENSION_MAP={m4a:"mp4"};a.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;a.defaultInterruptBehavior=
a.INTERRUPT_NONE;a.alternateExtensions=[];a._lastID=0;a.activePlugin=null;a._pluginsRegistered=!1;a._masterVolume=1;a._masterMute=!1;a._instances=[];a._idHash={};a._preloadHash={};a._defaultSoundInstance=null;a.addEventListener=null;a.removeEventListener=null;a.removeAllEventListeners=null;a.dispatchEvent=null;a.hasEventListener=null;a._listeners=null;createjs.EventDispatcher.initialize(a);a._sendFileLoadEvent=function(b){if(a._preloadHash[b])for(var d=0,f=a._preloadHash[b].length;f>d;d++){var c=
a._preloadHash[b][d];if(a._preloadHash[b][d]=!0,a.hasEventListener("fileload")){var e=new createjs.Event("fileload");e.src=c.src;e.id=c.id;e.data=c.data;a.dispatchEvent(e)}}};a.getPreloadHandlers=function(){return{callback:createjs.proxy(a.initLoad,a),types:["sound"],extensions:a.SUPPORTED_EXTENSIONS}};a.registerPlugin=function(b){try{$.log("createjs.Sound.registerPlugin has been deprecated. Please use registerPlugins.")}catch(d){}return a._registerPlugin(b)};a._registerPlugin=function(b){return a._pluginsRegistered=
!0,null==b?!1:b.isSupported()?(a.activePlugin=new b,!0):!1};a.registerPlugins=function(b){for(var d=0,f=b.length;f>d;d++)if(a._registerPlugin(b[d]))return!0;return!1};a.initializeDefaultPlugins=function(){return null!=a.activePlugin?!0:a._pluginsRegistered?!1:a.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1};a.isReady=function(){return null!=a.activePlugin};a.getCapabilities=function(){return null==a.activePlugin?null:a.activePlugin._capabilities};a.getCapability=function(b){return null==
a.activePlugin?null:a.activePlugin._capabilities[b]};a.initLoad=function(b,d,f,c,e){b=b.replace(e,"");b=a.registerSound(b,f,c,!1,e);return null==b?!1:b};a.registerSound=function(d,f,c,e,g){if(!a.initializeDefaultPlugins())return!1;var h=(d instanceof Object&&(g=f,f=d.id,c=d.data,d=d.src),a.alternateExtensions.length)?a._parsePath2(d,"sound",f,c):a._parsePath(d,"sound",f,c);if(null==h)return!1;null!=g&&(d=g+d,h.src=g+h.src);null!=f&&(a._idHash[f]=h.src);g=null;null!=c&&(isNaN(c.channels)?isNaN(c)||
(g=parseInt(c)):g=parseInt(c.channels));var q=a.activePlugin.register(h.src,g);if(null!=q&&(null!=q.numChannels&&(g=q.numChannels),b.create(h.src,g),null!=c&&isNaN(c)?c.channels=h.data.channels=g||b.maxPerChannel():c=h.data=g||b.maxPerChannel(),null!=q.tag?h.tag=q.tag:q.src&&(h.src=q.src),null!=q.completeHandler&&(h.completeHandler=q.completeHandler),q.type&&(h.type=q.type)),0!=e)if(a._preloadHash[h.src]||(a._preloadHash[h.src]=[]),a._preloadHash[h.src].push({src:d,id:f,data:c}),1==a._preloadHash[h.src].length)a.activePlugin.preload(h.src,
q);else if(1==a._preloadHash[h.src][0])return!0;return h};a.registerManifest=function(a,b){for(var d=[],f=0,c=a.length;c>f;f++)d[f]=createjs.Sound.registerSound(a[f].src,a[f].id,a[f].data,a[f].preload,b);return d};a.removeSound=function(d,f){if(null==a.activePlugin)return!1;var c=(d instanceof Object&&(d=d.src),d=a._getSrcById(d),a.alternateExtensions.length)?a._parsePath2(d):a._parsePath(d);if(null==c)return!1;null!=f&&(c.src=f+c.src);d=c.src;for(var e in a._idHash)a._idHash[e]==d&&delete a._idHash[e];
return b.removeSrc(d),delete a._preloadHash[d],a.activePlugin.removeSound(d),!0};a.removeManifest=function(a,b){for(var d=[],f=0,c=a.length;c>f;f++)d[f]=createjs.Sound.removeSound(a[f].src,b);return d};a.removeAllSounds=function(){a._idHash={};a._preloadHash={};b.removeAll();a.activePlugin.removeAllSounds()};a.loadComplete=function(b){var d=a.alternateExtensions.length?a._parsePath2(b,"sound"):a._parsePath(b,"sound");return b=d?a._getSrcById(d.src):a._getSrcById(b),1==a._preloadHash[b][0]};a._parsePath=
function(b,d,f,c){"string"!=typeof b&&(b=b.toString());b=b.split(a.DELIMITER);if(1<b.length)try{$.log('createjs.Sound.DELIMITER "|" loading approach has been deprecated. Please use the new alternateExtensions property.')}catch(e){}d={type:d||"sound",id:f,data:c};f=a.getCapabilities();c=0;for(var g=b.length;g>c;c++){var h=b[c],l=h.match(a.FILE_PATTERN);if(null==l)return!1;var k=l[4],l=l[5];if(f[l]&&-1<createjs.indexOf(a.SUPPORTED_EXTENSIONS,l))return d.name=k,d.src=h,d.extension=l,d}return null};a._parsePath2=
function(b,d,f,c){"string"!=typeof b&&(b=b.toString());var e=b.match(a.FILE_PATTERN);if(null==e)return!1;for(var g=e[4],h=e[5],l=a.getCapabilities(),k=0;!l[h];)if(h=a.alternateExtensions[k++],k>a.alternateExtensions.length)return null;b=b.replace("."+e[5],"."+h);d={type:d||"sound",id:f,data:c};return d.name=g,d.src=b,d.extension=h,d};a.play=function(b,d,f,c,e,g,h){b=a.createInstance(b);return a._playInstance(b,d,f,c,e,g,h)||b.playFailed(),b};a.createInstance=function(d){if(!a.initializeDefaultPlugins())return a._defaultSoundInstance;
var f=(d=a._getSrcById(d),a.alternateExtensions.length)?a._parsePath2(d,"sound"):a._parsePath(d,"sound");d=null;return null!=f&&null!=f.src?(b.create(f.src),d=a.activePlugin.create(f.src)):d=a._defaultSoundInstance,d.uniqueId=a._lastID++,d};a.setVolume=function(b){if(null==Number(b))return!1;if(b=Math.max(0,Math.min(1,b)),a._masterVolume=b,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(b))for(var d=this._instances,f=0,c=d.length;c>f;f++)d[f].setMasterVolume(b)};a.getVolume=
function(){return a._masterVolume};a.setMute=function(a){if(null==a||void 0==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,d=0,f=b.length;f>d;d++)b[d].setMasterMute(a);return!0};a.getMute=function(){return this._masterMute};a.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()};a._playInstance=function(b,d,f,c,e,g,h){if(d instanceof Object&&(f=d.delay,c=d.offset,e=d.loop,g=d.volume,h=d.pan,
d=d.interrupt),d=d||a.defaultInterruptBehavior,null==f&&(f=0),null==c&&(c=b.getPosition()),null==e&&(e=0),null==g&&(g=b.volume),null==h&&(h=b.pan),0==f){if(!a._beginPlaying(b,d,c,e,g,h))return!1}else f=K(function(){a._beginPlaying(b,d,c,e,g,h)},f),b._delayTimeoutId=f;return this._instances.push(b),!0};a._beginPlaying=function(a,d,f,c,e,g){return b.add(a,d)?a._beginPlaying(f,c,e,g)?!0:(a=createjs.indexOf(this._instances,a),-1<a&&this._instances.splice(a,1),!1):!1};a._getSrcById=function(b){return null==
a._idHash||null==a._idHash[b]?b:a._idHash[b]};a._playFinished=function(a){b.remove(a);a=createjs.indexOf(this._instances,a);-1<a&&this._instances.splice(a,1)};createjs.Sound=a;b.channels={};b.create=function(a,d){return null==b.get(a)?(b.channels[a]=new b(a,d),!0):!1};b.removeSrc=function(a){var d=b.get(a);return null==d?!1:(d.removeAll(),delete b.channels[a],!0)};b.removeAll=function(){for(var a in b.channels)b.channels[a].removeAll();b.channels={}};b.add=function(a,d){var f=b.get(a.src);return null==
f?!1:f.add(a,d)};b.remove=function(a){var d=b.get(a.src);return null==d?!1:(d.remove(a),!0)};b.maxPerChannel=function(){return f.maxDefault};b.get=function(a){return b.channels[a]};var f=b.prototype;f.src=null;f.max=null;f.maxDefault=100;f.length=0;f.init=function(a,b){this.src=a;this.max=b||this.maxDefault;-1==this.max&&(this.max=this.maxDefault);this._instances=[]};f.get=function(a){return this._instances[a]};f.add=function(a,b){return this.getSlot(b,a)?(this._instances.push(a),this.length++,!0):
!1};f.remove=function(a){a=createjs.indexOf(this._instances,a);return-1==a?!1:(this._instances.splice(a,1),this.length--,!0)};f.removeAll=function(){for(var a=this.length-1;0<=a;a--)this._instances[a].stop()};f.getSlot=function(b){for(var d,f,c=0,e=this.max;e>c;c++){if(d=this.get(c),null==d)return!0;(b!=a.INTERRUPT_NONE||d.playState==a.PLAY_FINISHED)&&(0!=c?d.playState==a.PLAY_FINISHED||d.playState==a.PLAY_INTERRUPTED||d.playState==a.PLAY_FAILED?f=d:(b==a.INTERRUPT_EARLY&&d.getPosition()<f.getPosition()||
b==a.INTERRUPT_LATE&&d.getPosition()>f.getPosition())&&(f=d):f=d)}return null!=f?(f._interrupt(),this.remove(f),!0):!1};f.toString=function(){return"[Sound SoundChannel]"};a._defaultSoundInstance=new function(){this.isDefault=!0;this.addEventListener=this.removeEventListener=this.removeAllEventListeners=this.dispatchEvent=this.hasEventListener=this._listeners=this._interrupt=this._playFailed=this.pause=this.resume=this.play=this._beginPlaying=this._cleanUp=this.stop=this.setMasterVolume=this.setVolume=
this.mute=this.setMute=this.getMute=this.setPan=this.getPosition=this.setPosition=this.playFailed=function(){return!1};this.getVolume=this.getPan=this.getDuration=function(){return 0};this.playState=a.PLAY_FAILED;this.toString=function(){return"[Sound Default Sound Instance]"}};d.init=function(){var a=g.navigator.userAgent;d.isFirefox=-1<a.indexOf("Firefox");d.isOpera=null!=g.opera;d.isChrome=-1<a.indexOf("Chrome");d.isIOS=-1<a.indexOf("iPod")||-1<a.indexOf("iPhone")||-1<a.indexOf("iPad");d.isAndroid=
-1<a.indexOf("Android");d.isBlackberry=-1<a.indexOf("Blackberry")};d.init();createjs.Sound.BrowserDetect=d})();this.createjs=this.createjs||{};(function(){function a(){this._init()}a._capabilities=null;a.isSupported=function(){var b=createjs.Sound.BrowserDetect.isIOS||createjs.Sound.BrowserDetect.isAndroid||createjs.Sound.BrowserDetect.isBlackberry;return"file:"!=Q.protocol||b||this._isFileXHRSupported()?(a._generateCapabilities(),null==a.context?!1:!0):!1};a._isFileXHRSupported=function(){var a=
!0,b=new XMLHttpRequest;try{b.open("GET","fail.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1};b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(e){a=!1}return a};a._generateCapabilities=function(){if(null==a._capabilities){var b=y.createElement("audio");if(null==b.canPlayType)return null;if(g.webkitAudioContext)a.context=new webkitAudioContext;else{if(!g.AudioContext)return null;a.context=new AudioContext}a._compatibilitySetUp();
a.playEmptySound();a._capabilities={panning:!0,volume:!0,tracks:-1};for(var f=createjs.Sound.SUPPORTED_EXTENSIONS,c=createjs.Sound.EXTENSION_MAP,e=0,h=f.length;h>e;e++){var A=f[e],l=c[A]||A;a._capabilities[A]="no"!=b.canPlayType("audio/"+A)&&""!=b.canPlayType("audio/"+A)||"no"!=b.canPlayType("audio/"+l)&&""!=b.canPlayType("audio/"+l)}2>a.context.destination.numberOfChannels&&(a._capabilities.panning=!1);a.dynamicsCompressorNode=a.context.createDynamicsCompressor();a.dynamicsCompressorNode.connect(a.context.destination);
a.gainNode=a.context.createGain();a.gainNode.connect(a.dynamicsCompressorNode)}};a._compatibilitySetUp=function(){if(!a.context.createGain){a.context.createGain=a.context.createGainNode;var b=a.context.createBufferSource();b.__proto__.start=b.__proto__.noteGrainOn;b.__proto__.stop=b.__proto__.noteOff;this._panningModel=0}};a.playEmptySound=function(){var a=this.context.createBuffer(1,1,22050),b=this.context.createBufferSource();b.buffer=a;b.connect(this.context.destination);b.start(0,0,0)};var b=
a.prototype;b._capabilities=null;b._volume=1;b.context=null;b._panningModel="equalpower";b.dynamicsCompressorNode=null;b.gainNode=null;b._arrayBuffers=null;b._init=function(){this._capabilities=a._capabilities;this._arrayBuffers={};this.context=a.context;this.gainNode=a.gainNode;this.dynamicsCompressorNode=a.dynamicsCompressorNode};b.register=function(a){this._arrayBuffers[a]=!0;return{tag:new createjs.WebAudioPlugin.Loader(a,this)}};b.isPreloadStarted=function(a){return null!=this._arrayBuffers[a]};
b.isPreloadComplete=function(a){return!(null==this._arrayBuffers[a]||1==this._arrayBuffers[a])};b.removeSound=function(a){delete this._arrayBuffers[a]};b.removeAllSounds=function(){this._arrayBuffers={}};b.addPreloadResults=function(a,b){this._arrayBuffers[a]=b};b._handlePreloadComplete=function(){createjs.Sound._sendFileLoadEvent(this.src)};b.preload=function(a){this._arrayBuffers[a]=!0;a=new createjs.WebAudioPlugin.Loader(a,this);a.onload=this._handlePreloadComplete;a.load()};b.create=function(a){return this.isPreloadStarted(a)||
this.preload(a),new createjs.WebAudioPlugin.SoundInstance(a,this)};b.setVolume=function(a){return this._volume=a,this._updateVolume(),!0};b._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)};b.getVolume=function(){return this._volume};b.setMute=function(){return this._updateVolume(),!0};b.toString=function(){return"[WebAudioPlugin]"};createjs.WebAudioPlugin=a})();(function(){function a(a,b){this._init(a,b)}var b=a.prototype=
new createjs.EventDispatcher;b.src=null;b.uniqueId=-1;b.playState=null;b._owner=null;b._offset=0;b._delay=0;b._volume=1;try{Object.defineProperty(b,"volume",{get:function(){return this._volume},set:function(a){return null==Number(a)?!1:(a=Math.max(0,Math.min(1,a)),this._volume=a,this._updateVolume(),void 0)}})}catch(d){}b._pan=0;try{Object.defineProperty(b,"pan",{get:function(){return this._pan},set:function(a){return this._owner._capabilities.panning&&null!=Number(a)?(a=Math.max(-1,Math.min(1,a)),
this._pan=a,this.panNode.setPosition(a,0,-0.5),void 0):!1}})}catch(f){}b._duration=0;b._remainingLoops=0;b._delayTimeoutId=null;b._soundCompleteTimeout=null;b.gainNode=null;b.panNode=null;b.sourceNode=null;b._sourceNodeNext=null;b._muted=!1;b._paused=!1;b._startTime=0;b._endedHandler=null;b._sendEvent=function(a){a=new createjs.Event(a);this.dispatchEvent(a)};b._init=function(a,b){this._owner=b;this.src=a;this.gainNode=this._owner.context.createGain();this.panNode=this._owner.context.createPanner();
this.panNode.panningModel=this._owner._panningModel;this.panNode.connect(this.gainNode);this._owner.isPreloadComplete(this.src)&&(this._duration=1E3*this._owner._arrayBuffers[this.src].duration);this._endedHandler=createjs.proxy(this._handleSoundComplete,this)};b._cleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext));0!=this.gainNode.numberOfOutputs&&
this.gainNode.disconnect(0);I(this._delayTimeoutId);I(this._soundCompleteTimeout);this._startTime=0;null!=g.createjs&&createjs.Sound._playFinished(this)};b._cleanUpAudioNode=function(a){return a&&(a.stop(0),a.disconnect(this.panNode),a=null),a};b._interrupt=function(){this._cleanUp();this.playState=createjs.Sound.PLAY_INTERRUPTED;this._paused=!1;this._sendEvent("interrupted")};b._handleSoundReady=function(){if(null!=g.createjs){if(1E3*this._offset>this.getDuration())return this.playFailed(),void 0;
0>this._offset&&(this._offset=0);this.playState=createjs.Sound.PLAY_SUCCEEDED;this._paused=!1;this.gainNode.connect(this._owner.gainNode);var a=this._owner._arrayBuffers[this.src].duration;this.sourceNode=this._createAndPlayAudioNode(this._owner.context.currentTime-a,this._offset);this._duration=1E3*a;this._startTime=this.sourceNode.startTime-this._offset;this._soundCompleteTimeout=K(this._endedHandler,1E3*(a-this._offset));0!=this._remainingLoops&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,
0))}};b._createAndPlayAudioNode=function(a,b){var d=this._owner.context.createBufferSource();return d.buffer=this._owner._arrayBuffers[this.src],d.connect(this.panNode),this._owner.context.currentTime,d.startTime=a+d.buffer.duration,d.start(d.startTime,b,d.buffer.duration-b),d};b.play=function(a,b,d,f,c,e){this._cleanUp();createjs.Sound._playInstance(this,a,b,d,f,c,e)};b._beginPlaying=function(a,b,d,f){return null!=g.createjs&&this.src?(this._offset=a/1E3,this._remainingLoops=b,this.volume=d,this.pan=
f,this._owner.isPreloadComplete(this.src)?(this._handleSoundReady(null),this._sendEvent("succeeded"),1):(this.playFailed(),void 0)):void 0};b.pause=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED?!1:(this._paused=!0,this._offset=this._owner.context.currentTime-this._startTime,this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(),I(this._delayTimeoutId),I(this._soundCompleteTimeout),
!0)};b.resume=function(){return this._paused?(this._handleSoundReady(null),!0):!1};b.stop=function(){return this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._offset=0,!0};b.setVolume=function(a){return this.volume=a,!0};b._updateVolume=function(){var a=this._muted?0:this._volume;return a!=this.gainNode.gain.value?(this.gainNode.gain.value=a,!0):!1};b.getVolume=function(){return this.volume};b.setMute=function(a){return null==a||void 0==a?!1:(this._muted=a,this._updateVolume(),!0)};
b.getMute=function(){return this._muted};b.setPan=function(a){return this.pan=a,this.pan!=a?!1:void 0};b.getPan=function(){return this.pan};b.getPosition=function(){return 1E3*(this._paused||null==this.sourceNode?this._offset:this._owner.context.currentTime-this._startTime)};b.setPosition=function(a){return this._offset=a/1E3,this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),I(this._soundCompleteTimeout)),
this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||this._handleSoundReady(null),!0};b.getDuration=function(){return this._duration};b._handleSoundComplete=function(){return this._offset=0,0!=this._remainingLoops?(this._remainingLoops--,this._sourceNodeNext?(this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._startTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,0),this._soundCompleteTimeout=K(this._endedHandler,
this._duration)):this._handleSoundReady(null),this._sendEvent("loop"),void 0):(null!=g.createjs&&(this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._sendEvent("complete")),void 0)};b.playFailed=function(){null!=g.createjs&&(this._cleanUp(),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed"))};b.toString=function(){return"[WebAudioPlugin SoundInstance]"};createjs.WebAudioPlugin.SoundInstance=a})();(function(){function a(a,b){this._init(a,b)}var b=a.prototype;b.request=
null;b.owner=null;b.progress=-1;b.src=null;b.originalSrc=null;b.result=null;b.onload=null;b.onprogress=null;b.onError=null;b._init=function(a,b){this.originalSrc=this.src=a;this.owner=b};b.load=function(a){null!=a&&(this.src=a);this.request=new XMLHttpRequest;this.request.open("GET",this.src,!0);this.request.responseType="arraybuffer";this.request.onload=createjs.proxy(this.handleLoad,this);this.request.onError=createjs.proxy(this.handleError,this);this.request.onprogress=createjs.proxy(this.handleProgress,
this);this.request.send()};b.handleProgress=function(a,b){this.progress=a/b;null!=this.onprogress&&this.onprogress({loaded:a,total:b,progress:this.progress})};b.handleLoad=function(){this.owner.context.decodeAudioData(this.request.response,createjs.proxy(this.handleAudioDecoded,this),createjs.proxy(this.handleError,this))};b.handleAudioDecoded=function(a){this.progress=1;this.result=a;this.src=this.originalSrc;this.owner.addPreloadResults(this.src,this.result);this.onload&&this.onload()};b.handleError=
function(a){this.owner.removeSound(this.src);this.onerror&&this.onerror(a)};b.toString=function(){return"[WebAudioPlugin Loader]"};createjs.WebAudioPlugin.Loader=a})();this.createjs=this.createjs||{};(function(){function a(){this._init()}a.MAX_INSTANCES=30;a._AUDIO_READY="canplaythrough";a._AUDIO_ENDED="ended";a._AUDIO_SEEKED="seeked";a._AUDIO_STALLED="stalled";a._capabilities=null;a.enableIOS=!1;a.isSupported=function(){if(createjs.Sound.BrowserDetect.isIOS&&!a.enableIOS)return!1;a._generateCapabilities();
return null==a.tag||null==a._capabilities?!1:!0};a._generateCapabilities=function(){if(null==a._capabilities){var b=a.tag=y.createElement("audio");if(null==b.canPlayType)return null;a._capabilities={panning:!0,volume:!0,tracks:-1};for(var f=createjs.Sound.SUPPORTED_EXTENSIONS,c=createjs.Sound.EXTENSION_MAP,e=0,g=f.length;g>e;e++){var h=f[e],l=c[h]||h;a._capabilities[h]="no"!=b.canPlayType("audio/"+h)&&""!=b.canPlayType("audio/"+h)||"no"!=b.canPlayType("audio/"+l)&&""!=b.canPlayType("audio/"+l)}}};
var b=a.prototype;b._capabilities=null;b._audioSources=null;b.defaultNumChannels=2;b.loadedHandler=null;b._init=function(){this._capabilities=a._capabilities;this._audioSources={}};b.register=function(a,b){this._audioSources[a]=!0;for(var c=createjs.HTMLAudioPlugin.TagPool.get(a),e=null,g=b||this.defaultNumChannels,h=0;g>h;h++)e=this._createTag(a),c.add(e);if(e.id=a,this.loadedHandler=createjs.proxy(this._handleTagLoad,this),e.addEventListener&&e.addEventListener("canplaythrough",this.loadedHandler),
null==e.onreadystatechange)e.onreadystatechange=this.loadedHandler;else{var l=e.onreadystatechange;e.onreadystatechange=function(){l();this.loadedHandler()}}return{tag:e,numChannels:g}};b._handleTagLoad=function(a){a.target.removeEventListener&&a.target.removeEventListener("canplaythrough",this.loadedHandler);a.target.onreadystatechange=null;a.target.src!=a.target.id&&createjs.HTMLAudioPlugin.TagPool.checkSrc(a.target.id)};b._createTag=function(a){var b=y.createElement("audio");return b.autoplay=
!1,b.preload="none",b.src=a,b};b.removeSound=function(a){delete this._audioSources[a];createjs.HTMLAudioPlugin.TagPool.remove(a)};b.removeAllSounds=function(){this._audioSources={};createjs.HTMLAudioPlugin.TagPool.removeAll()};b.create=function(a){if(!this.isPreloadStarted(a)){var b=createjs.HTMLAudioPlugin.TagPool.get(a),c=this._createTag(a);c.id=a;b.add(c);this.preload(a,{tag:c})}return new createjs.HTMLAudioPlugin.SoundInstance(a,this)};b.isPreloadStarted=function(a){return null!=this._audioSources[a]};
b.preload=function(a,b){this._audioSources[a]=!0;new createjs.HTMLAudioPlugin.Loader(a,b.tag)};b.toString=function(){return"[HTMLAudioPlugin]"};createjs.HTMLAudioPlugin=a})();(function(){function a(a,b){this._init(a,b)}var b=a.prototype=new createjs.EventDispatcher;b.src=null;b.uniqueId=-1;b.playState=null;b._owner=null;b.loaded=!1;b._offset=0;b._delay=0;b._volume=1;try{Object.defineProperty(b,"volume",{get:function(){return this._volume},set:function(a){null!=Number(a)&&(a=Math.max(0,Math.min(1,
a)),this._volume=a,this._updateVolume())}})}catch(d){}b.pan=0;b._duration=0;b._remainingLoops=0;b._delayTimeoutId=null;b.tag=null;b._muted=!1;b._paused=!1;b._endedHandler=null;b._readyHandler=null;b._stalledHandler=null;b.loopHandler=null;b._init=function(a,b){this.src=a;this._owner=b;this._endedHandler=createjs.proxy(this._handleSoundComplete,this);this._readyHandler=createjs.proxy(this._handleSoundReady,this);this._stalledHandler=createjs.proxy(this._handleSoundStalled,this);this.loopHandler=createjs.proxy(this.handleSoundLoop,
this)};b._sendEvent=function(a){a=new createjs.Event(a);this.dispatchEvent(a)};b._cleanUp=function(){var a=this.tag;if(null!=a){a.pause();a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1);a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1);a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1);try{a.currentTime=0}catch(b){}createjs.HTMLAudioPlugin.TagPool.setInstance(this.src,a);this.tag=null}I(this._delayTimeoutId);
null!=g.createjs&&createjs.Sound._playFinished(this)};b._interrupt=function(){null!=this.tag&&(this.playState=createjs.Sound.PLAY_INTERRUPTED,this._cleanUp(),this._paused=!1,this._sendEvent("interrupted"))};b.play=function(a,b,d,c,e,g){this._cleanUp();createjs.Sound._playInstance(this,a,b,d,c,e,g)};b._beginPlaying=function(a,b,d,c){if(null==g.createjs)return-1;var e=this.tag=createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);return null==e?(this.playFailed(),-1):(e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,
this._endedHandler,!1),this._offset=a,this.volume=d,this.pan=c,this._updateVolume(),this._remainingLoops=b,4!==e.readyState?(e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),e.preload="auto",e.load()):this._handleSoundReady(null),this._sendEvent("succeeded"),1)};b._handleSoundStalled=function(){this._cleanUp();this._sendEvent("failed")};b._handleSoundReady=function(){if(null!=g.createjs){if(this._duration=
1E3*this.tag.duration,this.playState=createjs.Sound.PLAY_SUCCEEDED,this._paused=!1,this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._offset>=this.getDuration())return this.playFailed(),void 0;0<this._offset&&(this.tag.currentTime=0.001*this._offset);-1==this._remainingLoops&&(this.tag.loop=!0);0!=this._remainingLoops&&(this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1),this.tag.loop=!0);this.tag.play()}};b.pause=function(){return this._paused||
this.playState!=createjs.Sound.PLAY_SUCCEEDED||null==this.tag?!1:(this._paused=!0,this.tag.pause(),I(this._delayTimeoutId),!0)};b.resume=function(){return this._paused&&null!=this.tag?(this._paused=!1,this.tag.play(),!0):!1};b.stop=function(){return this._offset=0,this.pause(),this.playState=createjs.Sound.PLAY_FINISHED,this._cleanUp(),!0};b.setMasterVolume=function(){return this._updateVolume(),!0};b.setVolume=function(a){return this.volume=a,!0};b._updateVolume=function(){if(null!=this.tag){var a=
this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;return a!=this.tag.volume&&(this.tag.volume=a),!0}return!1};b.getVolume=function(){return this.volume};b.setMasterMute=function(){return this._updateVolume(),!0};b.setMute=function(a){return null==a||void 0==a?!1:(this._muted=a,this._updateVolume(),!0)};b.getMute=function(){return this._muted};b.setPan=function(){return!1};b.getPan=function(){return 0};b.getPosition=function(){return null==this.tag?this._offset:1E3*
this.tag.currentTime};b.setPosition=function(a){if(null==this.tag)this._offset=a;else{this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1);try{this.tag.currentTime=0.001*a}catch(b){return!1}this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1)}return!0};b.getDuration=function(){return this._duration};b._handleSoundComplete=function(){this._offset=0;null!=g.createjs&&(this.playState=createjs.Sound.PLAY_FINISHED,this._cleanUp(),this._sendEvent("complete"))};
b.handleSoundLoop=function(){this._offset=0;this._remainingLoops--;0==this._remainingLoops&&(this.tag.loop=!1,this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1));this._sendEvent("loop")};b.playFailed=function(){null!=g.createjs&&(this.playState=createjs.Sound.PLAY_FAILED,this._cleanUp(),this._sendEvent("failed"))};b.toString=function(){return"[HTMLAudioPlugin SoundInstance]"};createjs.HTMLAudioPlugin.SoundInstance=a})();(function(){function a(a,b){this._init(a,
b)}var b=a.prototype;b.src=null;b.tag=null;b.preloadTimer=null;b.loadedHandler=null;b._init=function(a,b){if(this.src=a,this.tag=b,this.preloadTimer=setInterval(createjs.proxy(this.preloadTick,this),200),this.loadedHandler=createjs.proxy(this.sendLoadedEvent,this),this.tag.addEventListener&&this.tag.addEventListener("canplaythrough",this.loadedHandler),null==this.tag.onreadystatechange)this.tag.onreadystatechange=createjs.proxy(this.sendLoadedEvent,this);else{var c=this.tag.onreadystatechange;this.tag.onreadystatechange=
function(){c();this.tag.onreadystatechange=createjs.proxy(this.sendLoadedEvent,this)}}this.tag.preload="auto";this.tag.load()};b.preloadTick=function(){var a=this.tag.buffered,b=this.tag.duration;0<a.length&&a.end(0)>=b-1&&this.handleTagLoaded()};b.handleTagLoaded=function(){clearInterval(this.preloadTimer)};b.sendLoadedEvent=function(){this.tag.removeEventListener&&this.tag.removeEventListener("canplaythrough",this.loadedHandler);this.tag.onreadystatechange=null;createjs.Sound._sendFileLoadEvent(this.src)};
b.toString=function(){return"[HTMLAudioPlugin Loader]"};createjs.HTMLAudioPlugin.Loader=a})();(function(){function a(a){this._init(a)}a.tags={};a.get=function(b){var f=a.tags[b];return null==f&&(f=a.tags[b]=new a(b)),f};a.remove=function(b){var f=a.tags[b];return null==f?!1:(f.removeAll(),delete a.tags[b],!0)};a.removeAll=function(){for(var b in a.tags)a.tags[b].removeAll();a.tags={}};a.getInstance=function(b){b=a.tags[b];return null==b?null:b.get()};a.setInstance=function(b,f){var c=a.tags[b];return null==
c?null:c.set(f)};a.checkSrc=function(b){b=a.tags[b];return null==b?null:(b.checkSrcChange(),void 0)};var b=a.prototype;b.src=null;b.length=0;b.available=0;b.tags=null;b._init=function(a){this.src=a;this.tags=[]};b.add=function(a){this.tags.push(a);this.length++;this.available++};b.removeAll=function(){for(;this.length--;)delete this.tags[this.length];this.src=null;this.tags.length=0};b.get=function(){if(0==this.tags.length)return null;this.available=this.tags.length;var a=this.tags.pop();return null==
a.parentNode&&y.body.appendChild(a),a};b.set=function(a){-1==createjs.indexOf(this.tags,a)&&this.tags.push(a);this.available=this.tags.length};b.checkSrcChange=function(){for(var a=this.tags.length-1,b=this.tags[a].src;a--;)this.tags[a].src=b};b.toString=function(){return"[HTMLAudioPlugin TagPool]"};createjs.HTMLAudioPlugin.TagPool=a})();g.addToHomeConfig={autostart:!1,touchIcon:!0};var ga=function(a){function b(){a.removeEventListener("load",b,!1);C?s.expire&&B&&a.localStorage.setItem("addToHome",
Date.now()+6E4*s.expire):a.localStorage.setItem("addToHome",Date.now());if(F||w&&B&&!D&&!x&&C){var f="",e=k.platform.split(" ")[0],h=k.language.replace("-","_");m=y.createElement("div");m.id="addToHomeScreen";m.style.cssText+="left:-9999px;-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);position:"+(5>n?"absolute":"fixed");s.message in G&&(h=s.message,s.message="");""===s.message&&(s.message=h in G?G[h]:G.en_us);s.touchIcon&&
(f=t?y.querySelector('head link[rel^=apple-touch-icon][sizes="114x114"],head link[rel^=apple-touch-icon][sizes="144x144"],head link[rel^=apple-touch-icon]'):y.querySelector('head link[rel^=apple-touch-icon][sizes="57x57"],head link[rel^=apple-touch-icon]'))&&(f='<span style="background-image:url('+f.href+')" class="addToHomeTouchIcon"></span>');m.className=(7<=n?"addToHomeIOS7 ":"")+(q?"addToHomeIpad":"addToHomeIphone")+(f?" addToHomeWide":"");m.innerHTML=f+s.message.replace("%device",e).replace("%icon",
4.2<=n?'<span class="addToHomeShare"></span>':'<span class="addToHomePlus">+</span>')+(s.arrow?'<span class="addToHomeArrow"'+(7<=n&&q&&f?' style="margin-left:-32px"':"")+"></span>":"")+(s.closeButton?'<span class="addToHomeClose">\u00d7</span>':"");y.body.appendChild(m);s.closeButton&&m.addEventListener("click",c,!1);!q&&6<=n&&g.addEventListener("orientationchange",l,!1);K(d,s.startDelay)}}function d(){var b;b=208;if(q)switch(5>n?(u=a.scrollY,v=a.scrollX):6>n?b=160:7<=n&&(b=143),m.style.top=u+s.bottomOffset+
"px",m.style.left=Math.max(v+b-Math.round(m.offsetWidth/2),9)+"px",s.animationIn){case "drop":b="0.6s";m.style.webkitTransform="translate3d(0,"+-(a.scrollY+s.bottomOffset+m.offsetHeight)+"px,0)";break;case "bubble":b="0.6s";m.style.opacity="0";m.style.webkitTransform="translate3d(0,"+(u+50)+"px,0)";break;default:b="1s",m.style.opacity="0"}else switch(u=a.innerHeight+a.scrollY,5>n?(v=Math.round((a.innerWidth-m.offsetWidth)/2)+a.scrollX,m.style.left=v+"px",m.style.top=u-m.offsetHeight-s.bottomOffset+
"px"):(m.style.left="50%",m.style.marginLeft=-Math.round(m.offsetWidth/2)-(a.orientation%180&&6<=n&&7>n?40:0)+"px",m.style.bottom=s.bottomOffset+"px"),s.animationIn){case "drop":b="1s";m.style.webkitTransform="translate3d(0,"+-(u+s.bottomOffset)+"px,0)";break;case "bubble":b="0.6s";m.style.webkitTransform="translate3d(0,"+(m.offsetHeight+s.bottomOffset+50)+"px,0)";break;default:b="1s",m.style.opacity="0"}m.offsetHeight;m.style.webkitTransitionDuration=b;m.style.opacity="1";m.style.webkitTransform=
"translate3d(0,0,0)";m.addEventListener("webkitTransitionEnd",e,!1);E=K(f,s.lifespan)}function f(){clearInterval(H);I(E);E=null;if(m){var b=0,d=0,f="1",h="0";s.closeButton&&m.removeEventListener("click",c,!1);!q&&6<=n&&g.removeEventListener("orientationchange",l,!1);5>n&&(b=q?a.scrollY-u:a.scrollY+a.innerHeight-u,d=q?a.scrollX-v:a.scrollX+Math.round((a.innerWidth-m.offsetWidth)/2)-v);m.style.webkitTransitionProperty="-webkit-transform,opacity";switch(s.animationOut){case "drop":q?(h="0.4s",f="0",
b+=50):(h="0.6s",b+=m.offsetHeight+s.bottomOffset+50);break;case "bubble":q?(h="0.8s",b-=m.offsetHeight+s.bottomOffset+50):(h="0.4s",f="0",b-=50);break;default:h="0.8s",f="0"}m.addEventListener("webkitTransitionEnd",e,!1);m.style.opacity=f;m.style.webkitTransitionDuration=h;m.style.webkitTransform="translate3d("+d+"px,"+b+"px,0)"}}function c(){try{a.sessionStorage.setItem("addToHomeSession","1")}catch(b){}D=!0;f()}function e(){m.removeEventListener("webkitTransitionEnd",e,!1);m.style.webkitTransitionProperty=
"-webkit-transform";m.style.webkitTransitionDuration="0.2s";E?5>n&&E&&(H=setInterval(h,s.iterations)):(m.parentNode.removeChild(m),m=null)}function h(){var b=new WebKitCSSMatrix(a.getComputedStyle(m,null).webkitTransform),d=q?a.scrollY-u:a.scrollY+a.innerHeight-u,f=q?a.scrollX-v:a.scrollX+Math.round((a.innerWidth-m.offsetWidth)/2)-v;if(d!=b.m42||f!=b.m41)m.style.webkitTransform="translate3d("+f+"px,"+d+"px,0)"}function l(){m.style.marginLeft=-Math.round(m.offsetWidth/2)-(a.orientation%180&&6<=n&&
7>n?40:0)+"px"}var k=a.navigator,r="platform"in k&&/iphone|ipod|ipad/gi.test(k.platform),q,t,w,x,n,v=0,u=0,z=0,B,D,C,m,F,H,E,s={autostart:!0,returningVisitor:!1,animationIn:"drop",animationOut:"fade",startDelay:2E3,lifespan:15E3,bottomOffset:14,expire:0,message:"",touchIcon:!1,arrow:!0,hookOnLoad:!0,closeButton:!0,iterations:100},G={ar:'<span dir="rtl">\u0642\u0645 \u0628\u062a\u062b\u0628\u064a\u062a \u0647\u0630\u0627 \u0627\u0644\u062a\u0637\u0628\u064a\u0642 \u0639\u0644\u0649 <span dir="ltr">%device:</span>\u0627\u0646\u0642\u0631<span dir="ltr">%icon</span> \u060c<strong>\u062b\u0645 \u0627\u0636\u0641\u0647 \u0627\u0644\u0649 \u0627\u0644\u0634\u0627\u0634\u0629 \u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629.</strong></span>',
ca_es:"Per instal\u00b7lar aquesta aplicaci\u00f3 al vostre %device premeu %icon i llavors <strong>Afegir a pantalla d'inici</strong>.",cs_cz:"Pro instalaci aplikace na V\u00e1\u0161 %device, stiskn\u011bte %icon a v nab\u00eddce <strong>P\u0159idat na plochu</strong>.",da_dk:"Tilf\u00f8j denne side til din %device: tryk p\u00e5 %icon og derefter <strong>F\u00f8j til hjemmesk\u00e6rm</strong>.",de_de:"Installieren Sie diese App auf Ihrem %device: %icon antippen und dann <strong>Zum Home-Bildschirm</strong>.",
el_gr:"\u0395\u03b3\u03ba\u03b1\u03c4\u03b1\u03c3\u03c4\u03ae\u03c3\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03ae\u03bd \u03c4\u03b7\u03bd \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae \u03c3\u03c4\u03ae\u03bd \u03c3\u03c5\u03c3\u03ba\u03b5\u03c5\u03ae \u03c3\u03b1\u03c2 %device: %icon \u03bc\u03b5\u03c4\u03ac \u03c0\u03b1\u03c4\u03ac\u03c4\u03b5 <strong>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03c3\u03b5 \u0391\u03c6\u03b5\u03c4\u03b7\u03c1\u03af\u03b1</strong>.",en_us:"Install this web app on your %device: tap %icon and then <strong>Add to Home Screen</strong>.",
es_es:"Para instalar esta app en su %device, pulse %icon y seleccione <strong>A\u00f1adir a pantalla de inicio</strong>.",fi_fi:"Asenna t\u00e4m\u00e4 web-sovellus laitteeseesi %device: paina %icon ja sen j\u00e4lkeen valitse <strong>Lis\u00e4\u00e4 Koti-valikkoon</strong>.",fr_fr:"Ajoutez cette application sur votre %device en cliquant sur %icon, puis <strong>Ajouter \u00e0 l'\u00e9cran d'accueil</strong>.",he_il:'<span dir="rtl">\u05d4\u05ea\u05e7\u05df \u05d0\u05e4\u05dc\u05d9\u05e7\u05e6\u05d9\u05d4 \u05d6\u05d5 \u05e2\u05dc \u05d4-%device \u05e9\u05dc\u05da: \u05d4\u05e7\u05e9 %icon \u05d5\u05d0\u05d6 <strong>\u05d4\u05d5\u05e1\u05e3 \u05dc\u05de\u05e1\u05da \u05d4\u05d1\u05d9\u05ea</strong>.</span>',
hr_hr:"Instaliraj ovu aplikaciju na svoj %device: klikni na %icon i odaberi <strong>Dodaj u po\u010detni zaslon</strong>.",hu_hu:"Telep\u00edtse ezt a web-alkalmaz\u00e1st az \u00d6n %device-j\u00e1ra: nyomjon a %icon-ra majd a <strong>F\u0151k\u00e9perny\u0151h\u00f6z ad\u00e1s</strong> gombra.",it_it:"Installa questa applicazione sul tuo %device: premi su %icon e poi <strong>Aggiungi a Home</strong>.",ja_jp:"\u3053\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u3092\u3042\u306a\u305f\u306e%device\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306f%icon\u3092\u30bf\u30c3\u30d7\u3057\u3066<strong>\u30db\u30fc\u30e0\u753b\u9762\u306b\u8ffd\u52a0</strong>\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002",
ko_kr:'%device\uc5d0 \uc6f9\uc571\uc744 \uc124\uce58\ud558\ub824\uba74 %icon\uc744 \ud130\uce58 \ud6c4 "\ud648\ud654\uba74\uc5d0 \ucd94\uac00"\ub97c \uc120\ud0dd\ud558\uc138\uc694',nb_no:"Installer denne appen p\u00e5 din %device: trykk p\u00e5 %icon og deretter <strong>Legg til p\u00e5 Hjem-skjerm</strong>",nl_nl:"Installeer deze webapp op uw %device: tik %icon en dan <strong>Voeg toe aan beginscherm</strong>.",pl_pl:"Aby zainstalowa\u0107 t\u0119 aplikacje na %device: naci\u015bnij %icon a nast\u0119pnie <strong>Dodaj jako ikon\u0119</strong>.",
pt_br:"Instale este aplicativo em seu %device: aperte %icon e selecione <strong>Adicionar \u00e0 Tela Inicio</strong>.",pt_pt:"Para instalar esta aplica\u00e7\u00e3o no seu %device, prima o %icon e depois em <strong>Adicionar ao ecr\u00e3 principal</strong>.",ru_ru:"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u044d\u0442\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0430\u0448 %device: \u043d\u0430\u0436\u043c\u0438\u0442\u0435 %icon, \u0437\u0430\u0442\u0435\u043c <strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u00ab\u0414\u043e\u043c\u043e\u0439\u00bb</strong>.",
sv_se:"L\u00e4gg till denna webbapplikation p\u00e5 din %device: tryck p\u00e5 %icon och d\u00e4refter <strong>L\u00e4gg till p\u00e5 hemsk\u00e4rmen</strong>.",th_th:"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e47\u0e1a\u0e41\u0e2d\u0e1e\u0e2f \u0e19\u0e35\u0e49\u0e1a\u0e19 %device \u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13: \u0e41\u0e15\u0e30 %icon \u0e41\u0e25\u0e30 <strong>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e17\u0e35\u0e48\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d\u0e42\u0e2e\u0e21</strong>",
tr_tr:"Bu uygulamay\u0131 %device'a eklemek i\u00e7in %icon simgesine sonras\u0131nda <strong>Ana Ekrana Ekle</strong> d\u00fc\u011fmesine bas\u0131n.",uk_ua:"\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0456\u0442\u044c \u0446\u0435\u0439 \u0432\u0435\u0431 \u0441\u0430\u0439\u0442 \u043d\u0430 \u0412\u0430\u0448 %device: \u043d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c %icon, \u0430 \u043f\u043e\u0442\u0456\u043c <strong>\u041d\u0430 \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439 \u0435\u043a\u0440\u0430\u043d</strong>.",
zh_cn:"\u60a8\u53ef\u4ee5\u5c06\u6b64\u5e94\u7528\u7a0b\u5f0f\u5b89\u88c5\u5230\u60a8\u7684 %device \u4e0a\u3002\u8bf7\u6309 %icon \u7136\u540e\u70b9\u9009<strong>\u6dfb\u52a0\u81f3\u4e3b\u5c4f\u5e55</strong>\u3002",zh_tw:"\u60a8\u53ef\u4ee5\u5c07\u6b64\u61c9\u7528\u7a0b\u5f0f\u5b89\u88dd\u5230\u60a8\u7684 %device \u4e0a\u3002\u8acb\u6309 %icon \u7136\u5f8c\u9ede\u9078<strong>\u52a0\u5165\u4e3b\u756b\u9762\u87a2\u5e55</strong>\u3002"};(function(){if(r){var d=Date.now(),f;if(a.addToHomeConfig)for(f in a.addToHomeConfig)s[f]=
a.addToHomeConfig[f];s.autostart||(s.hookOnLoad=!1);q=/ipad/gi.test(k.platform);t=a.devicePixelRatio&&1<a.devicePixelRatio;w=/Safari/i.test(k.appVersion)&&!/CriOS/i.test(k.appVersion);x=k.standalone;n=(n=k.appVersion.match(/OS (\d+_\d+)/i))&&n[1]?+n[1].replace("_","."):0;z=+a.localStorage.getItem("addToHome");D=null;C=s.returningVisitor?z&&z+24192E5>d:!0;z||(z=d);B=C&&z<=d;s.hookOnLoad?a.addEventListener("load",b,!1):!s.hookOnLoad&&s.autostart&&b()}})();return{show:function(a){r&&!m&&(F=a,b())},close:f,
reset:function(){a.localStorage.removeItem("addToHome");a.sessionStorage.removeItem("addToHomeSession")}}}(g);h.doRectsIntersect=function(a,b){return 2*Math.abs(a.getCenterX()-b.getCenterX())<a.getWidth()+b.getWidth()&&2*Math.abs(a.getCenterY()-b.getCenterY())<a.getHeight()+b.getHeight()};h.prototype={getCenter:function(){return{x:this.getCenterX(),y:this.getCenterY()}},getCenterX:function(){return(this.left+this.right)/2},getCenterY:function(){return(this.top+this.bottom)/2},setX:function(a){var b=
this.getWidth();this.left=a;this.right=a+b},setY:function(a){var b=this.getHeight();this.top=a;this.bottom=a+b},setPosition:function(a,b){this.setX(a);this.setY(b)},checkDimensions:function(){var a;this.left>this.right&&(a=this.left,this.left=this.right,this.right=a);this.top>this.bottom&&(a=this.top,this.top=this.bottom,this.bottom=a)},translate:function(a,b){this.translateX(a);this.translateY(b)},translateX:function(a){this.left+=a;this.right+=a},translateY:function(a){this.top+=a;this.bottom+=
a},getWidth:function(){return this.right-this.left},getHeight:function(){return this.bottom-this.top},setWidth:function(a){this.right=this.left+a},setHeight:function(a){this.bottom=this.top+a},containsPoint:function(a,b){return a>=this.left&&a<this.right&&b>=this.top&&b<this.bottom},intersectsRect:function(a){return h.doRectsIntersect(this,a)},copy:function(){return new h({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};var c;(function(){c={nativeTypes:"Boolean Number String Function Array Date RegExp Object".split(" "),
class2type:{}};(function(){var a;for(a=0;a<c.nativeTypes.length;a+=1)c.class2type["[object "+c.nativeTypes[a]+"]"]=c.nativeTypes[a].toLowerCase()})();c.isNode=function(a){return"object"===typeof Node?a instanceof Node:a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName};c.isElement=function(a){return"object"===typeof HTMLElement?a instanceof HTMLElement:a&&"object"===typeof a&&null!==a&&1===a.nodeType&&"string"===typeof a.nodeName};c.isArray=Array.isArray||function(a){return"array"===
c.getType(a)};c.getType=function(a){return null==a?String(a):c.class2type[toString.call(a)]||"object"};c.isNativeObject=function(a){return"object"===c.getType(a)};c.getDigits=function(a){var b=[];if(0===a)b.push(0);else if(0<a)for(;0<a;)b.unshift(a%10),a=Math.floor(a/10);return b};c.makeUnselectable=function(a,b){if(a&&(1===a.nodeType&&a.setAttribute("unselectable","on"),b))for(var d=a.firstChild;d;)c.makeUnselectable(d,b),d=d.nextSibling};c.addClass=function(a,b){var d=a.hasOwnProperty("className"),
f=d?a.className:a.getAttribute("class"),c=[],e="object"===typeof b&&"number"===typeof b.length?b:[b],g;"string"===typeof f&&0<f.length&&(c=f.split(" "));for(g=0;g<e.length;g+=1)f=e[g],-1===c.indexOf(f)&&c.push(f);d?a.className=c.join(" "):a.setAttribute("class",c.join(" "))};c.removeClass=function(a,b){var d=a.hasOwnProperty("className"),f=d?a.className:a.getAttribute("class"),c=[],e,g="object"===typeof b&&"number"===typeof b.length?b:[b];"string"===typeof f&&0<f.length&&(c=f.split(" "));for(f=0;f<
g.length;f+=1)e=g[f],e=c.indexOf(e),-1!==e&&c.splice(e,1);d?a.className=c.join(" "):a.setAttribute("class",c.join(" "))};c.hasClass=function(a,b){var d,f=[];return a.getAttribute?(d=a.getAttribute("class"),"string"===typeof d&&0<d.length&&(f=d.split(" ")),-1!==f.indexOf(b)):!1};c.countProps=function(a){var b=0,d;for(d in a)a.hasOwnProperty(d)&&(b+=1);return b};c.cloneObject=function(a,b){var d,f;if("string"===typeof a)d=a;else for(f in d={},a)a.hasOwnProperty(f)&&(d[f]=b&&"object"===typeof a[f]?c.cloneObject(a[f],
b):a[f]);return d};c.extendObj=function(a,b,d){var f;b=c.cloneObject(b,d);for(f in a)a.hasOwnProperty(f)&&(d&&b.hasOwnProperty(f)&&"object"===typeof b[f]&&"object"===typeof a[f]&&(b[f]=c.extendObj(a[f],b[f],d)),b.hasOwnProperty(f)||(c.isNativeObject(a[f])?b[f]=a[f]?c.cloneObject(a[f],d):null:b[f]=a[f]));return b};c.equalsObj=function(a,b,d){if(a===b)return!0;var f,e={};for(f in a)if(a.hasOwnProperty(f)&&b.hasOwnProperty(f))if(a[f]===b[f])e[f]=!0;else if(d)if(c.equalsObj(a[f],b[f],d))e[f]=!0;else return!1;
else{if(a[f]!==b[f])return!1}else return!1;for(f in b)if(b.hasOwnProperty(f)&&a.hasOwnProperty(f)){if(!e[f])if(d){if(!c.equalsObj(a[f],b[f],d))return!1}else if(b[f]!==a[f])return!1}else return!1;return!0};c.inherit=function(){var a,b,d,f;for(b=0;b<arguments.length;b+=1)if(f=null,"function"===typeof arguments[b]?f=new arguments[b]:"object"===typeof arguments[b]&&(f=arguments[b]),f)if(a)for(d in f)f.hasOwnProperty(d)&&(a[d]=f[d]);else a=f;return a};c.objectToParamString=function(a){var b,d=[];for(b in a)a.hasOwnProperty(b)&&
d.push(b+"="+a[b]);return d.join("&")};c.paramStringToObject=function(a){var b={},d,f,c;if(a&&"string"===typeof a&&1<a.length)for("?"===a[0]&&(a=a.substr(1)),a=a.split("&"),d=0;d<a.length;d+=1)f=a[d].split("=",2),2===f.length&&(c=f[0],f=f[1],c&&f&&(b[c]=f));return b};c.ajaxBaseUrl="";c.ajax=function(a){if("object"===typeof a&&"string"===typeof a.url){var b,d,f,e,g,h,l,k,n,q;f=a&&a.params&&"object"===typeof a.params?a.params:null;g=a&&a.headers&&"object"===typeof a.headers?a.headers:null;d=c.ajaxBaseUrl+
a.url;if(JSON&&JSON.parse){b=new XMLHttpRequest;e=null;h="function"===typeof a.success?a.success:null;e="function"===typeof a.fail?a.fail:null;l="function"===typeof a.error?a.error:e;k="function"===typeof a.abort?a.abort:e;f&&(e=c.objectToParamString(f),d+="?"+e);b.open("GET",d);if(g)for(q in g)g.hasOwnProperty(q)&&b.setRequestHeader(q,g[q]);b.onload=function(){if(h){var a=null;try{a=JSON.parse(this.responseText)}catch(b){a=null}a?h(a):l&&l({status:"error",statusCode:this.status,message:"JSON parse error"})}};
b.onerror=function(){l&&l({status:"error",statusCode:this.status})};b.onabort=function(){k&&k({status:"abort"})};b.send()}else"string"===typeof a.jsonp&&(f||(f={}),f.callback=a.callback,e=c.objectToParamString(f),n=c.createScript(d+"?"+e),y.body.appendChild(n),K(function(){n.parentNode&&n.parentNode.removeChild(n)},10))}};c.createScript=function(a,b){var d=y.createElement("script");d.type="text/javascript";a&&(d.src=a);b&&(d.innerHTML=b);return d};c.isPropertySupported=function(a){var b=["Webkit",
"Khtml","Moz","O","ms"],d=(y.body||y.documentElement).style,f=a.charAt(0).toUpperCase()+a.substring(1);if("string"===typeof d[a])return!0;for(a=0;a<b.length;a+=1)if("undefined"!==typeof d[b[a]+f])return!0;return!1};c.getPrefixedProperty=function(a,b){var d=["Webkit","Khtml","Moz","O","ms"],f=b.style,c=a.charAt(0).toUpperCase()+a.substring(1),e;if("string"===typeof f[a])return a;for(e=0;e<d.length;e+=1)if("undefined"!==typeof f[d[e]+c])return d[e]+c;return a};c.addOnClick=function(a,b,d){a.onclick=
b;d&&a.addEventListener("touchstart",function(a){a.currentTarget.onclick(a);a.preventDefault();a.stopPropagation();return!1},!1)};c.isMobile={Android:function(){return z.userAgent.match(/Android/i)},FirefoxOS:function(){return-1==z.userAgent.indexOf("Android")&&0<=z.userAgent.indexOf("Firefox")&&0<=z.userAgent.indexOf("Mobile")},BlackBerry:function(){return z.userAgent.match(/BlackBerry/i)},iOS:function(){return z.userAgent.match(/iPhone|iPad|iPod/i)},iPod:function(){return z.userAgent.match(/iPod/i)},
iPhone:function(){return z.userAgent.match(/iPhone/i)},iPad:function(){return z.userAgent.match(/iPad/i)},Opera:function(){return z.userAgent.match(/Opera Mini/i)},Windows:function(){return z.userAgent.match(/IEMobile/i)},any:function(){return c.isMobile.Android()||c.isMobile.BlackBerry()||c.isMobile.iOS()||c.isMobile.Opera()||c.isMobile.Windows()||c.isMobile.FirefoxOS()},Safari:function(){return c.isMobile.iOS()&&!c.isMobile.ChromeIOS()&&z.userAgent.match(/AppleWebKit/i)},iPhoneSafari:function(){return(c.isMobile.iPhone()||
c.isMobile.iPod())&&!c.isMobile.ChromeIOS()&&z.userAgent.match(/AppleWebKit/i)},ChromeIOS:function(){return c.isMobile.iOS()&&z.userAgent.match("CriOS")},ChromeAndroid:function(){return z.userAgent.match(/Android.+Chrome|CrMo/i)}};c.getIOSVersion=function(){var a=z.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),a=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3]||0,10)];return parseFloat(a.join("."))};c.visibility={MAP:{hidden:"visibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange",
webkitHidden:"webkitvisibilitychange"},mIsSupported:!1,mCheckedIfSupported:!1,mHidden:null,mVisibilityChange:null,mOnChangeFunctions:[],addOnChange:function(a){return this.isSupported()&&-1===this.mOnChangeFunctions.indexOf(a)?(y.addEventListener(this.mVisibilityChange,a,!1),!0):!1},removeOnChange:function(a){if(this.isSupported()){var b=this.mOnChangeFunctions.indexOf(a);if(-1!==b)return y.removeEventListener(this.mVisibilityChange,a),this.mOnChangeFunctions.splice(b,1),!0}return!1},getOnChangeFunctions:function(){return this.mOnChangeFunctions},
isSupported:function(){if(!this.mCheckedIfSupported){for(var a in this.MAP)if(this.MAP.hasOwnProperty(a)&&"undefined"!==typeof y[a]){this.mHidden=a;this.mVisibilityChange=this.MAP[a];this.mIsSupported=!0;break}this.mCheckedIfSupported=!0}return this.mIsSupported},isHidden:function(){return this.isSupported()?y[this.mHidden]:!1}};c.bindFnc=function(a,b){return function(){return b.apply(a,arguments)}}})();aa.prototype={get:function(a){var b=this.map[a];b||(this.map[a]=b=y.getElementById(a));return b},
create:function(a,b,d,c){a=y.createElement(a);var e;b&&(a.hasOwnProperty("id")?a.id=b:a.setAttribute("id",b));d&&(a.hasOwnProperty("className")?a.className=d:a.setAttribute("class",d));if(c)for(e in c)c.hasOwnProperty(e)&&(a.hasOwnProperty(e)?a[e]=c[e]:a.setAttribute(e,c[e]));return a}};var x=new aa;C.prototype={addEventListener:function(a,b){return"function"===typeof b&&(this.eventMap.hasOwnProperty(a)||(this.eventMap[a]=[]),-1===this.eventMap[a].indexOf(b))?(this.eventMap[a].push(b),!0):!1},removeEventListener:function(a,
b){if("function"===typeof b&&this.eventMap[a]){var d=this.eventMap[a].indexOf(b);if(-1!==d)return this.eventMap[a].splice(d,1),!0}return!1},removeAllEventListeners:function(a){if(this.eventMap[a]){for(a=this.eventMap[a];0<a.length;)a.pop();return!0}return!1},dispatch:function(a,b){var d={source:this,name:a,data:b},c,e;if(this.eventMap[a]){e=this.eventMap[a];for(c=0;c<e.length;c+=1)e[c](d);return!0}return!1}};J.events={DOWN:"down",UP:"up",PRESS:"press"};J.keys={SPACE:32,0:48,1:49,2:50,3:51,4:52,5:53,
6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40};J.prototype=c.inherit(new C,{keyDown:function(a){this.keyMap[a.keyCode]||(this.keyMap[a.keyCode]=!0,this.dispatch(J.events.DOWN,{keyCode:a.keyCode,keyMap:this.keyMap,originalEvent:a}))},keyUp:function(a){this.keyMap[a.keyCode]&&(this.keyMap[a.keyCode]=!1,this.dispatch(J.events.UP,{keyCode:a.keyCode,
keyMap:this.keyMap,originalEvent:a}))},keyPress:function(a){this.dispatch(J.events.PRESS,{keyCode:a.keyCode,keyMap:this.keyMap,originalEvent:a})}});n.events={DOWN:"down",MOVE:"move",UP:"up",CLICK:"click",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEUP:"mouseup",MOUSECLICK:"mouseclick",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend"};n.prototype=c.inherit(new C,{resize:function(a){},resetSkips:function(){this.skipMouseUp=this.skipMouseDown=0},updateMousePos:function(a){var b=
a.target.getBoundingClientRect(),d=b.left,b=b.top,c=0,e=0;switch(a.type){case "touchstart":case "touchmove":case "touchend":c=a.changedTouches[0].pageX;e=a.changedTouches[0].pageY;break;case "mousedown":case "mousemove":case "mouseup":case "click":c=a.pageX,e=a.pageY}c-=d;e-=b;this.mouseX=c;this.mouseY=e;this.scaledMouseX=Math.round(c*this.scaleX);this.scaledMouseY=Math.round(e*this.scaleY)},mouseDown:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.dispatch(n.events.MOUSEDOWN,
{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});0<this.skipMouseDown?this.skipMouseDown-=1:this.dispatch(n.events.DOWN,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},mouseMove:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.dispatch(n.events.MOUSEMOVE,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});0===this.numTouch&&
this.dispatch(n.events.MOVE,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},mouseUp:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.dispatch(n.events.MOUSEUP,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});0<this.skipMouseUp?this.skipMouseUp-=1:this.dispatch(n.events.UP,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},
mouseClick:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.dispatch(n.events.MOUSECLICK,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});0===this.numTouch&&this.dispatch(n.events.CLICK,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},touchStart:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.numTouch+=1;this.skipMouseDown+=1;this.dispatch(n.events.TOUCHSTART,
{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});this.dispatch(n.events.DOWN,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},touchMove:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.dispatch(n.events.TOUCHMOVE,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});this.dispatch(n.events.MOVE,{originalEvent:a,x:this.mouseX,
y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})},touchEnd:function(a){a.preventDefault();a.stopPropagation();this.updateMousePos(a);this.numTouch-=1;this.skipMouseUp+=1;this.dispatch(n.events.TOUCHEND,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY});this.dispatch(n.events.UP,{originalEvent:a,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY})}});ba.prototype={hasCookie:function(a){return this.cookieMap.hasOwnProperty(a)},
getCookie:function(a,b,d){if(this.cookieMap[a])return this.cookieMap[a];d&&this.setCookie(a,b,d);return b},setCookie:function(a,b,d){var c=new Date;c.setSeconds(c.getSeconds()+d);y.cookie=a+"="+b+"; expires="+c.toUTCString();this.cookieMap[a]=b},parseCookies:function(){return y.cookie.split(";").map(function(a){return a.trim().split("=")}).reduce(function(a,b){a[b[0]]=b[1];return a},{})}};var H=new ba;D.events={CHECKING:"checking",LOADNORMALLY:"loadnormally",UPDATINGCACHE:"updatingcache",UPDATEPROGRESS:"updateprogress",
UPDATEREADY:"updateready"};D.prototype=c.inherit(new C,{init:function(){if(this.appCache)if(this.appCache.status===this.appCache.UNCACHED)this.loadNormally();else{if(this.appCache.addEventListener("checking",c.bindFnc(this,this.checking),!1),this.appCache.addEventListener("noupdate",c.bindFnc(this,this.loadNormally),!1),this.appCache.addEventListener("obsolete",c.bindFnc(this,this.loadNormally),!1),this.appCache.addEventListener("error",c.bindFnc(this,this.loadNormally),!1),this.appCache.addEventListener("cached",
c.bindFnc(this,this.loadNormally),!1),this.appCache.addEventListener("downloading",c.bindFnc(this,this.updatingCache),!1),this.appCache.addEventListener("progress",c.bindFnc(this,this.updateProgress),!1),this.appCache.addEventListener("updateready",c.bindFnc(this,this.updateReady),!1),this.appCache.status===this.appCache.IDLE)try{this.appCache.update()}catch(a){this.loadNormally()}}else this.loadNormally()},checking:function(a){this.finished||this.dispatch(D.events.CHECKING,{appCache:this.appCache,
originalEvent:a})},loadNormally:function(a){this.finished||(this.finished=!0,this.dispatch(D.events.LOADNORMALLY,{appCache:this.appCache,originalEvent:a}))},updateProgress:function(a){this.finished||this.dispatch(D.events.UPDATEPROGRESS,{appCache:this.appCache,originalEvent:a,lengthComputable:a.lengthComputable,total:a.total,loaded:a.loaded})},updatingCache:function(a){this.finished||this.dispatch(D.events.UPDATINGCACHE,{appCache:this.appCache,originalEvent:a})},updateReady:function(a){if(!this.finished){this.finished=
!0;this.dispatch(D.events.UPDATEREADY,{appCache:this.appCache,originalEvent:a});try{this.appCache.swapCache()}catch(b){}this.reloadOnNewUpdate&&Q.reload()}}});L.COOKIE_PREFIX="abt-";L.COOKIE_TTL=31536E3;L.prototype={getTestValue:function(a){return this.testsMap[a]},isTestValue:function(a,b){return this.testsMap.hasOwnProperty(a)&&this.testsMap[a]===b},hasTest:function(a){return this.testsMap.hasOwnProperty(a)}};l.IDPOOL=0;l.easingFunctions={linear:function(a){return a},easeInQuad:function(a){return a*
a},easeOutQuad:function(a){return a*(2-a)},easeInOutQuad:function(a){return 0.5>a?2*a*a:-1+(4-2*a)*a},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return--a*a*a+1},easeInOutCubic:function(a){return 0.5>a?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return 1- --a*a*a*a},easeInOutQuart:function(a){return 0.5>a?8*a*a*a*a:1-8*--a*a*a*a},easeInQuint:function(a){return a*a*a*a*a},easeOutQuint:function(a){return 1+--a*a*a*a*a},easeInOutQuint:function(a){return 0.5>
a?16*a*a*a*a*a:1+16*--a*a*a*a*a}};l.prototype={preStart:function(){this.prepared=!1;this.endTime=this.startTime=-1},start:function(a){this.prepared=!0;this.startTime=a;this.endTime=a+this.duration;this.startCallback&&this.startCallback(this.startValue,0,0)},step:function(a,b){var d=this.timeFunction(a),c=this.startValue+(this.endValue-this.startValue)*d;this.stepCallback&&this.stepCallback(c,d,a)},end:function(){this.prepared=!1;this.endTime=this.startTime=-1;this.endCallback&&this.endCallback(this.endValue,
1,1)},stop:function(){this.prepared=!1;this.endTime=this.startTime=-1}};Z.prototype=c.inherit(new l,{preStart:function(){l.prototype.preStart.call(this);var a;for(a=0;a<this.anims.length;a+=1)this.anims[a].preStart()},start:function(a){var b=0,d,c;this.currentIndex=0;l.prototype.start.call(this,a);for(d=0;d<this.anims.length;d+=1)c=this.anims[d],c.startTime=a+b,c.endTime=c.startTime+c.duration,b+=c.duration},step:function(a,b){l.prototype.step.call(this,a,b);if(this.currentIndex<this.anims.length){var d,
c;do d=this.anims[this.currentIndex],c=!1,d&&(d.prepared||d.start(d.startTime),b>=d.startTime&&b<d.endTime?(c=(b-d.startTime)/d.duration,d.step(c,b),c=!1):b>=d.endTime&&(d.step(1,b),d.end(),this.currentIndex+=1,c=!0));while(c)}},end:function(){l.prototype.end.call(this);this.currentIndex=this.anims.length},stop:function(){l.prototype.stop.call(this);this.currentIndex=this.anims.length;var a;for(a=0;a<this.anims.length;a+=1)this.anims[a].stop()}});T.prototype=c.inherit(new l,{preStart:function(){var a;
l.prototype.preStart.call(this);for(a=0;a<this.anims.length;a+=1)this.anims[a].preStart()},start:function(a){var b;l.prototype.start.call(this,a);for(b=0;b<this.anims.length;b+=1)this.anims[b].start(a)},step:function(a,b){var d;l.prototype.step.call(this,a,b);for(d=0;d<this.anims.length;d+=1)this.anims[d].step(a,b)},end:function(){var a;l.prototype.end.call(this);for(a=0;a<this.anims.length;a+=1)this.anims[a].end()},stop:function(){var a;l.prototype.stop.call(this);for(a=0;a<this.anims.length;a+=
1)this.anims[a].stop()}});ca.prototype=c.inherit(new C,U.prototype,{addAnim:function(a){this.anims[a.id]=a;a.manager=this},removeAnim:function(a){if(a=this.anims["string"===typeof a?a:a.id])this.anims[a.id]=void 0,a.manager=null},update:function(a,b,d,c){if(0<this.activeAnims.length)for(a=0;a<this.activeAnims.length;a+=1)c=this.activeAnims[a],c.prepared||c.start(d),d>=c.startTime&&d<c.endTime?(b=(d-c.startTime)/c.duration,c.step(b,d)):d>=c.endTime&&(c.step(1,d),c.end(),this.activeAnims.splice(a,1),
a-=1)},createAnim:function(a){new l(c.extendObj(a,{manager:this}))},getAnim:function(a){return this.anims[a]},startAnimById:function(a){this.startAnim(this.anims[a])},startAnim:function(a){a.manager=this;a.preStart();this.activeAnims.push(a)},stopAnimById:function(a){this.stopAnim(this.anims[a])},stopAnim:function(a){var b=this.activeAnims.indexOf(a);a.stop();-1!==b&&this.activeAnims.splice(b,1)}});U.prototype={update:function(a,b,d,c){}};F.prototype={draw:function(a){},getStageX:function(){return this.parent?
this.parent.x+this.x-this.anchorX:this.x-this.anchorX},getStageY:function(){return this.parent?this.parent.y+this.y-this.anchorY:this.y-this.anchorY},isGloballyVisible:function(){return this.parent&&this.parent.isGloballyVisible?this.parent.isGloballyVisible():!0},getTopVisible:function(){return this.parent&&this.parent.getTopVisible?this.parent.getTopVisible():!1}};V.prototype=c.inherit(new h,F.prototype,{draw:function(a){this.visible&&0<this.opacity&&(a.save(),a.translate(this.left,this.top),1>
this.opacity&&(a.globalAlpha=this.opacity),a.fillStyle=this.fillStyle,a.fillRect(-this.anchorX,-this.anchorY,this.getWidth(),this.getHeight()),a.restore())}});B.prototype=c.inherit(new F,{addChild:function(a){return-1===this.children.indexOf(a)?(a.parent=this,this.children.push(a),!0):!1},removeChild:function(a){var b=this.children.indexOf(a);return-1!==b?(a.parent=null,this.children.splice(b,1),a):null},removeChildAt:function(a){return a<this.children.length?(this.children[a].parent=null,this.children.splice(a,
1)):null},removeAllChilds:function(){for(;0<this.children.length;)this.removeChildAt(0)},draw:function(a){if(this.visible&&0<this.opacity){var b;a.save();1>this.opacity&&(a.globalAlpha=this.opacity);a.translate(this.x-this.anchorX,this.y-this.anchorY);a.scale(this.scaleX,this.scaleY);for(b=0;b<this.children.length;b+=1)this.children[b].draw(a);a.restore()}},isGloballyVisible:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0},getTopVisible:function(){return this.parent&&
this.parent.getTopVisible?this.parent.getTopVisible():this.visible},getTopOpacity:function(){return this.parent&&this.parent.getTopOpacity?this.parent.getTopOpacity():this.opacity}});M.prototype=c.inherit(new F,{draw:function(a){this.visible&&0<this.opacity&&(a.save(),1>this.opacity&&(a.globalAlpha=this.opacity),a.translate(this.x,this.y),a.scale(this.scaleX,this.scaleY),a.rotate(this.angle),a.drawImage(this.image,this.sourceRect.left,this.sourceRect.top,this.sourceRect.getWidth(),this.sourceRect.getHeight(),
-this.anchorX,-this.anchorY,this.width,this.height),a.restore())}});da.prototype=c.inherit(new F,{draw:function(a){var b=0!==this.imageWidth?this.offsetX%this.imageWidth:this.offsetX,d=0!==this.imageHeight?this.offsetY%this.imageHeight:this.offsetY;a.save();a.translate(this.x,this.y);a.scale(this.imageScaleX,this.imageScaleY);a.rotate(this.angle);a.translate(b/this.imageScaleX+this.imageOffsetX,d/this.imageScaleY+this.imageOffsetY);a.fillStyle=this.pattern;a.fillRect(-b/this.imageScaleX-this.imageOffsetX,
-d/this.imageScaleY-this.imageOffsetY,this.width*this.scaleX/this.imageScaleX,this.height*this.scaleY/this.imageScaleY);a.restore()}});W.prototype=c.inherit(new M,{setFrameId:function(a){var b=this.frameMap[a];this.currentFrameId=a;this.sourceRect=b},copy:function(){var a=c.cloneObject(this.options),b;if(a.frameMap)for(b in a.frameMap)a.frameMap.hasOwnProperty(b)&&(a.frameMap[b]=a.frameMap[b].copy());else a.rect&&(a.rect=a.rect.copy());return new W(a)},applyFromOptions:function(a){var b=a||{},d;M.call(this,
a);this.options=a;this.frameMap=b.frameMap||null;this.currentFrameId=b.startFrameId||null;if(this.frameMap)if(this.currentFrameId)this.setFrameId(this.currentFrameId);else for(d in this.frameMap){if(this.frameMap.hasOwnProperty(d)){this.setFrameId(d);break}}else this.sourceRect=b.rect||this.sourceRect||new h}});t.IDPOOL=0;t.states={UP:"up",DOWN:"down",HOVER:"hover",DISABLED:"disabled"};t.events={CLICK:"click",DOWN:"down",UP:"up",HOVER:"hover"};t.prototype=c.inherit(new W,C.prototype,{click:function(a){this.enabled&&
this.dispatch(t.events.CLICK,{originalEvent:a})},down:function(a){this.enabled&&(this.setState(t.states.DOWN),this.dispatch(t.events.DOWN,{originalEvent:a}))},up:function(a){this.enabled&&(this.setState(t.states.UP),this.dispatch(t.events.UP,{originalEvent:a}))},hover:function(a){this.enabled&&(this.setState(t.states.HOVER),this.dispatch(t.events.HOVER,{originalEvent:a}))},setEnabled:function(a){(this.enabled=a)?this.setState(t.states.UP):this.setState(t.states.DISABLED)},setState:function(a){this.state=
a;this.anchorY=this.state===t.states.DOWN?-5:0},contains:function(a,b){var d=this.getStageX(),c=this.getStageY();return a>=d&&a<d+this.width&&b>=c&&b<c+this.height}});P.prototype=c.inherit(new F,{draw:function(a){this.visible&&0<this.opacity&&(a.save(),1>this.opacity&&(a.globalAlpha=this.opacity),a.translate(this.x,this.y),a.rotate(this.angle),a.scale(this.scaleX,this.scaleY),a.textAlign=this.textAlign,a.textBaseline=this.textBaseline,a.fillText(this.text,-this.anchorX,-this.anchorY),a.restore())}});
w.gaEvents={PLAYBUTTON:"playbutton",TAPTAP:"taptap",REPLAY:"replay",SHARE_TW:"share_tw",SHARE_FB:"share_fb",SHARE_KIK:"share_kik",KIKMSG_RECEIVED:"kikmsg_received",KIKMSG_SENT:"kikmsg_sent",ENDGAME:"endgame",PASS_TUBE:"pass_tube",INTERSTITIAL_SHOWN:"interstitial_shown",INTERSTITIAL_HIDDEN:"interstitial_hidden",INTERSTITIAL_ERROR:"interstitial_error",GAMEOVERAD_SHOWN:"gameoverad_shown",GAMEOVERAD_HIDDEN:"gameoverad_hidden",GAMEOVERAD_ROTATED:"gameoverad_rotated",GAMEOVERAD_ERROR:"gameoverad_error"};
w.prototype={init:function(){this.game.addEventListener(e.events.initted,c.bindFnc(this,this.gameInitted));this.game.buttonManager.addEventListener(G.events.CLICK,c.bindFnc(this,this.onButtonClick));this.game.addEventListener(e.events.stateChanged,c.bindFnc(this,this.onStateChange));this.initAdManagerListeners()},initAdManagerListeners:function(){this.game.adManager&&(this.game.adManager.addEventListener(v.events.INTERSTITIALSHOWN,c.bindFnc(this,this.interstitialShown)),this.game.adManager.addEventListener(v.events.INTERSTITIALHIDDEN,
c.bindFnc(this,this.interstitialHidden)),this.game.adManager.addEventListener(v.events.GAMEOVERADSHOWN,c.bindFnc(this,this.gameOverAdShown)),this.game.adManager.addEventListener(v.events.GAMEOVERADHIDDEN,c.bindFnc(this,this.gameOverAdHidden)))},interstitialShown:function(a){if(a&&a.data&&a.data.ad){var b="ad";0<(a.data.ad.platforms&k.platforms.DESKTOP)&&(b+="-desktop");0<(a.data.ad.platforms&k.platforms.MOBILE)&&(b+="-mobile");0<(a.data.ad.platforms&k.platforms.TABLET)&&(b+="-tablet");a.source&&a.source.desktopPage&&
(b+="-landingpage");this.gaAdEvent(w.gaEvents.INTERSTITIAL_SHOWN,b)}else this.gaErrorEvent(w.gaEvents.INTERSTITIAL_ERROR,"shown-no-ad")},interstitialHidden:function(a){if(a&&a.data&&a.data.ad){var b="ad";0<(a.data.ad.platforms&k.platforms.DESKTOP)&&(b+="-desktop");0<(a.data.ad.platforms&k.platforms.MOBILE)&&(b+="-mobile");0<(a.data.ad.platforms&k.platforms.TABLET)&&(b+="-tablet");a.source&&a.source.desktopPage&&(b+="-landingpage");this.gaAdEvent(w.gaEvents.INTERSTITIAL_HIDDEN,b)}else this.gaErrorEvent(w.gaEvents.INTERSTITIAL_ERROR,
"hidden-no-ad")},gameOverAdShown:function(a){if(a&&a.data&&a.data.ad){var b="ad";0<(a.data.ad.platforms&k.platforms.DESKTOP)&&(b+="-desktop");0<(a.data.ad.platforms&k.platforms.MOBILE)&&(b+="-mobile");0<(a.data.ad.platforms&k.platforms.TABLET)&&(b+="-tablet");a.source&&a.source.desktopPage&&(b+="-landingpage");this.gaAdEvent(w.gaEvents.GAMEOVERAD_SHOWN,b)}else this.gaErrorEvent(w.gaEvents.GAMEOVERAD_ERROR,"shown-no-ad")},gameOverAdHidden:function(a){if(a&&a.data&&a.data.ad){var b="ad";0<(a.data.ad.platforms&
k.platforms.DESKTOP)&&(b+="-desktop");0<(a.data.ad.platforms&k.platforms.MOBILE)&&(b+="-mobile");0<(a.data.ad.platforms&k.platforms.TABLET)&&(b+="-tablet");a.source&&a.source.desktopPage&&(b+="-landingpage");this.gaAdEvent(w.gaEvents.GAMEOVERAD_HIDDEN,b)}else this.gaErrorEvent(w.gaEvents.GAMEOVERAD_ERROR,"hidden-no-ad")},gameOverAdRotated:function(a){if(a&&a.data&&a.data.ad){var b="ad";0<(a.data.ad.platforms&k.platforms.DESKTOP)&&(b+="-desktop");0<(a.data.ad.platforms&k.platforms.MOBILE)&&(b+="-mobile");
0<(a.data.ad.platforms&k.platforms.TABLET)&&(b+="-tablet");a.source&&a.source.desktopPage&&(b+="-landingpage");this.gaAdEvent(w.gaEvents.GAMEOVERAD_ROTATED,b)}else this.gaErrorEvent(w.gaEvents.GAMEOVERAD_ERROR,"rotated-no-ad")},gameInitted:function(a){a={};var b=!1,d,e=this.game.abTestManager.testsMap,g=this.game.initialUrlQuery;this.game.kikEnabled&&(b=a.kik=!0);for(d in e)e.hasOwnProperty(d)&&(a[L.COOKIE_PREFIX+d]=e[d],b=!0);for(d in g)g.hasOwnProperty(d)&&(a[d]=g[d],b=!0);b&&this.gaSetCurrentPage("/?"+
c.objectToParamString(a),y.title);this.gaPageView();this.game.kikEnabled&&!this.game.kikShareIdCreated&&this.game.kikShareId&&this.gaKikShareEvent(w.gaEvents.KIKMSG_RECEIVED,this.game.kikShareId)},onStateChange:function(a){if(a&&a.data&&a.data.state){var b=1>=this.game.numPlays;switch(a.data.state){case e.states.instructions:b||this.gaPageView();break;case e.states.showingBoard:this.gaGameplayEvent(w.gaEvents.ENDGAME),g.gmga&&g.gmga("gamedone"),b?this.gaLevelFirstPlayEvent(w.gaEvents.PASS_TUBE,this.game.kikEnabled?
"kik-tube-"+this.game.score:"nonkik-tube-"+this.game.score):this.gaLevelReplayEvent(w.gaEvents.PASS_TUBE,this.game.kikEnabled?"kik-tube-"+this.game.score:"nonkik-tube-"+this.game.score)}}},onButtonClick:function(a){if(a&&a.data&&a.data.button)switch(a.data.button.id){case "mainMenuPlayButton":this.gaButtonEvent(w.gaEvents.PLAYBUTTON,this.game.kikEnabled?"playbutton_kik":"playbutton_nonkik");break;case "gameOverPlayButton":this.gaButtonEvent(w.gaEvents.REPLAY,this.game.kikEnabled?"replay_kik":"replay_nonkik");
break;case "kikButton":this.gaButtonEvent(w.gaEvents.SHARE_KIK);this.game.kikShareId&&this.gaKikShareEvent(w.gaEvents.KIKMSG_SENT,this.game.kikShareId);break;case "gameOverTweetButton":this.gaButtonEvent(w.gaEvents.SHARE_TW);break;case "gameOverFBButton":this.gaButtonEvent(w.gaEvents.SHARE_FB)}},gaPageLoadEvent:function(a,b,d){this.gaSend({hitType:"event",eventCategory:"pageload",eventAction:a,eventLabel:b,eventValue:d,nonInteraction:1})},gaKikShareEvent:function(a,b,d){this.gaNonInteractionEvent("kikshare",
a,b,d)},gaAdEvent:function(a,b,d){this.gaEvent("ad",a,b,d)},gaButtonEvent:function(a,b,d){this.gaEvent("button",a,b,d)},gaErrorEvent:function(a,b,d){this.gaEvent("error",a,b,d)},gaTimingEvent:function(a,b,d){this.gaEvent("timing",a,b,d)},gaGameplayEvent:function(a,b,d){this.gaEvent("gameplay",a,b,d)},gaLevelFirstPlayEvent:function(a,b,d){this.gaEvent("level_firstplay",a,b,d)},gaLevelReplayEvent:function(a,b,d){this.gaEvent("level_replay",a,b,d)},gaKikPage:function(a,b,d){this.gaEvent("kik_page",a,
b,d)},gaSend:function(a){g.ga&&g.ga("send",a)},gaEvent:function(a,b,d,c){g.ga&&g.ga("send","event",a,b,d,c)},gaNonInteractionEvent:function(a,b,d,c){this.gaSend({hitType:"event",eventCategory:a,eventAction:b,eventLabel:d,eventValue:c,nonInteraction:1})},gaPageView:function(a){g.ga&&(a=a?c.extendObj(this.pageObj,a):this.pageObj,g.ga("send","pageview",a))},gaSetCurrentPage:function(a,b){this.pageObj={page:a,title:b};this.gaSet(this.pageObj)},gaSet:function(a){g.ga&&g.ga("set",a)}};X.createCombinedId=
function(a,b){var d=b||{},e=d.scaleX||1,g=d.scaleY||1;d.hasOwnProperty("scale")&&(e=g=d.scale);return c.objectToParamString({id:a,scaleX:e,scaleY:g})};X.prototype={getSprite:function(a){var b=this.sprites[a];b||(b=new W(c.inherit(this.spriteMap[a],{image:this.image})),this.sprites[a]=b);return b},getCanvas:function(a,b){var d,c=X.createCombinedId(a,b);d=this.canvases[c];d||(d=this.createCanvas(this.spriteMap[a],b),this.canvases[c]=d);return d},createPattern:function(a,b,d){a=this.createCanvas(a,d);
return this.context.createPattern(a,b||"repeat")},createRenderableImage:function(a,b){var d=this.createCanvas(a,b);return new M({image:d,width:d.width,height:d.height})},createCanvas:function(a,b){var d=b||{},c=a.left||a.x||0,e=a.top||a.y||0,g=a.right||0,h=a.bottom||0,l=y.createElement("canvas"),k=l.getContext("2d"),n=d.scaleX||1,q=d.scaleY||1;a.width&&(g=c+a.width);a.height&&(h=e+a.height);d.hasOwnProperty("scale")&&(n=q=d.scale);d=g-c;h-=e;l.width=d*n;l.height=h*q;k.save();k.scale(n,q);k.drawImage(this.image,
c,e,d,h,0,0,d,h);k.restore();return l}};R.imgOnLoad=function(a){!this.alreadyLoaded&&this.onLoadFunction&&(this.alreadyLoaded=!0,this.onLoadFunction(this))};R.imgOnError=function(a){if(this.onErrorFunction)this.onErrorFunction(this)};Y.prototype=c.inherit(new B,{setNumber:function(a){this.number=Math.floor(a);this.updateNumber()},updateNumber:function(){var a,b,d=c.getDigits(this.number),e=[],g=0,h=0,l=0,k;this.removeAllChilds();for(k=0;k<d.length;k+=1)b=d[k],a=this.baseSprite.copy(),a.setFrameId(b),
a.width=a.frameMap[b].getWidth()*this.scaleX,a.height=a.frameMap[b].getHeight()*this.scaleY,e.push(a),h+=a.frameMap[b].getWidth()*this.scaleX,k<d.length-1&&(h+=this.numberSpacing*this.scaleX),("middle"===this.verticalAlign||"bottom"===this.verticalAlign)&&a.frameMap[b].getHeight()>l&&(l=a.frameMap[b].getHeight()*this.scaleY);for(k=0;k<e.length;k+=1){b=a=0;switch(this.horizontalAlign){case "left":a=g;break;case "center":a=-h/2+g;break;case "right":a=-h+g}g+=e[k].width+this.numberSpacing;switch(this.verticalAlign){case "top":b=
l/2-e[k].height/2;break;case "middle":b=-e[k].height/2;break;case "bottom":b=-l/2-e[k].height/2}e[k].x=a;e[k].y=b;this.addChild(e[k])}}});ea.prototype=c.inherit(new B,{preAnim:function(){this.resetNewLabel();this.hideMedal();this.setScore(0)},postAnim:function(){10>this.score?this.hideMedal():(this.showMedal(),10<=this.score&&50>this.score?this.medalsSprite.setFrameId("bronze"):50<=this.score&&100>this.score?this.medalsSprite.setFrameId("silver"):100<=this.score&&this.medalsSprite.setFrameId("gold"));
this.isBestScoreNew&&(this.newLabel.visible=!0)},setScore:function(a){this.score=a;this.flappyNumbersScore.setNumber(a);this.score>this.bestScore&&(this.bestScore=this.score,this.flappyNumbersBestScore.setNumber(this.bestScore),this.isBestScoreNew=!0)},setBestScore:function(a){this.bestScore=a;this.flappyNumbersScore.setNumber(a)},resetNewLabel:function(){this.isBestScoreNew=!1;this.newLabel.visible=!1},showMedal:function(){this.medalsSprite.visible=!0},hideMedal:function(){this.medalsSprite.visible=
!1}});E.events={imageLoad:"imageload",imageError:"imageerror",allImagesLoad:"allimagesload"};E.prototype=c.inherit(new C,{startLoading:function(){var a,b=c.bindFnc(this,this.imageLoaded),d=c.bindFnc(this,this.imageErrored);for(a in this.imgListObj)this.imgListObj.hasOwnProperty(a)&&(this.imgs[a]=this.imgs[this.imgListObj[a]]=new R(this.imgListObj[a]),this.imgCount+=1,this.imgs[a].imgName=a,this.imgs[a].load(b,d));0===this.imgCount&&this.dispatch(E.events.allImagesLoad,{loaded:this.imgLoaded,total:this.imgCount})},
imageLoaded:function(a){this.imgLoaded+=1;this.dispatch(E.events.imageLoad,{img:a,loaded:this.imgLoaded,total:this.imgCount});this.imgLoaded>=this.imgCount&&this.dispatch(E.events.allImagesLoad,{loaded:this.imgLoaded,total:this.imgCount})},imageErrored:function(a){this.imgLoaded+=1;this.dispatch(E.events.imageError,{img:a,loaded:this.imgLoaded,total:this.imgCount})},get:function(a){return this.imgs[a]}});N.events={soundLoad:"soundload",soundError:"sounderror",allSoundsLoad:"allsoundsload"};N.prototype=
c.inherit(new C,{startLoading:function(){var a,b=[];for(a in this.soundMap)this.soundMap.hasOwnProperty(a)&&(b.push({id:a,src:this.soundMap[a]}),this.soundsCount+=1,g.cordova&&(this.cordovaSounds[this.soundMap[a]]=new Media("file:///android_asset/www/"+this.soundMap[a],function(){},function(){$.log("Error while playing "+this.src)})));if(g.cordova)for(a in this.soundMap)this.soundLoaded();else createjs.Sound.addEventListener("fileload",c.bindFnc(this,this.soundLoaded)),createjs.Sound.registerManifest(b,
"")},soundLoaded:function(a){this.soundsLoaded+=1;this.dispatch(N.events.soundLoad,{loaded:this.soundsLoaded,total:this.soundsCount});this.soundsLoaded>=this.soundsCount&&this.dispatch(N.events.allSoundsLoad,{loaded:this.soundsLoaded,total:this.soundsCount})},soundErrored:function(a){this.soundsError+=1},get:function(a){return this.sounds[a]},play:function(a){this.enabled&&!this.mute&&(g.cordova?this.cordovaSounds[a].play():createjs.Sound.play(a))},stop:function(a){this.enabled&&!g.cordova&&createjs.Sound.stop(a)}});
G.events={DOWN:"down",UP:"up",HOVERIN:"hoverin",HOVEROUT:"hoverout",MOVE:"move",CLICK:"click"};G.prototype=c.inherit(new C,{addButton:function(a){return-1===this.buttons.indexOf(a)?(this.buttons.push(a),!0):!1},removeButton:function(a){a=this.buttons.indexOf(a);return-1!==a?(this.buttons.splice(a,1),!0):!1},onDown:function(a){!this.downedButton&&(this.downedButton=this.getButtonFromCoords(a.data.scaledX,a.data.scaledY))&&(this.hoveredButton=null,this.downedButton.down(),this.dispatch(G.events.DOWN,
{button:this.downedButton}))},onMove:function(a){var b=a.data.scaledX;a=a.data.scaledY;if(this.downedButton)this.downedButton.state===t.states.UP&&this.downedButton.contains(b,a)?this.downedButton.down():this.downedButton.state!==t.states.DOWN||this.downedButton.contains(b,a)||this.downedButton.up();else if(this.hoveredButton)this.hoveredButton.contains(b,a)||(this.hoveredButton.up(),this.dispatch(G.events.HOVEROUT,{button:this.hoveredButton}),this.hoveredButton=null);else if(b=this.getButtonFromCoords(b,
a))this.hoveredButton=b,b.hover(),this.dispatch(G.events.HOVERIN,{button:this.hoveredButton})},onUp:function(a){this.downedButton&&(this.downedButton.state===t.states.DOWN&&(this.downedButton.click(),this.dispatch(G.events.CLICK,{button:this.downedButton})),this.downedButton.up(),this.dispatch(G.events.UP,{button:this.downedButton}),this.downedButton=null)},getButtonFromCoords:function(a,b){var d;for(d=this.buttons.length-1;0<=d&&!this.downedButton;d-=1)if(this.buttons[d].isGloballyVisible()&&this.buttons[d].contains(a,
b))return this.buttons[d];return null}});k.platforms={DESKTOP:1,MOBILE:2,TABLET:4};k.prototype={init:function(){this.enabled&&(this.initted=!0)},start:function(){this.enabled&&(this.started=!0)},rotate:function(){},show:function(){},hide:function(){},showContainer:function(){},hideContainer:function(){},shouldShow:function(){return this.initted&&this.enabled?this.shouldShowFunction():!1}};u.slotsToDefine=[];u.googletagInit=function(){g.googletag=g.googletag||{};g.googletag.cmd=g.googletag.cmd||[];
googletag.cmd.push(function(){var a,b,d=v.getCurrentPlatform();for(a=0;a<u.slotsToDefine.length;a+=1)(b=u.slotsToDefine[a])&&0<(b.platforms&d)&&b.enabled&&b.unitName&&b.size&&b.divId&&(b.adSlot=googletag.defineSlot(b.unitName,b.size,b.divId).addService(googletag.pubads()),b.init());googletag.pubads().enableSingleRequest();googletag.enableServices()})};u.prototype=c.inherit(new k,{start:function(){this.initted&&!this.started&&this.canRun()&&(k.prototype.start.call(this),googletag.cmd.push(c.bindFnc(this,
function(){googletag.display(this.divId)})))},rotate:function(){if(this.initted&&this.canRun()){var a=!1;this.started||(this.start(),a=!0);a||googletag.cmd.push(c.bindFnc(this,function(){googletag.pubads().refresh([this.adSlot])}))}},show:function(){this.initted&&this.canRun()&&c.addClass(x.get(this.divId),"show")},hide:function(){this.initted&&this.canRun()&&c.removeClass(x.get(this.divId),"show")},showContainer:function(){this.initted&&this.containerDivId&&x.get(this.containerDivId)&&this.canRun()&&
c.addClass(x.get(this.containerDivId),"show")},hideContainer:function(){this.initted&&this.containerDivId&&x.get(this.containerDivId)&&this.canRun()&&c.removeClass(x.get(this.containerDivId),"show")},shouldShow:function(){return this.canRun()?k.prototype.shouldShow.call(this):!1},canRun:function(){return this.enabled&&this.hasGoogleTag&&this.unitName&&this.size&&this.divId&&x.get(this.divId)}});v.GAMEOVERROTATEDELAY=3E4;v.events={INTERSTITIALREFRESHED:"interstitialrefreshed",INTERSTITIALSHOWN:"interstitialshown",
INTERSTITIALHIDDEN:"interstitialhidden",GAMEOVERADREFRESHED:"gameoveradrefreshed",GAMEOVERADSHOWN:"gameoveradshown",GAMEOVERADHIDDEN:"gameoveradhidden"};v.getCurrentPlatform=function(){return c.isMobile.any()?768<=(g.innerWidth||y.documentElement.clientWidth)?k.platforms.TABLET:k.platforms.MOBILE:k.platforms.DESKTOP};v.prototype=c.inherit(new C,{init:function(){this.interstitialScreen&&c.addOnClick(this.interstitialScreen,c.bindFnc(this,function(a){var b=a.target;do a.currentTarget===b?(this.hideInterstitial(),
b=null):b=c.hasClass(b,"dismissableArea")?b.parentNode:null;while(b)}),!0);this.interstitialClose&&c.addOnClick(this.interstitialClose,c.bindFnc(this,this.hideInterstitial),!0);u.googletagInit()},setGame:function(a){var b;this.game=a;for(b=0;b<this.interstitialAds.length;b+=1)this.interstitialAds[b].game=a;for(b=0;b<this.gameOverAds.length;b+=1)this.gameOverAds[b].game=a},isInterstitialShowing:function(){return this.enabled&&this.interstitialScreen?c.hasClass(this.interstitialScreen,"show"):!1},refreshInterstitial:function(){if(this.enabled){var a=
this.getInterstitialAd();a&&(a.rotate(),this.dispatch(v.events.INTERSTITIALREFRESHED,{ad:a}))}},showInterstitial:function(a){this.enabled&&(this.interestitialHideCallback=a,c.addClass(this.interstitialScreen,"show"),this.dispatch(v.events.INTERSTITIALSHOWN,{ad:this.currentInterstitialAd}))},hideInterstitial:function(){this.interstitialScreen&&c.removeClass(this.interstitialScreen,"show");this.interestitialHideCallback&&(this.interestitialHideCallback(),this.interestitialHideCallback=null);this.dispatch(v.events.INTERSTITIALHIDDEN,
{ad:this.currentInterstitialAd})},shouldShowInterstitial:function(){if(this.enabled){var a=this.getInterstitialAd();if(a)return a.shouldShow()}return!1},getInterstitialAd:function(){if(this.enabled&&!this.currentInterstitialAd){var a,b=v.getCurrentPlatform();for(a=0;a<this.interstitialAds.length&&!this.currentInterstitialAd;a+=1)this.interstitialAds[a].shouldShow()&&0<(this.interstitialAds[a].platforms&b)&&(this.currentInterstitialAd=this.interstitialAds[a],this.currentInterstitialAd.show())}return this.currentInterstitialAd},
isGameOverAdShowing:function(){return this.enabled&&this.gameOverAdScreen?c.hasClass(this.gameOverAdScreen,"show"):!1},refreshGameOverAd:function(){if(this.enabled){var a=(new Date).getTime(),b=this.getGameOverAd();b&&a-this.lastGameOverAdRotate>=v.GAMEOVERROTATEDELAY&&(b.rotate(),this.lastGameOverAdRotate=a,this.dispatch(v.events.GAMEOVERADREFRESHED,{ad:b}))}},showGameOverAd:function(a){this.enabled&&this.gameOverAdScreen&&(this.gameOverHideCallback=a,c.addClass(this.gameOverAdScreen,"show"),this.dispatch(v.events.GAMEOVERADSHOWN,
{ad:this.currentGameOverAd}))},hideGameOverAd:function(){this.gameOverAdScreen&&c.removeClass(this.gameOverAdScreen,"show");this.gameOverHideCallback&&(this.gameOverHideCallback(),this.gameOverHideCallback=null);this.dispatch(v.events.GAMEOVERADHIDDEN,{ad:this.currentGameOverAd})},shouldShowGameOverAd:function(){if(this.enabled){var a=this.getGameOverAd();if(a)return a.shouldShow()}return!1},getGameOverAd:function(){if(this.enabled&&!this.currentGameOverAd){var a,b=v.getCurrentPlatform();for(a=0;a<
this.gameOverAds.length&&!this.currentGameOverAd;a+=1)this.gameOverAds[a].shouldShow()&&0<(this.gameOverAds[a].platforms&b)&&(this.currentGameOverAd=this.gameOverAds[a],this.currentGameOverAd.show())}return this.currentGameOverAd}});r.gravity=2500;r.cruisingOscPeriod=800;r.cruisingOscHeight=10;r.states={cruising:"cruising",flapping:"flapping",stalling:"stalling",flyingDead:"flyingdead",groundDead:"grounddead"};r.spriteSpeeds={cruising:150,flapping:50,stalling:0,flyingDead:0,groundDead:0};r.PI2=2*
Math.PI;r.prototype=c.inherit(new M,U.prototype,{setX:function(a){this.x=a},setY:function(a){this.y=a},setPosition:function(a,b){this.setX(a);this.setY(b)},isAlive:function(){return this.state!==r.states.flyingDead&&this.state!==r.states.groundDead},update:function(a,b,d,c){a=0;switch(this.state){case r.states.cruising:a=Math.floor(d/r.spriteSpeeds.cruising)%this.imgs.length;break;case r.states.flapping:a=Math.floor(d/r.spriteSpeeds.flapping)%this.imgs.length;break;case r.states.stalling:case r.states.flyingDead:case r.states.groundDead:a=
this.stallingIndex}this.previousIndex!==a&&(this.image=this.imgs[a],this.previousIndex=a);this.started?(this.state!==r.states.groundDead&&(this.speedY+=r.gravity*b,this.x+=this.speedX*b,this.y+=this.speedY*b,0>this.y&&(this.y=0),this.rect.setPosition(this.x-this.rectWidth/2,this.y-this.rectHeight/2)),200<=this.speedY?(this.angle+=4*Math.PI/3*b,this.isAlive()&&(this.state=r.states.stalling),this.angle>Math.PI/2&&(this.angle=Math.PI/2)):200>this.speedY&&(this.angle-=3*Math.PI*b,this.isAlive()&&(this.state=
r.states.flapping),this.angle<-Math.PI/8&&(this.angle=-Math.PI/8))):this.state===r.states.cruising&&(this.y=this.startY+Math.sin(d%r.cruisingOscPeriod*r.PI2/r.cruisingOscPeriod)*r.cruisingOscHeight)},flap:function(){this.speedY=-700}});fa.prototype=c.inherit(new B,U.prototype,{update:function(a,b,d,c){this.x+=-c.scrollSpeed*b;this.rect.setX(this.x);this.gapRect.setX(this.x);this.pipeTiteRect.setX(this.x);this.pipeMiteRect.setX(this.x);0>this.rect.right&&(this.needsToBeDestroyed=!0)},passes:function(a){return this.gapRect.containsPoint(a.getCenterX(),
a.getCenterY())},collides:function(a){return this.pipeTiteRect.intersectsRect(a)||this.pipeMiteRect.intersectsRect(a)},draw:function(a){B.prototype.draw.call(this,a)}});e.BASEWIDTH=640;e.BASEHEIGHT=940;e.BESTSCORECOOKIE="fl_hs";e.BESTSCORECOOKIETTL=31536E4;e.SOUNDSETTINGCOOKIE="fl_s";e.SOUNDSETTINGCOOKIETTL=31536E4;e.FIXEDDTM=1E3/60;e.FIXEDDTS=e.FIXEDDTM/1E3;e.MAXCYCLES=5;e.MINFRAMEDELAY=1E3/60;e.MAXFRAMEDELAY=200;e.KIKSHAREIDHEXLENGTH=20;e.scrollSpeed=250;e.pipeGap=200;e.pipeSpacing=350;e.pipeWidth=
112;e.pipesticleHeight=892;e.pipeTopLimit=100;e.pipeBottomLimit=791;e.GLOBALFONT="25px Arial";e.IMGS={dayBg:"imgs/BG_day.png",nightBg:"imgs/BG_night.png",ground:"imgs/ground.png",flappyYellow:"imgs/Flappy_yellow.png",flappyYellow2:"imgs/Flappy_yellow2.png",flappyYellow3:"imgs/Flappy_yellow3.png",flappyBlue:"imgs/Flappy_blue.png",flappyBlue2:"imgs/Flappy_blue2.png",flappyBlue3:"imgs/Flappy_blue3.png",flappyRed:"imgs/Flappy_red.png",flappyRed2:"imgs/Flappy_red2.png",flappyRed3:"imgs/Flappy_red3.png",
sprites:"imgs/sprites.png",kikButton:"imgs/Flappy_kikbutton4.png"};e.SOUNDS={menu:"sounds/s_menu.wav",point:"sounds/s_point.wav",crash:"sounds/s_crash.wav",fall:"sounds/s_fall.wav",fly:"sounds/s_flap.wav"};e.states={none:"none",loading:"loading",mainMenu:"mainmenu",instructions:"instructions",playing:"playing",showingBoard:"showingboard",showingInterstitial:"showinginterstitial",end:"end"};e.events={stateChanged:"statechanged",initted:"initted"};e.SPRITEMAP={logo:{rect:new h({x:0,y:0,width:535,height:125})},
play:{rect:new h({x:0,y:135,width:260,height:145})},kik:{rect:new h({x:270,y:135,width:260,height:145})},getReady:{rect:new h({x:0,y:290,width:460,height:125})},numBigs:{frameMap:{0:new h({x:0,y:425,width:60,height:90}),1:new h({x:80,y:425,width:40,height:90}),2:new h({x:140,y:425,width:60,height:90}),3:new h({x:210,y:425,width:60,height:90}),4:new h({x:280,y:425,width:60,height:90}),5:new h({x:350,y:425,width:60,height:90}),6:new h({x:420,y:425,width:60,height:90}),7:new h({x:490,y:425,width:60,
height:90}),8:new h({x:560,y:425,width:60,height:90}),9:new h({x:630,y:425,width:60,height:90})}},instructions:{rect:new h({x:545,y:0,width:335,height:145})},instructionsClick:{rect:new h({x:545,y:145,width:335,height:105})},instructionsTap:{rect:new h({x:545,y:250,width:335,height:105})},pipeSection:new h({x:925,y:0,width:130,height:635}),pipeTop:new h({x:1065,y:0,width:130,height:65}),pipeBottom:new h({x:925,y:635,width:130,height:65}),pipeFullTop:{rect:new h({x:925,y:0,width:130,height:700})},
pipeFullBottom:{rect:new h({x:1065,y:0,width:130,height:700})},tweetButton:{rect:new h({x:700,y:425,width:215,height:90})},fbButton:{rect:new h({x:700,y:525,width:215,height:90})},gameOver:{rect:new h({x:0,y:525,width:480,height:105})},gameOverBoard:{rect:new h({x:0,y:640,width:565,height:285})},gameOverNew:{rect:new h({x:575,y:640,width:80,height:35})},numSmalls:{frameMap:{0:new h({x:575,y:715,width:35,height:50}),1:new h({x:625,y:715,width:25,height:50}),2:new h({x:665,y:715,width:35,height:50}),
3:new h({x:710,y:715,width:35,height:50}),4:new h({x:755,y:715,width:35,height:50}),5:new h({x:800,y:715,width:35,height:50}),6:new h({x:845,y:715,width:35,height:50}),7:new h({x:890,y:715,width:35,height:50}),8:new h({x:935,y:715,width:35,height:50}),9:new h({x:980,y:715,width:35,height:50})}},medals:{frameMap:{bronze:new h({x:575,y:775,width:110,height:110}),silver:new h({x:695,y:775,width:110,height:110}),gold:new h({x:815,y:775,width:110,height:110})}},soundIcons:{frameMap:{on:new h({x:935,y:780,
width:100,height:100}),off:new h({x:1045,y:780,width:100,height:100})}}};e.prototype=c.inherit(new C,{init:function(){var a=x.get("initScreen");a&&c.removeClass(a,"show");this.imgManager.addEventListener(E.events.imageLoad,c.bindFnc(this,this.imageLoaded));this.imgManager.addEventListener(E.events.allImagesLoad,c.bindFnc(this,this.allImagesLoaded));this.soundManager.addEventListener(N.events.soundLoad,c.bindFnc(this,this.soundLoaded));this.soundManager.addEventListener(N.events.allSoundsLoad,c.bindFnc(this,
this.allSoundsLoaded));this.mouseManager.addEventListener(n.events.DOWN,c.bindFnc(this.buttonManager,this.buttonManager.onDown));this.mouseManager.addEventListener(n.events.MOVE,c.bindFnc(this.buttonManager,this.buttonManager.onMove));this.mouseManager.addEventListener(n.events.UP,c.bindFnc(this.buttonManager,this.buttonManager.onUp));this.mouseManager.addEventListener(n.events.DOWN,c.bindFnc(this,this.mouseDown));this.keyboardManager.addEventListener(J.events.DOWN,c.bindFnc(this,this.keyDown));this.appCacheManager.addEventListener(D.events.LOADNORMALLY,
c.bindFnc(this,function(a){this.imgManager.startLoading();this.soundManager.startLoading()}));this.appCacheManager.addEventListener(D.events.CHECKING,c.bindFnc(this,this.appCacheChecking));this.appCacheManager.addEventListener(D.events.UPDATEPROGRESS,c.bindFnc(this,this.appCacheUpdateProgress));this.appCacheManager.addEventListener(D.events.UPDATEREADY,c.bindFnc(this,this.appCacheUpdateReady));c.makeUnselectable(x.get("mainCon"),!0);g.addEventListener("resize",c.bindFnc(this,this.windowResize));g.cards&&
g.cards.kik&&(this.kikEnabled=!0);this.kikEnabled&&(g.kik&&g.kik.browser&&g.kik.browser.setOrientationLock&&g.kik.browser.setOrientationLock("portrait"),g.kik&&g.kik.metrics&&g.kik.metrics.enableGoogleAnalytics&&kik.metrics.enableGoogleAnalytics(),g.kik&&g.kik.browser&&g.kik.browser.on&&(g.kik.browser.on("background",c.bindFnc(this,function(){this.stopLoop()})),g.kik.browser.on("foreground",c.bindFnc(this,function(){this.restartLoop()}))),g.kik&&g.kik.message&&(g.kik.message.shareId?(this.kikShareIdCreated=
!1,this.kikShareId=g.kik.message.shareId):(this.kikShareId=this.generateKikShareId(),this.kikShareIdCreated=!0)),this.kikShareId||(this.kikShareId=this.generateKikShareId(),this.kikShareIdCreated=!0));this.bindedResizeCanvas=c.bindFnc(this,this.resizeCanvas);K(this.bindedResizeCanvas,100);this.resizeCanvas();this.state=e.states.loading;this.appCacheManager.init();this.preStart();this.dispatch(e.events.initted)},setupDebug:function(){this.debugStuff.output=x.create("div","debugOutput","debugOutput");
this.debugStuff.output.style.position="absolute";this.debugStuff.output.style.top="0";this.debugStuff.output.style.left="0";this.debugStuff.output.style.backgroundColor="rgba(255, 255, 255, 0.8)";this.debugStuff.output.style.color="#000000";this.debugStuff.output.style.padding="3px";this.debugStuff.output.style.zIndex=Math.pow(2,32)-1;x.get("mainCon").appendChild(this.debugStuff.output);this.debugStuff.frameCounter=x.create("div","frameCounter","frameCounter");this.debugStuff.frameCounter.style.position=
"absolute";this.debugStuff.frameCounter.style.bottom="0";this.debugStuff.frameCounter.style.left="0";this.debugStuff.frameCounter.style.backgroundColor="rgba(255, 255, 255, 0.8)";this.debugStuff.frameCounter.style.color="#000000";this.debugStuff.frameCounter.style.padding="3px";this.debugStuff.frameCounter.style.zIndex=Math.pow(2,32)-1;x.get("mainCon").appendChild(this.debugStuff.frameCounter)},changeToState:function(a,b){if(!this.changingState||b)switch(a){case e.states.mainMenu:this.changingState=
!0;this.doFadeTransition(c.bindFnc(this,function(){this.changingState=!1;this.state=a;this.start();this.mainMenu.visible=!0;this.soundButton.visible=!0;this.soundButton.enabled=!0;this.dispatch(e.events.stateChanged,{state:a})}));break;case e.states.instructions:this.changingState=!0;this.soundManager.play(e.SOUNDS.menu);this.doFadeTransition(c.bindFnc(this,function(){this.adManager.isGameOverAdShowing()&&this.adManager.hideGameOverAd();this.crossPromoHide();this.changingState=!1;this.mainMenu.visible=
!1;this.gameOverButtons.visible=!1;this.gameOverButtons.opacity=0;this.gameOverText.opacity=0;this.gameOverBoard.opacity=0;this.gameOverVersion.opacity=0;this.instructionsContainer.visible=!0;this.instructionsContainer.opacity=1;this.soundButton.visible=!1;this.soundButton.enabled=!1;this.state=a;this.beginGame();this.dispatch(e.events.stateChanged,{state:a})}));break;case e.states.playing:this.animManager.startAnim(new l({duration:500,startValue:1,endValue:0,stepCallback:c.bindFnc(this,function(a){this.instructionsContainer.opacity=
a}),endCallback:c.bindFnc(this,function(){this.instructionsContainer.visible=!1})}));this.state=a;this.dispatch(e.events.stateChanged,{state:a});break;case e.states.showingBoard:this.changingState=!0;this.doFlashTransition(c.bindFnc(this,function(){this.changingState=!1;this.state=a;this.crossPromoShow();this.dispatch(e.events.stateChanged,{state:a});this.endGame()}));break;default:this.state=a,this.dispatch(e.events.stateChanged,{state:a})}},setTransitionOpacity:function(a){this.transitionOverlay.opacity=
a},setTransitionFillStyle:function(a){this.transitionOverlay.fillStyle=a},doFadeTransition:function(a){a=new Z({anims:[new l({startValue:0,endValue:1,duration:500,startCallback:c.bindFnc(this,function(){this.setTransitionFillStyle("#000000")}),endCallback:a,stepCallback:c.bindFnc(this,this.setTransitionOpacity)}),new l({startValue:1,endValue:0,duration:500,stepCallback:c.bindFnc(this,this.setTransitionOpacity)})]});this.animManager.startAnim(a)},doFlashTransition:function(a){var b=new l({startValue:1,
endValue:0,duration:500,startCallback:c.bindFnc(this,function(){a&&a();this.setTransitionFillStyle("#ffffff")}),stepCallback:c.bindFnc(this,this.setTransitionOpacity)});this.animManager.startAnim(b)},trace:function(){var a="",a=Array.prototype.slice.call(arguments),b=g.console||{log:function(){}},a=a.join(" ");this.debugStuff.output&&(this.debugStuff.output.innerHTML=a);b.log(a)},windowResize:function(a){this.bindedResizeCanvas();K(this.bindedResizeCanvas,100)},resizeCanvas:function(){var a=x.get("mainCon"),
b=x.get("limitCon"),d=x.get("canvasCon"),c=g.getComputedStyle(a),a=parseInt(c.width,10),c=parseInt(c.height,10);a/c>=this.aspectRatio?(d.style.height=c+"px",d.style.width=Math.floor(c*this.aspectRatio)+"px",this.canvas.height=this.startingHeight,this.mouseManager.scaleX=this.mouseManager.scaleY=e.BASEWIDTH/Math.floor(c*this.aspectRatio)):(this.canvas.height=this.canvas.width/(a/c),this.transitionOverlay.bottom=this.canvas.height/this.scaleY,d.style.width=a+"px",d.style.height=c+"px",this.mouseManager.scaleX=
this.mouseManager.scaleY=e.BASEWIDTH/a);b.style.width=d.style.width;b.style.height=c+"px";this.context.font=e.GLOBALFONT},keyDown:function(a){if(a&&a.data)switch(a.data.keyCode){case 27:try{g.top!==g&&"/desktop.html"===g.top.location.pathname&&g.top.unfullscreen&&g.top.unfullscreen()}catch(b){}break;case 32:case 65:case 87:case 38:this.defaultKeyPressBehavior(a.data.originalEvent)}},defaultKeyPressBehavior:function(a){if(!this.changingState)switch(this.state){case e.states.mainMenu:this.changeToState(e.states.instructions);
break;case e.states.instructions:case e.states.playing:this.birdFlap(a);break;case e.states.end:this.changeToState(e.states.instructions)}},mouseDown:function(a){this.birdFlap(a.data.originalEvent)},imageLoaded:function(a){this.checkLoaded()},allImagesLoaded:function(a){this.checkLoaded()},soundLoaded:function(a){this.checkLoaded()},allSoundsLoaded:function(a){this.checkLoaded()},appCacheChecking:function(a){this.updateNoPercent("Checking...")},appCacheUpdateProgress:function(a){a.data.lengthComputable?
a.data.loaded>=a.data.total?this.updatePercentLoaded(a.data.loaded,a.data.total,"Refreshing:"):this.updatePercentLoaded(a.data.loaded,a.data.total,"Updating:"):this.updateNoPercent("Updating...")},appCacheUpdateReady:function(a){this.updateNoPercent("Refreshing...",1)},checkLoaded:function(){var a=this.imgManager.imgLoaded,b=this.imgManager.imgCount;this.updatePercentLoaded(a,b,"Loading:");!this.allLoaded&&a>=b&&(this.allLoaded=!0,this.changeToState(e.states.mainMenu))},updatePercentLoaded:function(a,
b,c){a/=b;b=100*a;this.progressText.text=c?c+" "+Math.floor(b)+"%":Math.floor(b)+"%";this.progressBar.right=e.BASEWIDTH*a},updateNoPercent:function(a,b){this.progressText.text=a;this.progressBar.right=b?b*e.BASEWIDTH:0},getRandomBirdColor:function(){var a=Math.floor(Math.random()*this.flappySprites.length);return this.flappySprites[a]},stopLoop:function(){this.looping=!1;g.cancelAnimationFrame(this.animationFrameId)},startLoop:function(){this.looping=!0;this.animationFrameId=g.requestAnimationFrame(this.bindedMainLoop)},
restartLoop:function(){this.stopLoop();this.startLoop()},preStart:function(){this.startLoop()},start:function(){if(!this.started){this.started=!0;var a=this.imgManager.get(e.IMGS.ground);x.get("canvasCon");Math.random();var b;this.spriteSheet=new X({image:this.imgManager.get(e.IMGS.sprites),context:this.context,spriteMap:e.SPRITEMAP});this.patterns[e.IMGS.ground]=this.context.createPattern(a,"repeat");this.flappySprites=[{base:this.imgManager.get(e.IMGS.flappyYellow),sequence:[this.imgManager.get(e.IMGS.flappyYellow2),
this.imgManager.get(e.IMGS.flappyYellow),this.imgManager.get(e.IMGS.flappyYellow3),this.imgManager.get(e.IMGS.flappyYellow)]},{base:this.imgManager.get(e.IMGS.flappyBlue2),sequence:[this.imgManager.get(e.IMGS.flappyBlue3),this.imgManager.get(e.IMGS.flappyBlue2),this.imgManager.get(e.IMGS.flappyBlue),this.imgManager.get(e.IMGS.flappyBlue2)]},{base:this.imgManager.get(e.IMGS.flappyRed),sequence:[this.imgManager.get(e.IMGS.flappyRed2),this.imgManager.get(e.IMGS.flappyRed),this.imgManager.get(e.IMGS.flappyRed3),
this.imgManager.get(e.IMGS.flappyRed)]}];this.background=new M({img:this.imgManager.get(e.IMGS.dayBg),x:0,y:0,width:640,height:892});this.stage.addChild(this.background);this.pipes=[];this.pipesContainer=new B({x:0,y:0});this.stage.addChild(this.pipesContainer);b=this.getRandomBirdColor();this.bird=new r({x:e.BASEWIDTH/2,y:e.BASEHEIGHT/2,anchorX:38,anchorY:27,width:76,height:53,rectWidth:53,rectHeight:53,img:b.base,birdImages:b.sequence,stallingIndex:1});this.stage.addChild(this.bird);this.ground=
new da({pattern:this.patterns[e.IMGS.ground],x:0,y:892,width:640,height:50,imageWidth:a.width,imageHeight:a.height});this.ground.rect=new h({x:this.ground.x,y:this.ground.y,width:this.ground.width,height:this.ground.height});this.stage.addChild(this.ground);this.soundButton=new t(c.inherit(c.cloneObject(this.spriteSheet.getSprite("soundIcons").options),{id:"soundButton",x:e.BASEWIDTH-85,y:25,width:60,height:60,startFrameId:"1"===H.getCookie(e.SOUNDSETTINGCOOKIE,"1")?"on":"off",clickFunction:c.bindFnc(this,
function(a){this.soundManager.mute=!this.soundManager.mute;this.soundManager.mute?(this.soundButton.setFrameId("off"),H.setCookie(e.SOUNDSETTINGCOOKIE,"0",e.SOUNDSETTINGCOOKIETTL)):(this.soundButton.setFrameId("on"),H.setCookie(e.SOUNDSETTINGCOOKIE,"1",e.SOUNDSETTINGCOOKIETTL),this.soundManager.play(e.SOUNDS.fly))}),visible:!0,enabled:!0}));this.soundManager.enabled&&(this.buttonManager.addButton(this.soundButton),this.stage.addChild(this.soundButton));this.mainMenu=new B({x:e.BASEWIDTH/2,y:e.BASEHEIGHT/
2,visible:!0});this.stage.addChild(this.mainMenu);this.mainMenuLogo=this.spriteSheet.getSprite("logo");this.mainMenuLogo.x=-160;this.mainMenuLogo.y=-170;this.mainMenuLogo.width=320;this.mainMenuLogo.height=76;this.mainMenu.addChild(this.mainMenuLogo);this.mainMenuPlayButton=new t(c.inherit(c.cloneObject(this.spriteSheet.getSprite("play").options),{id:"mainMenuPlayButton",x:-128,y:107,width:256,height:143,clickFunction:c.bindFnc(this,this.playButtonPressed)}));this.buttonManager.addButton(this.mainMenuPlayButton);
this.mainMenu.addChild(this.mainMenuPlayButton);this.mainMenuVersion=new P({x:e.BASEWIDTH/2,y:420,textAlign:"right",textBaseline:"bottom",text:"v"+g.FLAPPYLIVESVERSION});this.mainMenu.addChild(this.mainMenuVersion);this.instructionsContainer=new B({x:e.BASEWIDTH/2,y:290,visible:!1,opacity:0});this.stage.addChild(this.instructionsContainer);this.getReadyText=this.spriteSheet.getSprite("getReady");this.getReadyText.x=-256;this.getReadyText.y=0;this.getReadyText.width=512;this.getReadyText.height=138;
this.instructionsContainer.addChild(this.getReadyText);this.instructionsBird=this.spriteSheet.getSprite("instructions");this.instructionsBird.x=-140;this.instructionsBird.y=161;this.instructionsBird.width=290;this.instructionsBird.height=130;this.instructionsContainer.addChild(this.instructionsBird);this.instructionsBottom=this.spriteSheet.getSprite(c.isMobile.any()?"instructionsTap":"instructionsClick");this.instructionsBottom.x=-145;this.instructionsBottom.y=275;this.instructionsBottom.width=290;
this.instructionsBottom.height=91;this.instructionsContainer.addChild(this.instructionsBottom);this.scoreboard=new Y({x:e.BASEWIDTH/2,y:180,horizontalAlign:"center",verticalAlign:"middle",number:0,numberSprite:this.spriteSheet.getSprite("numBigs"),numberSpacing:-5});this.scoreboard.visible=!1;this.stage.addChild(this.scoreboard);this.gameOverText=this.spriteSheet.getSprite("gameOver");this.gameOverText.width=512;this.gameOverText.height=112;this.gameOverText.x=e.BASEWIDTH/2-this.gameOverText.width/
2;this.gameOverText.y=110;this.gameOverText.opacity=0;this.stage.addChild(this.gameOverText);this.gameOverBoard=new ea({x:e.BASEWIDTH/2,y:260,width:576,height:291,numberSprite:this.spriteSheet.getSprite("numSmalls"),medalsSprite:this.spriteSheet.getSprite("medals"),boardSprite:this.spriteSheet.getSprite("gameOverBoard"),newLabelSprite:this.spriteSheet.getSprite("gameOverNew"),opacity:0,bestScore:this.bestScore});this.gameOverBoard.anchorX=this.gameOverBoard.width/2;this.stage.addChild(this.gameOverBoard);
this.gameOverButtons=new B({x:e.BASEWIDTH/2,y:587,visible:!1,opacity:0});this.stage.addChild(this.gameOverButtons);this.gameOverPlayButton=new t(c.inherit(c.cloneObject(this.spriteSheet.getSprite("play").options),{id:"gameOverPlayButton",x:this.kikEnabled?-261:-128,y:0,width:256,height:143,clickFunction:c.bindFnc(this,this.playButtonPressed)}));this.buttonManager.addButton(this.gameOverPlayButton);this.gameOverButtons.addChild(this.gameOverPlayButton);this.gameOverVersion=new P({x:e.BASEWIDTH,y:890,
textAlign:"right",textBaseline:"bottom",text:"v"+g.FLAPPYLIVESVERSION,opacity:0});this.stage.addChild(this.gameOverVersion);this.kikEnabled&&(this.gameOverKikButton=new t({image:this.imgManager.get(e.IMGS.kikButton),id:"kikButton",x:5,y:0,width:256,height:143,clickFunction:c.bindFnc(this,this.sendKik)}),this.buttonManager.addButton(this.gameOverKikButton),this.gameOverButtons.addChild(this.gameOverKikButton));if(!this.kikEnabled||this.kikEnabled&&!c.isMobile.iOS())this.gameOverTweetButton=new t(c.inherit(c.cloneObject(this.spriteSheet.getSprite("tweetButton").options),
{id:"gameOverTweetButton",x:-189,y:160,width:179,height:75,clickFunction:c.bindFnc(this,this.shareTwitter)})),this.buttonManager.addButton(this.gameOverTweetButton),this.gameOverButtons.addChild(this.gameOverTweetButton),this.gameOverFBButton=new t(c.inherit(c.cloneObject(this.spriteSheet.getSprite("fbButton").options),{id:"gameOverFBButton",x:10,y:160,width:179,height:75,clickFunction:c.bindFnc(this,this.shareFB)})),this.buttonManager.addButton(this.gameOverFBButton),this.gameOverButtons.addChild(this.gameOverFBButton);
this.updateContext.scrollSpeed=e.scrollSpeed;this.loadingStage.visible=!1;this.logicLooping=this.stage.visible=!0}},playButtonPressed:function(a){this.state!==e.states.mainMenu&&this.state!==e.states.end||this.changeToState(e.states.instructions)},beginGame:function(a){x.get("canvasCon");a=0.5<Math.random()?this.imgManager.get(e.IMGS.dayBg):this.imgManager.get(e.IMGS.nightBg);var b=this.getRandomBirdColor();this.numPlays+=1;this.score=0;this.scoreboard.setNumber(this.score);this.scoreboard.visible=
!0;this.pipes=[];this.pipesContainer.removeAllChilds();this.background.image=a;this.ignoreMouseDown=!1;this.firstTap=!0;this.bird.image=b.base;this.bird.imgs=b.sequence;this.bird.started=!1;this.bird.startY=500;this.bird.setPosition(200,500);this.bird.angle=0;this.bird.state=r.states.cruising;this.updateContext.scrollSpeed=e.scrollSpeed},mainLoop:function(a){this.looping?this.animationFrameId=g.requestAnimationFrame(this.bindedMainLoop):g.cancelAnimationFrame(this.animationFrameId);var b=a-this.lastMainLoopTime,
c,f;b<e.MINFRAMEDELAY&&(b=e.MINFRAMEDELAY);b>e.MAXFRAMEDELAY&&(b=e.MAXFRAMEDELAY);c=b/1E3;if(this.logicLooping)for(this.fixedAccumulator+=b,f=0;this.fixedAccumulator>=e.FIXEDDTM&&f<e.MAXCYCLES;f+=1)this.updateLoop(e.FIXEDDTM,e.FIXEDDTS,a),this.fixedAccumulator-=e.FIXEDDTM;this.animManager.update(b,c,a);this.renderLoop(b,c,a);this.debug&&1E3<=a-this.debugStuff.lastFrameCaptureTime&&(this.debugStuff.frameCounter.innerHTML="FPS-count: "+Math.round((this.frameCount-this.debugStuff.lastFrameCapture)/((a-
this.debugStuff.lastFrameCaptureTime)/1E3))+"<br />FPS-time: "+Math.round(1E3/b),this.debugStuff.lastFrameCapture=this.frameCount,this.debugStuff.lastFrameCaptureTime=a);this.frameCount+=1;this.lastMainLoopTime=a},updateLoop:function(a,b,c){this.pipeDistance+=b*this.updateContext.scrollSpeed;if(!this.firstTap&&this.bird.isAlive()&&this.pipeDistance>=e.pipeSpacing){var f=this.pipeDistance-e.pipeSpacing,g=this.createRandomPipes(f);this.pipes.push(g);this.pipesContainer.addChild(g);this.pipeDistance=
f}this.bird.update(a,b,c,this.updateContext);if(!this.firstTap)for(i=0;i<this.pipes.length;i+=1)this.pipes[i].needsToBeDestroyed?(this.pipesContainer.removeChild(this.pipes[i]),this.pipes.splice(i,1),i-=1):(this.pipes[i].update(a,b,c,this.updateContext),this.bird.isAlive()&&this.pipes[i].collides(this.bird.rect)&&(this.bird.state=r.states.flyingDead,this.soundManager.play(e.SOUNDS.crash),this.soundManager.play(e.SOUNDS.fall)),this.bird.isAlive()&&!this.pipes[i].passed&&this.pipes[i].passes(this.bird.rect)&&
(this.pipes[i].passed=!0,this.score+=1,this.scoreboard.setNumber(this.score),this.soundManager.play(e.SOUNDS.point)));!this.firstTap&&this.bird.state!==r.states.groundDead&&this.bird.rect.bottom>this.ground.rect.top&&(this.bird.y=this.ground.rect.top-26,this.bird.isAlive()&&this.soundManager.play(e.SOUNDS.crash),this.bird.state=r.states.groundDead);this.bird.isAlive()||(this.updateContext.scrollSpeed=0,this.state!==e.states.showingInterstitial&&this.state!==e.states.end&&this.state!==e.states.showingBoard&&
this.changeToState(e.states.showingBoard));this.ground.offsetX-=b*this.updateContext.scrollSpeed},renderLoop:function(a,b,c){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);this.context.save();this.context.fillStyle="#ded895";this.context.fillRect(0,0,this.canvas.width,this.canvas.height);this.context.restore();this.loadingStage.draw(this.context);this.stage.draw(this.context);this.transitionOverlay.draw(this.context);if(this.debug){if(this.pipes)for(a=0;a<this.pipes.length;a+=1)this.debugDrawRects(this.pipes[a].gapRect,
"#0000ff"),this.debugDrawRects(this.pipes[a].pipeTiteRect,"#ff0000"),this.debugDrawRects(this.pipes[a].pipeMiteRect,"#ff0000");this.bird&&this.debugDrawRects(this.bird.rect,"#000000");this.ground&&this.debugDrawRects(this.ground.rect,"#ffffff")}},debugDrawRects:function(a,b){this.context.save();this.context.scale(this.scaleX,this.scaleY);this.context.lineWidth=2;this.context.strokeStyle=b;this.context.strokeRect(a.left,a.top,a.getWidth(),a.getHeight());this.context.restore()},createRandomPipes:function(a){var b=
Math.random()*(e.pipeBottomLimit-e.pipeGap-e.pipeTopLimit)+e.pipeTopLimit,b=new h({left:0,top:b,right:e.pipeWidth,bottom:b+e.pipeGap});return new fa({x:e.BASEWIDTH-a,y:0,gapRect:b,pipeFullTopSprite:this.spriteSheet.getSprite("pipeFullTop"),pipeFullBottomSprite:this.spriteSheet.getSprite("pipeFullBottom"),pipesticleHeight:e.pipesticleHeight})},birdFlap:function(a){if(this.state===e.states.instructions||this.state===e.states.playing)this.firstTap&&(this.bird.started=!0,this.firstTap=!1,this.pipeDistance=
-250,this.changeToState(e.states.playing)),this.bird.isAlive()&&(this.bird.flap(),this.soundManager.play(e.SOUNDS.fly))},endGame:function(){var a,b=this.score;this.score>this.bestScore&&(this.bestScore=this.score,H.setCookie(e.BESTSCORECOOKIE,this.bestScore.toString(),e.BESTSCORECOOKIETTL));a=new Z({anims:[new l({duration:300,stepCallback:c.bindFnc(this,function(){this.stage.anchorX=20*Math.random()-10;this.stage.anchorY=20*Math.random()-10}),endCallback:c.bindFnc(this,function(){this.stage.anchorX=
0;this.stage.anchorY=0})}),new l({startCallback:c.bindFnc(this,function(){if(0<b&&g.gmapi){var a=this;g.gmapi(function(c){(c=c.game.leaderboard.sendScore(b))&&c.always(function(){a.restartLoop()})})}this.adManager.shouldShowInterstitial()&&this.adManager.refreshInterstitial();this.adManager.shouldShowGameOverAd()&&this.adManager.refreshGameOverAd();this.addToHome&&!this.addToHomeShown&&this.numPlays>=this.addToHomeNumPlays&&(this.addToHome.show(),this.addToHomeShown=!0)}),duration:1E3}),new T({startCallback:c.bindFnc(this,
function(){this.scoreboard.visible=!1;this.soundManager.play(e.SOUNDS.menu);this.adManager.shouldShowInterstitial()&&(this.crossPromoHide(),this.adManager.showInterstitial(c.bindFnc(this,function(){this.changeToState(e.states.end);this.crossPromoShow()})));this.adManager.shouldShowGameOverAd()&&this.adManager.showGameOverAd()}),anims:[new l({startValue:0,endValue:0.5,timeFunction:l.easingFunctions.easeOutCubic,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverText.opacity=a}),duration:125}),
new l({startValue:0,endValue:20,timeFunction:l.easingFunctions.easeOutCubic,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverText.anchorY=a}),duration:125})]}),new T({anims:[new l({startValue:0.5,endValue:1,timeFunction:l.easingFunctions.easeOutCubic,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverText.opacity=a}),duration:125}),new l({startValue:20,endValue:0,timeFunction:l.easingFunctions.easeOutCubic,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverText.anchorY=a}),duration:125})]}),
new l({duration:750}),new T({startCallback:c.bindFnc(this,function(){this.soundManager.play(e.SOUNDS.menu);this.gameOverBoard.preAnim()}),anims:[new l({startValue:0,endValue:1,timeFunction:l.easingFunctions.linear,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverBoard.opacity=a}),duration:300}),new l({startValue:-200,endValue:0,timeFunction:l.easingFunctions.easeOutCubic,stepCallback:c.bindFnc(this,function(a,b,c){this.gameOverBoard.anchorY=a}),duration:300})]}),new l({startValue:0,endValue:this.score,
duration:10<this.score?1E3:100*this.score,stepCallback:c.bindFnc(this.gameOverBoard,this.gameOverBoard.setScore),endCallback:c.bindFnc(this.gameOverBoard,this.gameOverBoard.postAnim)}),new l({startValue:0,endValue:1,duration:500,startCallback:c.bindFnc(this,function(){this.soundButton.visible=!0;this.soundButton.enabled=!0;this.soundButton.opacity=0;this.gameOverButtons.visible=!0;this.adManager.isInterstitialShowing()||this.changeToState(e.states.end);this.mouseManager.resetSkips()}),stepCallback:c.bindFnc(this,
function(a,b,c){this.gameOverButtons.opacity=a;this.gameOverVersion.opacity=a;this.soundButton.opacity=a})})]});this.animManager.startAnim(a)},shareTwitter:function(){if(this.state===e.states.end){var a=this.crazygames?{text:encodeURIComponent("I just scored "+this.score+" on #FlappyBird! Try to beat my score at http://m.crazygames.com/game/flappy-bird via @CrazyGamesCom")}:{text:encodeURIComponent("I just scored "+this.score+" on #FlappyBird! Try to beat my score at http://flappylives.com. #FlappyLives")},
a="https://twitter.com/intent/tweet?"+c.objectToParamString(a);ha(a,g.cordova?"_blank":"shareTwitterWindow","width=480,height=480,scrollbars=yes,location="+(g.cordova?"yes":"no"))}},shareFB:function(){if(this.state===e.states.end){var rdl = Omlet.createRDL({
noun: "a game",
displayTitle: "Flappy Yo",
displayThumbnailUrl: "https://mobi-summer-evan.s3.amazonaws.com/Flappy%20Bird/Z.jpg",
displayText: "I just scored " + this.score + " on FlappyYo! Try to beat my score!",
webCallback: "https://mobi-summer-evan.s3.amazonaws.com/Flappy%20Bird/flapbird.html",
callback: window.location.href,
});
Omlet.exit(rdl);}},generateKikShareId:function(){var a=(new Date).getTime(),b="",
c=e.KIKSHAREIDHEXLENGTH,f;for(f=0;f<c;f+=1)b+=Math.floor(16*Math.random()).toString(16);return a.toString(16)+":"+b},sendKik:function(){g.cards&&cards.kik&&kik.send({title:"I scored "+this.score+" on Flappy Lives",text:"Can you beat me?",pic:"/imgs/Flappy-icon-96.png",data:{score:this.score,shareId:this.kikShareId}})},crossPromoShow:function(){g.crossPromo&&g.crossPromo.show&&g.crossPromo.show()},crossPromoHide:function(){g.crossPromo&&g.crossPromo.hide&&g.crossPromo.hide()}});g.init=function(){c.paramStringToObject(g.location.search).desktopcheck&&
"/game.html"!==g.location.pathname&&!c.isMobile.any()&&(g.location.href="/desktop.html");new e}})(window);