var rotateDelay = 4; // delay in seconds
var fadeDuration = 2;

$(function() {
	// create the image rotator
	setInterval("rotateImages()", rotateDelay * 1000);
	$('#bannerSlide div:first').addClass('current');
});


function rotateImages() {
	var oCurPhoto = $('#bannerSlide div.current')
	var oNxtPhoto = oCurPhoto.next();
	if (oNxtPhoto.length == 0)
		oNxtPhoto = $('#bannerSlide div:first');

	oCurPhoto.removeClass('current').addClass('previous');
	oNxtPhoto.css({ opacity: 0.0 }).addClass('current').animate({ opacity: 1.0 }, fadeDuration * 1000,
		function() {
			oCurPhoto.removeClass('previous');
		});
}