//====================================
// DDL Hilite
//
//
// Version: 2.00
//
// Author:   Dawson Cowals
// Created:  06-10-2003
// Modified: 02-04-2004
//
// 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 ddlHilite = new DDLHiliteObj();

//initialize the object
//ddlSelect.initHilite(hiliteBackColorOff,hiliteBorderColorOff,hiliteBackColorOn,hiliteBorderColorOn);

//============================================================================
// DO NOT CHANGE ANYTHING BELOW THIS LINE...
//============================================================================


//DDLSelectObj type constructor
function DDLHiliteObj() {
  //current selection
  this.selectBackColorOn      = "#ffcc66";
  this.selectBorderColorOn    = "#ff9900";
  this.currentBackColorOff    = "#ffffff";
  this.currentBorderColorOff  = "#8f8d87";

  //hilite properties
  this.hiliteBackColorOn      = "#c1d1ec";
  this.hiliteBorderColorOn    = "#4b65a1";
  this.hiliteBackColorOff     = "#ffffff";
  this.hiliteBorderColorOff   = "#8f8d87";

  //member functions
  this.initHilite             = initHilite;
  this.hilite                 = hilite;

}

function initHilite(hiliteBackColorOff,hiliteBorderColorOff,hiliteBackColorOn,hiliteBorderColorOn) {
  //hilite properties
  this.hiliteBackColorOn      = hiliteBackColorOn;
  this.hiliteBorderColorOn    = hiliteBorderColorOn;
  this.hiliteBackColorOff     = hiliteBackColorOff;
  this.hiliteBorderColorOff   = hiliteBorderColorOff;
}


//allows you to change the background color, border color and select if an input cell
//sample call to change back/border color and select input content:
//	hilite('inputName', true, 'on', 'on');
//sample call to turn it back off:
//	hilite('inputName', false, 'off', 'off');
function hilite(objID,doSelect,backOnOff,borderOnOff) {

	var backColor;
	var borderColor;

	if ((backOnOff == 'on') || (borderOnOff == 'on')){
		//grab existing off colors before changing them
		if (is_nav6up || is_ie6up || is_gecko) {
			this.hiliteBackColorOff   = document.getElementById(objID).style.backgroundColor;
			this.hiliteBorderColorOff = document.getElementById(objID).style.borderColor;
		} else if (is_nav4up) {
			this.hiliteBackColorOff   = document.layers[objID].backgroundColor;
			this.hiliteBorderColorOff = document.layers[objID].borderColor;
		} else if (is_ie5up) {
			this.hiliteBackColorOff   = document.all[objID].style.backgroundColor;
			this.hiliteBorderColorOff = document.all[objID].style.borderColor;
		}

	}

	if (backOnOff == 'on') {
		backColor = this.hiliteBackColorOn;
	} else {
		backColor = this.hiliteBackColorOff;
	}

	if (borderOnOff == 'on') {
		borderColor = this.hiliteBorderColorOn;
	} else {
		borderColor = this.hiliteBorderColorOff;
	}

	if (doSelect) {
		//if we are in a text input box, select it
		if (is_nav6up || is_ie6up || is_gecko) {
			document.getElementById(objID).select();
		} else if (is_nav4up) {
			document.layers[objID].select();
		} else if (is_ie5up) {
			document.all[objID].select();
		}
	}

	//do highlight
	if (is_nav6up || is_ie6up || is_gecko) {
		document.getElementById(objID).style.backgroundColor = backColor;
		document.getElementById(objID).style.borderColor = borderColor;
	} else if (is_nav4up) {
		document.layers[objID].backgroundColor = backColor;
		document.layers[objID].borderColor = borderColor;
	} else if (is_ie5up) {
		document.all[objID].style.backgroundColor = backColor;
		document.all[objID].style.borderColor = borderColor;
	}

}



