/* $Id: popup.js,v 1.1.1.1 2006/12/12 06:53:43 malte Exp $ */

function showHelp(name) {
	showPopup('help', '/helpOnlineIndex.htm#' + name, 400,600,100,100,true);
}

function showPopup(name, URL, h, w, x, y, scrollbars){

  if (isEmpty(h)) h = 300;
  if (isEmpty(w)) w = 300;

  if (isEmpty(x)) x = 100;
  if (isEmpty(y)) y = 200;

  var defaultOptions = "location=no,menubar=no,resizable=yes,scrollbars=" + (scrollbars ? "yes" : "no") +
  	",status=no,titlebar=no,toolbar=no,directories=no";

  var dimensions = "height=" + h + ",width=" + w + ",top=" + x + ",left=" + y;

  var win = window.open(URL, name, dimensions + "," + defaultOptions);
  win.focus();
}

function showPopupStatus(name, URL, h, w, x, y, scrollbars){

  if (isEmpty(h)) h = 300;
  if (isEmpty(w)) w = 300;

  if (isEmpty(x)) x = 100;
  if (isEmpty(y)) y = 200;

  var defaultOptions = "location=no,menubar=no,resizable=yes,scrollbars=" + (scrollbars ? "yes" : "no") +
  	",status=yes,titlebar=no,toolbar=no,directories=no";

  var dimensions = "height=" + h + ",width=" + w + ",top=" + x + ",left=" + y;

  var win = window.open(URL, name, dimensions + "," + defaultOptions);
  win.focus();
}

/* Return true if object is empty, false otherwise */
function isEmpty(s) {
  if (typeof s == "undefined") return true;
  return ((s == null) || (s.length == 0))
}
