var myAccordion = new Class({
	Extends: Accordion,
	
	Implements: Chain,
	
	options: {
		onActive: Class.empty,
		onBackground: Class.empty,
		display: 0,
		show: false,
		height: true,
		width: false,
		opacity: true,
		fixedHeight: false,
		fixedWidth: false,
		wait: false,
		alwaysHide: false,
		is_nested: false
	},
	
	display: function(index){
		index = ($type(index) == 'element') ? this.elements.indexOf(index) : index;
		if ((this.timer && this.options.wait) || (index === this.previous && !this.options.alwaysHide)) return this;
		this.previous = index;
		var obj = {};
		this.elements.each(function(el, i){
			obj[i] = {};
			var hide = (i != index); //|| (this.options.alwaysHide && (el.offsetHeight > 0));
			this.fireEvent(hide ? 'onBackground' : 'onActive', [this.togglers[i], el]);
			for (var fx in this.effects) obj[i][fx] = hide ? 0 : el[this.effects[fx]];
		}, this);
		var ret_val = this.start(obj);
		// this is really frikkin ugly...
		if (this.options.is_nested) {
			if (this.container.getParent().getStyle("height") != "auto" || this.container.getParent().getStyle("height") != '' )
				this.container.getParent().setStyle("height", "auto");
		} 
		return ret_val;
	}
});