// ID(s) of CSS Horizontal UL menus, separated by commas 
var ListMenuIDs = ["navigation_menu"]

// This offsets the submenus from main menu, value in pixels.  Default: 0 
var SubMenuOffsetPx = -1

function listMenuOnMouseOver () {
  // Move the menu to the top of the display order and make it visible 

  this.style.zIndex = 1000
  this.getElementsByTagName ("ul") [0].style.visibility = "visible"
  this.getElementsByTagName ("ul") [0].style.zIndex = 0
}


function listMenuOnMouseOut () {
  // Move the menu to the bottom of the display order and hide it 

  this.style.zIndex = 0
  this.getElementsByTagName ("ul") [0].style.visibility = "hidden"
  this.getElementsByTagName ("ul") [0].style.zIndex = 1000
}


function createListMenu () {

  var ultags;
  var i;
  var spanref;

  for (i=0; i<ListMenuIDs.length; i++) {
    ultags = document.getElementById (ListMenuIDs [i]).getElementsByTagName ("ul")

    for (var t=0; t<ultags.length; t++) {
      ultags[t].style.top = ultags[t].parentNode.offsetHeight + SubMenuOffsetPx + "px"
      spanref = document.createElement ("span")
      spanref.className = "arrowdiv"
      spanref.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;"

      ultags[t].parentNode.getElementsByTagName ("a") [0].appendChild (spanref)
      ultags[t].parentNode.onmouseover = listMenuOnMouseOver
      ultags[t].parentNode.onmouseout = listMenuOnMouseOut
    }
  }
}

if (window.addEventListener) {
  window.addEventListener ("load", createListMenu, false)
} else if (window.attachEvent) {
  window.attachEvent ("onload", createListMenu)
}


