function revolve_news(){
	$('#top_content > div > ul > li:first').fadeOut('fast',
		function(){
			$(this).clone().appendTo('#top_content > div > ul').hide();
			$(this).remove();
			$('#top_content > div > ul > li:first').fadeIn('fast',
				function(){
					$('#subnews').html('<strong>'+$('#top_content > div > ul > li:first strong.title').text()+'</strong>: '+$('#top_content > div > ul > li:first p').html());
					$('#news_list > a.current').removeClass('current');
					$('#news_list > a[order='+$(this).attr('order')+']').addClass('current');
				}
			);
		}
	);
	news_cycle = setTimeout('revolve_news()',10000);
}
function show_news(id){
	$('#news_list > a.current').removeClass('current');
	$('#news_list > a[order='+id+']').addClass('current');
	$('#top_content > div > ul > li:first').fadeOut('fast',
		function(){
			while($('#top_content > div > ul > li:first').attr('order')!=id){
				$('#top_content > div > ul > li:first').clone().appendTo('#top_content > div > ul').hide();
				$('#top_content > div > ul > li:first').remove();
			}
			$('#top_content > div > ul > li:first').fadeIn('fast');
			$('#subnews').html('<strong>'+$('#top_content > div > ul > li:first strong.title').text()+'</strong>: '+$('#top_content > div > ul > li:first p').html());
		}
	);
	clearTimeout(news_cycle);
	delete news_cycle;
}
function set_situational_content(content){
	$('#situational_content').html(content);
	$('#situational_content_wrapper').show();
}
var news_cycle = setTimeout('revolve_news()',10000);
$(document).ready(
	function(){
		$('#subnews').html('<strong>'+$('#top_content > div > ul > li:first strong.title').text()+'</strong>: '+$('#top_content > div > ul > li:first p').html());
		$('#top_content > div > ul > li').hide();
		$('#top_content > div > ul > li:first').show();

		$('#top_content > div').css('overflow', 'hidden');

		$('#top_content').hover(
			function(){
				clearTimeout(news_cycle);
				delete news_cycle;
			},function(){
				news_cycle = setTimeout('revolve_news()',10000);
			}
		);
		//Now make the links for the news.
		$('#top_content > div > ul').children().each(
			function(index){
				$(this).attr('order',index);
				if(index == 0){
					class_data = 'class="current" ';
				}else{
					class_data = '';
				}
				$('#news_list').append('<a order="'+index+'" href="javascript:show_news('+index+');" '+class_data+'>'+$(this).children('strong.title').text()+'</a>');
			}
		);
	}
);
