$(".jpgs img").ready(function() {
	$(".jpgs img").hide();
});

$(".jpgs").ready(function() {
	$(".jpgs").each(function(i) {
		var numImages = $(this).children("img").length;
		$(this).children("img").each(function(j) {
			$(this).wait(j*4000);
			fadeImage($(this),((numImages-1)*4000)-3000);
		});
	});
});

function fadeImage(obj, total) {
	obj.fadeIn(1000, function() { 
		obj.wait(3000);
		obj.fadeOut(1000, function() {
			obj.wait(total);
			fadeImage(obj,total);
		});
	});
}