var detailBox = {
	codes : Array,
	init : function() {
		detailBox.codes = document.getElementsByClassName('tab');
		detailBox.attach();
	},
	attach : function() {
		var i;
		for ( i=0;i<detailBox.codes.length;i++ ) {
			Event.observe(detailBox.codes[i],'click',detailBox.collapse,false);
			Element.cleanWhitespace(detailBox.codes[i].parentNode);
		}
	},
	getEventSrc : function (e) {
		if (!e) e = window.event;
		if (e.originalTarget)
			return e.originalTarget;
		else if (e.srcElement)
			return e.srcElement;
	},
	collapse : function(e) {
		var el = detailBox.getEventSrc(e).nextSibling;
		Effect.toggle(el.id,'slide', {duration:0.2});
	}
};

// ATTACH ONCLICK EVENT TO ALL ELEMENTS WITH THE l-item CLASS
Event.observe(window,'load',detailBox.init,false);
