$(document).ready(function()
{
	
	tm_m = (906 - parseInt($('#top_menu #top_menu_ul').css('width'))) / 2;
	$('#top_menu #top_menu_ul').css('padding-left', tm_m+'px');
	
	function go_next_hi(i_num)
	{
		s = 2000;
		
		
		$('.active_hi').stop().animate({
			"opacity": "0"
			}, s , function() {
			
			$(this).removeClass('active_hi');
		});
		
		$('.home_img' + i_num).stop().animate({
			"opacity": "1"
			}, s , function() {
			
			$(this).addClass('active_hi');
		});
		
		
	}
	
	hi = $('.home_img').size();
	if (hi > 1)
	{
		curr_hi = 1;
		setInterval(function() {
			if (curr_hi < hi)
				curr_hi++;
			else
				curr_hi = 1;
				
			go_next_hi(curr_hi);
		}, 10000);
		
	}

});
