function closeSubMenus(id) {
  var mainItem = document.getElementById(id);
  if (mainItem != undefined) {
    //[TODO] --> is dit goed zo???
    var listItems = mainItem.getElementsByTagName("li")
    for (var i = 0; i < listItems.length; i++) {
      if (listItems.item(i).className == "submenu-open")
        listItems.item(i).className = "submenu";
    }
  }
}

function openSubMenu(id) {
  closeSubMenus("sgp-menu");
  document.getElementById(id).className = "submenu-open";
  return false;
}

function openNewWindow(URL,width,height,windowname) {
  if (windowname == null) windowname = '';
  if (width      == null) width  = 640;
  if (height     == null) height = 480;

  var x,y;
  x = screen.width/2  - width/2;
  y = screen.height/2 - height/2;

  wndNew = window.open(URL, windowname,'width='+width+',height='+height+',scrollbars=yes,resizable=no,screenX='+x+',screenY='+y);
//  wndNew.moveTo(x,y);
  return wndNew;
}

function popupform(myform, windowname) {
  if (!window.focus) return true;
  openNewWindow('', 525, 375, windowname);;

  myform.target=windowname;
  return true;
}

