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