function init(){canvas=document.getElementById("canvas"),stage=new createjs.Stage(canvas),stage.enableMouseOver(10),stage.update(),handleComplete()}function handleComplete(){var A=new lib.Background;A.y=350,A.x=400,stage.addChild(A),jaguar=new lib.JaguarTotem,jaguar.y=totemStartAt,jaguar.x=160,stage.addChild(jaguar),bird=new lib.BirdTotem,bird.y=totemStartAt,bird.x=405,stage.addChild(bird),monkey=new lib.MonkeyTotem,monkey.y=totemStartAt,monkey.x=660,stage.addChild(monkey),createjs.Ticker.setFPS(24),createjs.Ticker.addListener(window),setTimeout(checkNetworks,4e3)}function addMayan(){var A=new lib.MiniMayan;A.gotoAndStop("running"),A.speed=7,A.direction=-1,A.y=stage.canvas.height-100,A.x=stage.canvas.width+100,A.onMouseOver=handleMayanMouseOver,A.onClick=handleMayanClick,mayans.push(A),stage.addChild(A),createjs.Touch.enable(A)}function checkNetworks(){null!=$("#facebook")?animateTokens():setTimeout(checkNetworks,4e3)}function animateTokens(){$("#twitter").find(".number").html(data.twitter),createjs.Tween.get(bird).to({y:totemStartAt-data.twitter/totemGoal*(totemStartAt-totemEndAt)},1e3,createjs.Ease.circOut),$("#linkedin").find(".number").html(data.linkedin),createjs.Tween.get(monkey).to({y:totemStartAt-data.linkedin/totemGoal*(totemStartAt-totemEndAt)},1e3,createjs.Ease.circOut),$("#facebook").find(".number").html(data.facebook),createjs.Tween.get(jaguar).to({y:totemStartAt-data.facebook/totemGoal*(totemStartAt-totemEndAt)},1e3,createjs.Ease.circOut),addMayan()}function onAnimationFinish(A,g,Q){return animations.push({id:animationCounter,target:A,duration:g,handler:Q,current_frame:0}),animationCounter++}function removeAnimationFromStack(A){for(var g=0;g=animations[A].duration&&removeAnimationFromStack(animations[A].id);for(var A=0;Astage.canvas.width+100&&1==mayan.direction&&(mayan.direction*=-1,mayan.scaleX*=-1);stage.update()}this.createjs=this.createjs||{},function(){var A=function(){throw"UID cannot be instantiated"};A._nextID=0,A.get=function(){return A._nextID++},createjs.UID=A}(),this.createjs=this.createjs||{},function(){var A=function(){throw"Ticker cannot be instantiated."};A.useRAF=null,A._listeners=null,A._pauseable=null,A._paused=!1,A._inited=!1,A._startTime=0,A._pausedTime=0,A._ticks=0,A._pausedTicks=0,A._interval=50,A._lastTime=0,A._times=null,A._tickTimes=null,A._rafActive=!1,A._timeoutID=null,A.addListener=function(g,Q){null!=g&&(A._inited||A.init(),A.removeListener(g),A._pauseable[A._listeners.length]=null==Q||Q,A._listeners.push(g))},A.init=function(){A._inited=!0,A._times=[],A._tickTimes=[],A._pauseable=[],A._listeners=[],A._times.push(A._lastTime=A._startTime=A._getTime()),A.setInterval(A._interval)},A.removeListener=function(g){var Q=A._listeners;Q&&(g=Q.indexOf(g),g!=-1&&(Q.splice(g,1),A._pauseable.splice(g,1)))},A.removeAllListeners=function(){A._listeners=[],A._pauseable=[]},A.setInterval=function(g){A._interval=g,A._inited&&A._setupTick()},A.getInterval=function(){return A._interval},A.setFPS=function(g){A.setInterval(1e3/g)},A.getFPS=function(){return 1e3/A._interval},A.getMeasuredFPS=function(g){return A._times.length<2?-1:(null==g&&(g=0|A.getFPS()),g=Math.min(A._times.length-1,g),1e3/((A._times[0]-A._times[g])/g))},A.setPaused=function(g){A._paused=g},A.getPaused=function(){return A._paused},A.getTime=function(g){return A._getTime()-A._startTime-(g?A._pausedTime:0)},A.getTicks=function(g){return A._ticks-(g?A._pausedTicks:0)},A._handleAF=function(){A._rafActive=!1,A._setupTick(),A._getTime()-A._lastTime>=.97*(A._interval-1)&&A._tick()},A._handleTimeout=function(){A.timeoutID=null,A._setupTick(),A._tick()},A._setupTick=function(){if(!A._rafActive&&null==A.timeoutID){if(A.useRAF){var g=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(g)return g(A._handleAF),void(A._rafActive=!0)}A.timeoutID=setTimeout(A._handleTimeout,A._interval)}},A._tick=function(){var g=A._getTime();A._ticks++;var Q=g-A._lastTime,B=A._paused;B&&(A._pausedTicks++,A._pausedTime+=Q),A._lastTime=g;for(var t=A._pauseable,I=A._listeners.slice(),h=I?I.length:0,i=0;i100;)A._tickTimes.pop();for(A._times.unshift(g);A._times.length>100;)A._times.pop()};var g=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow);A._getTime=function(){return g&&g.call(performance)||(new Date).getTime()},createjs.Ticker=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q,B,t,I,h,i,e){this.initialize(A,g,Q,B,t,I,h,i,e)},g=A.prototype;g.stageX=0,g.stageY=0,g.rawX=0,g.rawY=0,g.type=null,g.nativeEvent=null,g.onMouseMove=null,g.onMouseUp=null,g.target=null,g.pointerID=0,g.primary=!1,g.initialize=function(A,g,Q,B,t,I,h,i,e){this.type=A,this.stageX=g,this.stageY=Q,this.target=B,this.nativeEvent=t,this.pointerID=I,this.primary=h,this.rawX=null==i?g:i,this.rawY=null==e?Q:e},g.clone=function(){return new A(this.type,this.stageX,this.stageY,this.target,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},g.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q,B,t,I){this.initialize(A,g,Q,B,t,I)},g=A.prototype;A.identity=null,A.DEG_TO_RAD=Math.PI/180,g.a=1,g.b=0,g.c=0,g.d=1,g.tx=0,g.ty=0,g.alpha=1,g.shadow=null,g.compositeOperation=null,g.initialize=function(A,g,Q,B,t,I){return null!=A&&(this.a=A),this.b=g||0,this.c=Q||0,null!=B&&(this.d=B),this.tx=t||0,this.ty=I||0,this},g.prepend=function(A,g,Q,B,t,I){var h=this.tx;if(1!=A||0!=g||0!=Q||1!=B){var i=this.a,e=this.c;this.a=i*A+this.b*Q,this.b=i*g+this.b*B,this.c=e*A+this.d*Q,this.d=e*g+this.d*B}return this.tx=h*A+this.ty*Q+t,this.ty=h*g+this.ty*B+I,this},g.append=function(A,g,Q,B,t,I){var h=this.a,i=this.b,e=this.c,s=this.d;return this.a=A*h+g*e,this.b=A*i+g*s,this.c=Q*h+B*e,this.d=Q*i+B*s,this.tx=t*h+I*e+this.tx,this.ty=t*i+I*s+this.ty,this},g.prependMatrix=function(A){return this.prepend(A.a,A.b,A.c,A.d,A.tx,A.ty),this.prependProperties(A.alpha,A.shadow,A.compositeOperation),this},g.appendMatrix=function(A){return this.append(A.a,A.b,A.c,A.d,A.tx,A.ty),this.appendProperties(A.alpha,A.shadow,A.compositeOperation),this},g.prependTransform=function(g,Q,B,t,I,h,i,e,s){if(I%360)var a=I*A.DEG_TO_RAD,I=Math.cos(a),a=Math.sin(a);else I=1,a=0;return(e||s)&&(this.tx-=e,this.ty-=s),h||i?(h*=A.DEG_TO_RAD,i*=A.DEG_TO_RAD,this.prepend(I*B,a*B,-a*t,I*t,0,0),this.prepend(Math.cos(i),Math.sin(i),-Math.sin(h),Math.cos(h),g,Q)):this.prepend(I*B,a*B,-a*t,I*t,g,Q),this},g.appendTransform=function(g,Q,B,t,I,h,i,e,s){if(I%360)var a=I*A.DEG_TO_RAD,I=Math.cos(a),a=Math.sin(a);else I=1,a=0;return h||i?(h*=A.DEG_TO_RAD,i*=A.DEG_TO_RAD,this.append(Math.cos(i),Math.sin(i),-Math.sin(h),Math.cos(h),g,Q),this.append(I*B,a*B,-a*t,I*t,0,0)):this.append(I*B,a*B,-a*t,I*t,g,Q),(e||s)&&(this.tx-=e*this.a+s*this.c,this.ty-=e*this.b+s*this.d),this},g.rotate=function(A){var g=Math.cos(A),A=Math.sin(A),Q=this.a,B=this.c,t=this.tx;return this.a=Q*g-this.b*A,this.b=Q*A+this.b*g,this.c=B*g-this.d*A,this.d=B*A+this.d*g,this.tx=t*g-this.ty*A,this.ty=t*A+this.ty*g,this},g.skew=function(g,Q){return g*=A.DEG_TO_RAD,Q*=A.DEG_TO_RAD,this.append(Math.cos(Q),Math.sin(Q),-Math.sin(g),Math.cos(g),0,0),this},g.scale=function(A,g){return this.a*=A,this.d*=g,this.tx*=A,this.ty*=g,this},g.translate=function(A,g){return this.tx+=A,this.ty+=g,this},g.identity=function(){return this.alpha=this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this.shadow=this.compositeOperation=null,this},g.invert=function(){var A=this.a,g=this.b,Q=this.c,B=this.d,t=this.tx,I=A*B-g*Q;return this.a=B/I,this.b=-g/I,this.c=-Q/I,this.d=A/I,this.tx=(Q*this.ty-B*t)/I,this.ty=-(A*this.ty-g*t)/I,this},g.isIdentity=function(){return 0==this.tx&&0==this.ty&&1==this.a&&0==this.b&&0==this.c&&1==this.d},g.decompose=function(g){null==g&&(g={}),g.x=this.tx,g.y=this.ty,g.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),g.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var Q=Math.atan2(-this.c,this.d),B=Math.atan2(this.b,this.a);return Q==B?(g.rotation=B/A.DEG_TO_RAD,this.a<0&&this.d>=0&&(g.rotation+=g.rotation<=0?180:-180),g.skewX=g.skewY=0):(g.skewX=Q/A.DEG_TO_RAD,g.skewY=B/A.DEG_TO_RAD),g},g.reinitialize=function(A,g,Q,B,t,I,h,i,e){return this.initialize(A,g,Q,B,t,I),this.alpha=h||1,this.shadow=i,this.compositeOperation=e,this},g.appendProperties=function(A,g,Q){return this.alpha*=A,this.shadow=g||this.shadow,this.compositeOperation=Q||this.compositeOperation,this},g.prependProperties=function(A,g,Q){return this.alpha*=A,this.shadow=this.shadow||g,this.compositeOperation=this.compositeOperation||Q,this},g.clone=function(){var g=new A(this.a,this.b,this.c,this.d,this.tx,this.ty);return g.shadow=this.shadow,g.alpha=this.alpha,g.compositeOperation=this.compositeOperation,g},g.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},A.identity=new A(1,0,0,1,0,0),createjs.Matrix2D=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g){this.initialize(A,g)},g=A.prototype;g.x=0,g.y=0,g.initialize=function(A,g){this.x=null==A?0:A,this.y=null==g?0:g},g.clone=function(){return new A(this.x,this.y)},g.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q,B){this.initialize(A,g,Q,B)},g=A.prototype;g.x=0,g.y=0,g.width=0,g.height=0,g.initialize=function(A,g,Q,B){this.x=null==A?0:A,this.y=null==g?0:g,this.width=null==Q?0:Q,this.height=null==B?0:B},g.clone=function(){return new A(this.x,this.y,this.width,this.height)},g.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q,B){this.initialize(A,g,Q,B)},g=A.prototype;A.identity=null,g.color=null,g.offsetX=0,g.offsetY=0,g.blur=0,g.initialize=function(A,g,Q,B){this.color=A,this.offsetX=g,this.offsetY=Q,this.blur=B},g.toString=function(){return"[Shadow]"},g.clone=function(){return new A(this.color,this.offsetX,this.offsetY,this.blur)},A.identity=new A("transparent",0,0,0),createjs.Shadow=A}(),this.createjs=this.createjs||{},function(){var A=function(A){this.initialize(A)},g=A.prototype;g.complete=!0,g.onComplete=null,g._animations=null,g._frames=null,g._images=null,g._data=null,g._loadCount=0,g._frameHeight=0,g._frameWidth=0,g._numFrames=0,g._regX=0,g._regY=0,g.initialize=function(A){var g,Q,B;if(null!=A){if(A.images&&(Q=A.images.length)>0)for(B=this._images=[],g=0;g0?Math.min(this._numFrames-A,h*i):h*i,e=0;e>8&255,A=A>>16&255),null==B?"rgb("+A+","+g+","+Q+")":"rgba("+A+","+g+","+Q+","+B+")"},g.getHSL=function(A,g,Q,B){return null==B?"hsl("+A%360+","+g+"%,"+Q+"%)":"hsla("+A%360+","+g+"%,"+Q+"%,"+B+")"},g.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63},g.STROKE_CAPS_MAP=["butt","round","square"],g.STROKE_JOINTS_MAP=["miter","round","bevel"],g._ctx=(createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")).getContext("2d"),g.beginCmd=new A(g._ctx.beginPath,[],(!1)),g.fillCmd=new A(g._ctx.fill,[],(!1)),g.strokeCmd=new A(g._ctx.stroke,[],(!1)),Q._strokeInstructions=null,Q._strokeStyleInstructions=null,Q._fillInstructions=null,Q._instructions=null,Q._oldInstructions=null,Q._activeInstructions=null,Q._active=!1,Q._dirty=!1,Q.initialize=function(){this.clear(),this._ctx=g._ctx},Q.draw=function(A){this._dirty&&this._updateInstructions();for(var g=this._instructions,Q=0,B=g.length;Qs&&(I=s),h<0&&(h*=C=-1),h>s&&(h=s),i<0&&(i*=n=-1),i>s&&(i=s),e<0&&(e*=o=-1),e>s&&(e=s),this._dirty=this._active=!0;var s=this._ctx.arcTo,r=this._ctx.lineTo;return this._activeInstructions.push(new A(this._ctx.moveTo,[g+B-h,Q]),new A(s,[g+B+h*C,Q-h*C,g+B,Q+h,h]),new A(r,[g+B,Q+t-i]),new A(s,[g+B+i*n,Q+t+i*n,g+B-i,Q+t,i]),new A(r,[g+e,Q+t]),new A(s,[g-e*o,Q+t+e*o,g,Q+t-e,e]),new A(r,[g,Q+I]),new A(s,[g-I*a,Q-I*a,g+I,Q,I]),new A(this._ctx.closePath)),this},Q.drawCircle=function(A,g,Q){return this.arc(A,g,Q,0,2*Math.PI),this},Q.drawEllipse=function(g,Q,B,t){this._dirty=this._active=!0;var I=B/2*.5522848,h=t/2*.5522848,i=g+B,e=Q+t,B=g+B/2,t=Q+t/2;return this._activeInstructions.push(new A(this._ctx.moveTo,[g,t]),new A(this._ctx.bezierCurveTo,[g,t-h,B-I,Q,B,Q]),new A(this._ctx.bezierCurveTo,[B+I,Q,i,t-h,i,t]),new A(this._ctx.bezierCurveTo,[i,t+h,B+I,e,B,e]),new A(this._ctx.bezierCurveTo,[B-I,e,g,t+h,g,t])),this},Q.drawPolyStar=function(g,Q,B,t,I,h){this._dirty=this._active=!0,null==I&&(I=0),I=1-I,null==h?h=0:h/=180/Math.PI;var i=Math.PI/t;this._activeInstructions.push(new A(this._ctx.moveTo,[g+Math.cos(h)*B,Q+Math.sin(h)*B]));for(var e=0;e>3,o=Q[n];if(!o||3&C)throw"bad path data (@"+t+"): "+a;for(a=B[n],n||(i=e=0),h.length=0,t++,C=(C>>2&1)+2,n=0;n>5?-1:1,r=(31&r)<<6|s[A.charAt(t+1)];3==C&&(r=r<<6|s[A.charAt(t+2)]),r=D*r/10,n%2?i=r+=i:e=r+=e,h[n]=r,t+=C}o.apply(this,h)}return this},Q.clone=function(){var A=new g;return A._instructions=this._instructions.slice(),A._activeInstructions=this._activeInstructions.slice(),A._oldInstructions=this._oldInstructions.slice(),this._fillInstructions&&(A._fillInstructions=this._fillInstructions.slice()),this._strokeInstructions&&(A._strokeInstructions=this._strokeInstructions.slice()),this._strokeStyleInstructions&&(A._strokeStyleInstructions=this._strokeStyleInstructions.slice()),A._active=this._active,A._dirty=this._dirty,A.drawAsPath=this.drawAsPath,A},Q.toString=function(){return"[Graphics]"},Q.mt=Q.moveTo,Q.lt=Q.lineTo,Q.at=Q.arcTo,Q.bt=Q.bezierCurveTo,Q.qt=Q.quadraticCurveTo,Q.a=Q.arc,Q.r=Q.rect,Q.cp=Q.closePath,Q.c=Q.clear,Q.f=Q.beginFill,Q.lf=Q.beginLinearGradientFill,Q.rf=Q.beginRadialGradientFill,Q.bf=Q.beginBitmapFill,Q.ef=Q.endFill,Q.ss=Q.setStrokeStyle,Q.s=Q.beginStroke,Q.ls=Q.beginLinearGradientStroke,Q.rs=Q.beginRadialGradientStroke,Q.bs=Q.beginBitmapStroke,Q.es=Q.endStroke,Q.dr=Q.drawRect,Q.rr=Q.drawRoundRect,Q.rc=Q.drawRoundRectComplex,Q.dc=Q.drawCircle,Q.de=Q.drawEllipse,Q.dp=Q.drawPolyStar,Q.p=Q.decodePath,Q._updateInstructions=function(){this._instructions=this._oldInstructions.slice(),this._instructions.push(g.beginCmd),this._fillInstructions&&this._instructions.push.apply(this._instructions,this._fillInstructions),this._strokeInstructions&&(this._instructions.push.apply(this._instructions,this._strokeInstructions),this._strokeStyleInstructions&&this._instructions.push.apply(this._instructions,this._strokeStyleInstructions)),this._instructions.push.apply(this._instructions,this._activeInstructions),this._fillInstructions&&this._instructions.push(g.fillCmd),this._strokeInstructions&&this._instructions.push(g.strokeCmd)},Q._getEllipseArc=function(g,Q,B,t){var I=B/2*.5522848,h=t/2*.5522848,i=g+B,e=Q+t,B=g+B/2,t=Q+t/2;return this._activeInstructions.push(new A(this._ctx.moveTo,[g,t]),new A(this._ctx.bezierCurveTo,[g,t-h,B-I,Q,B,Q]),new A(this._ctx.bezierCurveTo,[B+I,Q,i,t-h,i,t]),new A(this._ctx.bezierCurveTo,[i,t+h,B+I,e,B,e]),new A(this._ctx.bezierCurveTo,[B-I,e,g,t+h,g,t])),this},Q._newPath=function(){this._dirty&&this._updateInstructions(),this._oldInstructions=this._instructions,this._activeInstructions=[],this._active=this._dirty=!1},Q._setProp=function(A,g){this[A]=g},createjs.Graphics=g}(),this.createjs=this.createjs||{},function(){var A=function(){this.initialize()},g=A.prototype;A.suppressCrossDomainErrors=!1,A._hitTestCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),A._hitTestCanvas.width=A._hitTestCanvas.height=1,A._hitTestContext=A._hitTestCanvas.getContext("2d"),A._nextCacheID=1,g.alpha=1,g.cacheCanvas=null,g.id=-1,g.mouseEnabled=!0,g.name=null,g.parent=null,g.regX=0,g.regY=0,g.rotation=0,g.scaleX=1,g.scaleY=1,g.skewX=0,g.skewY=0,g.shadow=null,g.visible=!0,g.x=0,g.y=0,g.compositeOperation=null,g.snapToPixel=!1,g.onPress=null,g.onClick=null,g.onDoubleClick=null,g.onMouseOver=null,g.onMouseOut=null,g.onTick=null,g.filters=null,g.cacheID=0,g.mask=null,g.hitArea=null,g._cacheOffsetX=0,g._cacheOffsetY=0,g._cacheScale=1,g._cacheDataURLID=0,g._cacheDataURL=null,g._matrix=null,g.initialize=function(){this.id=createjs.UID.get(),this._matrix=new createjs.Matrix2D},g.isVisible=function(){return this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY},g.draw=function(A,g){var Q=this.cacheCanvas;if(g||!Q)return!1;var B=this._cacheScale;return A.drawImage(Q,this._cacheOffsetX,this._cacheOffsetY,Q.width/B,Q.height/B),!0},g.updateContext=function(A){var g,Q=this.mask;Q&&Q.graphics&&(g=Q.getMatrix(Q._matrix),A.transform(g.a,g.b,g.c,g.d,g.tx,g.ty),Q.graphics.drawAsPath(A),A.clip(),g.invert(),A.transform(g.a,g.b,g.c,g.d,g.tx,g.ty)),g=this._matrix.identity().appendTransform(this.x,this.y,this.scaleX,this.scaleY,this.rotation,this.skewX,this.skewY,this.regX,this.regY),createjs.Stage._snapToPixelEnabled&&this.snapToPixel?A.transform(g.a,g.b,g.c,g.d,g.tx+.5|0,g.ty+.5|0):A.transform(g.a,g.b,g.c,g.d,g.tx,g.ty),A.globalAlpha*=this.alpha,this.compositeOperation&&(A.globalCompositeOperation=this.compositeOperation),this.shadow&&this._applyShadow(A,this.shadow)},g.cache=function(A,g,Q,B,t){t=t||1,this.cacheCanvas||(this.cacheCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),this.cacheCanvas.width=Math.ceil(Q*t),this.cacheCanvas.height=Math.ceil(B*t),this._cacheOffsetX=A,this._cacheOffsetY=g,this._cacheScale=t||1,this.updateCache()},g.updateCache=function(g){var Q=this.cacheCanvas,B=this._cacheOffsetX,t=this._cacheOffsetY,I=this._cacheScale;if(!Q)throw"cache() must be called before updateCache()";var h=Q.getContext("2d");h.save(),g||h.clearRect(0,0,Q.width,Q.height),h.globalCompositeOperation=g,h.setTransform(I,0,0,I,-B,-t),this.draw(h,!0),this._applyFilters(),h.restore(),this.cacheID=A._nextCacheID++},g.uncache=function(){this._cacheDataURL=this.cacheCanvas=null,this.cacheID=this._cacheOffsetX=this._cacheOffsetY=0,this._cacheScale=1},g.getCacheDataURL=function(){return this.cacheCanvas?(this.cacheID!=this._cacheDataURLID&&(this._cacheDataURL=this.cacheCanvas.toDataURL()),this._cacheDataURL):null},g.getStage=function(){for(var A=this;A.parent;)A=A.parent;return A instanceof createjs.Stage?A:null},g.localToGlobal=function(A,g){var Q=this.getConcatenatedMatrix(this._matrix);return null==Q?null:(Q.append(1,0,0,1,A,g),new createjs.Point(Q.tx,Q.ty))},g.globalToLocal=function(A,g){var Q=this.getConcatenatedMatrix(this._matrix);return null==Q?null:(Q.invert(),Q.append(1,0,0,1,A,g),new createjs.Point(Q.tx,Q.ty))},g.localToLocal=function(A,g,Q){return A=this.localToGlobal(A,g),Q.globalToLocal(A.x,A.y)},g.setTransform=function(A,g,Q,B,t,I,h,i,e){return this.x=A||0,this.y=g||0,this.scaleX=null==Q?1:Q,this.scaleY=null==B?1:B,this.rotation=t||0,this.skewX=I||0,this.skewY=h||0,this.regX=i||0,this.regY=e||0,this},g.getMatrix=function(A){return(A?A.identity():new createjs.Matrix2D).appendTransform(this.x,this.y,this.scaleX,this.scaleY,this.rotation,this.skewX,this.skewY,this.regX,this.regY).appendProperties(this.alpha,this.shadow,this.compositeOperation)},g.getConcatenatedMatrix=function(A){A?A.identity():A=new createjs.Matrix2D;for(var g=this;null!=g;)A.prependTransform(g.x,g.y,g.scaleX,g.scaleY,g.rotation,g.skewX,g.skewY,g.regX,g.regY).prependProperties(g.alpha,g.shadow,g.compositeOperation),g=g.parent;return A},g.hitTest=function(g,Q){var B=A._hitTestContext,t=A._hitTestCanvas;return B.setTransform(1,0,0,1,-g,-Q),this.draw(B),B=this._testHit(B),t.width=0,t.width=1,B},g.clone=function(){var g=new A;return this.cloneProps(g),g},g.toString=function(){return"[DisplayObject (name="+this.name+")]"},g.cloneProps=function(A){A.alpha=this.alpha,A.name=this.name,A.regX=this.regX,A.regY=this.regY,A.rotation=this.rotation,A.scaleX=this.scaleX,A.scaleY=this.scaleY,A.shadow=this.shadow,A.skewX=this.skewX,A.skewY=this.skewY,A.visible=this.visible,A.x=this.x,A.y=this.y,A.mouseEnabled=this.mouseEnabled,A.compositeOperation=this.compositeOperation,this.cacheCanvas&&(A.cacheCanvas=this.cacheCanvas.cloneNode(!0),A.cacheCanvas.getContext("2d").putImageData(this.cacheCanvas.getContext("2d").getImageData(0,0,this.cacheCanvas.width,this.cacheCanvas.height),0,0))},g._applyShadow=function(A,g){g=g||Shadow.identity,A.shadowColor=g.color,A.shadowOffsetX=g.offsetX,A.shadowOffsetY=g.offsetY,A.shadowBlur=g.blur},g._tick=function(A){this.onTick&&(A?this.onTick.apply(this,A):this.onTick())},g._testHit=function(g){try{var Q=g.getImageData(0,0,1,1).data[3]>1}catch(g){if(!A.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."}return Q},g._applyFilters=function(){if(this.filters&&0!=this.filters.length&&this.cacheCanvas)for(var A=this.filters.length,g=this.cacheCanvas.getContext("2d"),Q=this.cacheCanvas.width,B=this.cacheCanvas.height,t=0;t0&&this.children.length&&0!=this.scaleX&&0!=this.scaleY},g.DisplayObject_draw=g.draw,g.draw=function(A,g){if(this.DisplayObject_draw(A,g))return!0;for(var Q=this.children.slice(0),B=0,t=Q.length;B1){for(var Q=0;Qthis.children.length)return arguments[Q-2];if(Q>2){for(var t=0;t1){for(var Q=!0,B=0;B1){for(var Q=[],B=0;Bthis.children.length-1)&&((g=this.children[A])&&(g.parent=null),this.children.splice(A,1),!0)},g.removeAllChildren=function(){for(var A=this.children;A.length;)A.pop().parent=null},g.getChildAt=function(A){return this.children[A]},g.sortChildren=function(A){this.children.sort(A)},g.getChildIndex=function(A){return this.children.indexOf(A)},g.getNumChildren=function(){return this.children.length},g.swapChildrenAt=function(A,g){var Q=this.children,B=Q[A],t=Q[g];B&&t&&(Q[A]=t,Q[g]=B)},g.swapChildren=function(A,g){for(var Q,B,t=this.children,I=0,h=t.length;I=B)){for(var t=0;t=0;g--){var Q=this.children[g];Q._tick&&Q._tick(A)}this.DisplayObject__tick(A)},g._getObjectsUnderPoint=function(g,Q,B,t){var I=createjs.DisplayObject._hitTestContext,h=createjs.DisplayObject._hitTestCanvas,i=this._matrix,e=1&t&&(this.onPress||this.onClick||this.onDoubleClick)||2&t&&(this.onMouseOver||this.onMouseOut);if(this.cacheCanvas&&e&&(this.getConcatenatedMatrix(i),I.setTransform(i.a,i.b,i.c,i.d,i.tx-g,i.ty-Q),I.globalAlpha=i.alpha,this.draw(I),this._testHit(I)))return h.width=0,h.width=1,this;for(var s=this.children.length-1;s>=0;s--){var a=this.children[s];if(a.isVisible()&&a.mouseEnabled)if(a instanceof A){if(e){if(a=a._getObjectsUnderPoint(g,Q))return this}else if(a=a._getObjectsUnderPoint(g,Q,B,t),!B&&a)return a}else if(!t||e||1&t&&(a.onPress||a.onClick||a.onDoubleClick)||2&t&&(a.onMouseOver||a.onMouseOut)){var C=a.hitArea;if(a.getConcatenatedMatrix(i),C&&(i.appendTransform(C.x+a.regX,C.y+a.regY,C.scaleX,C.scaleY,C.rotation,C.skewX,C.skewY,C.regX,C.regY),i.alpha*=C.alpha/a.alpha),I.globalAlpha=i.alpha,I.setTransform(i.a,i.b,i.c,i.d,i.tx-g,i.ty-Q),(C||a).draw(I),this._testHit(I)){if(h.width=0,h.width=1,e)return this;if(!B)return a;B.push(a)}}}return null},createjs.Container=A}(),this.createjs=this.createjs||{},function(){var A=function(A){this.initialize(A)},g=A.prototype=new createjs.Container;A._snapToPixelEnabled=!1,g.autoClear=!0,g.canvas=null,g.mouseX=0,g.mouseY=0,g.onMouseMove=null,g.onMouseUp=null,g.onMouseDown=null,g.snapToPixelEnabled=!1,g.mouseInBounds=!1,g.tickOnUpdate=!0,g.mouseMoveOutside=!1,g._pointerData=null,g._pointerCount=0,g._primaryPointerID=null,g._mouseOverIntervalID=null,g.Container_initialize=g.initialize,g.initialize=function(A){this.Container_initialize(),this.canvas=A instanceof HTMLCanvasElement?A:document.getElementById(A),this._pointerData={},this._enableMouseEvents(!0)},g.update=function(){if(this.canvas){this.autoClear&&this.clear(),A._snapToPixelEnabled=this.snapToPixelEnabled,this.tickOnUpdate&&this._tick(arguments.length?arguments:null);var g=this.canvas.getContext("2d");g.save(),this.updateContext(g),this.draw(g,!1),g.restore()}},g.tick=g.update,g.clear=function(){if(this.canvas){var A=this.canvas.getContext("2d");A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,this.canvas.width,this.canvas.height)}},g.toDataURL=function(A,g){g||(g="image/png");var Q,B=this.canvas.getContext("2d"),t=this.canvas.width,I=this.canvas.height;if(A){Q=B.getImageData(0,0,t,I);var h=B.globalCompositeOperation;B.globalCompositeOperation="destination-over",B.fillStyle=A,B.fillRect(0,0,t,I)}var i=this.canvas.toDataURL(g);return A&&(B.clearRect(0,0,t,I),B.putImageData(Q,0,0),B.globalCompositeOperation=h),i},g.enableMouseOver=function(A){if(this._mouseOverIntervalID&&(clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null),null==A)A=20;else if(A<=0)return;var g=this;this._mouseOverIntervalID=setInterval(function(){g._testMouseOver()},1e3/Math.min(50,A))},g.clone=function(){var g=new A(null);return this.cloneProps(g),g},g.toString=function(){return"[Stage (name="+this.name+")]"},g._enableMouseEvents=function(){var A=this,g=window.addEventListener?window:document;g.addEventListener("mouseup",function(g){A._handleMouseUp(g)},!1),g.addEventListener("mousemove",function(g){A._handleMouseMove(g)},!1),g.addEventListener("dblclick",function(g){A._handleDoubleClick(g)},!1),this.canvas&&this.canvas.addEventListener("mousedown",function(g){A._handleMouseDown(g)},!1)},g._getPointerData=function(A){var g=this._pointerData[A];return g||(g=this._pointerData[A]={x:0,y:0},null!=this._primaryPointerID)||(this._primaryPointerID=A),g},g._handleMouseMove=function(A){A||(A=window.event),this._handlePointerMove(-1,A,A.pageX,A.pageY)},g._handlePointerMove=function(A,g,Q,B){if(this.canvas){var t=this._getPointerData(A),I=t.inBounds;this._updatePointerPosition(A,Q,B),(I||t.inBounds||this.mouseMoveOutside)&&(A=new createjs.MouseEvent("onMouseMove",t.x,t.y,this,g,A,A==this._primaryPointerID,t.rawX,t.rawY),this.onMouseMove&&this.onMouseMove(A),t.event&&t.event.onMouseMove&&(A=A.clone(),A.target=t.event.target,t.event.onMouseMove(A)))}},g._updatePointerPosition=function(A,g,Q){var B=this._getElementRect(this.canvas);g-=B.left,Q-=B.top;var t=this.canvas.width,I=this.canvas.height;g/=(B.right-B.left)/t,Q/=(B.bottom-B.top)/I,B=this._getPointerData(A),(B.inBounds=g>=0&&Q>=0&&g<=t-1&&Q<=I-1)?(B.x=g,B.y=Q):this.mouseMoveOutside&&(B.x=g<0?0:g>t-1?t-1:g,B.y=Q<0?0:Q>I-1?I-1:Q),B.rawX=g,B.rawY=Q,A==this._primaryPointerID&&(this.mouseX=B.x,this.mouseY=B.y,this.mouseInBounds=B.inBounds)},g._getElementRect=function(A){var g=A.getBoundingClientRect(),Q=(window.pageXOffset||document.scrollLeft||0)-(document.clientLeft||document.body.clientLeft||0),B=(window.pageYOffset||document.scrollTop||0)-(document.clientTop||document.body.clientTop||0),t=window.getComputedStyle?getComputedStyle(A):A.currentStyle,A=parseInt(t.paddingLeft)+parseInt(t.borderLeftWidth),I=parseInt(t.paddingTop)+parseInt(t.borderTopWidth),h=parseInt(t.paddingRight)+parseInt(t.borderRightWidth),t=parseInt(t.paddingBottom)+parseInt(t.borderBottomWidth);return{left:g.left+Q+A,right:g.right+Q-h,top:g.top+B+I,bottom:g.bottom+B-t}},g._handleMouseUp=function(A){this._handlePointerUp(-1,A,!1)},g._handlePointerUp=function(A,g,Q){var B=this._getPointerData(A),t=new createjs.MouseEvent("onMouseUp",B.x,B.y,this,g,A,A==this._primaryPointerID,B.rawX,B.rawY);this.onMouseUp&&this.onMouseUp(t),B.event&&B.event.onMouseUp&&(t=t.clone(),t.target=B.event.target,B.event.onMouseUp(t)),B.target&&B.target.onClick&&this._getObjectsUnderPoint(B.x,B.y,null,!0,this._mouseOverIntervalID?3:1)==B.target&&B.target.onClick(new createjs.MouseEvent("onClick",B.x,B.y,B.target,g,A,A==this._primaryPointerID,B.rawX,B.rawY)),Q?(A==this._primaryPointerID&&(this._primaryPointerID=null),delete this._pointerData[A]):B.event=B.target=null},g._handleMouseDown=function(A){this._handlePointerDown(-1,A,!1)},g._handlePointerDown=function(A,g,Q,B){var t=this._getPointerData(A);null!=B&&this._updatePointerPosition(A,Q,B),this.onMouseDown&&this.onMouseDown(new createjs.MouseEvent("onMouseDown",t.x,t.y,this,g,A,A==this._primaryPointerID,t.rawX,t.rawY)),(Q=this._getObjectsUnderPoint(t.x,t.y,null,this._mouseOverIntervalID?3:1))&&(Q.onPress&&(A=new createjs.MouseEvent("onPress",t.x,t.y,Q,g,A,A==this._primaryPointerID,t.rawX,t.rawY),Q.onPress(A),A.onMouseMove||A.onMouseUp)&&(t.event=A),t.target=Q)},g._testMouseOver=function(){if(this._primaryPointerID==-1&&(this.mouseX!=this._mouseOverX||this.mouseY!=this._mouseOverY||!this.mouseInBounds)){var A=null;this.mouseInBounds&&(A=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,3),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY),this._mouseOverTarget!=A&&(this._mouseOverTarget&&this._mouseOverTarget.onMouseOut&&this._mouseOverTarget.onMouseOut(new createjs.MouseEvent("onMouseOut",this.mouseX,this.mouseY,this._mouseOverTarget)),A&&A.onMouseOver&&A.onMouseOver(new createjs.MouseEvent("onMouseOver",this.mouseX,this.mouseY,A)),this._mouseOverTarget=A)}},g._handleDoubleClick=function(A){this.onDoubleClick&&this.onDoubleClick(new createjs.MouseEvent("onDoubleClick",this.mouseX,this.mouseY,this,A,(-1),(!0)));var g=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);g&&g.onDoubleClick&&g.onDoubleClick(new createjs.MouseEvent("onDoubleClick",this.mouseX,this.mouseY,g,A,(-1),(!0)))},createjs.Stage=A}(),this.createjs=this.createjs||{},function(){var A=function(A){this.initialize(A)},g=A.prototype=new createjs.DisplayObject;g.image=null,g.snapToPixel=!0,g.sourceRect=null,g.DisplayObject_initialize=g.initialize,g.initialize=function(A){this.DisplayObject_initialize(),"string"==typeof A?(this.image=new Image,this.image.src=A):this.image=A},g.isVisible=function(){return this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&this.image&&(this.image.complete||this.image.getContext||this.image.readyState>=2)},g.DisplayObject_draw=g.draw,g.draw=function(A,g){if(this.DisplayObject_draw(A,g))return!0;var Q=this.sourceRect;return Q?A.drawImage(this.image,Q.x,Q.y,Q.width,Q.height,0,0,Q.width,Q.height):A.drawImage(this.image,0,0),!0},g.clone=function(){var g=new A(this.image);return this.cloneProps(g),g},g.toString=function(){return"[Bitmap (name="+this.name+")]"},createjs.Bitmap=A}(),this.createjs=this.createjs||{},function(){var A=function(A){this.initialize(A)},g=A.prototype=new createjs.DisplayObject;g.onAnimationEnd=null,g.currentFrame=-1,g.currentAnimation=null,g.paused=!0,g.spriteSheet=null,g.snapToPixel=!0,g.offset=0,g.currentAnimationFrame=0,g._advanceCount=0,g._animation=null,g.DisplayObject_initialize=g.initialize,g.initialize=function(A){this.DisplayObject_initialize(),this.spriteSheet=A},g.isVisible=function(){return this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&this.spriteSheet.complete&&this.currentFrame>=0},g.DisplayObject_draw=g.draw,g.draw=function(A,g){if(this.DisplayObject_draw(A,g))return!0;this._normalizeFrame();var Q=this.spriteSheet.getFrame(this.currentFrame);if(null!=Q){var B=Q.rect;return A.drawImage(Q.image,B.x,B.y,B.width,B.height,-Q.regX,-Q.regY,B.width,B.height),!0}},g.play=function(){this.paused=!1},g.stop=function(){this.paused=!0},g.gotoAndPlay=function(A){this.paused=!1,this._goto(A)},g.gotoAndStop=function(A){this.paused=!0,this._goto(A)},g.advance=function(){this._animation?this.currentAnimationFrame++:this.currentFrame++,this._normalizeFrame()},g.clone=function(){var g=new A(this.spriteSheet);return this.cloneProps(g),g},g.toString=function(){return"[BitmapAnimation (name="+this.name+")]"},g.DisplayObject__tick=g._tick,g._tick=function(A){var g=this._animation?this._animation.frequency:1;!this.paused&&(++this._advanceCount+this.offset)%g==0&&this.advance(),this.DisplayObject__tick(A)},g._normalizeFrame=function(){var A=this._animation;A?this.currentAnimationFrame>=A.frames.length?(A.next?this._goto(A.next):(this.paused=!0,this.currentAnimationFrame=A.frames.length-1,this.currentFrame=A.frames[this.currentAnimationFrame]),this.onAnimationEnd&&this.onAnimationEnd(this,A.name)):this.currentFrame=A.frames[this.currentAnimationFrame]:this.currentFrame>=this.spriteSheet.getNumFrames()&&(this.currentFrame=0,this.onAnimationEnd)&&this.onAnimationEnd(this,null)},g.DisplayObject_cloneProps=g.cloneProps,g.cloneProps=function(A){this.DisplayObject_cloneProps(A),A.onAnimationEnd=this.onAnimationEnd,A.currentFrame=this.currentFrame,A.currentAnimation=this.currentAnimation,A.paused=this.paused,A.offset=this.offset,A._animation=this._animation,A.currentAnimationFrame=this.currentAnimationFrame},g._goto=function(A){if(isNaN(A)){var g=this.spriteSheet.getAnimation(A);g&&(this.currentAnimationFrame=0,this._animation=g,this.currentAnimation=A,this._normalizeFrame())}else this.currentAnimation=this._animation=null,this.currentFrame=A},createjs.BitmapAnimation=A}(),this.createjs=this.createjs||{},function(){var A=function(A){this.initialize(A)},g=A.prototype=new createjs.DisplayObject;g.graphics=null,g.DisplayObject_initialize=g.initialize,g.initialize=function(A){this.DisplayObject_initialize(),this.graphics=A?A:new createjs.Graphics},g.isVisible=function(){return Boolean(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&this.graphics)},g.DisplayObject_draw=g.draw,g.draw=function(A,g){return!!this.DisplayObject_draw(A,g)||(this.graphics.draw(A),!0)},g.clone=function(g){return g=new A(g&&this.graphics?this.graphics.clone():this.graphics),this.cloneProps(g),g},g.toString=function(){return"[Shape (name="+this.name+")]"},createjs.Shape=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q){this.initialize(A,g,Q)},g=A.prototype=new createjs.DisplayObject;A._workingContext=(createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")).getContext("2d"),g.text="",g.font=null,g.color="#000",g.textAlign="left",g.textBaseline="top",g.maxWidth=null,g.outline=!1,g.lineHeight=0,g.lineWidth=null,g.DisplayObject_initialize=g.initialize,g.initialize=function(A,g,Q){this.DisplayObject_initialize(),this.text=A,this.font=g,this.color=Q?Q:"#000"},g.isVisible=function(){return Boolean(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&null!=this.text&&""!==this.text)},g.DisplayObject_draw=g.draw,g.draw=function(A,g){return!!this.DisplayObject_draw(A,g)||(this.outline?A.strokeStyle=this.color:A.fillStyle=this.color,A.font=this.font,A.textAlign=this.textAlign||"start",A.textBaseline=this.textBaseline||"alphabetic",this._drawText(A),!0)},g.getMeasuredWidth=function(){return this._getWorkingContext().measureText(this.text).width},g.getMeasuredLineHeight=function(){return 1.2*this._getWorkingContext().measureText("M").width},g.getMeasuredHeight=function(){return this._drawText()*(this.lineHeight||this.getMeasuredLineHeight())},g.clone=function(){var g=new A(this.text,this.font,this.color);return this.cloneProps(g),g},g.toString=function(){return"[Text (text="+(this.text.length>20?this.text.substr(0,17)+"...":this.text)+")]"},g.DisplayObject_cloneProps=g.cloneProps,g.cloneProps=function(A){this.DisplayObject_cloneProps(A),A.textAlign=this.textAlign,A.textBaseline=this.textBaseline,A.maxWidth=this.maxWidth,A.outline=this.outline,A.lineHeight=this.lineHeight,A.lineWidth=this.lineWidth},g._getWorkingContext=function(){var g=A._workingContext;return g.font=this.font,g.textAlign=this.textAlign||"start",g.textBaseline=this.textBaseline||"alphabetic",g},g._drawText=function(A){var g=!!A;g||(A=this._getWorkingContext());for(var Q=String(this.text).split(/(?:\r\n|\r|\n)/),B=this.lineHeight||this.getMeasuredLineHeight(),t=0,I=0,h=Q.length;Ithis.lineWidth?(g&&this._drawTextLine(A,e,t*B),t++,e=i[s+1]):e+=i[s]+i[s+1];g&&this._drawTextLine(A,e,t*B)}t++}return t},g._drawTextLine=function(A,g,Q){this.outline?A.strokeText(g,0,Q,this.maxWidth||65535):A.fillText(g,0,Q,this.maxWidth||65535)},createjs.Text=A}(),this.createjs=this.createjs||{},function(){var A=function(){throw"SpriteSheetUtils cannot be instantiated"};A._workingCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),A._workingContext=A._workingCanvas.getContext("2d"),A.addFlippedFrames=function(g,Q,B,t){if(Q||B||t){var I=0;Q&&A._flip(g,++I,!0,!1),B&&A._flip(g,++I,!1,!0),t&&A._flip(g,++I,!0,!0)}},A.extractFrame=function(g,Q){isNaN(Q)&&(Q=g.getAnimation(Q).frames[0]);var B=g.getFrame(Q);if(!B)return null;var t=B.rect,I=A._workingCanvas;return I.width=t.width,I.height=t.height,A._workingContext.drawImage(B.image,t.x,t.y,t.width,t.height,0,0,t.width,t.height),B=new Image,B.src=I.toDataURL("image/png"),B},A.mergeAlpha=function(A,g,Q){Q||(Q=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),Q.width=Math.max(g.width,A.width),Q.height=Math.max(g.height,A.height);var B=Q.getContext("2d");return B.save(),B.drawImage(A,0,0),B.globalCompositeOperation="destination-in",B.drawImage(g,0,0),B.restore(),Q},A._flip=function(g,Q,B,t){for(var I=g._images,h=A._workingCanvas,i=A._workingContext,e=I.length/Q,s=0;sthis.maxHeight)throw A.ERR_DIMENSIONS;for(var t=0,I=0,h=0;B.length;){var i=this._fillRow(B,t,h,Q,g);if(i.w>I&&(I=i.w),t+=i.h,!i.h||!B.length){var e=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");e.width=this._getSize(I,this.maxWidth),e.height=this._getSize(t,this.maxHeight),this._data.images[h]=e,i.h||(I=t=0,h++)}}},g._getSize=function(A,g){for(var Q=4;Math.pow(2,++Q)=0;a--){var C=g[a],n=this._scale*C.scale,o=C.sourceRect,r=C.source,D=Math.floor(n*o.x-I),E=Math.floor(n*o.y-I),p=Math.ceil(n*o.height+2*I),o=Math.ceil(n*o.width+2*I);if(o>h)throw A.ERR_DIMENSIONS;p>i||e+o>h||(C.img=B,C.rect=new createjs.Rectangle(e,Q,o,p),s=s||p,g.splice(a,1),t[C.index]=[e,Q,o,p,B,Math.round(-D+n*r.regX-I),Math.round(-E+n*r.regY-I)],e+=o)}return{w:e,h:s}},g._endBuild=function(){this.spriteSheet=new createjs.SpriteSheet(this._data),this._data=null,this._callback&&this._callback(this)},g._run=function(){for(var A=(new Date).getTime()+this._timeSlice,g=!1;A>(new Date).getTime();)if(!this._drawNext()){g=!0;break}if(g)this._endBuild();else{var Q=this;this._timerID=setTimeout(function(){Q._run()},50-this._timeSlice)}},g._drawNext=function(){var A=this._frames[this._index],g=A.scale*this._scale,Q=A.rect,B=A.sourceRect,t=this._data.images[A.img].getContext("2d");return A.funct&&A.funct.apply(A.scope,A.params),t.save(),t.beginPath(),t.rect(Q.x,Q.y,Q.width,Q.height),t.clip(),t.translate(Math.ceil(Q.x-B.x*g),Math.ceil(Q.y-B.y*g)),t.scale(g,g),A.source.draw(t),t.restore(),++this._index=0;t--){var I=B[t];Q&&!I.ignoreGlobalPause||I._paused||I.tick(I._useTicks?1:g)}},createjs.Ticker&&createjs.Ticker.addListener(A,!1),A.removeTweens=function(g){if(g.tweenjs_count){for(var Q=A._tweens,B=Q.length-1;B>=0;B--)Q[B]._target==g&&(Q[B]._paused=!0,Q.splice(B,1));g.tweenjs_count=0}},A.hasActiveTweens=function(g){return g?g.tweenjs_count:A._tweens&&A._tweens.length},A.installPlugin=function(g,Q){var B=g.priority;null==B&&(g.priority=B=0);for(var t=0,I=Q.length,h=A._plugins;t=this.duration&&(this.loop?Q%=this.duration:(Q=this.duration,B=!0)),Q==this._prevPos)return B;if(this._target)if(B)this._updateTargetProps(null,1);else if(this._steps.length>0){for(var t=0,I=this._steps.length;tQ);t++);t=this._steps[t-1],this._updateTargetProps(t,(this._stepPosition=Q-t.t)/t.d,Q)}return t=this._prevPos,this.position=this._prevPos=Q,this._prevPosition=A,0!=g&&this._actions.length>0&&(this._useTicks?this._runActions(Q,Q):1==g&&Qg&&(B=g,t=A,I=h,h=i=-1);(I+=i)!=h;){var g=this._actions[I],e=g.t;(e==t||e>B&&e0&&(this._steps.push(A),A.t=this.duration,this.duration+=A.d),this},g._addAction=function(A){return A.t=this.duration,this._actions.push(A),this},g._set=function(A,g){for(var Q in A)g[Q]=A[Q]},createjs.Tween=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q){this.initialize(A,g,Q)},g=A.prototype;g.ignoreGlobalPause=!1,g.duration=0,g.loop=!1,g.onChange=null,g.position=null,g._paused=!1,g._tweens=null,g._labels=null,g._prevPosition=0,g._prevPos=-1,g._useTicks=!1,g.initialize=function(A,g,Q){this._tweens=[],Q&&(this._useTicks=Q.useTicks,this.loop=Q.loop,this.ignoreGlobalPause=Q.ignoreGlobalPause,this.onChange=Q.onChange),A&&this.addTween.apply(this,A),this.setLabels(g),Q&&Q.paused?this._paused=!0:createjs.Tween._register(this,!0),Q&&null!=Q.position&&this.setPosition(Q.position,createjs.Tween.NONE)},g.addTween=function(A){var g=arguments.length;if(g>1){for(var Q=0;Qthis.duration&&(this.duration=A.duration),this._prevPos>=0&&A.setPosition(this._prevPos,createjs.Tween.NONE),A)},g.removeTween=function(A){var g=arguments.length;if(g>1){for(var Q=!0,B=0;B=this.duration&&this.updateDuration(),!0))},g.addLabel=function(A,g){this._labels[A]=g},g.setLabels=function(A){this._labels=A?A:{}},g.gotoAndPlay=function(A){this.setPaused(!1),this._goto(A)},g.gotoAndStop=function(A){this.setPaused(!0),this._goto(A)},g.setPosition=function(A,g){A<0&&(A=0);var Q=this.loop?A%this.duration:A,B=!this.loop&&A>=this.duration;if(Q==this._prevPos)return B;this._prevPosition=A,this.position=this._prevPos=Q;for(var t=0,I=this._tweens.length;tthis.duration&&(this.duration=tween.duration)},g.tick=function(A){this.setPosition(this._prevPosition+A)},g.resolve=function(A){var g=parseFloat(A);return isNaN(g)&&(g=this._labels[A]),g},g.toString=function(){return"[Timeline]"},g.clone=function(){throw"Timeline can not be cloned."},g._goto=function(A){A=this.resolve(A),null!=A&&this.setPosition(A)},createjs.Timeline=A}(),this.createjs=this.createjs||{}, function(){var A=function(){throw"Ease cannot be instantiated."};A.linear=function(A){return A},A.none=A.linear,A.get=function(A){return A<-1&&(A=-1),A>1&&(A=1),function(g){return 0==A?g:A<0?g*(g*-A+1+A):g*((2-g)*A+(1-A))}},A.getPowIn=function(A){return function(g){return Math.pow(g,A)}},A.getPowOut=function(A){return function(g){return 1-Math.pow(1-g,A)}},A.getPowInOut=function(A){return function(g){return(g*=2)<1?.5*Math.pow(g,A):1-.5*Math.abs(Math.pow(2-g,A))}},A.quadIn=A.getPowIn(2),A.quadOut=A.getPowOut(2),A.quadInOut=A.getPowInOut(2),A.cubicIn=A.getPowIn(3),A.cubicOut=A.getPowOut(3),A.cubicInOut=A.getPowInOut(3),A.quartIn=A.getPowIn(4),A.quartOut=A.getPowOut(4),A.quartInOut=A.getPowInOut(4),A.quintIn=A.getPowIn(5),A.quintOut=A.getPowOut(5),A.quintInOut=A.getPowInOut(5),A.sineIn=function(A){return 1-Math.cos(A*Math.PI/2)},A.sineOut=function(A){return Math.sin(A*Math.PI/2)},A.sineInOut=function(A){return-.5*(Math.cos(Math.PI*A)-1)},A.getBackIn=function(A){return function(g){return g*g*((A+1)*g-A)}},A.backIn=A.getBackIn(1.7),A.getBackOut=function(A){return function(g){return--g*g*((A+1)*g+A)+1}},A.backOut=A.getBackOut(1.7),A.getBackInOut=function(A){return A*=1.525,function(g){return(g*=2)<1?.5*g*g*((A+1)*g-A):.5*((g-=2)*g*((A+1)*g+A)+2)}},A.backInOut=A.getBackInOut(1.7),A.circIn=function(A){return-(Math.sqrt(1-A*A)-1)},A.circOut=function(A){return Math.sqrt(1- --A*A)},A.circInOut=function(A){return(A*=2)<1?-.5*(Math.sqrt(1-A*A)-1):.5*(Math.sqrt(1-(A-=2)*A)+1)},A.bounceIn=function(g){return 1-A.bounceOut(1-g)},A.bounceOut=function(A){return A<1/2.75?7.5625*A*A:A<2/2.75?7.5625*(A-=1.5/2.75)*A+.75:A<2.5/2.75?7.5625*(A-=2.25/2.75)*A+.9375:7.5625*(A-=2.625/2.75)*A+.984375},A.bounceInOut=function(g){return g<.5?.5*A.bounceIn(2*g):.5*A.bounceOut(2*g-1)+.5},A.getElasticIn=function(A,g){var Q=2*Math.PI;return function(B){if(0==B||1==B)return B;var t=g/Q*Math.asin(1/A);return-(A*Math.pow(2,10*(B-=1))*Math.sin((B-t)*Q/g))}},A.elasticIn=A.getElasticIn(1,.3),A.getElasticOut=function(A,g){var Q=2*Math.PI;return function(B){if(0==B||1==B)return B;var t=g/Q*Math.asin(1/A);return A*Math.pow(2,-10*B)*Math.sin((B-t)*Q/g)+1}},A.elasticOut=A.getElasticOut(1,.3),A.getElasticInOut=function(A,g){var Q=2*Math.PI;return function(B){var t=g/Q*Math.asin(1/A);return(B*=2)<1?-.5*A*Math.pow(2,10*(B-=1))*Math.sin((B-t)*Q/g):A*Math.pow(2,-10*(B-=1))*Math.sin((B-t)*Q/g)*.5+1}},A.elasticInOut=A.getElasticInOut(1,.3*1.5),createjs.Ease=A}(),this.createjs=this.createjs||{},function(){var A=function(A,g,Q,B){this.initialize(A,g,Q,B)},g=A.prototype=new createjs.Container;A.INDEPENDENT="independent",A.SINGLE_FRAME="single",A.SYNCHED="synched",g.startPosition=0,g.loop=!0,g.timeline=null,g.paused=!1,g.actionsEnabled=!0,g._synchOffset=0,g._prevPos=-1,g._prevPosition=0,g.Container_initialize=g.initialize,g.initialize=function(g,Q,B,t){this.mode=g||A.INDEPENDENT,this.startPosition=Q||0,this.loop=B,props={paused:!0,position:Q,useTicks:!0},this.Container_initialize(),this.timeline=new createjs.Timeline(null,t,props),this._managed={}},g.isVisible=function(){return this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY},g.Container_draw=g.draw,g.draw=function(A,g,Q){return!!this.DisplayObject_draw(A,g)||(this._updateTimeline(),void this.Container_draw(A,g,Q))},g.play=function(){this.paused=!1},g.stop=function(){this.paused=!0},g.gotoAndPlay=function(A){this.paused=!1,this._goto(A)},g.gotoAndStop=function(A){this.paused=!0,this._goto(A)},g.clone=function(){throw"MovieClip cannot be cloned."},g.toString=function(){return"[MovieClip (name="+this.name+")]"},g.Container__tick=g._tick,g._tick=function(g){this.paused||this.mode!=A.INDEPENDENT||(this._prevPosition=this._prevPos<0?0:this._prevPosition+1),this.Container__tick(g)},g._goto=function(A){A=this.timeline.resolve(A),null!=A&&(this._prevPosition=A,this._updateTimeline())},g._reset=function(){this._prevPos=-1},g._updateTimeline=function(){var g=this.timeline,Q=g._tweens,B=this.children,t=this.mode!=A.INDEPENDENT;if(g.loop=null==this.loop||this.loop,t?g.setPosition(this.startPosition+(this.mode==A.SINGLE_FRAME?0:this._synchOffset),createjs.Tween.NONE):g.setPosition(this._prevPosition,this.actionsEnabled?null:createjs.Tween.NONE),this._prevPosition=g._prevPosition,this._prevPos!=g._prevPos){this._prevPos=g._prevPos;for(var I in this._managed)this._managed[I]=1;for(g=Q.length-1;g>=0;g--)I=Q[g],t=I._target,t!=this&&(I=I._stepPosition,t instanceof createjs.DisplayObject?this._addManagedChild(t,I):this._setState(t.state,I));for(g=B.length-1;g>=0;g--)Q=B[g].id,1==this._managed[Q]&&(this.removeChildAt(g),delete this._managed[Q])}},g._setState=function(A,g){if(A)for(var Q=0,B=A.length;Q