(function($) {
		  
	$.fn.Slider = function(){

		this.each(function() {
			var obj = $(this);		
			var s = $("li", obj).length;
			var w = $("li", obj).width(); 
			var h = $("li", obj).height(); 
			obj.width(w); 
			obj.height(h); 
			obj.css("overflow","hidden");
			var ts = s-1;
			var t = 0;
			$("ul", obj).css('width',s*w);
				
			function animate() {
				t = (t>=s-1) ? 0 : t+1;						
				var p = (t * w * -1);
				$("ul", obj).animate(
					{ marginLeft: p }, 
					{ queue: false, duration: 800}
				);
				timeout = setTimeout(function(){
					animate();
				},5000);
			};
			
			var timeout;
			timeout = setTimeout(function(){
				animate();
			},5000);
			
		});
	};
		  
})(jQuery);
