///////////////////////////////////////////////////////////////////
// XHTML Collapsible Menu
///////////////////////////////////////////////////////////////////

// Fucntion which handles sub item show/hide.
function s(element)
{
	// Get all divs in the document
	var a_Div = document.getElementsByTagName('div');
	var x = 0, d;
	while (d = a_Div.item(x++)) 
	{
		// If this div is a sub item
		if (String(d.id).indexOf("item") != -1)
		{
			// If it's the one we clicked
			if (d.id == element)
			{
				// Show or hide it depending on current state
				if (d.style.display == "" || d.style.display == "block")
				{
					d.style.display = "none";
					d.display = "none";
				}
				else if (d.style.display == "none")
				{
					d.style.display = "block";
					d.display = "block";
				}
			}
			else
			{
				// Hide all the others
				d.style.display = "none";	
				d.display = "none";	
			}
		}
    }
}

// This function is simpler and will alow you to have more
// than one branch open at a time
function s2(element)
{
	d = document.getElementById(element);

	if (d.style.display == "" || d.style.display == "block")
	{
		d.style.display = "none";
		d.display = "none";
	}
	else if (d.style.display == "none")
	{
		d.style.display = "block";
	}
}

// Initally hide all items. This means anyone with JavaScript 
// turned off will see ALL menu items all the time
function initMenu()
{	
	var a_Div = document.getElementsByTagName('div');
	var x = 0, d;
	while (d = a_Div.item(x++)) 
	{
		// Loop throught DIVs hiding each that is a sub item
		if (String(d.id).indexOf("item") != -1)
		{
			d.style.display = "none";	
			d.display = "none";	
		}
    }
}