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