/*
* Author: Giovanni Bolognese
* Revision: 1.1
* Date: 19 June 2009
* 
* New version of the functionality for the navigation menu with "Toggle" effect implemented
* making use of JQuery.
*/

$(document).ready(function(){
	activateSliders('navigation_left');
});  

function activateSliders(menuNavID){
	/* Define the onClick event for each item of the navigation menu*/
	$.each(menuItems, function(i, val){
		$('a.'+val).click(function()
		{
			$.each(menuItems, function(subInd,subVal){
				/* If the item is not open, then open it.*/
				if(subVal != val){
					$('ul#'+subVal+':visible').slideToggle('medium');
				} else {
					$('ul#'+subVal).slideToggle('medium');
				}
			});
			/* The actual active menu has to remain open (here we execute a 2nd toggle for
			the active menu, the first time toggled in the here above $.each() loop)*/
			$('#'+menuNavID+' > li.active > ul').slideToggle('medium');
		});
	});
}
