/*	Expanding Menus for Indexhibit
 *		uses jquery
 *
 *	Created by Ross Cairns  Mar 2008
*/


function expandingMenu(num) {
	var speed = 500;
	
	var item_title = $("#menu ul").eq(num).children(":first");
	var items = $("#menu ul").eq(num).children().filter(function (index) { return index > 0; });
	
	/* hide items if not active */
	if (items.is(".active") == false) {
		items.hide();
	}

	/* add click functions + pointer to title */
	item_title.css({cursor:"pointer"}).toggle(
		function () {
			items.show(speed);
			$('ul li.section-title').css("color", "#9F9F9F");
			$(this).css("color", "#7A0000");
		}, function () {
			items.hide(speed);
			$(this).css("color", "#9F9F9F");
		}
	)
	
	/*
	$("ul li.section-title:contains('Vida de vivos')").nextAll().css("marginLeft", "5px");
	$("ul:contains('Vida de vivos')").css("marginBottom", "0");
		
	$("ul:contains('Vida de vivos')").hover(function() {
		$(this).css({"text-decoration" : "underline", "cursor" : "pointer"});
	}, function() {
		$(this).css({"text-decoration" : "none", "cursor" : "auto"});
	});
	*/
}


