var pause = false;

function slideShow() {
	$('#home_gallery').mouseover(function() {pause = true;});
	$('#home_gallery').mouseout(function() {pause = false;});
	$('#home_gallery li').css({opacity: 0.0});
	$('#home_gallery li.first').css({opacity: 1.0});
	$('#home_gallery li.first span').css({opacity: 0.6});
	//$('#home_gallery li span').css({width: $('#home_gallery img').width() - 10});
	setInterval('gallery()', 8000);
}
  
function gallery() {
	if (!pause) {
		$('#home_gallery li').each(function(index) {
			if ($(this).hasClass('first')) {
				$(this).animate({opacity: 0.0}, 2000).removeClass('first');
				index_add = (index + 1) % $('#home_gallery li').length;
			}
		});
		
		$('#home_gallery li:eq(' + index_add + ') span').css({opacity: 0.6});
		$('#home_gallery li:eq(' + index_add + ')').css({opacity: 0.0}).addClass('first').animate({opacity: 1.0}, 3000);
	}
}

