
var zebra = {
	
	init: function(settings) {

		zebra.config = {
			$obj: $("#zebra"),
			over: "#DDDDEC",
			odd: "#FFFFFF",
			even: "#EEEEEE",
			column: "#ECDDDD",
		}
		$.extend( zebra.config, settings );	


		if(!zebra.config.$obj.length) return;

		var tr = $("tr", zebra.config.$obj);
		var td = $("td:first-child",tr);
		var even = $("tr:even",zebra.config.$obj);
		even.css("background-color",zebra.config.even);
		td.css("background-color",zebra.config.column);
		tr.hover(function() {
			$(this).animate({
				backgroundColor: zebra.config.over
			}).find("td:first-child").animate({
					backgroundColor: zebra.config.over
			});
		},
		function() {
			var color;
			$(this).is(":nth-child(even)") ?
			color = zebra.config.even :
			color = zebra.config.odd ;
			$(this).animate({
				backgroundColor: color
			}).find("td:first-child").animate({
					backgroundColor: zebra.config.column
			});
		});
	}
}

$(document).ready(zebra.init);