/*
** SCRIPT: hvml_menu.js
**
** PURPOSE: To control the menu system
**
** AUTHOR: MPSERELLIS Ltd
**
** DATE: 28/12/2008
**       03/03/2009 - Added code to maintain the color state of the selected option while it's sub menu is open
*/

function showSubHVMLmenu(menuItem)
{
  clearTimeout(menuItem.outTimeout);
  menuItem.getElementsByTagName("ul")[0].style.display="block";

  if(menuItem.className!="hvmlHorizontal" && menuItem.className!="hvmlVertical")
  {
    menuItem.getElementsByTagName("a")[0].style.backgroundColor="#A4B182";
    menuItem.getElementsByTagName("a")[0].style.color="white";
  }

}

function setToHideSubHVMLmenu(menuItem)
{
  menuItem.outTimeout = setTimeout(function() {hideSubHVMLmenu(menuItem);}, 300);
}


function hideSubHVMLmenu(menuItem)
{
  menuItem.getElementsByTagName("ul")[0].style.display="none";

  if(menuItem.className!="hvmlHorizontal" && menuItem.className!="hvmlVertical")
  {
    menuItem.getElementsByTagName("a")[0].style.backgroundColor="#CDD3B2";
    menuItem.getElementsByTagName("a")[0].style.color="#131C34";
  }

}

