//global variables for all three examples
var colors = new Array('#ffffff','#dddddd','#aaaaaa','#888888');
var bgcolor = 255; 			//starting bgcolor in decimal
var steps = 10;				//the factor, a distance between colors
var down = true;			//direction, if going up or down when calculating bgcolor value
var switchingPoint = 160;	//the numeric value where the foreground color need to change
var fgColorHi = "white";
var fgColorLo = "black";
/****************************************************************************************/
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";
     }      
   }
 }
}
