// PRELOADING IMAGES
if (document.images)
{
  help_up   = new Image(); help_up.src   = '../images/help.gif';
  help_over = new Image(); help_over.src = '../images/help_over.gif';
  help_down = new Image(); help_down.src = '../images/help_down.gif';
}
// EVENT HANDLERS
function overButton(name_of_button)
{
  if (document.images)
    eval('document.' + name_of_button + '.src=' + name_of_button + '_over.src');
}

function pressButton(name_of_button)
{
  if (document.images)
    eval('document.' + name_of_button + '.src=' + name_of_button + '_down.src');
}

function releaseButton(name_of_button)
{
  if (document.images)
    eval('document.' + name_of_button + '.src=' + name_of_button + '_up.src');
}

function show_help(which_help)
{
  var helpWindow;
  var the_width  = 600;
  var the_height = 400;

  var left_pos = (screen.width - the_width) / 2;
  var top_pos  = (screen.height - the_height) / 2;

  var the_url      = '';
  var the_name     = 'Help_window';
  var the_settings = '';

  the_url += 'help.php?help=' + which_help;

  the_settings += 'width=' + the_width;
  the_settings += ',height=' + the_height;
  the_settings += ',left=' + left_pos;
  the_settings += ',top=' + top_pos;
  the_settings += ',status=no';
  the_settings += ',menubar=no';
  the_settings += ',toolbar=no';
  the_settings += ',location=no';
  the_settings += ',resizable=no';
  the_settings += ',scrollbars=no';
  the_settings += ',directories=no';
  the_settings += ',copyhistory=no';

  if (!helpWindow || helpWindow.closed)
  {
    helpWindow = window.open(the_url, the_name, the_settings);
  }
  else
  {
    helpWindow = window.open(the_url, the_name, the_settings);
    helpWindow.focus();
  }
}

function the_message(the_message)
{
  var messageWindow;
  var the_width  = 400;
  var the_height = 200;

  var left_pos = (screen.width - the_width) / 2;
  var top_pos  = (screen.height - the_height) / 2;

  var the_url      = '';
  var the_name     = 'message_window';
  var the_settings = '';

  the_url += 'message.php?message=' + the_message;

  the_settings += 'width=' + the_width;
  the_settings += ',height=' + the_height;
  the_settings += ',left=' + left_pos;
  the_settings += ',top=' + top_pos;
  the_settings += ',status=no';
  the_settings += ',menubar=no';
  the_settings += ',toolbar=no';
  the_settings += ',location=no';
  the_settings += ',resizable=no';
  the_settings += ',scrollbars=no';
  the_settings += ',directories=no';
  the_settings += ',copyhistory=no';

  if (!messageWindow || messageWindow.closed)
  {
    messageWindow = window.open(the_url, the_name, the_settings);
  }
  else
  {
    messageWindow = window.open(the_url, the_name, the_settings);
    messageWindow.focus();
  }
}


