function slideSwitch() {
	var $active = $('#imgTop li.active');
 
	if ( $active.length == 0 ) $active = $('#imgTop li:last');
 
	var $next =  $active.next().length ? $active.next()
		: $('#imgTop li:first');
 
	var $sibs  = $active.siblings();
	var rndNum = Math.floor(Math.random() * $sibs.length );
	var $next  = $( $sibs[ rndNum ] );
 
	$active.addClass('last-active');
 
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({
			opacity: 1.0

			}, 100, function() {
			$active.removeClass('active last-active');
		});
}

function slideSwitchHome() {
	var $active = $('#imgTopHome li.active');
 
	if ( $active.length == 0 ) $active = $('#imgTopHome li:last');
 
	var $next =  $active.next().length ? $active.next()
		: $('#imgTopHome li:first');
 
	var $sibs  = $active.siblings();
	var rndNum = Math.floor(Math.random() * $sibs.length );
	var $next  = $( $sibs[ rndNum ] );
 
	$active.addClass('last-active');
 
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({
			opacity: 1.0
			}, 100, function() {
			$active.removeClass('active last-active');
		});
}
 
$(function() {
	setInterval( "slideSwitch()", 20000 );
	setInterval( "slideSwitchHome()", 10000 );
});
	 
