;(function($) {
$.fn.slideshow = function(options) {
	var o =  $.extend({}, $.fn.slideshow.defaults, options);

	var pointer = 0;
	var last = this.length -1;

	this.hide();
	this.eq(0).show();
	
	function go(collection) {
		return (function() {
		  collection.eq(pointer).fadeOut(o.duration);
   
		  if(pointer == last)
				pointer = 0;
		  else
			 pointer = pointer + 1;	
   
		  collection.eq(pointer).fadeIn(o.duration);
		  setTimeout(go(collection), o.delay);
	   })
	}
	setTimeout(go(this), o.delay);
}

$.fn.slideshow.defaults = {
	delay: 4000,
	duration: 1000
}
})(jQuery);