var listing = {
	codes : Array,
	init : function() {
		listing.codes = document.getElementsByClassName('l-item');
		listing.attach();
	},
	attach : function() {
		var i;
		for ( i=0;i<listing.codes.length;i++ ) {
			Event.observe(listing.codes[i],'click',listing.collapse,false);
			Element.cleanWhitespace(listing.codes[i].parentNode.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 = listing.getEventSrc(e).parentNode.nextSibling;
		Effect.toggle(el.id,'slide', {duration:0.2});

		if (el.style.display == "none") {
			listing.getEventSrc(e).style.backgroundImage = "url('"+imgroot+"/includes/images/imgBulletOn.jpg')";
		} else {
			listing.getEventSrc(e).style.backgroundImage = "url('"+imgroot+"/includes/images/imgBullet.jpg')";
		}
	}
};

// ATTACH ONCLICK EVENT TO ALL ELEMENTS WITH THE l-item CLASS
Event.observe(window,'load',listing.init,false);
