// Stripes alternating rows of every table on the page

var ODD = "dark"; // class name of the odd rows
var EVEN = "light"; // class name of the even rows

function getTables () {
	if (!document.getElementsByTagName) return false;
	var tables = document.getElementsByTagName("table");
	for (var i=0; i<tables.length; i++) {
		//alert(tables[i].id);
		stripeTables(tables[i]);
	}
}

function stripeTables(curTable) {
	var odd = false;
	var rows = curTable.getElementsByTagName("tr");
		
	for (var j=0; j<rows.length; j++) {
		var headers = rows[j].getElementsByTagName("th");
			if (headers.length == 0) {
				if (j%2==1) {
					rows[j].className = ODD;
				} else {
					rows[j].className = EVEN;
				}
			}
	}
	return;
}

window.onload = getTables;