var delay = 5000;

$(document).ready(function(){
	window.setTimeout(imgFader,delay);
});

function imgFader(){
	$('.before-after img:visible').fadeOut('slow',function(){
		if($(this).next('img').size()){
			$(this).next('img').fadeIn('slow',function(){
				window.setTimeout(imgFader,delay);
			});
		}else{
			$(this).parent().find('img:first').fadeIn('slow',function(){
				window.setTimeout(imgFader,delay);
			});
		}
	});
}
