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