$(document).ready(function(){	
	//$('#mycarousel').jcarousel();
	$('a.close').click(function(){
		//$('body').css('display','none');
	});
	$('#lang a').mouseover(function(){
		$(this).css('background','url("img/lang_bg.gif") 50% top no-repeat');
	});
	$('#lang a').mouseout(function(){
		$(this).css('background','none');
		$('#lang a.selected').css('background','url("img/lang_bg.gif") 50% top no-repeat');
	});
	$('.content .menu li, .index .content .menu li').mouseover(function(){
		$(this).addClass('selected');
	});
	$('.content .menu li, .index .content .menu li').mouseout(function(){
		$(this).removeClass('selected');
	});	
	$('.content .menu_up li a').mouseover(function(){
		$(this).css('color','#6f90ae');
	});
	$('.content .menu_up li a').mouseout(function(){
		if ($(this).parent().hasClass('selected')) {
			$(this).css('color','#adbdc9');
		}else{
		$(this).css('color','#f3f5f5');
		};
	});	
	$('.content .menu_down li a, .main .menu_left div a').mouseover(function(){
		$(this).css('color','#d2ff02');			//tuto mozno pomenjatj ottenok zoltogo
	});
	$('.content .menu_down li a, .main .menu_left div a').mouseout(function(){
		if ($(this).parent().hasClass('selected')) {
			$(this).css('color','#d9f312');
		}else{
		$(this).css('color','#f3f5f5');
		};
	});
	$('#footer .copuring .link').mouseover(function(){
		$(this).css('cursor','hand');
	});
		$('.layer .close').mouseover(function(){
		$(this).css('cursor','hand');
	});
		$('.layer .bottom .link').mouseover(function(){
		$(this).css('cursor','hand');
	});
});

function repositionBottomMenu()
{
	var top_menu_width = $('.menu_up').outerWidth();
	var bottom_menu_width = $('.menu_down').width();
	var menu_center = item_right_edge = 0;
	if(bottom_menu_width < top_menu_width) {
		menu_center = Math.round($('.menu_up .selected').position().left + $('.menu_up .selected').outerWidth()/2,0);
		item_right_edge = Math.round(menu_center+bottom_menu_width/2, 0);
		if(top_menu_width>item_right_edge && bottom_menu_width<=item_right_edge) {
			$('.menu_down').css('padding-right', (top_menu_width-item_right_edge)+'px');
		} else if(bottom_menu_width>item_right_edge) {
			$('.menu_down').css('padding-right', (top_menu_width-bottom_menu_width)+'px');
		}
	}
}

