//====================================
// DDL Rollover
//
//
// Version: 2.84
//
// Author:   Dawson Cowals
// Created:  06-07-2003
// Modified: 07-10-2003
//
// Requires: ddl_browser.js
//====================================

//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(imgLayer,imgName,imgIndex,imgState) {
  if (document.images) {

	switch (imgState) {
		case 'off':
			//if we are using a newer browser
			if (is_nav6up || is_ie6up || is_gecko || is_opera5up) {
			   changeSrc = eval('document.getElementById(imgName).setAttribute("src",this.imageOffName['+imgIndex+'])');
			//if we are dealing with NS4 and we are inside a layer
			//we have to call the div name first
			} else if (is_nav4up && imgLayer!=null) {
			   changeSrc = eval('document.layers["'+imgLayer+'"].document.images["'+imgName+'"].src=this.imageOffSrc['+imgIndex+'].src');
			//otherwise if we are using IE5 or not accessing an image inside a layer
			} else {
			   document.images[imgName].src = this.imageOffSrc[imgIndex].src;
			}
			break;
		case 'on':
			//if we are using a newer browser
			if (is_nav6up || is_ie6up || is_gecko || is_opera5up) {
			   changeSrc = eval('document.getElementById(imgName).setAttribute("src",this.imageOnName['+imgIndex+'])');
			//if we are dealing with NS4 and we are inside a layer
			//we have to call the div name first
			} else if (is_nav4up && imgLayer!=null) {
			   changeSrc = eval('document.layers["'+imgLayer+'"].document.images["'+imgName+'"].src=this.imageOnSrc['+imgIndex+'].src');
			//otherwise if we are using IE5 or not accessing an image inside a layer
			} else {
			   document.images[imgName].src = this.imageOnSrc[imgIndex].src;
			}
			break;
	}
  }

}



