$(document).ready(function () {
	var showTime = 5000;
	var duration = 2000;
	var lastShowId = 'img_0';
	var count = 0;
	var max_count = $('.imageheader > img').length;
	
	$('.imageheader .first').fadeIn(duration);	
	
	window.setTimeout(function(){
		showNext();
	}, showTime);
	
	function showNext(){
		$('.imageheader #'+lastShowId).removeClass('first');
		count++;
		if(count == max_count){
			count = 0;
		}
		nextShowId = 'img_'+count;
		$('.imageheader #'+nextShowId).addClass('first');
		$('.imageheader #'+nextShowId).fadeIn(duration, function() {
			$('.imageheader #'+lastShowId).hide();
			lastShowId = nextShowId;
			window.setTimeout(function(){
				showNext();
			}, showTime);
		});
	}
});
