function HexMenuDisplay(idPlaceToShow, idDivHead, idDivToShow, offX, offY, headHeight, bIsRight)
{
  if(document.lastDivToShow == idDivToShow)
  {
    clearTimeout(document.oMenuTimeOut);
  }
  else if(document.lastDivToShow != 0)
  {
    clearTimeout(document.oMenuTimeOut);
    HexMenuTimeOut();
  };
  document.lastHeadToShow = idDivHead;
  document.lastDivToShow = idDivToShow;
  document.lastTargetToShow = idPlaceToShow;
  ShowDivEx(idPlaceToShow, idDivHead, offX, offY, bIsRight);
  ShowDivEx(idPlaceToShow, idDivToShow, offX, offY + headHeight, bIsRight);
}

function ReleaseHexMenu()
{
  document.oMenuTimeOut = setTimeout("HexMenuTimeOut()", MENUDELAY_DISAPPEAR);
}

function HexMenuTimeOut()
{
  HideDiv(document.lastTargetToShow, document.lastHeadToShow);
  HideDiv(document.lastTargetToShow, document.lastDivToShow);
}

function HoverAtMenu(menuID, itemID)
{
  var oBG = document.getElementById('entrybg'+menuID+'m'+itemID);
  var oText = document.getElementById('entrytext'+menuID+'m'+itemID);
    
  oText.className = 'popupmenu_link_hover';
  oBG.className = 'popupmenu_menuholder_field_hover';
  
  document.lastMenuID = menuID;
  document.lastHoverID = itemID;
}

function ExitMenu()
{
  var oBG = document.getElementById('entrybg'+document.lastMenuID+'m'+document.lastHoverID);
  var oText = document.getElementById('entrytext'+document.lastMenuID+'m'+document.lastHoverID);
  
  oText.className = 'popupmenu_link';
  oBG.className = 'popupmenu_menuholder_field';
}

function HexSubMenuDisplay(idPlaceToShow, idDivToShow, offX, offY, bIsRight)
{
  if(document.lastSubDivToShow == idDivToShow)
  {
    clearTimeout(document.oSubMenuTimeOut);
  }
  else if(document.lastSubDivToShow != 0)
  {
    clearTimeout(document.oSubMenuTimeOut);
    HexSubMenuTimeOut();
  };
  document.lastSubDivToShow = idDivToShow;
  document.lastSubTargetToShow = idPlaceToShow;
  ShowDivEx(idPlaceToShow, idDivToShow, offX, offY, bIsRight);
}

function ReleaseHexSubMenu()
{
  document.oSubMenuTimeOut = setTimeout("HexSubMenuTimeOut()", MENUDELAY_DISAPPEAR);
}

function HexSubMenuTimeOut()
{
  HideDiv(document.lastSubTargetToShow, document.lastSubDivToShow);
}

function HoverAtSubMenu(menuID, itemID)
{
  var oBGLeft = document.getElementById('subentrybg'+menuID+'m'+itemID+"_left");
  var oBG = document.getElementById('subentrybg'+menuID+'m'+itemID);
  var oBGRight = document.getElementById('subentrybg'+menuID+'m'+itemID+"_right");
  var oText = document.getElementById('subentrytext'+menuID+'m'+itemID);
    
  oText.className = 'popup_submenu_link_hover';
  oBGLeft.className = 'popup_submenu_menuholder_field_hover';
  oBG.className = 'popup_submenu_menuholder_field_hover';
  oBGRight.className = 'popup_submenu_menuholder_field_hover';
  
  document.lastSubMenuID = menuID;
  document.lastHoverID = itemID;
}

function ExitSubMenu()
{
  var oBGLeft = document.getElementById('subentrybg'+document.lastSubMenuID+'m'+document.lastHoverID+"_left");
  var oBG = document.getElementById('subentrybg'+document.lastSubMenuID+'m'+document.lastHoverID);
  var oBGRight = document.getElementById('subentrybg'+document.lastSubMenuID+'m'+document.lastHoverID+"_right");
  var oText = document.getElementById('subentrytext'+document.lastSubMenuID+'m'+document.lastHoverID);
  
  oText.className = 'popup_submenu_link';
  oBGLeft.className = 'popup_submenu_menuholder_field';
  oBG.className = 'popup_submenu_menuholder_field';
  oBGRight.className = 'popup_submenu_menuholder_field';
}
