
// build and show a pop-up window for help text
//
// tested and works with:
//   Konqueror v3.1.2/linux
//   mozilla v1.5/linux
//   Opera v7.23/linux
//
// JT 20040131 EBI.

// the help window itself
var helpWindow;

// attributes for the pop-up help window
var windowAttributes = "width=300,height=300,toolbar=0,menubar=0,scrollbars=1,resizeable=0,status=0,copyhistory=0,personalbar=0";

// display a help item
// arguments: id - the unique id of the item to display
function showHelp( id ) {

  if( helpWindow == null || helpWindow.closed ) {
    helpWindow = window.open( "", id, windowAttributes );
  } 

  // don't write the same thing twice...
  if( id == helpWindow.id ) return;

  // new bit of text. Write it to the help window
  helpWindow.document.open( "text/html" );
  helpWindow.document.write( document.getElementById( id ).innerHTML );
  helpWindow.id = id;

  // this is probably paranoia, but Opera seems to need it...
  helpWindow.document.close();
}

