/* Dependant on the jQuery library. */
/*
 * accordian
 * l: elements to click
 * b: elements to hide or show
 * a: first active element
 * y: sibling tag
*/

$.accordian = function(l, b, a, y) {
	var active = a, running = 0;
	$(b).not(active).hide();
	$(a).show();
	$(l).click(function(e){
		var p = $(this).parent().parent().siblings(y);
		if (running || !p.is(":hidden")) return false;
		running = 2;
		//if ($(active).css("display") != 'none')
			$(active).slideUp('fast', function(){--running;});
		//else { --running;}
		active = '#' + p.slideDown('slow', function(){--running;})[0].id;
		return false;
	})
};

$(function(){
	$.accordian('#dplist/li/strong/span/a.c-exp','#dplist/li/ul','#active','ul');
});

