/**
 * @author shevchenquot
 */

$(document).ready(function() {
	$('#mainmenu .mainmenu_elt').each(function(i) {
		$(this).find('.submenu').width($(this).width() - 2);
	
		$(this).mouseover(function() {
			$(this).stop().animate({
					height: $(this).find('.submenu').height() + 27
				}, {
					queue: false,
					duration: 400
				}, 'linear'
			);
			$(this).find('.mainmenu_elt_bg').stop().animate({
					width: $(this).find('.submenu').width() + 18
				}, {
					queue: false,
					duration: 400
				}, 'linear'
			);
		});
		
		$(this).mouseout(function() {
			$(this).stop().animate({
					height: '25px'
				}, {
					queue: false,
					duration: 400
				}, 'linear'
			);
			$(this).find('.mainmenu_elt_bg').stop().animate({
					width: '25px'
				}, {
					queue: false,
					duration: 400
				}, 'linear'
			);
		});
	});
	
	$('.submenu').each(function(i) {
		$(this).find('li:first').css('border-top', 0);
	});
});
