
$(document).ready(function()
{ 
  
  $('ul.sf-menu').superfish();    
   $('a.lightbox').lightBox();
   
   slideShow();
   
});

/*
$(document).load(function()
    slideShow();
});
*/


function slideShow() {

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

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'));	
	//Set the fade in effect for the next image, show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1800);

	//Hide the current image
	current.animate({opacity: 0.0}, 1800)
	.removeClass('show');	
}




