
schedule("window", initTableHighlights);




function initTableHighlights()
{
	var tables = document.getElementsByTagName("table");
	
	for (var i = 0; i < tables.length; i++)
	{
		if (tables[i].className.match(/(^| )highlightRow( |$)/))
		{
			var tbody = tables[i].getElementsByTagName("tbody")[0];
			var trs = tbody.getElementsByTagName("tr");
			
			for (var k = 0; k < trs.length; k++)
			{
				trs[k].onmouseover = mouseoverTr;
				trs[k].onmouseout = mouseoutTr;
				
				var anchor = trs[k].getElementsByTagName("a")[0];
				
				if (anchor != null)
				{
					addClass(trs[k], "clickable");
					
					trs[k].onclick = clickTr;
				}
			}
		}
	}
	
	return true;
};




function mouseoverTr()
{
	addClass(this, "hover");
	
	return true;
};




function mouseoutTr()
{
	removeClass(this, "hover");
	
	return true;
};




function clickTr()
{
	var anchor = this.getElementsByTagName("a")[0];
	
	window.location = anchor.href;
	
	return false;
};
