function slideSwitch() {
    var $active = $('#slideshow img.active');

	var length = $('#slideshow img').length;

	if ( length > 1 )
	{
	    if ( $active.length == 0 ) $active = $('#slideshow img:last');
	
	    var $next =  $active.next().length ? $active.next()
	        : $('#slideshow img:first');
	
	    $active.addClass('img-active');
	
		$next.addClass('active');
		$active.removeClass('active last-active');
		
		if ( $next.hasClass('show'))
		{
			$('#testimonial').show();
		}
		else
		{
			$('#testimonial').hide();
		}
    }
}

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