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

function addTableStripes(){
	if(!document.getElementById) return false;
	if (!document.getElementsByTagName) return false;
	if (!document.getElementsByTagName("table")) return false;
	if(document.getElementById("stripytable")){
		var stripyTable = document.getElementById("stripytable");
		var odd = true;
		var tableRows = stripyTable.getElementsByTagName("tr");
		for (i=0; i<tableRows.length; i++){
			if(odd){
				tableRows[i].className = "odd";
				odd = false;
				continue;
			}else if(!odd){
				odd = true;
				continue;
			}
		}	
	}else if(!document.getElementById("stripytable")){
		var classApplied = false;
		var tables = document.getElementsByTagName("table");
		for (var i=0; i<tables.length; i++){
			var odd = true;
			var tableRows = tables[i].getElementsByTagName("tr");
			if(tables[i].getAttribute("class") == "stripytable"){
				classApplied = true;
				for (var j=0; j<tableRows.length; j++){
					if(odd){
						tableRows[j].className = "odd";
						odd = false;
						continue;
					}else if(!odd){
						odd = true;
						continue;
					}
				} 
			}else{
				continue;
			}
		}
		if(!classApplied){
			for (var i=0; i<tables.length; i++){
				var odd = true;
				var tableRows = tables[i].getElementsByTagName("tr");
				for (var j=0; j<tableRows.length; j++){
					if(odd){
						tableRows[j].className = "odd";
						odd = false;
						continue;
					}else if(!odd){
						odd = true;
						continue;
					}
				}
			}
		}
	}

}




