// JavaScript Document
$(document).ready(function() {
	/* _____ MENU _______ */
	defPos();
	$(window).resize(function(){  defPos();	});
	/* hover position */
	$('.h_menu a').hover(function(){
		$('.h_menu a.active').addClass('noact');
		lft = $(this).position().left;
		wid = $(this).innerWidth();
		lftA = $('.mnActive').position().left;
		lft < lftA ? r=-(wid/15) : r=wid/15;
		$('.mnActive').stop(true,false).animate({width: wid,left: lft + r},500).animate({width: wid, left: lft+2},250);
	});	
	/* back to defoult position */
	$('.h_menu').mouseleave(function(){
		lft = $('.h_menu a.active').position().left;
		wid = $('.h_menu a.active').innerWidth();
		$('.mnActive').stop(true,false).animate({width: wid,left: lft+2},500);
		clearTimeout(timeoutId);
		function act2(){$('.h_menu a').removeClass('noact');}
		timeoutId2 = setTimeout(act2, 400);		
	});

	
});
function defPos(){
	lft = $('.h_menu a.active').position().left;
	wid = $('.h_menu a.active').innerWidth();
	r=wid/15;
	$('.mnActive').stop(true,false).animate({width: wid + r,left: lft + r},700).animate({width: wid, left: lft+2});
}
