// stripeTable + add rowshighlighting

window.onload = init;

function init() {
//	stripeAllTables();
	stripeTableById('table1');
	stripeTableById('table2');
    stripeTableByIdOnly('table4');
    stripeTableByIdOnly('table5');
    stripeTableByIdOnly('table6');
    stripeTableByIdOnly('table7');
    stripeTableByIdOnly('table8');
}

function stripeTable(t) {
	var i, odd = true;
	for (i=0; i<t.rows.length; i++) {
		// add trhighlighting to striped table
        t.rows[i].onmouseover = function() { this.className += " trOver"; return false }
        t.rows[i].onmouseout = function() { this.className = this.className.replace(" trOver", ""); return false }
        t.rows[i].className += odd ? ' odd' : ' even';
		odd = !odd;
		}
}

function stripeTableOnly(t) {
	var i, odd = true;
	for (i=0; i<t.rows.length; i++) {
        t.rows[i].className += odd ? ' odd' : ' even';
		odd = !odd;
		}
}

function stripeTableById(id) {
	var t = document.getElementById(id);
	if (t) stripeTable(t);
}

function stripeTableByIdOnly(id) {
	var t = document.getElementById(id);
	if (t) stripeTableOnly(t);
}

function stripeAllTables() {
	var t = document.getElementsByTagName('TABLE');
	for (var i=0; i<t.length; i++) stripeTable(t[i])
}

