function openWindow(strWindowName, strUrl, intWidth, intHeight, strOptions) {
  var params;
  var agent = navigator.userAgent;
  var strName	      = strWindowName;  
  var intTopPos       = Math.round(screen.height/6);
  var intLeftPos      = Math.round(screen.width/6);
  if ((intTopPos + intHeight) > screen.height) {
	intTopPos -= ((intTopPos + intHeight) - screen.height) + 24;
  }
  if ((intLeftPos + intWidth) > screen.width) {
	intLeftPos -= ((intLeftPos + intWidth) - screen.width) + 24;
  }
  params = "";
  params += "height=" + intHeight + ","
  params += "width=" + intWidth + ","  
  params += "left=" + intLeftPos + ","
  params += "top=" + intTopPos + ","
  if (!strOptions) {
	params += "alwaysRaised=0,"
	params += "directories=0,"
	params += "fullscreen=0,"
	params += "location=0,"
	params += "menubar=0,"
	params += "resizable=0,"
	params += "scrollbars=0,"
	params += "status=0,"
	params += "toolbar=0"
  } else {
    params += strOptions;
  }
  var win = window.open(strUrl,strName,params);	
  if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
    win = window.open(strUrl,strName,params);
  }
  if (!win.opener) {
    win.opener = window;
  }    
}

