/*
 * Copyright (c) 2009, The Walt Disney Company All Rights Reserved.
 */

var Fx=fx={};Fx.Base=function(){};Fx.Base.prototype={setOptions:function(_1){this.options=Object.extend({onStart:function(){},onComplete:function(){},transition:Fx.Transitions.quadOut,duration:500,unit:"px",wait:true,fps:30},_1||{});},step:function(){var _2=new Date().getTime();if(_2<this.time+this.options.duration){this.cTime=_2-this.time;this.setNow();}else{setTimeout(this.options.onComplete.bind(this,this.element),10);this.clearTimer();this.now=this.to;}this.increase();},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(_3,to){var _5=to-_3;return this.options.transition(this.cTime,_3,_5,this.options.duration);},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this;},_start:function(_6,to){if(!this.options.wait){this.clearTimer();}if(this.timer){return;}setTimeout(this.options.onStart.bind(this,this.element),10);this.from=_6;this.to=to;this.time=new Date().getTime();this.timer=setInterval(this.step.bind(this),Math.round(1000/this.options.fps));return this;},custom:function(_8,to){return this._start(_8,to);},set:function(to){this.now=to;this.increase();return this;},hide:function(){return this.set(0);},setStyle:function(e,p,v){if(p=="opacity"){if(v==0&&e.style.visibility!="hidden"){e.style.visibility="hidden";}else{if(e.style.visibility!="visible"){e.style.visibility="visible";}}if(v==1&&this.to==1){v=0.99999;this.clearTimer();}if(window.ActiveXObject){e.style.filter="alpha(opacity="+v*100+")";}e.style.opacity=v;}else{e.style[p]=v+this.options.unit;}}};Fx.Style=Class.create();Fx.Style.prototype=Object.extend(new Fx.Base(),{initialize:function(el,_f,_10){this.element=$(el);this.setOptions(_10);this.property=_f.camelize();},increase:function(){this.setStyle(this.element,this.property,this.now);}});Fx.Styles=Class.create();Fx.Styles.prototype=Object.extend(new Fx.Base(),{initialize:function(el,_12){this.element=$(el);this.setOptions(_12);this.now={};},setNow:function(){for(p in this.from){this.now[p]=this.compute(this.from[p],this.to[p]);}},custom:function(obj){if(this.timer&&this.options.wait){return;}var _14={};var to={};for(p in obj){_14[p]=obj[p][0];to[p]=obj[p][1];}return this._start(_14,to);},increase:function(){for(var p in this.now){this.setStyle(this.element,p,this.now[p]);}}});Fx.Transitions={linear:function(t,b,c,d){return c*t/d+b;},sineInOut:function(t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b;},sineOut:function(t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},quadOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},backOut:function(t,b,c,d,s){if(s==undefined){s=1.2;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;}};