$(document).ready(function() {
	
	$("#bg_slideshow img:first").fadeIn(700).addClass("active");
	setInterval(function() {
		var activeSlide = $("#bg_slideshow img.active");
		
		activeSlide.fadeOut(700).removeClass("active");
		
		var nextOrFirst = (activeSlide.next("img").length) ? activeSlide.next("img") : $("#bg_slideshow img:first");
		
		nextOrFirst.fadeIn(700).addClass("active");
	}, 5000);
	
});

