// namespacing
YAHOO.namespace("htmlblog");
			
YAHOO.htmlblog.alternateRows = {
	/**
	*	Our init function
	*	@params className String, the table class name
	*	@params firstColor String hex value for first color
	*	@params secondColor String hex value for second color
	*/
	init: function(className, firstColor, secondColor){
		// get all the tables with that particular class name
		tableList = YAHOO.util.Dom.getElementsByClassName(className);
		
		// loop through them
		for(var i=0; i< tableList.length; i++) {
			// get the table rows for the table
			var rowsList = tableList[i].getElementsByTagName('tr');
			
			// loop through them
			for(var j=0; j< rowsList.length; j++){
				// if divisible by 2 set first color else set second color
				if(j % 2 == 0){
					YAHOO.util.Dom.setStyle(rowsList[j], 'backgroundColor', firstColor);
				}
				else{
					YAHOO.util.Dom.setStyle(rowsList[j], 'backgroundColor', secondColor);
				}
			}
		}
	}
};
