﻿/////////////////////////////////////////////////////////////////////////////////////////////////////
// Developer	: Chris Hack
// Date			: 2006/11/28
// Description	: This module provides a code base for dynamically changing styles of tables
// Dependencies : 
/////////////////////////////////////////////////////////////////////////////////////////////////////

var m_hotTrackClass;

function getTableRows(table) {	
	var rows = new Array();
	
	if (table) {	
		var i = 0;
		
		var node = table.childNodes[i];

		while (node) {
			i++;
			if (node.tagName == "TR") rows.push(node);
			else if (node.tagName == "TBODY") {
				table = node;
				i = 0;
			}		
			node = table.childNodes[i];		
		}
	}
	return rows;
}// getTableRows
/////////////////////////////////////////////////////////////////////////////////////////////////////

function registerHotTrackTable(table, className, startRow) {
	tableRows = getTableRows(table);
	m_hotTrackClass = className;

	// TableOptionsList Row Events
	for (i = startRow - 1; i < tableRows.length; i++) {
		tableRows[i].onmouseover = tableRow_MouseOver;
		tableRows[i].onmouseout = tableRow_MouseOut;
	}
}// registerHotTrackTable
/////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////////////////////////////
// Event handlers
/////////////////////////////////////////////////////////////////////////////////////////////////////
function tableRow_MouseOver() {
	this.className = m_hotTrackClass;
}// tableRow_MouseOver
/////////////////////////////////////////////////////////////////////////////////////////////////////

function tableRow_MouseOut() {
	this.className = "";
}// tableRow_MouseOut

