var timer;
function go_new(){
	var $this = $(this);
	clearInterval(timer);
	$(".new_current")
		.removeClass("new_current")
		.fadeOut(300);
	$("#new-"+$this.attr("href").substring(1,$this.attr("href").length))
		.addClass("new_current")
		.fadeIn(300);
	$(".thumb_current").removeClass("thumb_current");
	$this.addClass("thumb_current");
	timer = setInterval("go_next()", 5000);
	return false;
}

function go_next(){
	var $current = $(".new_current");
	var $current_id = eval($current.attr("id").substring(4,$current.attr("id").length));
	var $next_id = ($current_id == $(".new").size()) ? 1 : $current_id+1;
	
	$current
		.removeClass("new_current")
			.fadeOut(300);
	$("#new-"+$next_id)
		.addClass("new_current")
		.fadeIn(300);
	$(".thumb_current").removeClass("thumb_current");
	$(".thumb[href=#"+$next_id+"]").addClass("thumb_current");
}

$(function(){
$(".new")
	.not(":first")
		.hide()
	.end()
	.first()
		.addClass("new_current");

$(".thumb")
	.first()
		.addClass("thumb_current")
	.end()
	.bind("click",go_new);
		
	 timer=setInterval("go_next()", 5000);
})

