if (typeof(AC) == "undefined") { AC = {}; }


AC.SectionDrawer = Class.create();
Object.extend(AC.SectionDrawer.prototype, AC.Drawer.prototype);
Object.extend(AC.SectionDrawer.prototype, {
	isOpen: false,
	trigger: 			function(){this.toggle();},
	toggle: 			function(){if(!this.isOpen) {this.open();}},
	open: 				function()
						{
							if(this.bureau.locked){return;}
							var afterTransition = function(){Element.show(this.contentElement);}.bind(this);
							if(typeof(this.afterOpen) == 'function'){this.bureau.locked = true;afterTransition = this.afterOpen.bind(this);}
							this.bureau.openingDrawer(this);
							if(typeof(this.beforeOpen) == 'function'){this.beforeOpen();}
							this.isOpen = true;
							Element.removeClassName(this.handle, 'obscured');
							new Effect.Appear(this.contentElement,{afterFinish: afterTransition,duration: this.transitionDuration,queue: {scope: 'sectionalscope'}});
						},
	close: 				function() 
						{
							if(typeof(this.beforeClose) == 'function'){this.beforeClose();}
							this.isOpen = false;
							Element.addClassName(this.handle, 'obscured');
							var afterTransition = function(){if(typeof(this.afterClose) == 'function'){this.afterClose();}}.bind(this)
							new Effect.Fade(this.contentElement, {afterFinish: afterTransition,duration: this.transitionDuration,queue: {scope: 'sectionalscope'}});
						},
reportFinishedOpening: function(){this.bureau.locked = false;}
	
});
