// Bill Weinman's Generic Rollover Engine
// (c) 2000 William E. Weinman
//
// http://bw.org/
//
// This program is free software. You may modify and distribute it
// as long as you include this notice in all copies.
//
// No other rights are granted. This program is not "public domain".
//

okay = false;  // wait until variables are initialized

var preload = new Array (

///////////////////////////////////////////////////
// list all your images here.
// Remember: No comma after the last image!
//

  "kn1-on.gif",   "kn1-off.gif",
  "kn2-on.gif",   "kn2-off.gif",
  "kn3-on.gif",   "kn3-off.gif",
  "kn4-on.gif",   "kn4-off.gif", 
  "kn5-on.gif",   "kn5-off.gif",
  "kn6-on.gif",   "kn6-off.gif",
  "kn7-on.gif",   "kn7-off.gif",
  "kn8-on.gif",   "kn8-off.gif",
  "kn9-on.gif",   "kn9-off.gif",
  "kn10-on.gif",  "kn10-off.gif",
  "kn11-on.gif",  "kn11-off.gif",
  "kn12-on.gif",  "kn12-off.gif",
  "kn13-on.gif",  "kn13-off.gif",
  "kn14-on.gif",  "kn14-off.gif",
  "kn15-on.gif",  "kn15-off.gif"

//
// you shouldn't need to modify anything
// below this line
///////////////////////////////////////////////////

  );

// find out what browser this is
with(navigator) {
  code = appCodeName;
  app = appName;
  version = appVersion;
  iver = parseInt(version);
  ua = userAgent;
  }

// this will work in "Mozilla" 3+ (includes MSIE 4)
if ( code == "Mozilla" && iver >= 3 )  okay = true;
else { okay = false; }

if(okay) {
  // compile the RegExp because we use it a lot
  var re = new RegExp();
  re.compile("[\\/.:\\-\\s]", "g");

  // preload the images
  for (var i = 0; i < preload.length; i++) {
    i_preload(preload[i]);
    }
  var preloaded = true
  }

// take a filename and make a legal variable name from it
function iname (img)
{
var s = img.replace(re, "_");
return s;
}

// preload the images
function i_preload(img)
{
if(img) {
  var imgn = iname(img);
  eval(imgn + " = new Image()");
  eval(imgn + ".src = '" + img + "'");
  }
return true;
}

// swap entry function
function swap (name, image)
{
if(!okay) return true; // just leave unless okay

// don't try to do this before the preloading is finished
if(preloaded) document.images[name].src = image;
return true;
}
