//Slideshow configuration

var fade_speed = 800; //Adjust the fade out speed of the slideshow (in milliseconds)
var fade_delay = 4000; //Adjust the delay between fading pictures in the slideshow (in milliseconds)

//End slideshow configuration

function slide_change() {
	

	$('#slideshow img.prev-active').addClass('active').removeClass('prev-active').show();
	var size = $('#slideshow img').length;
	var _idx = $('#slideshow img').index($('#slideshow img.active'));	
	if(_idx < size-1) {	nextidx = _idx+1;}
	else {nextidx = 0;}	
	var next = $('#slideshow img').eq(nextidx);	
	next.addClass('prev-active');
	$('#slideshow img').eq(_idx).fadeOut(fade_speed, removeactive);
	
}

var nextidx;

function removeactive() {	
	$('#slideshow img.active').removeClass('active').show();		
}

$(document).ready(function() {

	// Slider function 	
	var interval = setInterval(slide_change, fade_delay);
	//End slider function
	
	
	//Adjust darker blue block
	var mheight = -($('#main').height() + 10 - 373);
	var mheightpx = mheight + "px";
	var padding = $('#main').height() + 37 - 373;
	var paddingpx = padding + "px";
	$('#footer').css({"margin-top": mheightpx, "padding-top": paddingpx});
	//End adjust darker blue block
	
	/*
	//Makes the watermark logo show only if there is enough text content
	if($('#content-inner').height()>700) {
		$('#content-inner').addClass('watermark');
	}
	*/

});
