function spin(slot) { 
	var next = 0;
	switch (slot)	{
		case 1:
			var $active = $('#pic_slot1 IMG.active');
			if ( $active.length == 0 ) $active = $('#pic_slot1 IMG:last');
    			var $next =  $active.next().length ? $active.next()
        			: $('#pic_slot1 IMG:first');
    			$active.addClass('last-active');
    			$next.css({opacity: 0.0})
        			.addClass('active')
        			.animate({opacity: 1.0}, 2000, function() {
            				$active.removeClass('active last-active');
        		});			
  			next = slot + 1 ;
			break;
		case 2:
			var $active = $('#pic_slot2 IMG.active');
			if ( $active.length == 0 ) $active = $('#pic_slot2 IMG:last');
    			var $next =  $active.next().length ? $active.next()
        			: $('#pic_slot2 IMG:first');
    			$active.addClass('last-active');
    			$next.css({opacity: 0.0})
        			.addClass('active')
        			.animate({opacity: 1.0}, 2000, function() {
            				$active.removeClass('active last-active');
        		});			
  			next = slot + 1 ;
 			break;	
		case 3:
			var $active = $('#pic_slot3 IMG.active');
			if ( $active.length == 0 ) $active = $('#pic_slot3 IMG:last');
    			var $next =  $active.next().length ? $active.next()
        			: $('#pic_slot3 IMG:first');
    			$active.addClass('last-active');
    			$next.css({opacity: 0.0})
        			.addClass('active')
        			.animate({opacity: 1.0}, 2000, function() {
            				$active.removeClass('active last-active');
        		});			
  			next = slot + 1 ;
 			break;				
		case 4:
			var $active = $('#pic_slot4 IMG.active');
			if ( $active.length == 0 ) $active = $('#pic_slot4 IMG:last');
    			var $next =  $active.next().length ? $active.next()
        			: $('#pic_slot4 IMG:first');
    			$active.addClass('last-active');
    			$next.css({opacity: 0.0})
        			.addClass('active')
        			.animate({opacity: 1.0}, 2000, function() {
            				$active.removeClass('active last-active');
        		});			
  			next = slot + 1 ;
 			break;
		case 5:
			var $active = $('#pic_slot5 IMG.active');
			if ( $active.length == 0 ) $active = $('#pic_slot5 IMG:last');
    			var $next =  $active.next().length ? $active.next()
        			: $('#pic_slot5 IMG:first');
    			$active.addClass('last-active');
    			$next.css({opacity: 0.0})
        			.addClass('active')
        			.animate({opacity: 1.0}, 2000, function() {
            				$active.removeClass('active last-active');
        		});			
  			next = 1 ;
		default:
			next = 1 ;
 			break;
	}
	setTimeout("spin("+next+")",4000);
}
setTimeout("spin(1)",4000);

