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