// Set tabel row colours, pass the id name of the DIV inserted in the HTLM prior to the table, also pass the number of the table - 0 is the first table after the DIV.

  function setColors(divId,tableNumber){	  
    var colors  = ['#d9e9ee', 'white'];
    var tableID = divId.getElementsByTagName('TABLE');
    tableObject = tableID[tableNumber];
    var trs     = tableObject.getElementsByTagName('TR');
     for(var i=0; i<trs.length; i++){
	     if (i==0) {
	     		trs[i].className = 'title';
			var tds     = trs[i].getElementsByTagName('TH');
			for(var j=0; j<tds.length; j++){
				//tds[j].className = 'title';
				tds[j].style.color = 'white';
			}
			var tds     = trs[i].getElementsByTagName('TD');
			for(var j=0; j<tds.length; j++){
				//tds[j].className = 'title';
				tds[j].style.color = 'white';
			}
	     }
		else {
			trs[i].style.backgroundColor = colors[i % 2];
		}
    }
}
 
