
  //..... ..... ..... .....

  var _descendent=new Object();

  _descendent["Main"]=[
    "SubMenuInformation",
    "SubMenuOurWork",
    "SubMenuGetInvolved"
  ];

  _descendent["SubMenuOurWork"]=[
    "SubMenuPositiveOptions",
    "SubMenuHealthPromotion",
    "SubMenuEducationAndCampaigns"
  ];

  _descendent["Page"]=[
    "SubMenuInternal",
    "SubMenuRelated"
  ];

  //..... ..... ..... .....

  function _surid(_id)
  {
    return _id.substr(7);
  };
    //ie strip "SubMenu" from _id to get the id of the element raising the submenu
    //eg element AboutHIV raises submenu SubMenuAboutHIV

  //..... ..... ..... .....

  function _setMenu(_id)
  {
    var _subMenu=document.getElementById(_id);
    if (!_subMenu) {return;};
    with (_subMenu.style)
    {
      display="inline";
      visibility="visible";
    };

    if (_surid(_id)=="None") {return;};

    //.....set trigger's foreground color..
    //var _surMenu=document.getElementById(_surid(_id));
    //with (_surMenu.style)
    //{
    //  color="#fbe4b6"; 
    //};
  };

  function _clearMenu(_id)
  {
    var _subMenu=document.getElementById(_id);
    if (!_subMenu) {return;};
    with (_subMenu.style)
    {
      display="none";
      visibility="hidden";
    };

    if (_surid(_id)=="None") {return;};

    //var _surMenu=document.getElementById(_surid(_id));
    //with (_surMenu.style)
    //{
    //  color="#ffffff"; 
    //};
  };

  //..... ..... ..... .....recursively clear submenus from this level

  function _clearSubTree(_pid)
  {
    if (typeof _descendent[_pid]!="undefined")
    {
      var _i, _n;
      var _subMenuList=_descendent[_pid];
      _n=_subMenuList.length;

      for (_i=0; _i<_n; _i++)
      {
        _clearSubTree(_subMenuList[_i]);
        _clearMenu(_subMenuList[_i]);
      };
    };
  };

  //..... ..... ..... .....top level calls from HTML context

  var _timeoutId=new Object();

  var _latency=300; //millisecs

  function _setHideMenu(_id) //onmouseout menu boundary
  {
    _timeoutId[_id]=setTimeout("_clear('"+_id+"')", _latency); //delay closing menu for _latency millisecs
  };

  function _clearHideMenu(_id) //delete any pending onmouseout close menu event
  {
    clearTimeout(_timeoutId[_id]);
  };

  function _showMenu(_id, _parentId) //onmouseover trigger
  {
    _clear(_parentId);
    _setMenu(_id);
  };

  function _clear(_parentId)
    //clear back to parent submenu level, on mixed menu triggers which don't have submenus
  {
    _clearHideMenu(_parentId);
    _clearSubTree(_parentId);
  };
    //for menus _parentId with mixed link and submenu trigger elements, all link-only elements
    //need to _clear descendent menus of _parentId

  //..... ..... ..... .....

  function _clearAll(_pid) //if using more than one menu tree on a page, respect boundaries
  {
    _clearHideMenu(_pid);
    _clearSubTree(_pid);
  };

  //..... ..... ..... .....//

