// Common code for popout definition/help windows
//   07/05/02  El Buki [ispepsiok@yahoo.com]

// you need to set up a global array like this (with page-specific)
//   status line messages) ... NOTE the null in first position ...
// var glosses = new Array (
//   null,
//   "rollover message 1",
//   "rollover message 2",
//   "etc" ) ;
// alert (glosses);  # just a debug hook

// typical usage within the HTML body:
//  <A HREF="javascript:void"
//           onmouseover="return(gloss(2))"
//           onmouseout="return(gloss(0))"
//           onclick="popout('spanish.htm')"}Spanish</A}
// the 'javascript:void' for link destination prevents the browser
//   jumping back to top of page when the link is clicked.

var popwin = 0;
var virgin = true;      // haven't yet 'popped' out the window  ;)

function popout(URLspec) {

  if ( !popwin || popwin.closed )  {
      popwin = window.open ( '', 'win2', 'width=500,height=400,scrollbars=yes' );
      if ( !popwin.opener )  { popwin.opener = self; }
  }

  if ( popwin )  {
      popwin.location.href = URLspec;
      popwin.focus();
      virgin = false;
  }

  return true;

}

function gloss(sense) {
  window.status = sense  ?  glosses[sense]  : "Document: Done" ;
  return (true);
}

