var YOOFxBase=Fx.Base;if(parseFloat(String(MooTools.version).slice(0,3))>=1.2)YOOFxBase=new Class({Extends:Fx,initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Base is deprecated. use Fx.");this.parent.apply(this,arguments)},step:function(){var a=$time();if(a<this.time+this.options.duration){this.delta=a=this.transition((a-this.time)/this.options.duration);this.setNow();this.set(this.compute(this.from,this.to,a));this.increase()}else{this.set(this.compute(this.from,this.to,1));this.complete()}}});
YOOtoppanel=YOOFxBase.extend({initialize:function(a,b){this.setOptions({offset:320,duration:500,transition:Fx.Transitions.linear},b);this.element=$E(".panel",a);this.wrapper=$E(".panel-wrapper",a);this.container=$E(".panel-container",a);this.margin="top";this.layout="height";this.mode="out";this.now=[];this.parent(this.options)},addTriggerEvent:function(a){a=$E(a);this.element&&a&&a.addEvent("click",function(){this.toggle()}.bind(this))},setNow:function(){if(parseFloat(String(MooTools.version).slice(0,
3))>=1.2)for(var a=0;a<2;a++)this.now[a]=this.compute(this.from[a],this.to[a],this.delta);else for(a=0;a<2;a++)this.now[a]=this.compute(this.from[a],this.to[a])},vertical:function(){return[this.element.getStyle("margin-top").toInt(),this.wrapper.getStyle("height").toInt()]},slideIn:function(){this.container.setStyle("z-index",20);this.mode="in";return this.start(this.vertical(),[0,this.options.offset])},slideOut:function(){this.container.setStyle("z-index",15);this.mode="out";return this.start(this.vertical(),
[-this.options.offset,0])},toggle:function(){return this.wrapper.offsetHeight==0?this.slideIn():this.slideOut()},increase:function(){this.element.setStyle("margin-"+this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)},onComplete:function(){if(this.mode=="out"){this.element.setStyle("margin-"+this.margin,-this.options.offset);this.wrapper.setStyle(this.layout,0);return this}}});
