/*	Expanding Menus for Indexhibit
 *		uses jquery 1.2.1
 *
 *	Originally created by Ross Cairns  Mar 2008
 *	Modified by Kevin Maher  July 2009
*/


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

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

/*	menu group styling*/

function style_list(group, name)
{
    // group is the section - start from 0 when counting
    // name is the class name you will attach to the ul
    $("#menu ul:eq(" + group + ")").addClass(name);
}
