$(document).ready(function(){
	setInterval('swapImages()', 5000);
});

function swapImages(){
	var $active = $('#background-images .active');
	var $next = ($('#background-images .active').next().length > 0) ? $('#background-images .active').next() : $('#background-images img:first');
	
	$next.fadeIn(2000).addClass('active');
	
	$active.fadeOut(2000, function(){
		$active.removeClass('active'); 
	});
}