var HWAccordion = new Class({
	
	// extends the native accordion class from MooTools.More
	Extends: Accordion,
	
	//options
	options:{
        multiOpen: false
	},
	initialize:function(toggles,content,options) {
		this.initialize.__parent.apply(this,arguments);
		toggles.addEvent('click',function(e){e.stop()});
	},
	display: function (A) {
        A = ($type(A) == "element") ? this.elements.indexOf(A) : A;
        if ((this.timer && this.options.wait) || (A === this.previous && !this.options.alwaysHide)) {
            return this;
        }
        this.previous = A;
        var B = {};
        this.elements.each(function (E, D) {
            B[D] = {};
			if(D != A && this.options.multiOpen) {
				return;
			}
            var C = (D != A) || (this.options.alwaysHide && (E.offsetHeight > 0));
            this.fireEvent(C ? "background" : "active", [this.togglers[D], E]);
            for (var F in this.effects) {
                B[D][F] = C ? 0 : E[this.effects[F]];
            }
        }, this);
        return this.start(B);
    },
	show: function (A) {
        A = ($type(A) == "element") ? this.elements.indexOf(A) : A;
        this.previous = A;
        var B = {};
        this.elements.each(function (E, D) {
            B[D] = {};
            var C = ((D != A) || (this.options.alwaysHide && E.offsetHeight > 0)) && !this.options.multiOpen;
            this.fireEvent(C ? "background" : "active", [this.togglers[D], E]);
            for (var F in this.effects) {
                B[D][F] = C ? 0 : E[this.effects[F]];
            }
        }, this);
        return this.start(B);
    },
	showAll: function () {
		if(!this.options.multiOpen) {
			return;
		}
        this.elements.each(function (E, D) {
            this.show(D);
        }, this);
    }
	
	
});
