//refer to sitepoint book pages 109-110. Apparently i've violated the content separation paradigm by calling the function direct from the attribute
//redo function as an object with relation to the core library featured in the book

	function switchmenu(selectedYear)
	{
			var submenu = "submenu" + selectedYear;
			var node = document.getElementById(submenu);
			
			if (node.style.display == "none")
			{
				//style has been switched off previously
				//alert(node.style.display);
				node.style.display="block";
			} else if (node.style.display == "block") {
				//style has been triggered so needs to be closed
				node.style.display="none";
			} else {
				//style is null therefore page is in default state and menu needs to be opened
				node.style.display="block";
			}
			
	}