$(document).ready(function()
{
	theRotator();
});

function theRotator ()
{
	if ($('ul#photo-slideshow').length == 0)
		return false;
	$('ul#photo-slideshow li').css({opacity: 0.0});
	$('ul#photo-slideshow li:first').css({opacity: 1.0});
	setInterval('rotate()',4000);
}

function rotate ()
{
	var current = ((typeof $('ul#photo-slideshow li.show').attr('class') != 'undefined')?  $('ul#photo-slideshow li.show') : $('ul#photo-slideshow li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('ul#photo-slideshow li:first') :current.next()) : $('ul#photo-slideshow li:first'));
	next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 2500);
	current.animate({opacity: 0.0}, 2500).removeClass('show');
};

