function hideSubMenus()
{
  var divCollection = document.getElementsByTagName("div");
  for (i=0;i<divCollection.length;i++)
  {
    if (divCollection[i].className == "navSubMenu") { divCollection[i].style.display = "none"; }
  }
  setNavBG();
  setPageBtm();
}
function showSubMenu(which)
{
  hideSubMenus();
  document.getElementById(which).style.display = "block";
  setNavBG();
  setPageBtm();
}
function setNavBG()
{
  navHeight = document.getElementById("divNav").offsetHeight;
  navHeight-= 267;
  document.getElementById("imgNavMid").height = navHeight;
}
function setPageBtm()
{
  mainHeight = parseInt(document.getElementById("divMain").offsetHeight) + mainTop;
  navHeight = parseInt(document.getElementById("divNavBG").offsetHeight);
  if (mainHeight > navHeight) { bottomHeight = mainHeight; } else { bottomHeight = navHeight; }
  bottomHeight+= 10;
  document.getElementById("divBottom").style.top = bottomHeight+"px";
}
function swapBG(item,newBack) { item.style.background="url('"+newBack+"') no-repeat"; }
function loadPage(page) { window.location.href=page; }
function loadSite(page) { window.open(page); }
function imgPreload()
{
  var args = imgPreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++) { document.imageArray[i] = new Image; document.imageArray[i].src = args[i]; }
}
function viewLarge(id,which,image)
{
  imgPopup = window.open(sDir+'popups/show_img.php?'+which+'='+id+'&img='+image,'imgPopup','width=10,height=10,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0');
  if (window.focus) { imgPopup.focus(); }
}
function breakout() { if (window != top) { top.location.href = document.location.href ; } }
function init()
{
  setNavBG();
  setPageBtm();
  imgPreload(sDir+'images/nav/darkblue_over.jpg', sDir+'images/nav/darkgrey_over.jpg', sDir+'images/nav/greyblue_over.jpg', sDir+'images/nav/lightgrey_over.jpg', sDir+'images/nav/paleblue_over.jpg', sDir+'images/nav/sharpblue_over.jpg');
}
