(function($) {
	$.fn.slide = function(settings) {
		var obj = new Object();
		obj["default"]		= 0;
		obj["slide"]		= "auto";
		obj["interval"]		= 4000;
		obj["animation"]	= true;
		obj["time"]			= 4000;
		settings = $.extend(obj, settings);
		/*settings = $.extend({
			default		: 0,
			slide		: "auto",
			interval	: 2000,
			animation	: true,
			time		: 1000
		}, settings);*/

		var _root	= this;
		var max		= $(this).find("li").length;
		var current	= settings["default"];

		$(this).find("li").not(":first-child").hide();

		if(settings.slide == "auto") {
			setInterval(animation, settings.interval);
		} else if(settings.slide == "click") {
			$(this).click(animation);
		};

		function animation() {
			prev = $(_root).find("li").eq(current);
			if(current == (max - 1)) {
				current = 0;
			} else {
				current++;
			};
			next = $(_root).find("li").eq(current);

			if(settings.animation == true) {
				next.fadeIn(settings.time);
				prev.fadeOut(settings.time);
			} else {
				next.show();
				prev.hide();
			};
		};
	};
})(jQuery);

