/* collapsible menu
 * Mathieu Gagnon <zebrocratie.org>
 */

 // quick and dirty collapsable submenu
	$(function() {
		var loc = window.location;
		$('dl.l-sections dd').each(function() {
			if (window.location.href.match($(this).find('a').attr('href'))) {
				$(this).toggle();
				toggleAll($(this), 'next', 'dd');
				toggleAll($(this), 'prev', 'dd');
			}
		});
		$('dl.l-sections dt')
			.css('cursor', 'pointer')
			.click(function() {
				toggleAll($(this), 'next', 'dd');
			});
	});
	function toggleAll(n, met, tagName) {
		while ( (n = n[met](tagName)).length == 1) {
			n.toggle();
		}
	}


