// Fucntion which handles sub item show/hide.
function s(element)
{	
	// Get the nav LI elements
	var navitems = document.getElementById('productnav').childNodes;
	
	var x = 0, subs;
	
	for(x=0; x<navitems.length; x++)
	{
		var subs = navitems[x].childNodes;
		
		for(i=0; i<subs.length; i++)
		{
			// If this div is a sub item
			if(subs[i].nodeName == 'UL' && String(subs[i].id).indexOf("sub") != -1)
			{
				// If it's the one we clicked
				if (subs[i].id == element)
				{
					// Show or hide it depending on current state
					subs[i].style.display = (subs[i].style.display != 'block') ? 'block' : 'none';
				}
				else
				{
					// Hide all the others
					subs[i].style.display = 'none';
				}
			}
		}
    }
}

addEvent(window, 'load', function() { s('sd'); });