jQuery(document).ready(function() {
	slideShow('gallery',4000);
});
function slideShow(div1,time) {
	jQuery('#'+div1+' a').css({opacity: 0.0});
	jQuery('#'+div1+' a:first').css({opacity: 1.0});
	setInterval("gallery('"+div1+"')",time);
}
function gallery(div1) {
	if((typeof(play)!='undefined' && play=='1') || typeof(play)=='undefined'){
		var current = (jQuery('#'+div1+' a.show')?  jQuery('#'+div1+' a.show') : jQuery('#'+div1+' a:first'));
		var next = ((current.next().length) ? ((current.next().hasClass('caption'))? jQuery('#'+div1+' a:first') :current.next()) : jQuery('#'+div1+' a:first'));
		next.css({opacity: 0.0})
		.addClass('show')
		.animate({opacity: 1.0}, 1500);
		current.animate({opacity: 0.0}, 1000)
		.removeClass('show');
	}
}
