(function($) {
$(function() {

	$('#numbers').delegate('li:not(.current)', 'click', function() {
		$(this).addClass('current').siblings().removeClass('current')
			.parents('#featured').find('div.item').hide().eq($(this).index()).show();
	})

	rotate = function(){
		$("#numbers li").removeClass('current');
		$active.addClass('current');
		$index = $("#numbers li.current").index();
		$('#featured div.item').hide().delay(200).eq($index).fadeIn(300);
	};
	rotateSwitch = function(){
		play = setInterval(function(){
			$active = $('#numbers li.current').next();
			if ( $active.length === 0) {
				$active = $('#numbers li:first');
			}
			rotate();
		}, 10000);
	};
	rotateSwitch();
	$("#numbers li").click(function() {
		$active = $(this);
		clearInterval(play);
		rotate();
		rotateSwitch();
	});
	$("#featured div.item").hover(function() {
		clearInterval(play);
	}, function() {
	  rotateSwitch();
	});


	$('#tabs ul.tabs').delegate('li:not(.current)', 'click', function() {
		$(this).addClass('current').siblings().removeClass('current')
			.parents('#tabs').find('div.box').hide().eq($(this).index()).show();
	})

	$('div.entry table tr:even').addClass('even');
	$('div.entry table').attr({cellspacing: 0});

})
})(jQuery)
