  ////////////
 // Usage: //
////////////
// 
// ImageName -- a unique name for each image to flip
// InitialImage -- URL of first image to load, often the same as DefaultImage
// DefaultImage -- URL of image to return to onMouseUp or onMouseOut
// OverImage -- URL of image to display onMouseOver
// DownImage -- URL of image to display onMouseDown, often the same as OverImage
// this -- Javascript shorthand for affected object,
//         saves having to know full path to object
//
// N.B. not all browsers understand onMouseOver and onMouseOut, so beware.
//
// In <body> of page, you'll need:
// 
// <img name="ImageName" src="InitialImage" [other parameters...]
//   onMouseOver = FlipImage(this, "over")
//    onMouseOut = FlipImage(this, "default")
//   onMouseDown = FlipImage(this, "down")
//     onMouseUp = FlipImage(this, "default")
//  >
// 
// In <head> of page you'll need:
// 
// <script language="javascript" src="effects.js"></script>
// <script language="javascript">
// 
//   AddToFlipList("ImageName", "DefaultImage", "OverImage", "DownImage");
// 
// </script>
////////////

  ///////////////////////////////////////////////////////////////////////
 /// No User Serviceable Parts Beyond This Point ///////////////////////
///////////////////////////////////////////////////////////////////////
//Associative array of Images to flip through
FlipList = new Array();

//Create a two-dimensional array of images to flip between when mousing
//Called from <script> tag.
function AddImageToFlipList(name, Default, MouseOver, MouseDown)
{
  FlipList[name] = new Array();
  if (Default != "") {
    FlipList[name]["default"] = new Image();
    FlipList[name]["default"].src = Default;
  }
  if (MouseOver != "") {
    FlipList[name]["over"] = new Image();
    FlipList[name]["over"].src = MouseOver;
  }
  if (MouseDown != "") {
    FlipList[name]["down"] = new Image();
    FlipList[name]["down"].src = MouseDown;
  }
}

//Flip to the selected image, called by onMouse[Over|Out|Down|Up] in <img> tag
function FlipImage(img, state)
{
  usage = "AddToFlipList('"+img.name+"', DefaultImage, OverImage, DownImage)";
  if(FlipList[img.name]) {
    if(FlipList[img.name][state]) {
      img.src = FlipList[img.name][state].src;
    } else {
      msg = "There's no '"+state+"' image for '"+img.name+"'.  ";
      StatusMessage(msg + usage, 5000);
    }
  } else {
    msg = "The image '"+img.name+"' is not in the FlipList.  ";
    StatusMessage(msg + usage, 5000);
  }
  return;
}

//Show a status message in the window.status bar,
//and erase it after duration milliseconds

var StatusDelay;

function StatusMessage(msg, duration) {
  window.status = msg;
  clearTimeout(StatusDelay);
  StatusDelay = setTimeout("window.status=''", duration);
  return;
}
