var stripe = function() {
	//find tables in document
	var tables = document.getElementsByTagName("table");  
	for(var x=0;x!=tables.length;x++){
		var table = tables[x];
		//if no tables exist quit the script
		if (! table) { return; }
		//only stripe the tables with the class stripetable
		if (table.className=="stripetable"){
			//in the tables found find ones with the tbody tag
			var tbodies = table.getElementsByTagName("tbody");
			for (var h = 0; h < tbodies.length; h++) {
				var even = true;
				
				var trs = tbodies[h].getElementsByTagName("tr");
				//loop through all the table rows and color alternatively
				for (var i = 0; i < trs.length; i++) { 
					if(even)
					trs[i].className += (!trs[i].className) ? 'even' : ' even';        
					even = !even;
				}
			}
		}
	}
}

window.onload = stripe;
