/* 2010 by Mark de Jong @ Eggplant Digital */
jQuery(document).ready(function(){
	var delay=300;
	jQuery("a.hdr_news_small").hover(
	function () {
			this_num = jQuery(this).attr("id").substr(3)
			clearInterval(sh);
			showItem(this_num);
		},
		function () {
			sh = setInterval(autoRotate, timer);;
		}
	);
	
});

var curr_no=1;
var timer_no=1;
var rotate_timer="";
var timer=2000;
var sh;

function showItem(no){
	if(curr_no!=no){
		resetItems();
		jQuery("#slide-"+no).fadeIn();
		t=0+(no*81)-81;
		jQuery("#tab-arrow").css("top",t+"px");
		jQuery("#tab"+no).addClass("hdr_news_big");
		
		curr_no=no;
	}
}

function resetItems(){
	jQuery("#slide-"+curr_no).fadeOut();
	jQuery("#tab"+curr_no).removeClass("hdr_news_big");
}

function autoRotate(){
	showItem(timer_no);
	timer_no++;
	if(timer_no > jQuery("#caroussel div.slide").length){
		timer_no=1;
	}
}

sh = setInterval(autoRotate, timer);
