/*-------------------------------------------------------------------
The functions handle a simple menu. To use the menu an id which starts
with menu and then a number must be given to the menu element. The
numbers first value must be 0 and must be increased by 1 for every
further element.
dropdown() -	allows a variable number of menus to be visible. This
							function is recommended for nasted menus.
dropdown1() - allows only one menu open
setStartPosition() - Hides all submenus when the page is loaded


example:
<body onload="setStartPosition()">
<a href="javascript:dropdown(0)">Heading1</a>
<div id="menu0">
Something
</div>

<a href="javascript:dropdown(1)">Heading2</a>
<div id="menu1">
Something
</div>
</body>
-------------------------------------------------------------------*/
function getNumberMenus()
{
	if (!document.all)
		return(false);
	
	var count = 0;
	while(document.getElementById("menu"+count))
		count++;
	
	return(count);
}


function setStartPosition()
{
	var menus = getNumberMenus();
	
	if(document.all)
	{
		for(count = 0; count < menus; count++)
			document.all["menu"+count].style.display="none";
	}
}


function dropdown(pos)
{
	if(!document.all)
		return;
	
	if(document.all["menu"+pos].style.display == "block")
		document.all["menu"+pos].style.display = "none";
	else
		document.all["menu"+pos].style.display = "block";
}


function dropdown1(pos)
{
	if(!document.all)
		return;
	
	var menus = getNumberMenus();
	var cur_menu_stat = "block";
	
	if(document.all["menu"+pos].style.display == "block")
		cur_menu_stat = "block";
	else
		cur_menu_stat = "none";
	
	for (count = 0; count < menus; count++)
		document.all["menu"+count].style.display="none";
	
	if(cur_menu_stat == "none")
		document.all["menu"+pos].style.display="block";
}