// Seawasp Popup menus

// pop up/down menu
function menu(p, n, href, mouseclick)
{
  var m, f, i, t, l;

  m = document.getElementsByTagName("iframe");
  f = document.getElementById(href);
  for ( i = 0; i < m.length; i++ )
  {
    if ( m[i] != f )
      m[i].style.display = "none";
  }
  for ( t = 0, l = 0, i = p; i.offsetParent; i = i.offsetParent )
  {
    t += i.offsetTop;
    l += i.offsetLeft;
  }
  // f.style.left = l + 10 + "px";
  // f.style.top = t + 13 + p.offsetHeight + "px";
  // f.style.width = p.offsetWidth + "px";
  // f.style.height = (n * p.offsetHeight) + 7 + "px";
  f.style.left = l + "px"; // + 10 for windows
  f.style.top = t + p.offsetHeight + "px"; // + 14 for windows
  f.style.width = p.offsetWidth + "px";
  f.style.height = (n * p.offsetHeight) + "px";
  click = false;
  if ( mouseclick )             // this was a click
    menu.click = !menu.click;
  f.style.display = (menu.click)? "block": "none";
  return false;
}

// load href into an iframe
function loadmenu(n, href)
{
  var f;

  f  = document.createElement("iframe");
  f.scrolling = "no";
  f.src = href;
  f.setAttribute("class", "popmenu");
  f.setAttribute("id", href);
  f.style.display = "none";
  f.style.position = "absolute";
  document.body.appendChild(f);
  return;
}

function jump(p)
{
  document.getElementById('seawasp').submit();
  return false;
}


