// 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 stripeTables() {
	if (!document.getElementsByTagName) return false;
	var tables = document.getElementsByTagName("table");
	
	for (var i=0; i<tables.length; i++) {
		if(tables[i].getAttribute("class") == "colored") {
			var odd = false;
			var rows = tables[i].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;
					}
				}
			}
		}
	}
}

window.onload = stripeTables;