$(document).ready(function(){
	var delay=0;
	$("#hdr_news1").mouseover(function () {
		showItem(1);
	});
	$("#hdr_news2").mouseover(function () {
		showItem(2);
	});
	$("#hdr_news3").mouseover(function () {
		showItem(3);
	});
	$("#hdr_news4").mouseover(function () {
		showItem(4);
	});
	$("#hdr_news5").mouseover(function () {
		showItem(5);
	});
	autoRotate();
});

var curr_no=1;
var timer_no=1;
var rotate_timer="";
var timer=5000;

function showItem(no){
	if(curr_no!=no){
		resetItems();
		$("#news_image_"+no).fadeIn();
		//t=(no*58)-58;
		t=(no*45) - 45;
		$("#hdr_news"+no).css("height","30px");
		$("#hdr_news"+no).children().removeClass();
		$("#hdr_news"+no).children("#white"+no).addClass("carousselitem_over"+no);
		curr_no=no;
	}
}

function resetItems(){
	$("#news_image_"+curr_no).fadeOut();
	$("#hdr_news"+curr_no).css("height","30px");
	$("#hdr_news"+curr_no).children().removeClass();
	$("#hdr_news"+curr_no).children("#white"+curr_no).addClass("carousselitem"+curr_no);
}

function autoRotate(){
	showItem(timer_no);
	timer_no++;
	if(timer_no>5){
		timer_no=1;
	}
	rotate_timer=setTimeout("autoRotate()",timer);
}

