(function($) {

	var settings;
	// Call this public method like $(elem).myMethod();
	$.fn.fadeLis = function(customSettings) {
		settings = jQuery.extend({
			displayDuration: 6000,
			fadeDuration: 1000
		},
		customSettings);

		return this.each(function() {
			//initialization:
			thisUl = $(this);
			thisUl.children().hide().siblings(":first-child").fadeIn(settings.fadeDuration / 2);
			//loop thru the lis
			var active = setInterval(function() {
				fadeCurrentOut(thisUl);
			},
			settings.displayDuration);
			var fadeInQuick;
			thisUl.hover(function() {
				clearInterval(active);
				clearTimeout(fadeInQuick);
				$(this).children(':visible').stop().fadeTo('fast', 1);
			},
			function() {
				fadeInQuick = setTimeout(function() {
					fadeCurrentOut(thisUl);
					active = setInterval(function() {
						fadeCurrentOut(thisUl);
					},
					settings.displayDuration);
				},
				2000
				);
			});
		});
	};

	function fadeCurrentOut(container) {
		current = $("li:visible", container);
		current.fadeOut(settings.fadeDuration / 2,
		function() {
			var next = current.is(":last-child") ? current.siblings(":first-child") : current.next();
			next.fadeIn(settings.fadeDuration / 2);
		});
	}
})(jQuery);
