// Tabellenzeilen mit Maus hervorheben

//~ <script>
var TABCLASS_LS= 'inc_main';
var Ls_Table= document.getElementsByTagName('table');

for (var i= 0; i<Ls_Table.length; i++) {
	if (Ls_Table[i].className && Ls_Table[i].className==TABCLASS_LS) tableLineStress(Ls_Table[i]);
}


function tableLineStress(Table)
{
	var Clr= LS_CLR;
	var TableBody= Table.tBodies[0];
	var CurrentRow;
	
	Table.onmousemove = function(Event)
	{
		if (!Event) Event= window.event;
		var Cell= Event.srcElement || Event.target;
		if (!Cell || Cell.tagName.toLowerCase()!='td') return;
		if (typeof Cell.rowIndex=='undefined') Cell.rowIndex= getRow(Cell,Cell.cellIndex);
		if (!CurrentRow || CurrentRow!=Cell.rowIndex) markRow(Cell.rowIndex);
	}
	
	function markRow(MarkRow)
	{
		if (CurrentRow && CurrentRow!=MarkRow) {
			// unmark
			for (var i=0; i<TableBody.rows[MarkRow].getElementsByTagName('td').length; i++) 
				TableBody.rows[CurrentRow].cells[i].style.backgroundColor= '';
		}
		for (var i= 0; i<TableBody.rows[MarkRow].getElementsByTagName('td').length; i++) 
			TableBody.rows[MarkRow].cells[i].style.backgroundColor= Clr;
		CurrentRow= MarkRow;
	}
	
	function getRow(Cell,Col)
	{
		for (var i= 0; i<TableBody.rows.length; i++) {
			if(TableBody.rows[i].cells[Col]==Cell) return i;
		}
	}
}
//~ </script>
