var scroll = 1;
var statusValue = 0;
var resizeValue = 1;

function openWindow(theFile, theName, w, h)
{
  if (parseInt(navigator.appVersion) >= 3)
  {
    var winProps;

    if (parseInt(navigator.appVersion) >= 4)
    {
      var leftPos = (screen.width - w) / 1.1;	// horizontal position of popup (wrt to screen LHS)
      var topPos = (screen.height - h) / 3;	// vertical position of popup (wrt to screen top)

      winProps = 'width='+w+',height='+h+',left='+leftPos+',top='+topPos+',scrollbars='+scroll+',status='+statusValue+',resizable='+resizeValue+''; 
    }
    else
    {
      winProps = 'width='+w+',height='+h+',scrollbars='+scroll+',status='+statusValue+',resizable='+resizeValue+'';
    }
    win = window.open(theFile, theName, winProps);
    win.window.focus();
  }
  else
  {
    location = theFile;
  }
}