
// Function for showing/hiding sub menus in the main menu.
function showHide(id)
{
		// Get elements of interest (Icon clicked and the submenu)
		var obj = document.getElementById(id);		
		var img = document.getElementById('img_'+id);

		// If the submenu is visible, hide it
		if(obj.offsetHeight > 0)
		{
			obj.style.visibility='hidden';
			obj.style.height='0px';
			img.src = "img/expandable.png";
			img.className = "expand";
			img.title = "Ekspander";
			
			// Also hide all the submenus of the submenu
			var children = obj.getElementsByTagName('ul');			
			for(var i=0; i<children.length; i++)
			{
				children[i].style.visibility='hidden';
				children[i].style.height='0px';			
				
				// Update expandable/collapsable images
				var childImages = obj.getElementsByTagName("img");				
				for(var j=0; j<childImages.length; j++)
				{
					childImages[j].src = "img/expandable.png"; 
					childImages[j].title = "Ekspander";
					childImages[j].className = "expand";
				}
			}
		}
		else
		{
			// If UL is hidden, show it.
			obj.style.visibility='visible';
			obj.style.height='auto';
			img.src = "img/collapsable.png";
			img.title = "Minimer";
			img.className="collapse";
		}
	}