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

function expandingMenu(num) {
	var speed = 200; //speed of the dropdown on click
	
	var item_title = $("#menu ul").eq(num).children(":first");  		// Sets the first child of the 'Menu UL' As a varible
	var items = $("#menu ul").eq(num).children().filter(function (index) { return index > 0; }); 		//
	
	if (items.is(".active") == false) { 		//If a li is not active then hide the drop downmenu
		items.hide();								//
	}

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