/**
 * source:
 * 	A Simple jQuery Slideshow | Jon Raasch’s Blog
 * 	http://jonraasch.com/blog/a-simple-jquery-slideshow
 */

function slideSwitch()
{
	var $active = $("#banner img.active_banner") ;

	if ($active.length == 0) $active = $("#banner img:last") ;

	//select next image
	//~ var $next = $active.next().length ? $active.next() : $("#banner img:first") ;

	//select random image
	var $sibs = $active.siblings() ;
	var rndNum = Math.floor(Math.random() * $sibs.length) ;
	var $next = $($sibs[rndNum]) ;

	$active.addClass("last_active_banner") ;

	$next.css({opacity: 0.0}).addClass("active_banner").animate
	(
		{
			opacity: 1.0
		},
		1000,
		function()
		{
			$active.removeClass("active_banner last_active_banner") ;
		}
	) ;
}

$(
	function()
	{
		setInterval("slideSwitch()", 5000) ;
	}
) ;

