// this function is need to work around 
// a bug in IE related to element attributes
function hasClass(obj) {
	var result = false;
	if (obj.getAttributeNode("class") != null) {
		result = obj.getAttributeNode("class").value;
	}
	return result;
}	

function stripe(id) {
/* note: comments stripped - see implementation on lra site */
/* note: this will not stripe class'd or background'd rows - check the html */
	var oddColor = arguments[1] ? arguments[1] : "#e9e8ce";
	var evenColor = arguments[2] ? arguments[2] : "#ffffff";
	var even = false;
	var table = document.getElementById(id);
	if (!table) return;
	var tbodies = table.getElementsByTagName("tbody");
	for (var h = 0; h < tbodies.length; h++) {
		var trs = tbodies[h].getElementsByTagName("tr");
		for (var i = 0; i < trs.length; i++) {
			if (!hasClass(trs[i]) && !trs[i].style.backgroundColor) {
				trs[i].style.backgroundColor = even ? evenColor : oddColor;
				// var tds = trs[i].getElementsByTagName("td");
				// for (var j = 0; j < tds.length; j++) {
					// var mytd = tds[j];
					// if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
						// mytd.style.backgroundColor = even ? evenColor : oddColor;
					// }
				// }
				even = !even;
			}
		}
	}
}