zk.extend=function(abstractObj,extendObj){var prototype;if(!!abstractObj&&!!extendObj&&zk.isFunction(abstractObj)&&typeof extendObj==="object"){for(prototype in extendObj){abstractObj.prototype[prototype]=extendObj[prototype]}}else if(!!abstractObj&&!!extendObj&&typeof abstractObj==="object"&&typeof extendObj==="object"){for(prototype in extendObj){abstractObj[prototype]=extendObj[prototype]}}return abstractObj};zk.isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};zk.isFunction=function(obj){return Object.prototype.toString.call(obj)==="[object Function]"};if(!zk.CustomEvent){zk.CustomEvent={addEventListener:function(eventName,listener){var t=this;if(!t._eventList){t._eventList={}}if(!t._eventList[eventName]){t._eventList[eventName]=[]}t._eventList[eventName].push(listener)},removeEventListener:function(eventName,listener){var t=this;if(t._eventList&&t._eventList[eventName]){for(var i=0,l=t._eventList[eventName].length;i<l;i++){if(t._eventList[eventName][i]===listener){t._eventList[eventName].splice(i,1);t.removeEventListener(eventName,listener);break}}}},dispatchEvent:function(e){var t=this;if(t._eventList&&t._eventList[e.type]){for(var i=0,l=t._eventList[e.type].length;i<l;i++){t._eventList[e.type][i](e)}}},TWEEN_ONSTOP:"onstop",TWEEN_ONSTART:"onstart",TWEEN_ONCHANGE:"onchange",TWEEN_ONFINISH:"onfinish"}}zk.tween={setAttribute:{width:function(obj,val){obj.style.width=(val<0?0:val)+"px"},height:function(obj,val){obj.style.height=(val<0?0:val)+"px"},top:function(obj,val){obj.style.top=val+"px"},left:function(obj,val){obj.style.left=val+"px"},alpha:function(obj,val){if(!isNaN(obj.style.opacity)){obj.style.opacity=val/100}else{obj.style.filter="Alpha(Opacity="+Math.ceil(val)+")"}},scrollTop:function(obj,val){obj.scrollTop=val+"px"},scrollLeft:function(obj,val){obj.scrollLeft=val+"px"}},create:zk.extend(function(obj,att,startVal,endVal,frames,delay,animationFun){this.timerid=null;this.obj=obj;this.startVal=startVal;this.endVal=endVal;this.frames=frames;this.delay=delay;this.cFrame=0;this.animationFun=animationFun;this.att=att;this.change=(function(t){return function(){t.currentVal=t.animationFun(t.startVal,(t.endVal<t.startVal?t.endVal-t.startVal:t.endVal),t.frames,t.cFrame);zk.tween.setAttribute[t.att](t.obj,t.currentVal);t.dispatchEvent({"type":zk.CustomEvent.TWEEN_ONCHANGE,"target":t.obj});t.cFrame++;if(t.cFrame>t.frames){window.clearInterval(t.timerid);t.timerid=null;t.cFrame=0;t.dispatchEvent({"type":zk.CustomEvent.TWEEN_ONFINISH,"target":t.obj})}}})(this);this.start=(function(t){return function(){if(t.timerid!==null){window.clearInterval(t.timerid);t.timerid=null}if(zk.tween.setAttribute[t.att]){t.dispatchEvent({"type":zk.CustomEvent.TWEEN_ONSTART,"target":t.obj});t.timerid=window.setInterval(t.change,delay)}}})(this);this.stop=(function(t){return function(){if(t.timerid!==null){window.clearInterval(t.timerid);t.timerid=null;t.cFrame=0;t.dispatchEvent({"type":zk.CustomEvent.TWEEN_ONSTOP,"target":t.obj})}}})(this)},zk.CustomEvent),AnimationFun:{linear:function(b,c,d,t){return c*t/d+b},quad:{easeIn:function(b,c,d,t){return c*(t/=d)*t+b},easeOut:function(b,c,d,t){return-c*(t/=d)*(t-2)+b},easeInOut:function(b,c,d,t){if((t/=d/2)<1){return c/2*t*t+b}return-c/2*((--t)*(t-2)-1)+b}},cubic:{easeIn:function(b,c,d,t){return c*(t/=d)*t*t+b},easeOut:function(b,c,d,t){return c*((t=t/d-1)*t*t+1)+b},easeInOut:function(b,c,d,t){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b}},quart:{easeIn:function(b,c,d,t){return c*(t/=d)*t*t*t+b},easeOut:function(b,c,d,t){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOut:function(b,c,d,t){if((t/=d/2)<1){return c/2*t*t*t*t+b}return-c/2*((t-=2)*t*t*t-2)+b}},quint:{easeIn:function(b,c,d,t){return c*(t/=d)*t*t*t*t+b},easeOut:function(b,c,d,t){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOut:function(b,c,d,t){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b}},sine:{easeIn:function(b,c,d,t){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOut:function(b,c,d,t){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOut:function(b,c,d,t){return-c/2*(Math.cos(Math.PI*t/d)-1)+b}},expo:{easeIn:function(b,c,d,t){return(t===0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOut:function(b,c,d,t){return(t===d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOut:function(b,c,d,t){if(t===0){return b}if(t===d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b}},circ:{easeIn:function(b,c,d,t){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOut:function(b,c,d,t){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOut:function(b,c,d,t){if((t/=d/2)<1){return-c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b}},elastic:{easeIn:function(b,c,d,t,a,p){var s;if(t===0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(!a||a<Math.abs(c)){a=c;s=p/4}else{s=p/(2*Math.PI)*Math.asin(c/a)}return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOut:function(b,c,d,t,a,p){var s;if(t===0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(!a||a<Math.abs(c)){a=c;s=p/4}else{s=p/(2*Math.PI)*Math.asin(c/a)}return(a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b)},easeInOut:function(b,c,d,t,a,p){var s;if(t===0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(!a||a<Math.abs(c)){a=c;s=p/4}else{s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return-0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b}},back:{easeIn:function(b,c,d,t,s){if(!s){s=1.70158}return c*(t/=d)*t*((s+1)*t-s)+b},easeOut:function(b,c,d,t,s){if(!s){s=1.70158}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOut:function(b,c,d,t,s){if(!s){s=1.70158}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}else{return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b}}},bounce:{easeIn:function(b,c,d,t){return c-zk.tween.AnimationFun.bounce.easeOut(0,c,d,d-t)+b},easeOut:function(b,c,d,t,p){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}},easeInOut:function(b,c,d,t){if(t<d/2){return zk.tween.AnimationFun.bounce.easeIn(0,c,d,t*2)*0.5+b}else{return zk.tween.AnimationFun.bounce.easeOut(0,c,d,t*2-d)*0.5+c*0.5+b}}}}};
