// jquery tabs
$(function(){
	rotation($('#gallery ul>li'))
});

function rotation(slideshow){
	var i = 0;
	var length = slideshow.length;
	slideshow.hide();
	slideshow.eq(i).show();
	_rTime = 8000;
	_fadeTime = 2000;
	
	function move(){
		if (i < length-1) i = i+1
		else i = 0;
		slideshow.fadeOut(_fadeTime);
		slideshow.eq(i).fadeIn(_fadeTime);
	}
	int = setInterval(move, _rTime);
	slideshow.each(function(){
		$(this).mouseover(function(){
			if (int) clearInterval(int);
		})
		$(this).mouseout(function(){
			if (int) clearInterval(int);
			int = setInterval(move, _rTime);
		})
	})
}
