if (window.jQuery) $(document).ready(function(){
	if ($('.main-news').length) news_change();
});

function news_change()
{
	var cur, timer;
	$('.news-foto a:first').show();
	$('.main-news ul li').mouseenter(
		function(){
			cur = $(this);
			if (timer)
			{
				clearTimeout(timer);
				timer = null;
			}
			timer = setTimeout(function(){
				$('.main-news ul li').removeClass('active');
				$(cur).addClass('active');
				$(cur).append('<em></em>');
				rel = $('a', cur).attr('rel');
				$('.news-foto a:visible').fadeOut('slow');
				$('.news-foto a.news_'+rel).fadeIn('slow');
				clearTimeout(timer);
			}, 50);
		}
	);
}
