// -------------------------------- //
// "Banner" slideshow on the        //
// homepage. Use this function to   //
// rotate through a series of       //
// <li> tags.                      //
// -------------------------------- //
// Author: rachel@dollypower.com    //
// -------------------------------- //
// Credit: This is based on the     //
// tutorial by Jon Raasch - more    //
// info and credit here:            //
// http://jonraasch.com/blog/       //
// a-simple-jquery-slideshow        //
// -------------------------------- //

// Put jQuery in no conflict mode
var $j = jQuery.noConflict();

// Start slideshow function
function slideshow() {
	
	var $jactive = $j('#slides li.active');
	
	if ( $jactive.length == 0 ) $jactive = $j('#slides li:last');
	
	var $jnext =  $jactive.next().length ? $jactive.next()
	: $j('#slides li:first');
	
	$jactive.addClass('last-active');
	
	$jnext.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
	$jactive.removeClass('active last-active');
	});
}

// Set interval

$j(function() {
	setInterval( "slideshow()", 6000 );
});

