/******************************************************************************************************************/
// NEWS FUNCTIONS
/******************************************************************************************************************/

function TickerHoverHandle(){
	$('.ticker LI').hover(function(){
		clearTimeout(TickerTimerId);
		index = $('.ticker LI').index(this);
	}, function(){
		TickerRun(index);
	});
}

function TickerShow(i){
	$('.ticker LI').hide();
	$('.ticker LI:eq('+ i +')').show();
}

function TickerRun(i){
	num = $('.ticker LI').size();
	if (num > 1) {
		TickerShow(i)
		i++;
		if (i == num) i = 0;
		TickerTimerId = window.setTimeout('TickerRun('+ i +')', 3000);
	}
}

/******************************************************************************************************************/
// ON DOCUMENT LOAD...
/******************************************************************************************************************/

$(function(){
	// News
	max = 0;
	$('.ticker LI').each(function(){
		if ($(this).height() > max) max = $(this).height();
	});
	$('.ticker LI').height(max);
	
	TickerRun(0);
	TickerHoverHandle();
});