function popup(t,x,y) {
  P = window.open('/popup/' + t,'ImgPopup','height=' + (y + 20) + ',width=' + (x + 20));
  P.focus();
}

var hideTimerID = null;
var selectedSubNav = "";

function showSubNav(name) {
  if (selectedSubNav == name) {
    if (hideTimerID)
      clearTimeout(hideTimerID);
  } else {
    hideSubNavReal();
  }
  if (document.getElementById(name)) {
    selectedSubNav = name;
    document.getElementById(name).style.visibility = "visible";
  }
}

function hideSubNav() {
  hideTimerID = setTimeout("hideSubNavReal()",2000);
}

function hideSubNavReal() {
  if (hideTimerID)
    clearTimeout(hideTimerID);
  if (selectedSubNav && document.getElementById(selectedSubNav)) {
    document.getElementById(selectedSubNav).style.visibility = "hidden";
    selectedSubNav = "";
  }
}

function swapImg(id,src) {
  document.images[id].src = src
}
