/* This function alternates the background color of table rows between 
	white and gray by placing a class of "odd" on every other row. 
	This function applies to tables that contain a class of 'graybarTable'.*/

function alternateOddRowsInGraybarTables () {
	/* sanity check */
	if (!document.getElementsByTagName) {
		return;
	}

	var tables = document.getElementsByTagName("table");
	for (var i = 0; i < tables.length; ++i) {
		var table = tables[i];
		if (!table.className || !/\bgraybarTable\b/.test(table.className)) {
			continue;
		}

		var els = table.getElementsByTagName("tbody");
		if (!els || !els.length) continue;
		var tbody = els[0];

		var rows = tbody.getElementsByTagName("tr");
		if (!rows || !rows.length) continue;
		for (var j = 0; j < rows.length; j += 2) {
		rows[j].className = rows[j].className + " odd";
		}
	}
}