$(document).ready(function(){
	$("#diashow_header").height($(".diashow_image.first").height());
	$("#diashow_content").height($(".diashow_image.first").height());
	
	diashow_start();
});
var images = 0;
var i = 0;

function animate_header_image(){
	$("#diashow_header").height($(".diashow_image.first").height());
	$("#diashow_content").height($(".diashow_image.first").height());
	if(typeof images[i - 1] == "undefined")
	{
		this.i = images.length - 1;
		$('.diashow_image').css("opacity","1");
	}
	var j = 0;
	images.each(function(){
		if(i == j)
		{
			$(this).animate({
				opacity: 0
			  }, 5000, function(){
		        	i--;
		        	setTimeout('animate_header_image()',diashow_speed);
		        }
			);
		}
		j++;
	});
};

function diashow_start(){
	images = $('.diashow_image');
	i = images.length - 1;
	if(i>1)
	{
		setTimeout('animate_header_image()',diashow_speed);
	}
	$("#diashow_header").height($(".diashow_image.first").height());
	$("#diashow_content").height($(".diashow_image.first").height());
};

