// Menu manipulation functions

var activeMenus = Array();

function read_selection(obj, jumpLink)
{
	var menuSection = null;
	var sectionID = null;
	var optionCount = obj.options.length - 1;

	if(obj.selectedIndex == 0)
		return false;
		
	while(activeMenus.length > 0)
	{
		sectionID = activeMenus.pop();
		if(sectionID != optionCount){
			menuSection = 'section' + String(sectionID);
			getElement(menuSection).style.display = 'none';
		}
	}
	
	if(obj.selectedIndex == optionCount){
		for(var i = 0; i < optionCount - 1;  i++)
		{
			activeMenus.push(i);
			menuSection = 'section' + String(i);
			getElement(menuSection).style.display = 'block';
		}
	}	
	else{
		activeMenus.push(obj.selectedIndex - 1);
		menuSection = 'section' + String(obj.selectedIndex - 1);
		elem = getElement(menuSection)//
		elem.style.display = "block";
	}
	
	if(arguments.length > 1)
		document.location.hash = jumpLink;
}
