// TableRowHighlight.js
// In conjunction with CSS, this script sets the background color of table rows
// alternately, depending on odd/even row count.  Table must be assigned to the highlightTable class, CSS must handle the highlightOffOdd, highlightOffEven, highlightOn classes.
// Updated: 11/04/2006

function highLightRow()
	{
	if (document.getElementById) 
		{
		var tables=document.getElementsByTagName('table');
		for (var tblCounter=0; tblCounter<tables.length; tblCounter++) 
			{
			// Step through table rows.
//			if(tables[tblCounter].className=='highlightTable') 
			if(tables[tblCounter].className.indexOf("highlightTable")!='-1') 
				{
//				alert("highlightTable found in table's class string."); 
				var tblrows=tables[tblCounter].getElementsByTagName('tr');
				for(var rowCounter=0; rowCounter<tblrows.length; rowCounter++) 
					{
					if(tblrows[rowCounter].parentNode.nodeName=='TBODY')	
						{
//				alert("row found in table."); 
						// Is this an odd-numbered row?
						if (rowCounter % 2 == 1) 
							{
							var highlightClass = 'highlightOffOdd'; 
							}
						else var highlightClass = 'highlightOffEven';
							tblrows[rowCounter].className=highlightClass;
						// Handle mousing over a row.
						tblrows[rowCounter].onmouseover=function()
							{
							this.className='highlightOn';
							return false
							}
						if (highlightClass=='highlightOffOdd') 
							{
							tblrows[rowCounter].onmouseout=function()
								{
								this.className='highlightOffOdd';
								return false
								}
							}
						if (highlightClass=='highlightOffEven') 
							{
							tblrows[rowCounter].onmouseout=function()
								{
								this.className='highlightOffEven';
								return false
								}
							}
						}
					}
				}
			}
		}
	}

