$.fn.jDiaporama = function(o) {
	var currDiapo = 0;
	var div=$(this);
	var ul = ("ul",div);
	var nbElt = $("li[id='diapo-item']").size();
	$("li[id='diapo-item']").hide();

	$(".bNext").bind("click",function(){
		if(currDiapo < nbElt-1)
		{
			currDiapo++;
			$(".bPrev").show();
			$(this).display();
		}
	});

	$(".bPrev").bind("click",function(){
		if(currDiapo > 0)
		{
			currDiapo--;
			$(".bNext").show();
			$(this).display();
		}
		
	});

	o = $.fn.extend({
		display: function(){
			$("div[id='diapo']").empty();
			content = $("li[id='diapo-item']:eq(" + currDiapo + ")").html();
			$("div[id='diapo']").append(content);
			if(currDiapo == 0) { $(".bPrev").hide(); } else { $(".bPrev").show();}
			if(currDiapo==nbElt-1){ $(".bNext").hide(); } else { $(".bNext").show();}
		}
	});
}
