(function($){
	$.fn.slideout = function(options) {
		
		var defaults = {
			speed: 800,
			delay: 800,
			followup: 1800,
			easeIn: "easeOutQuad",
			easeOut: "easeInQuad"
		};
		
		var options = $.extend(defaults, options);
		var liItems = new Array();
		var current = 0;
		
		this.each(function() {
			obj = $(this);  
			$(obj).find('li').each(function(index) {
				$(this).css('display','none');
				liItems[index] = $(this);
			});
			
		});
	
			
			setInterval(function() {
				slide();
			}, options.followup);
			
		
		function slide(){
			var obj = liItems[current];
        	var width = $(window).width();
			$(obj).css('margin-left', width+'px');	
        	$(obj).css('display', 'block');	
			
			
			$(obj)
			.css('z-index',1)
			.animate({ 
				'margin-left' : "0px",
				'opacity' : 100 }, {
				duration: options.speed,
				easing: options.easeIn
			})
			.css('z-index',0)
			.delay(options.delay)
			.animate({ 
				'margin-left' : -width+"px",
				'opacity' : 0 }, {
				duration: options.speed,
				easing: options.easeOut
			});
			
			current++;
			if(current==liItems.length){
				current = 0;	
			}
			allert(current);
        }
		
	};
})(jQuery);

