$(window).ready(function(){
	$('#divSlideShow').find('img.active').fadeIn('slow');
	setInterval("slideSwitch()",5000);
});

function slideSwitch()
{
	var $active = $('#divSlideShow img.active');
	if($active.length == 0)
	{
		$active = $('#divSlideShow img:last');	
	}
	if($active.next().length == 0)
	{
		var $next = $('#divSlideShow img:first');
	}
	else
	{
		var $next = $active.next();
	}
	 var $sibs  = $active.siblings();
	 var rndNum = Math.floor(Math.random() * $sibs.length );
	 var $next  = $( $sibs[ rndNum ] );

	$left = $('#divSlideShow').width()/2-$next.width()/2;
	$top = $('#divSlideShow').height()/2-$next.height()/2;
	$active.addClass('last-active').fadeOut('slow');
	$next.addClass('active')
		.css('top',$top)
		.css('left',$left)
		.fadeIn('slow',function(){
			$active.removeClass('active last-active');	
		})
}

