/*	Expanding Menus for Indexhibit
 *		uses jquery
 *
 *	Created by Luca Limardo  Set 2010
*/
jQuery(document).ready(function() {
	
	$('#menu .container ul li').hide();
	$('#menu .container ul li.section-title').show().css('cursor','pointer');
	$('#menu .container ul li.active').parent().addClass('selected');
	
	$('#menu .container ul li:not(.section-title)').each(function() {
		var h = $(this).height();
		$(this).hide().css('height', h+'px');
	});
	
	$('.selected li').show();

	$("#menu .container ul li.section-title").click(function(){
		var $parent = $(this).parent();
        var status = $(this).hasClass('selected') ? true : false;

		$('.selected').removeClass('selected').find('li:not(.section-title)').slideUp('fast');
		
		if (!status){
			$(this).parent().addClass('selected');
			$(this).parent().find('li').slideDown('slow');
        }
	});
		
});
