// JavaScript Document

var oldMenuStyle=null; 				/* creates the variable oldMenuStyle and stores nothing inside , also clears if used in prev visited website */



function toggle(currMenuId)			/* gives the javascript function a script element (name) i.e. 'toggle' so the function can be called from html,
											(object) created to store the id named in the html */
{											
	
	
var currMenuStyle=document.getElementById(currMenuId).style;		/* creates variable currMenuStyle to store style in, 
																		looks in the document (html) to find the object by the id	*/





if(oldMenuStyle)						/* checks if script has been used before, i.e. if oldMenuStyle is displaying something then: */

{

oldMenuStyle.display='none';			/* changes the variable oldMenuStlye by changing the css display style to 'none' (hiding it) */

}



currMenuStyle.display='block';			/* changes the variable oldMenuStlye by changing the css display style to 'block' (showing it) */

oldMenuStyle=currMenuStyle;				/* makes the currMenuStyle into the oldMenuStyle ready for line 19 again */


}