////////////////////////////////////////////////
//
// Show a popup window containing the specified 
// html page  (called from Main win only)
//
var winPopup;         // the popup window we're playing with here

function showPopupWindow(url, wid, hgt)
  {
  // if the popup window is already present, close it...
  closePopupWindow(); 
  // create a new popup window...
  winPopup = window.open(url, "winPopup", "toolbar=0,scrollbars=0,directories=0,menubar=0,top=100,left=200,width="+wid+",height="+hgt+",resizable=1");
  return false;
  }

////////////////////////////////////////////////
//
// close the popup window
//
// can be called either from the main window 
// or from the popup
//
function closePopupWindow()
  {
  if (winPopup)
    winPopup.close();     // called from creator of winPopup
  else if (window.name == "winPopup")
    window.close();       // called from winPopup itself
  }
  
////////////////////////////////////////////////
//
// return from popup win to (a specific url in) 
// parent win...  (called from winPopup)
//
function backToOpener(url)
  {
  if (url != undefined && url != "")
    opener.location = url;
  window.close();
  }