/*
trhover.js
*/
//global background color variable
//set this to change the hover background color
var BACKGROUND_COLOR = "#eaeaea";
	function trhover() {
	//sets up all rows in all tables to have the hover effect.
	var tables = document.getElementsByTagName("table"),
        thisTable, thisRow, rowcount=0, tablecount=0;
         //loop through all tables in the document.
	while (thisTable = tables[tablecount++]) {
                //loop through all table rows in the current table
		while (thisRow = thisTable.rows[rowcount++]) {
                        //set table row functions for mouseover/out
			thisRow.onmouseover = turnOn;
			thisRow.onmouseout = turnOff;
		}
                 //reset the row counter for the next table
                rowcount = 0;
	}
}

function turnOn() {
	//this function sets the row’s background
        //color on mouseover
	this.style.backgroundColor = BACKGROUND_COLOR;
}

function turnOff() {
	//this function sets the row’s background
        //color back to normal
	this.style.backgroundColor = "";
}

window.onload = trhover;
