var Dropdown=new JS.Class({include:JS.State,initialize:function(A){this._wrapper=Ojay.byId(A);this._toggler=Ojay(this._wrapper.descendants(".dropdown-toggler").node);this._content=Ojay(this._wrapper.descendants(".dropdown-content").node);this._contentContent=Ojay(this._content.children("ol, ul").node);this._wrapper.addClass("activated");this._content.addClass(this.klass.COLLAPSED);this.setState("COLLAPSED");this._toggler.on("mouseover").addClass(this.klass.HOVERED);this._toggler.on("mouseout").removeClass(this.klass.HOVERED);this._toggler.on("click")._(this).toggle()},extend:{COLLAPSED:"collapsed",EXPANDED:"expanded",HOVERED:"hovered",DURATION:0.1,EASING:"easeOut"},states:{COLLAPSED:{expand:function(){this.setState("ANIMATING");var A={height:{from:0,to:this._contentContent.getHeight()}};return this._content.setStyle({overflow:"hidden"}).animate(A,this.klass.DURATION,{easing:this.klass.EASING}).setStyle({overflow:""}).replaceClass(this.klass.COLLAPSED,this.klass.EXPANDED)._(this).setState("EXPANDED")._(this)},toggle:function(){return this.expand()}},EXPANDED:{collapse:function(){this.setState("ANIMATING");var A={height:{to:0}};return this._content.setStyle({overflow:"hidden"}).animate(A,this.klass.DURATION,{easing:this.klass.EASING}).setStyle({overflow:""}).replaceClass(this.klass.EXPANDED,this.klass.COLLAPSED)._(this).setState("COLLAPSED")._(this)},toggle:function(){return this.collapse()}},ANIMATING:{}}})