//====================================
// DDL Rollover
//
//
// Version: 3.07
//
// Author:   Dawson Cowals
// Created:  06-07-2003
// Modified: 01-08-2008
//====================================

//these properties and init functions can be set and called from a page that
//includes this file to provide the ability to make an array of these objects
//and initialize them with different properties

//instantiate our object
var ddlRollover = new DDLRolloverObj();

//IMAGE ROLLOVERS
//
//ddlRollover.addImage(imageIndex,imageOffPath,imageOnPath);

//============================================================================
// DO NOT CHANGE ANYTHING BELOW THIS LINE...
//============================================================================


//DDLRolloverObj type constructor
function DDLRolloverObj() {
  //images needed for mouseovers
  this.imageOffName           = new Array();
  this.imageOnName            = new Array();
  this.imageOffSrc            = new Array();
  this.imageOnSrc             = new Array();

  //member functions
  this.addImage               = addImage;
  this.imageSwap              = imageSwap;
}

function addImage(imgIndex,imgOffSrc,imgOnSrc) {

    //off image name
    this.imageOffName[imgIndex]    = imgOffSrc;
    //on image name
    this.imageOnName[imgIndex]     = imgOnSrc;
    //off image source
    this.imageOffSrc[imgIndex]     = new Image();
    this.imageOffSrc[imgIndex].src = imgOffSrc;
    //on image source
    this.imageOnSrc[imgIndex]      = new Image();
    this.imageOnSrc[imgIndex].src  = imgOnSrc;

}

function imageSwap(imgIndex,imgID,imgState) {
  if (document.images) {

  	switch (imgState) {
  		case 'off':
  			changeSrc = eval('document.getElementById(imgID).setAttribute("src",this.imageOffName['+imgIndex+'])');
  			break;
  		case 'on':
  			changeSrc = eval('document.getElementById(imgID).setAttribute("src",this.imageOnName['+imgIndex+'])');
  			break;
  	}
  }
}


