<!-- Start hide script from older browsers.

// File MenuStuff.js
// Functions and processing of drop down menus.

/*
Inserted into the web page with something like:
<script language=JavaScript src="MenuStuff.js"></script>

Then some style definitions are required:

  <STYLE TYPE="text/css">
    .menuTitle { background-color: #FF8C00; position: absolute; 
      top: 91; }
    .menuDropArea { background-color: #CD853F; position: absolute; 
      top: 110; visibility: hidden; }
    .menuDropOne { background-color: #CD853F; position: absolute; 
      top: 91; visibility: hidden; }
    A.menuLink { position: relative; TEXT-DECORATION: none; 
      color: #000000; }
    A.menuLinkOne { position: relative; TEXT-DECORATION: none; 
      color: #FFFFFF; }
  </STYLE>

*/

var Using_IE = false;
var iMenuLeft = 0;  // Menu left or x position.
var iMenuTop = 0;   // Menu down-from-top or y position.
var iMenuWidth = 0;  // Menu width.
var iMenuHeight = 0;  // Menu height.
var iMouseX = 0;    // Mouse left or x position.
var iMouseY = 0;    // Mouse top or y position.
// Current menu name. Set in function showMenu 
// and reset to "" in function hideMenu.
var sPrevMenuName = "";

if (navigator.userAgent.indexOf("MSIE")    != -1 && 
  navigator.userAgent.indexOf("Windows") != -1 && 
  navigator.appVersion.substring(0,1) > 3)
{
  Using_IE = true;
}
else
{
  /*
  The following 2 lines allow onmouseup to execute when the 
  page is clicked for Navigator 4.79. Have to click to get the 
  mouse to work   again, but mousedown and onclick cause worse 
  effects. The called routine must return true or it acts like 
  mouse button was never released.
  */
  window.captureEvents(Event.MOUSEUP);
  window.onmouseup=BodyOnmouseup;
  /*
  Set to capture mouse position for use in menus (hideMenu function). 
  Anytime the mouse moves, the position is recorded in iMouseX and 
  iMouseY by GetMousePos.
  */
  window.captureEvents(Event.MOUSEMOVE);
  window.onmousemove=GetMousePos;

} // End If / Else IE or NN.

// Show a menu.
function showMenu(sMenuName)
{
  // Hide any previous menus before showing a new one.
  if (sPrevMenuName != "") hideMenu(sPrevMenuName)
  
  if (Using_IE)
    document.all[sMenuName].style.visibility = 'visible';
  else
    document.layers[sMenuName].visibility = 'visible';

  // Keep track of previous menu name.
  sPrevMenuName = sMenuName
} // End function showMenu.


/*
Hide a menu.
Called on mouseout in the menu bar text definition.
Called on mouseout in the map definition (if there is one).
sMenuName is the current menu ID name.
- Because the DIV where mouseout is called encloses the SPAN where 
the menu items are, the DIV mouseout is called after the mouseout
in the menu item SPAN.
- SPANs or DIVs containing menu items must be positioned absolutely 
or text under the menu item is pushed down and hideMenu does not 
work properly (the menu is hidden on the 2nd to last menu item 
instead of the last).
*/
function hideMenu(sMenuName)
{
/*
sPrevMenuName used as a flag to determine if should hide previous 
menu. If sPrevMenuName="", there is no menu currently displayed. 
If sPrevMenuName=sMenuName, it is a menu item under the same title.
If it is a new menu name, the mouse has moved to a new menu so the 
previous menu should be hidden.
*/
  if (sPrevMenuName == "") return;

  // Get the current menu postion values (top, left, height width).
  GetMenuPos(sPrevMenuName)

  // Gets here if Not sPrevMenuName == "" and if Using_IE.
  if(Using_IE)
  {    // Get the current mouse postions (top, left).
    GetMousePos()

    /*
    Don't hide the menu if the mouse is inside a menu title or 
    menu item.
    
    The menu name check is included because a mouse position can 
    be within the previous menu and a new menu if the menu title 
    (or image map) and/or dropdown items overlap.
    For Debugging:
    alert('IE iMouseX='+iMouseX+' iMouseY='+iMouseY+' iMenuLeft='
    +iMenuLeft+' iMenuWidth='+iMenuWidth+' iMenuTop='+iMenuTop
    +' iMenuHeight='+iMenuHeight+' sPrevMenuName='+sPrevMenuName
    +' sMenuName='+sMenuName); 
    */

    if 
    (
      ( iMouseX > iMenuLeft+5 )
      && ( iMouseX < iMenuLeft+iMenuWidth-5 ) 
      && ( iMouseY >= iMenuTop+2 ) 
      && ( iMouseY < iMenuTop+iMenuHeight ) 
      && ( sPrevMenuName == sMenuName )
    )
    {
      window.event.cancelBubble = true;
      return;
    }

    // Hide the menu.
    document.all[sPrevMenuName].style.visibility = 'hidden';
    window.event.cancelBubble = true;

  } // End if using IE.

  else // NAVIGATOR: Not using_IE.
  {
    /* 
    iMouseX and iMouseY are captured in GetMousePos via captureEvents.
    For Debugging:
    alert('NN iMouseX='+iMouseX+' iMouseY='+iMouseY+' iMenuLeft='
    +iMenuLeft+' iMenuWidth='+iMenuWidth+' iMenuTop='+iMenuTop
    +' iMenuHeight='+iMenuHeight+' sPrevMenuName='+sPrevMenuName
    +' sMenuName='+sMenuName);
    */

    if 
    (
      ( iMouseX > iMenuLeft+5 )
      && ( iMouseX < iMenuLeft+iMenuWidth-5 ) 
      && ( iMouseY >= iMenuTop ) 
      && ( iMouseY < iMenuTop+iMenuHeight ) 
      && ( sPrevMenuName == sMenuName )
    )
    {
      return;
    }
    
    // Use sPrevMenuName in case sMenuName = menu99 from BodyOnmouseup.
    window.document.layers[sPrevMenuName].visibility='hide';

  } // End if using IE / else.

  // Clear prev menu name, it is gone.
  sPrevMenuName = ""

} // End function hideMenu


// Retrieve current menu positions (top, left, height width).
function GetMenuPos(sMenuName)
{
  if(Using_IE)
  {    // Determine the over-from-left location.
    iMenuLeft = document.all(sMenuName).offsetLeft +
      document.all(sMenuName).offsetParent.offsetLeft;
    // Determine the down-from-top location.
    iMenuTop = document.all(sMenuName).offsetTop +
      document.all(sMenuName).offsetParent.offsetTop;
    // Menu width.
    iMenuWidth = document.all(sMenuName).offsetWidth;
    // Menu height.
    iMenuHeight = document.all(sMenuName).offsetHeight;
  }
  else  // Not using IE (using Navigator).
  {
    // Determine the over-from-left location.
    iMenuLeft = document.layers[sMenuName].left;
    // Determine the down-from-top location.
    iMenuTop = document.layers[sMenuName].top;
    // Menu width.
    iMenuWidth = document.layers[sMenuName].document.width;
    // Menu height.
    iMenuHeight = document.layers[sMenuName].document.height;
  }

} // End function GetMenuPos


/*
Retrieve current mouse positions (top, left).

In Navigator the following lines must be executed 
somewhere in the code. This updates everytime the mouse
is moved. The capture events here interfere with the 
mouse capture done in the Pretty Script (circle of stars 
around mouse pointer) found on the home page. To prevent 
this the variable names Xpos and Ypos in the Pretty Script 
were changed to iMouseX and iMouseY.
  window.captureEvents(Event.MOUSEMOVE);
  window.onmousemove=GetMousePos;

*/
function GetMousePos(e)
{
  if(Using_IE)
  {
    iMouseX = event.clientX;
    iMouseY = event.clientY + document.body.scrollTop;
  }
  else  // Not using IE.
  {
    iMouseX = e.pageX;
    iMouseY = e.pageY;
  }
} // End function GetMousePos


/*
- Close current menu if Body clicked. Netscape only.
- For this function to work there must be an initialization like:
    window.captureEvents(Event.MOUSEUP);
    window.onmouseup=BodyOnmouseup;
- Will not work if the current (active) menu ID is menu99.
- A 'not an object' error will occur in the IE routine of hideMenu
  if call with invalid parameter. Therefore not called if Using_IE.
*/
function BodyOnmouseup()
{
  if (!Using_IE) hideMenu('menu99');
  return true;
}


/*
Changes the dropdown menu text color on mouse over / out the text.
bIsMouseOut = false for mouseover or true for mouseout.
Called on onmouseover and onmouseout in the menu item definitions.
*/
function menuChgColor(bIsMouseOut, sMenuItemID) 
{
  if (Using_IE) {

    if (bIsMouseOut)
    {
      // #000000 = black.
      document.all(sMenuItemID).style.color = "#000000";
    }
    else // Is mouse over.
    {
      // #ffffff = white.
      document.all(sMenuItemID).style.color = "#ffffff";
    } // End if (IsMouseout)
    
  }
  else // NAVIGATOR: Not using_IE.
  {
    /*
    Could not get color or background to change in Navigator 4.79. 
    "this.bgColor=" works in the <A> tag if nothing else interferes 
    (due to Navigator bugs).
    */
    if (bIsMouseOut)
    {
      /*
      In IE, the onMouseOut declared in an outer SPAN or DIV is 
      executed for nested inner SPANs and DIVs. NN does not do this, 
      but it does execute the MouseOut for the inner SPAN or DIV.
      This causes a menu hiding problem in NN. Because this routine 
      is called by the inner SPAN or DIV, the following corrects
      the problem. For this to work the sMenuItemID must be in the 
      format menu1_1.
      */
      hideMenu(sMenuItemID.substr(0,5));
    }

  } // End if (Using_IE).

} // End function menuChgColor

// End hide script from older browsers. -->
