// Ke svoji funkci potrebuje modul event_attacher.js

function tableRower(cl, clrs)
	{
	// all tables with this class will be affected by this script
	tableClass = cl;

	// values of colors that should be used to highlight rows
	rowColors = clrs;
	
	tables = document.getElementsByTagName("table");
	for (tableI = 0; tableI < tables.length; tableI++)
		{
		if (tables[tableI].className == tableClass)
			{
			rows = tables[tableI].getElementsByTagName("tr");
			colorNumber = 0;
			for (row = 0; row < rows.length; row++)
				{
				if (rows[row].getElementsByTagName("th").length < 1)
					{
					rows[row].style.backgroundColor = rowColors[colorNumber];
					colorNumber++;
					if (colorNumber == rowColors.length) {colorNumber = 0;}
					}
				}
			}
		}
	}


function tableHighlighter(cl, clr)
	{
	// all tables with this class will be affected by this script
	tableClass = cl;

	// values of colors that should be used to highlight rows
	hlColor = clr;
	tables = document.getElementsByTagName("table");
	for (tableI = 0; tableI < tables.length; tableI++)
		{
		if (tables[tableI].className == tableClass)
			{
			rows = tables[tableI].getElementsByTagName("tr");
			for (row = 0; row < rows.length; row++)
				{
				if (rows[row].getElementsByTagName("th").length < 1)
					{
					addEvent(rows[row], "mouseover", tableHighlight);
					addEvent(rows[row], "mouseout", tableHighlight);
					}
				}
			}
		}
	}

function tableHighlight(e) {
	if (!e && window.event) e = window.event;
	if (!e.target) {actElm = e.srcElement.parentElement;}
	else {actElm = e.currentTarget;}
	if (e.type == "mouseover") {trBg = hlColor; actBgColor = actElm.style.backgroundColor;}
	else {trBg = actBgColor;}
	actElm.style.backgroundColor = trBg;
}

