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


function expandingMenu(num) {
	//Davia canviant el valor d'aquesta constant es varia la velocitat de l'animació
	var speedCons = 26;
	var speed = ($("#menu ul").eq(num).children().size()-1)*speedCons;
	
	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);
		}, function () {
			items.hide(speed);
		}
	)
}

 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);
}

$(document).ready(function(){ style_list(0, 'new') });
