$(window).bind("load",function(){
	$(".headerSlideshow").children().eq(0).show();

});

	setInterval('showNextHeaderImage()',3000);

var headerImageFadeTime = 500;

function showNextHeaderImage() {
	var thisWasShowing;
	$(".headerSlideshow").children().each(function(i) {
		if ($(this).is(':visible')) {
			thisWasShowing = $(this);
		}
	});
	var showThisNext = thisWasShowing.next();
	
	// must use the same size images to avoid 'popping' effect
	if (!showThisNext.length) {	// if at the last image, fade to the first
		$(".headerSlideshow").children().eq(0).show();
		thisWasShowing.fadeOut(headerImageFadeTime);
	}
	else {
		showThisNext.fadeIn(headerImageFadeTime,function() {
			thisWasShowing.hide();
		});
	}
	
	// simple cross-fade solution.  May show too much white, but might be tweaked by changing to .animate instead, and using linear transition curve
	// if (!showThisNext.length) showThisNext = $(".headerSlideshow").children().eq(0);
	// thisWasShowing.fadeOut(500);
	// showThisNext.fadeIn(500);
	
	
}
