/*
 * jQuery slideshow function 
 * Written for Springfield Hotel by Clearweb
 * September 2009
 */

function primeSlideShow()
{
	$('.slideshow IMG').css({opacity: 0.0});
	$('.slideshow IMG:first-child').css({opacity: 1.0});
}

function initSlideShow()
{
	if($('#slideshow img').length > 1)
	{
		var $active = $('#slideshow img.active');
		if($active.length == 0) $active = $('#slideshow img:last');
		var $next = $active.next().length ? $active.next() : $('#slideshow img:first-child');
		
		$active.addClass('last-active');
		
		$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 700, function()
		{
			$active.removeClass('active last-active');
		});
	}
}