/*	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.slideToggle("fast");
	}

	/* add click functions + pointer to title  
	item_title.css({cursor:"pointer"}).toggle(
		function () {
			items.show();
		}, function () {
			items.slideToggle("fast");
		}
	)
}
*/



function expandingMenu()
{
	// First we hide all exhibitis

	$("#menu ul li.section-title").nextAll().hide();

	// then the active exhibit is showed

	$("#menu ul").each(function(){
	$(this).find("li.active").prevAll().nextAll().show();
	}); 

	//This is the toggle function

	$("#menu ul li.section-title").click(function(){
	$(this).nextAll().slideToggle("fast");
	
	});
	
}

/*
function expandingMenu() {
	
		$("#menu ul li.section-title").nextAll().hide();
		$("#menu ul").each(function(){
			$(this).find("li.active").prevAll().nextAll().show();
		});
		$("#menu ul li.section-title").click(function(){
			$("#menu ul li.section-title").nextAll().hide();
			$("#menu ul li.section-title").removeClass("active")
			$(this).addClass("active");
			$(this).nextAll().slideToggle("fast");
		});	
	
}
*/
