$(document).ready(function() {		
	var speed = 3000;//You can manage the speed of slideshow from here(1000 = 1SEC)
	slideShow(speed);

});

function slideShow(speed) {
	$('#gallery a').css({opacity: 0.0});
	$('#gallery a:first').css({opacity: 1.0});
	
	setInterval('gallery()', speed);
}

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