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