// JavaScript Document
// Alternate colors (or other style) by row in a defined table

 function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 0; i < rows.length; i++){          
 //manipulate rows
     if(i % 2 == 0){
       rows[i].className = "even";
     }else{
       rows[i].className = "odd";
     }      
   }
 }
}   

// To change styles, define .odd & .even in HTML header styles tag like this:
// 			<style type="text/css">
// 			.odd{background-color: white;}
// 			.even{background-color: #f0f8ff;}
// 			</style>
// identify the table like this: <table id="theTable">
// call function by updating Body tag like this: <body onload="alternate('theTable')">
// see example in file named clubs.html
