function openAppletWindow(url) {
  var path = getPath(url) + "/splash.htm";
  path = ""; // todo
  var appletWindow = open(path, "applet", "width="+screen.availWidth+",height="+screen.availHeight+",location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,top=0,left=0");

  if (!(appletWindow.location.pathname == url)) {
    appletWindow = null;
  }

  if (appletWindow == null) {
    url = url + location.search;
    appletWindow = open(url, "applet", "width="+screen.availWidth+",height="+screen.availHeight+",location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,top=0,left=0");
  } else {
    appletWindow.focus();
    appletWindow.document.sMOTIVEApplet.gotoRequest(location.search);
  }
}

function openAppletWindowAndClose(url) {
  openAppletWindow(url);

  opener = top;           // for IE (opener must be defined to suppress popup)
  open('','_parent','');  // for Mozilla (otherwise window is not closed)
  close();
}

function getPath(url) {
  var index = url.lastIndexOf("/");
  var path = url.substring(0, index);
  return path;
}

