function open_window(url, w_name, w_width, w_height)
{
  var myWindow;
  var w_toolbar     = 'no';
  var w_location    = 'no';
  var w_directories = 'no';
  var w_status      = 'no';
  var w_menubar     = 'no';
  var w_scrollbars  = 'yes';
  var w_copyhistory = 'no';
  var w_resizable   = 'no';

  var w_pos_left    = parseInt((screen.availWidth/2)-(w_width/2));
  var w_pos_top     = parseInt((screen.availHeight/2)-(w_height/2));

  var window_controls    = 'width='+w_width+
                           ', height='+w_height+
                           ', left='+w_pos_left+
                           ', top='+w_pos_top+
                           ', toolbar='+w_toolbar+
                           ', location='+w_location+
                           ', directories='+w_directories+
                           ', status='+w_status+
                           ', menubar='+w_menubar+
                           ', scrollbars='+w_scrollbars+
                           ', copyhistory='+w_copyhistory+
                           ', resizable='+w_resizable;

  if (!myWindow || myWindow.closed)
  {
    // Not opened, or no longer open
    myWindow = window.open(url, w_name, window_controls);
  }
  else
  {
    // Already open, so bring to front
    myWindow.focus();
  }
}

