/* Page slideshows */
function slideSwitch1() {
	var $active = $('#slide1 img.active');

	if ( $active.length == 0 ) $active = $('#slide1 img:last');

	var $next =  $active.next().length ? $active.next()
		: $('#slide1 img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1500, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch1()", 5000 );
});


function slideSwitch2() {
	var $active = $('#slide2 img.active');

	if ( $active.length == 0 ) $active = $('#slide2 img:last');

	var $next =  $active.next().length ? $active.next()
		: $('#slide2 img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1500, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch2()", 5000 );
});


function slideSwitch3() {
	var $active = $('#slide3 img.active');

	if ( $active.length == 0 ) $active = $('#slide3 img:last');

	var $next =  $active.next().length ? $active.next()
		: $('#slide3 img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1500, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch3()", 5000 );
});


function slideSwitch4() {
	var $active = $('#slide4 img.active');

	if ( $active.length == 0 ) $active = $('#slide4 img:last');

	var $next =  $active.next().length ? $active.next()
		: $('#slide4 img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1500, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch4()", 5000 );
});



function slideSwitch5() {
	var $active = $('#slide5 img.active');

	if ( $active.length == 0 ) $active = $('#slide5 img:last');

	var $next =  $active.next().length ? $active.next()
		: $('#slide5 img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1500, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch5()", 5000 );
});
