
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function stripeTable() {
	if (! document.getElementsByTagName) return false;
	var tabs = document.getElementsByTagName("table");
	var tablen = tabs.length;
	for (var i=0; i < tablen; i++) {
		cl = tabs[i].className;	// for convenience
		cl = ' ' + cl + ' ';	// be sure there's a space at end
		if (cl.indexOf(" striped ") < 0) continue;

		var odd = false;
		var rows = tabs[i].getElementsByTagName("tr");
		rowlen = rows.length;
		for (j=0; j< rowlen; j++) {
			if (odd) {
				rows[j].style.backgroundColor = "#c0c0c0";
			}
			odd = ! odd;
		}
	}
}
addLoadEvent(stripeTable);
