$(document).ready(function() {		
	
	slideShow();

});

function slideShow() {

	
	$('#gallery img').css({opacity: 0.0});
	
	
	$('#gallery img:first').css({opacity: 1.0});
	
	
	setInterval('gallery()',8000);
	
}

function gallery() {
	
	
	var current = ($('#gallery img.show')?  $('#gallery img.show') : $('#gallery img:first'));

	
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery img:first') :current.next()) : $('#gallery img:first'));	
	
	
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);


	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
			
}


