/**
 * myZebra ( http://supercanard.phpnet.org/jquery-test/myzebra/ )
 * 
 * Version 1.0
 *
 * Auteur : Jonathan Coulet ( j.coulet@gmail.com )
 * 
 **/
(function($){
	$.fn.myZebra = function(option){
		var param = jQuery.extend({
			color1: '#d3ebff',
			color2: '#f1f1f1'
		}, option);

		$(this).each(function(){
			switch($(this).attr('nodeName')){
				case 'TABLE':
					$('tr:odd', this).css({ background: option.color2 });
       			 		$('tr:even', this).css({ background: option.color1 });
					break;
				case 'UL':
					$('li:odd', this).css({ background: option.color2 });
       			 		$('li:even', this).css({ background: option.color1 });
					break;
				case 'DIV':
					node = $(this).children().attr('nodeName');
					$(node+':odd', this).css({ background: option.color2 });
       			 		$(node+':even', this).css({ background: option.color1 });
					break;
			}
		});

	};
})(jQuery);
