$.fn.slider = function(options)
			{
				var defaults = { nbDisplay : 4, type:'vertical', margin:0, nbSlide:1, speed:'slow' };
				var opts = $.extend(defaults,options);
				
				var count = 0;
				var nbElements = $(this).find('ul li').length;
				
				var prDiv = $(this);
				
				if(nbElements < opts.nbDisplay) opts.nbDisplay = nbElements;
				
				if(opts.type == 'horizontal')	
				{
					var refWidth = prDiv.find('ul li:first').width();
					var refHeight = prDiv.find('ul li:first').height();
					if(prDiv.find('.layer'))
					{
						prDiv.find('.layer').width((refWidth+opts.margin) * (opts.nbDisplay+1));
					}								
					prDiv.css({overflow:'hidden',height :refHeight,width : (refWidth+opts.margin) * opts.nbDisplay});					
				}
				else if(opts.type == 'vertical')
				{
					var refHeight = prDiv.find('ul li:first').height();
					prDiv.css({overflow:'hidden',height :(refHeight+opts.margin) * opts.nbDisplay});	
				}		
				
				var next = prDiv.find('.next:first');
				var prev = prDiv.find('.prev:first');
				
				next.click(function(){
					
					if(count < (nbElements - opts.nbDisplay))
					{		
					
								
						if((nbElements - (count+opts.nbSlide))< opts.nbDisplay)
							count += nbElements - (count+opts.nbSlide);
						else
							count+= opts.nbSlide;
						
						
						
						
						if(opts.type == 'horizontal')
							prDiv.find('ul').animate({marginLeft : - ((refWidth + opts.margin)*count)},opts.speed);
						if(opts.type == 'vertical'){
							prDiv.find('ul').animate({marginTop : - ((refHeight + opts.margin)*count)},opts.speed); }
					}
				});
				
				prev.click(function(){
					if(count > 0)
					{
						count-= opts.nbSlide;
						if(count < 0) count =0;
						
						if(opts.type == 'horizontal')
							prDiv.find('ul').animate({marginLeft : - ((refWidth + opts.margin)*count)},opts.speed);
						if(opts.type == 'vertical')
							prDiv.find('ul').animate({marginTop : - ((refHeight + opts.margin)*count)},opts.speed);
					}
				});

				return $(this);
			};

