function hlrow(o) {
// Check if the row's classname already contains hl and respectively remove or add it.
	o.className = (/hl/.test(o.className)) ? o.className.replace('hl', '') : o.className + ' hl';
}

function zebra() {
// Grab each tbody in the table.
	var table = document.getElementById('stripe');
	if (!table) return;
	var tbodys = table.getElementsByTagName('tbody');
// Loop through the rows of the tbodys.
	for (var i = 0; i < tbodys.length; i++) {
		var trs = tbodys[i].getElementsByTagName('tr');
		for (var j = 0; j < trs.length; j++) {
// If the rows contain no headers...
			if (trs[j].getElementsByTagName('th').length === 0) {
// ... add class 'cr' to each second row.
				trs[j].className += (j%2 === 0) ? ' cr' : ' cs';
// Highlight or unhighlight row.
				trs[j].onmouseover = function() {hlrow(this);};
				trs[j].onmouseout = function() {hlrow(this);};
			}
		}
	}
}

if (document.getElementById && document.getElementsByTagName)
	window.onload = zebra;