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

    if ( $active.length == 0 ) $active = $('#slideshow li:last');
    
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow li:first');
    
    $active.addClass('last-active');

    $next.css({opacity: 0.0,display:'block'})
        .addClass('active')
        .animate({opacity: 1.0}, 2000, function() {
            $active.removeClass('active last-active');
			$active.css({opacity: 0.0,display:'none'})
        });
}

	onStartClick = function(el) {
		if (intval!='') {
			var title = $('#stop').html();
			$('#stop').html($(el).html());
			$(el).html(title);
			window.clearInterval(intval);
			intval='';
		} else {
			var title = $('#stop').html();
			$('#stop').html($(el).html());
			$(el).html(title);
			intval=window.setInterval( "slideSwitch()", 6000 );
		}
	}

$(function() {
    intval=window.setInterval( "slideSwitch()", 6000 );
});
