// Support functions for the HTML results generator.

// Opens the link in the window that opened this one.
function openInMain(url)
{
  opener.location.href=url;
  opener.focus();
}

// Opens a dive sheet popup window
function openWindow(url, diverid, w, h)
{
  if (!w)
  {
    w = 540;
  }
  if (!h)
  {
    h = 320;
  }
  
  var options = 'width=' + w + ',height=' + h + ',';
  options += 'resizable=yes,scrollbars=yes,status=yes,';
  options += 'menubar=no,toolbar=no,location=no,directories=no';
  
  var newWin = window.open(url, 'divesheet_' + diverid, options);
  newWin.focus();
}
