/*
  Functions and classes to make popup windows more useful.

  Keep a consistant list of Window.open features, and implement 
  "dependant=yes" type behaviour (Netscape only) for all browsers.

  See The Definitive Guide P673 for a list of features.

  Author: Steven Mackenzie
  Copyright Aptile Ltd 2004.
*/

/* nothing happening yet: just bring the window to the foreground

  Call this as the onclick handler in an <a href=... target=...> tag. It 
  will use JavaScript to open the window with the requested features, and
  return false to stop the browser following the link. 

  This allows more control over the opened window, but allows links to be 
  followed by browsers that have JavaScript switched off.
*/
function managePopUp(aTag, windowFeatures) {
  var win;
  if (!windowFeatures) {
    var myWindowFeatures = "resizable,menubar,scrollbars";
  }
  else {
    myWindowFeatures = windowFeatures;
  }
  win = window.open(aTag.href, aTag.target, myWindowFeatures);
  if (win) { //check we got a window, not stopped by a popup blocker
    win.focus();  
    // If we made a Window then return false to stop the normal window open 
    // action of the <a> tag. 
    return false; 
  }
  // The window didn't open, so let the browser do whatever it normally does.
  return true; }

