/*******************************************************************************
 * vim:noet:sw=2:ts=8:sts=8:tw=80:ft=js:ff=unix:
 *******************************************************************************
 * Roll-over code for the navigation on www.elephant.org, originally by
 * cordelia@elephant.org, updated by azazel@elephant.org.
 ******************************************************************************/

var path 	= "http://www.elephant.org/images/sub_nav/button/";
var suffix_on	= "_n.gif";
var suffix_off	= "_f.gif";
var buttons	= new Array ();

function make_button (img_name, file_name)
  {
  var images = new Array ();

  images['on']  = new Image ();
  images['off'] = new Image ();

  images['on'].src  = path + file_name + suffix_on;
  images['off'].src = path + file_name + suffix_off;

  buttons[img_name] = images;
  }

if (document.images)
  {
  make_button ('b1', "news");
  make_button ('b2', "history");
  make_button ('b3', "geography");
  make_button ('b4', "people");
  make_button ('b5', "play");
  make_button ('b6', "guilds");

  make_button ('c1', "b_news");
  make_button ('c2', "b_history");
  make_button ('c3', "b_geography");
  make_button ('c4', "b_people");
  make_button ('c5', "b_play");
  make_button ('c6', "b_guilds");
  }

function rollover (btn)
  {
  if (document.images)
    document.images[btn].src = buttons[btn]['on'].src;
  }

function rollback (btn)
  {
  if (document.images)
    document.images[btn].src = buttons[btn]['off'].src;
  }
