<!--JavaScript Document

<!--Alternating Table Row Colors


addEvent(window,"load",alternate_init);


function addEvent(elm,evType,fn,useCapture){

	if(elm.addEventListener){
		elm.addEventListener(evType,fn,useCapture);
		return true;
	}else if (elm.attachEvent){
		var r = elm.attachEvent("on"+evType,fn);
		return r;
	}else{
		alert("Handler could not be removed");
	}
}


function alternate_init(){
	if(!document.getElementsByTagName) return;
	tbls = document.getElementsByTagName("table");
	
	for(ti=0;ti<tbls.length;ti++){
		thisTbl = tbls[ti];
		if(((''+thisTbl.className+'').indexOf("alternate_rows")!=-1)&&(thisTbl.id)){
			alternate(thisTbl);
		}
	}

}


function alternate(table){
		<!--Take object table and get all it's tbodies	
		var tableBodies = table.getElementsByTagName("tbody");
	
		<!--Loop through these tbodies
		for(var i=0; i<tableBodies.length; i++){
		<!--Take the tbody, and get all it's rows
		var tableRows = tableBodies[i].getElementsByTagName("tr");
		
		<!--Loop through these rows
		for(var j=0; j< tableRows.length; j++){
			<!--Check if j is even and apply classes for both possible results
			if((j % 2)== 0){
				if(tableRows[j].className == 'odd' || !(tableRows[j].className.indexOf('odd')== -1)){
			 	   tableRows[j].className == replace(tableRows[j].className, 'odd', 'even');
				} else {
				tableRows[j].className += "even";
				}
			} else {
				if(tableRows[j].className == 'even' || !(tableRows[j].className.indexOf('even')== -1)){
			 	   tableRows[j].className == replace(tableRows[j].className, 'odd', 'even');
				} else {
				tableRows[j].className += "odd";
			}
		}
	}

}
}
