﻿(function(){var a=YAHOO.util,d=function(a,b,f,c){this.init(a,b,f,c)};d.NAME="Anim";d.prototype={toString:function(){var a=this.getEl()||{};return this.constructor.NAME+": "+(a.id||a.tagName)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(a,b,f){return this.method(this.currentFrame,b,f-b,this.totalFrames)},setAttribute:function(e,
b,f){var c=this.getEl();this.patterns.noNegatives.test(e)&&(b=b>0?b:0);e in c&&!("style"in c&&e in c.style)?c[e]=b:a.Dom.setStyle(c,e,b+f)},getAttribute:function(e){var b=this.getEl(),f=a.Dom.getStyle(b,e);if(f!=="auto"&&!this.patterns.offsetUnit.test(f))return parseFloat(f);var c=this.patterns.offsetAttribute.exec(e)||[],d=!!c[3],j=!!c[2];"style"in b?f=j||a.Dom.getStyle(b,"position")=="absolute"&&d?b["offset"+c[0].charAt(0).toUpperCase()+c[0].substr(1)]:0:e in b&&(f=b[e]);return f},getDefaultUnit:function(a){return this.patterns.defaultUnit.test(a)?
"px":""},setRuntimeAttribute:function(a){var b,f,c=this.attributes;this.runtimeAttributes[a]={};var d=function(a){return typeof a!=="undefined"};if(!d(c[a].to)&&!d(c[a].by))return!1;b=d(c[a].from)?c[a].from:this.getAttribute(a);if(d(c[a].to))f=c[a].to;else if(d(c[a].by))if(b.constructor==Array){f=[];for(var j=0,g=b.length;j<g;++j)f[j]=b[j]+c[a].by[j]*1}else f=b+c[a].by*1;this.runtimeAttributes[a].start=b;this.runtimeAttributes[a].end=f;this.runtimeAttributes[a].unit=d(c[a].unit)?c[a].unit:this.getDefaultUnit(a);
return!0},init:function(e,b,f,c){var d=!1,j=null,g=0,e=a.Dom.get(e);this.attributes=b||{};this.duration=!YAHOO.lang.isUndefined(f)?f:1;this.method=c||a.Easing.easeNone;this.useSeconds=!0;this.currentFrame=0;this.totalFrames=a.AnimMgr.fps;this.setEl=function(f){e=a.Dom.get(f)};this.getEl=function(){return e};this.isAnimated=function(){return d};this.getStartTime=function(){return j};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated())return!1;this.currentFrame=0;this.totalFrames=
this.useSeconds?Math.ceil(a.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds)this.totalFrames=1;a.AnimMgr.registerElement(this);return!0};this.stop=function(f){if(!this.isAnimated())return!1;if(f)this.currentFrame=this.totalFrames,this._onTween.fire();a.AnimMgr.stop(this)};this._onStart=new a.CustomEvent("_start",this,!0);this.onStart=new a.CustomEvent("start",this);this.onTween=new a.CustomEvent("tween",this);this._onTween=new a.CustomEvent("_tween",this,!0);this.onComplete=
new a.CustomEvent("complete",this);this._onComplete=new a.CustomEvent("_complete",this,!0);this._onStart.subscribe(function(){this.onStart.fire();this.runtimeAttributes={};for(var a in this.attributes)this.setRuntimeAttribute(a);d=!0;g=0;j=new Date});this._onTween.subscribe(function(){var a={duration:new Date-this.getStartTime(),currentFrame:this.currentFrame};a.toString=function(){return"duration: "+a.duration+", currentFrame: "+a.currentFrame};this.onTween.fire(a);var f=this.runtimeAttributes,c;
for(c in f)this.setAttribute(c,this.doMethod(c,f[c].start,f[c].end),f[c].unit);g+=1});this._onComplete.subscribe(function(){var a=(new Date-j)/1E3,f={duration:a,frames:g,fps:g/a};f.toString=function(){return"duration: "+f.duration+", frames: "+f.frames+", fps: "+f.fps};d=!1;g=0;this.onComplete.fire(f)})}};a.Anim=d})();
YAHOO.util.AnimMgr=new function(){var a=null,d=[],e=0;this.fps=1E3;this.delay=1;this.registerElement=function(a){d[d.length]=a;e+=1;a._onStart.fire();this.start()};this.unRegister=function(a,c){c=c||b(a);if(!a.isAnimated()||c===-1)return!1;a._onComplete.fire();d.splice(c,1);e-=1;e<=0&&this.stop();return!0};this.start=function(){a===null&&(a=setInterval(this.run,this.delay))};this.stop=function(f){if(f)this.unRegister(f);else{clearInterval(a);for(var f=0,c=d.length;f<c;++f)this.unRegister(d[0],0);
d=[];a=null;e=0}};this.run=function(){for(var a=0,c=d.length;a<c;++a){var b=d[a];if(b&&b.isAnimated())if(b.currentFrame<b.totalFrames||b.totalFrames===null){b.currentFrame+=1;if(b.useSeconds){var e=b,g=e.totalFrames,h=e.currentFrame,m=e.currentFrame*e.duration*1E3/e.totalFrames,i=new Date-e.getStartTime(),k=0,k=i<e.duration*1E3?Math.round((i/m-1)*e.currentFrame):g-(h+1);k>0&&isFinite(k)&&(e.currentFrame+k>=g&&(k=g-(h+1)),e.currentFrame+=k)}b._onTween.fire()}else YAHOO.util.AnimMgr.stop(b,a)}};var b=
function(a){for(var c=0,b=d.length;c<b;++c)if(d[c]===a)return c;return-1};this._queue=d;this._getIndex=b};YAHOO.util.Bezier=new function(){this.getPosition=function(a,d){for(var e=a.length,b=[],f=0;f<e;++f)b[f]=[a[f][0],a[f][1]];for(var c=1;c<e;++c)for(f=0;f<e-c;++f)b[f][0]=(1-d)*b[f][0]+d*b[parseInt(f+1,10)][0],b[f][1]=(1-d)*b[f][1]+d*b[parseInt(f+1,10)][1];return[b[0][0],b[0][1]]}};
(function(){var a=function(f,c,b,e){a.superclass.constructor.call(this,f,c,b,e)};a.NAME="ColorAnim";a.DEFAULT_BGCOLOR="#fff";var d=YAHOO.util;YAHOO.extend(a,d.Anim);var e=a.superclass,b=a.prototype;b.patterns.color=/color$/i;b.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;b.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;b.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;b.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;b.parseColor=function(a){if(a.length==
3)return a;var c=this.patterns.hex.exec(a);if(c&&c.length==4)return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];return(c=this.patterns.rgb.exec(a))&&c.length==4?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=this.patterns.hex3.exec(a))&&c.length==4?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:null};b.getAttribute=function(f){var c=this.getEl();if(this.patterns.color.test(f)){var b=YAHOO.util.Dom.getStyle(c,f),j=this;this.patterns.transparent.test(b)&&
(b=(c=YAHOO.util.Dom.getAncestorBy(c,function(){return!j.patterns.transparent.test(b)}))?d.Dom.getStyle(c,f):a.DEFAULT_BGCOLOR)}else b=e.getAttribute.call(this,f);return b};b.doMethod=function(a,c,b){var d;if(this.patterns.color.test(a)){d=[];for(var g=0,h=c.length;g<h;++g)d[g]=e.doMethod.call(this,a,c[g],b[g]);d="rgb("+Math.floor(d[0])+","+Math.floor(d[1])+","+Math.floor(d[2])+")"}else d=e.doMethod.call(this,a,c,b);return d};b.setRuntimeAttribute=function(a){e.setRuntimeAttribute.call(this,a);if(this.patterns.color.test(a)){var c=
this.attributes,b=this.parseColor(this.runtimeAttributes[a].start),d=this.parseColor(this.runtimeAttributes[a].end);if(typeof c[a].to==="undefined"&&typeof c[a].by!=="undefined")for(var d=this.parseColor(c[a].by),c=0,g=b.length;c<g;++c)d[c]=b[c]+d[c];this.runtimeAttributes[a].start=b;this.runtimeAttributes[a].end=d}};d.ColorAnim=a})();
YAHOO.util.Easing={easeNone:function(a,d,e,b){return e*a/b+d},easeIn:function(a,d,e,b){return e*(a/=b)*a+d},easeOut:function(a,d,e,b){return-e*(a/=b)*(a-2)+d},easeBoth:function(a,d,e,b){return(a/=b/2)<1?e/2*a*a+d:-e/2*(--a*(a-2)-1)+d},easeInStrong:function(a,d,e,b){return e*(a/=b)*a*a*a+d},easeOutStrong:function(a,d,e,b){return-e*((a=a/b-1)*a*a*a-1)+d},easeBothStrong:function(a,d,e,b){return(a/=b/2)<1?e/2*a*a*a*a+d:-e/2*((a-=2)*a*a*a-2)+d},elasticIn:function(a,d,e,b,f,c){if(a==0)return d;if((a/=b)==
1)return d+e;c||(c=b*0.3);!f||f<Math.abs(e)?(f=e,e=c/4):e=c/(2*Math.PI)*Math.asin(e/f);return-(f*Math.pow(2,10*(a-=1))*Math.sin((a*b-e)*2*Math.PI/c))+d},elasticOut:function(a,d,e,b,f,c){if(a==0)return d;if((a/=b)==1)return d+e;c||(c=b*0.3);if(!f||f<Math.abs(e))var f=e,l=c/4;else l=c/(2*Math.PI)*Math.asin(e/f);return f*Math.pow(2,-10*a)*Math.sin((a*b-l)*2*Math.PI/c)+e+d},elasticBoth:function(a,d,e,b,f,c){if(a==0)return d;if((a/=b/2)==2)return d+e;c||(c=b*0.3*1.5);if(!f||f<Math.abs(e))var f=e,l=c/4;
else l=c/(2*Math.PI)*Math.asin(e/f);return a<1?-0.5*f*Math.pow(2,10*(a-=1))*Math.sin((a*b-l)*2*Math.PI/c)+d:f*Math.pow(2,-10*(a-=1))*Math.sin((a*b-l)*2*Math.PI/c)*0.5+e+d},backIn:function(a,d,e,b,f){typeof f=="undefined"&&(f=1.70158);return e*(a/=b)*a*((f+1)*a-f)+d},backOut:function(a,d,e,b,f){typeof f=="undefined"&&(f=1.70158);return e*((a=a/b-1)*a*((f+1)*a+f)+1)+d},backBoth:function(a,d,e,b,f){typeof f=="undefined"&&(f=1.70158);return(a/=b/2)<1?e/2*a*a*(((f*=1.525)+1)*a-f)+d:e/2*((a-=2)*a*(((f*=
1.525)+1)*a+f)+2)+d},bounceIn:function(a,d,e,b){return e-YAHOO.util.Easing.bounceOut(b-a,0,e,b)+d},bounceOut:function(a,d,e,b){if((a/=b)<1/2.75)return e*7.5625*a*a+d;else if(a<2/2.75)return e*(7.5625*(a-=1.5/2.75)*a+0.75)+d;else if(a<2.5/2.75)return e*(7.5625*(a-=2.25/2.75)*a+0.9375)+d;return e*(7.5625*(a-=2.625/2.75)*a+0.984375)+d},bounceBoth:function(a,d,e,b){return a<b/2?YAHOO.util.Easing.bounceIn(a*2,0,e,b)*0.5+d:YAHOO.util.Easing.bounceOut(a*2-b,0,e,b)*0.5+e*0.5+d}};
(function(){var a=function(c,b,f,d){c&&a.superclass.constructor.call(this,c,b,f,d)};a.NAME="Motion";var d=YAHOO.util;YAHOO.extend(a,d.ColorAnim);var e=a.superclass,b=a.prototype;b.patterns.points=/^points$/i;b.setAttribute=function(a,c,b){this.patterns.points.test(a)?(b=b||"px",e.setAttribute.call(this,"left",c[0],b),e.setAttribute.call(this,"top",c[1],b)):e.setAttribute.call(this,a,c,b)};b.getAttribute=function(a){return this.patterns.points.test(a)?[e.getAttribute.call(this,"left"),e.getAttribute.call(this,
"top")]:e.getAttribute.call(this,a)};b.doMethod=function(a,b,c){var f=null;this.patterns.points.test(a)?(b=this.method(this.currentFrame,0,100,this.totalFrames)/100,f=d.Bezier.getPosition(this.runtimeAttributes[a],b)):f=e.doMethod.call(this,a,b,c);return f};b.setRuntimeAttribute=function(a){if(this.patterns.points.test(a)){var b=this.getEl(),g=this.attributes,h=g.points.control||[],m,i,k;if(h.length>0&&!(h[0]instanceof Array))h=[h];else{var n=[];for(i=0,k=h.length;i<k;++i)n[i]=h[i];h=n}d.Dom.getStyle(b,
"position")=="static"&&d.Dom.setStyle(b,"position","relative");c(g.points.from)?d.Dom.setXY(b,g.points.from):d.Dom.setXY(b,d.Dom.getXY(b));b=this.getAttribute("points");if(c(g.points.to)){m=f.call(this,g.points.to,b);d.Dom.getXY(this.getEl());for(i=0,k=h.length;i<k;++i)h[i]=f.call(this,h[i],b)}else if(c(g.points.by)){m=[b[0]+g.points.by[0],b[1]+g.points.by[1]];for(i=0,k=h.length;i<k;++i)h[i]=[b[0]+h[i][0],b[1]+h[i][1]]}this.runtimeAttributes[a]=[b];h.length>0&&(this.runtimeAttributes[a]=this.runtimeAttributes[a].concat(h));
this.runtimeAttributes[a][this.runtimeAttributes[a].length]=m}else e.setRuntimeAttribute.call(this,a)};var f=function(a,b){var c=d.Dom.getXY(this.getEl());return a=[a[0]-c[0]+b[0],a[1]-c[1]+b[1]]},c=function(a){return typeof a!=="undefined"};d.Motion=a})();
(function(){var a=function(b,c,d,e){b&&a.superclass.constructor.call(this,b,c,d,e)};a.NAME="Scroll";var d=YAHOO.util;YAHOO.extend(a,d.ColorAnim);var e=a.superclass,b=a.prototype;b.doMethod=function(a,b,d){var j=null;return j=a=="scroll"?[this.method(this.currentFrame,b[0],d[0]-b[0],this.totalFrames),this.method(this.currentFrame,b[1],d[1]-b[1],this.totalFrames)]:e.doMethod.call(this,a,b,d)};b.getAttribute=function(a){var b=null,b=this.getEl();return b=a=="scroll"?[b.scrollLeft,b.scrollTop]:e.getAttribute.call(this,
a)};b.setAttribute=function(a,b,d){var j=this.getEl();a=="scroll"?(j.scrollLeft=b[0],j.scrollTop=b[1]):e.setAttribute.call(this,a,b,d)};d.Scroll=a})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.8.0r4",build:"2449"});

