/* popup_help.js
 * Purpose: Pop up a browser window with help text,
 *          when link is clicked in a main page.
 * Description: Set window size and placement, minimal window decoration.
 * To use: 1. Make a link as follows:
 *              <a href="somepage.html"
 *                  onClick="return p_popup(this, 'help_page')">blah blah</a>
 *           replacing 'somepage.html' with filename to link to,
 *                     'blah blah' with whatever words you want to click on.
 *         2. In the filename to link to, add onLoad="window.focus()"
 *              to the body tag, to make the window come to front for new
 *              click, if it has gone behind.
 *
 * Bugs/caveats: Bug in MSIE: do not put any spaces in the list of properties!
 *               Bug in linux mozilla: status bar shows even if defined as 'no'.
 *               Bug in linux mozilla: onLoad="window.focus()" doesn't work.
 * History:      Works good. october 2004 jw.
 */
  function popup(mylink, windowname) {

    // make window come back to top if it was there from
    //  a previous click but got hidden:
    if (! window.focus) return true;

    // Make sure the link is a link:
    var href;
    if (typeof(mylink) == 'string') {
       href = mylink;
    } else {
       href = mylink.href;
    }

    // Now open the window:
    // bug in MSIE: do not put any spaces in the list of properties!
     window.open(
        href,
        windowname,
        'width=300,height=200,left=50,top=100,resizable=yes,scrollbars=no,status=no,dependent=yes'
    );
    return false;
  }
// eof
