function swapImages(){
    var $active = $('#site_thumb .active');
    var $next = ($('#site_thumb .active').next('img').length > 0) ? $('#site_thumb .active').next('img') : $('#site_thumb img:first');
    $active.fadeOut(function(){
	    $next.fadeIn('slow').addClass('active');
	    $('#thumb_text').html($next.attr('alt'));
	    $active.removeClass('active');
    });
}

$(document).ready(function(){
	$('#thumb_text').hide();
	var random = Math.ceil(Math.random()*5);
	$('#site_thumb img:nth-child('+random+')').addClass('active');
	$('#thumb_text').html($('#site_thumb img:nth-child('+random+')').attr('alt'));
	var timer = setInterval('swapImages()', 6000);
	  
	$('#site_thumb').hover(function(){
		$('#thumb_text').show();
		clearInterval(timer);
	},function(){
		$('#thumb_text').hide();
		timer = setInterval('swapImages()', 6000);
	});
});
