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