// TableRowHighlight.js
// In conjunction with CSS, this script sets the background color of table rows
// alternately, depending on odd/even row count.  HTML document must call this script (ex. <body onload="highLightRow();">).  Table must be part of the highlightTable class, CSS must handle the highlightOffOdd, highlightOffEven, highlightOn classes.

function highLightRow()
	{
	if (document.getElementById) 
		{
		var tables=document.getElementsByTagName('table');
		for (var tblCounter=0; tblCounter<tables.length; tblCounter++) 
			{
			if(tables[tblCounter].className=='highlightTable') 
				{
				var tblrows=tables[tblCounter].getElementsByTagName('tr');
				for(var rowCounter=0; rowCounter<tblrows.length; rowCounter++) 
					{
					if(tblrows[rowCounter].parentNode.nodeName=='TBODY')	
						{
						if (rowCounter % 2 == 1) 
							var highlightClass = 'highlightOffOdd'; 
						else var highlightClass = 'highlightOffEven';
							tblrows[rowCounter].className=highlightClass;
						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
								}
							}
						}
					}
				}
			}
		}
	}

