/* popup-verse-lwta.js
 * Purpose: Pop up a browser window with a verse,
 *          when link is clicked in a page.
 * Description: Set window size and placement, minimal window decoration.
 *     We want to have the different translations show up
 *     in separate windows.  Seems like we should be able
 *     to do this all in one function, by checking for windowname,
 *     but it doesn't work - it doesn't even get to the next 'if',
 *     just reuses the same window.
 * To use: 1. Make a link as follows:
 *              <a href="somepage.html"
 *                  onClick="return p_popup(this, 'verse_page')">blah blah</a>
 *           replacing 'somepage.html' with filename to link to,
 *                     'blah blah' with whatever words or image 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:      mar 2005 jw - added condition for different size windows.
 *               oct 2004 jw - Works good. 
 */
  function popup_lwta(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!)
   // (Can't seem to put width/height or window params in a variable.)
   window.open(
     href,
     windowname,
     'width=500,height=300,left=200,top=80,resizable=yes,scrollbars=yes,status=no,dependent=yes'
   );

    return false;

  }
// eof 

