(function($){
	$.fn.slideshow = function()
	{
		this.each(function(){

			var current = 0;
			var images = $(this).children('img');

			if (images.length > 1) {
				setInterval(next_image, 4500);
			}

			function next_image() {
				var next;
				if (current >= images.length - 1) {
					next = 0;
				} else {
					next = current + 1;
				}
				$(images[current]).fadeTo(1200, 0);
				$(images[next]).fadeTo(2500, 1);
				current = next;
			}


		})

	}
})(jQuery);
