
//
// rollover object and methods //
//

// rollover 'add' method //
function rollObjAdd(imgName, srcOn, srcOff) {
	if (document.images) {
    this.items[this.count] = new Object();      // create new object - required for NN3 //
		this.items[this.count].name = imgName;      // set rollover image name //
		this.items[this.count].on = new Image();    // set rollover image "on" source //
		this.items[this.count].on.src = srcOn;      // preload rollover "on" //
		this.items[this.count].off = new Image();   // set rollover image "off" source //
		this.items[this.count].off.src = srcOff;    // preload rollover "off" //
		this.items[this.count].enabled = true;      // set rollover to enabled by default //
    this.count++;                               // increment the image count by 1 //
    return (this.count - 1);                    // returns the array index as an id //
		}
	}

// rollover 'on' method //
function rollObjOn(imgID) {
  // perform functionality only if image object exists -- does not function for IE3 (or 2.0 or earlier browsers) //
	if ((document.images) && (this.enabled) && (this.items[eval(imgID)].enabled)) {
    // sets the image source to rollover "on" source //
    document.images[this.items[eval(imgID)].name].src = this.items[eval(imgID)].on.src;
    }
	}

// rollover 'off' method //
function rollObjOff(imgID) {
  // perform functionality only if image object exists -- does not function for IE3 (or 2.0 or earlier browsers) //
	if ((document.images) && (this.enabled) && (this.items[eval(imgID)].enabled)) {
    // sets the image source to rollover "off" source //
    document.images[this.items[eval(imgID)].name].src = this.items[eval(imgID)].off.src;
    }
	}

// rollover 'enable' method //
function rollObjEnable(imgName) {
  // disable rollover with supplied name //
  for (intCounter = 0; intCounter < this.count; intCounter++) {
	  if (this.items[intCounter].name == imgName) this.items[intCounter].enabled = true;
    }
	}

// rollover 'disable' method //
function rollObjDisable(imgName) {
  // disable rollover with supplied name //
  for (intCounter = 0; intCounter < this.count; intCounter++) {
	  if (this.items[intCounter].name == imgName) this.items[intCounter].enabled = false;
    }
	}
  
// rollover object (rollObj) constructor //
function rollObj() {
  this.items = new Array;             // creates item array -- each will have name/on/off properties //
  this.add = rollObjAdd;              // defines add method -- used to add a rollover item to the item array //
  this.on = rollObjOn;                // defines on method -- changes a rollover image object's source to the "on" source //
  this.off = rollObjOff;              // defines off method -- changes a rollover image object's source to the "off" source //
  this.enable = rollObjEnable;        // defines enable method -- makes a defined rollover work //
  this.disable = rollObjDisable;      // defines disable method -- makes a defined rollover not work //
  this.count = 0;                     // initializes rollover count to none (zero) //
  this.enabled = false;               // initializes enabled flag to false //
  }
	
//
//
//

