function highlightMenu(){
	
   if (!(document.all || document.getElementById)) return;

   var loop = 0;
   var the_layer = '';

   for (loop = 0; loop < highlightMenu.arguments.length; loop++)
   {
		argument = highlightMenu.arguments[loop];
		the_layer = getDOM(the_layer, argument);
		setClass(argument,'highlighted')
	}
	y = new String(argument).split("_");//gets the menu name from the button's id.
	openMenus("menu_"+y[1])//shows the menu that the pages relates to.
}


function openMenus()
{

   if (!(document.all || document.getElementById)) return;

	var allMenus = new Array('menu_0','menu_1','menu_2','menu_3','menu_4','menu_5','menu_6');
	var loop = 0;
	var the_layer = '';

   for (loop = 0; loop < openMenus.arguments.length; loop++)
   {
   argument = openMenus.arguments[loop];//stores the current menu name
	
   if(argument != "menu_6"){//ignore if the box to hide is the "MAIN" box (ABOUT US etc)....
	   expandCollapse(argument)//shows/hides the relevent sub menu
	  flipClass(argument+"Title", 'menuTitle', 'menuTitleOver')//changes the css to 'over' state if selected
   }
 }

}

function expandCollapse(the_block)
{

   if (!(document.all || document.getElementById)) return;

var the_layer = getDOM(the_layer, the_block);

   if (the_layer.display == 'none')
   {
   the_layer.display = 'block';
   }
   else
   {
   the_layer.display = 'none';
   }
  
}

function getDOM(the_layer, div_id) {
   if (document.getElementById) {
	   the_layer = document.getElementById(div_id).style;
   }
   else if (document.all) {
	   the_layer = document.all(div_id).style;
   }
  return the_layer;
}


function setClass(objectID,newClass){
	var object = document.getElementById(objectID);

	if(object.className !== 'highlighted'){
		object.className = newClass;
	 }
	object.blur();

}


function flipClass(ObjectID,newClass,oldClass){

	if (!(document.all || document.getElementById)) return;
	var object = document.getElementById(ObjectID);
	
	  if (object.className == newClass){
		   object.className = oldClass;
	  }else{
		   object.className = newClass;
	  }
}
