//menu stuff
function showLayer(name)
{
   hideAll();
   subx= document.getElementById("s"+name);
   mainx=document.getElementById(name);
   c=document.getElementById("mainmenu");
   subx.style.left=mainx.offsetLeft;
   if(navigator.appName=="Microsoft Internet Explorer") subx.style.left=mainx.offsetLeft+c.offsetLeft;
   subx.style.visibility = "visible";
}

function hideLayer(name)
{
  document.getElementById(name).style.visibility = "hidden";
}

function hideAll()
{
  for(i=1; i<8; i++) { hideLayer("sm"+i); }
}


function containsDOM (container, containee)
{
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

function checkMouseLeave (element, evt)
{
  if (element.contains && evt.toElement) {
    return !element.contains(evt.toElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}
//popup opener
function go(wintype,w,h,command)
{
  st=new String("toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,width="+w+",height="+h);
  picture=window.open(wintype+command,"picture",st);
  picture.window.focus();
}