
$(document).ready(function() {
						   
	/*effect on menu */
	
	$('.page .menu li').mouseenter(function() {
		if ($(this).attr('class') == 'first') {
			$(this).children('ul').animate({height:"140px"}, { queue:false, duration:500 });
			$(this).children('a').css('border-right', '0');
		}
		else if($(this).attr('class') == 'second') {
			$(this).children('ul').animate({height:"140px"}, { queue:false, duration:500 });
			$(this).children('a.main').css('border-right', '0');
			$('.page .menu li.first a.main').css('border-right', '0');

		}
		else if($(this).attr('class') == 'last') {
			$(this).children('ul').animate({height:"140px"}, { queue:false, duration:500 });
			$('.page .menu li.second a.main').css('border-right', '0');
		}

    });	
		
	$('.page .menu li.first').mouseleave(function() {	 
			$('.page .menu li.first ul').animate({height:"0px"}, { queue:false, duration:500 });
			$(this).children('a.main').css('border-right', '1px solid #66d5e6');
	});
	$('.page .menu li.second').mouseleave(function() {	 
			$(this).children('ul').animate({height:"0px"}, { queue:false, duration:500 });
			$(this).children('a.main').css('border-right', '1px solid #66d5e6');
			$('.page .menu li.first a.main').css('border-right', '1px solid #66d5e6');

	});
	$('.page .menu li.last').mouseleave(function() {	 
			$(this).children('ul').animate({height:"0px"}, { queue:false, duration:500 });
			$('.page .menu li.second a.main').css('border-right', '1px solid #66d5e6');

	});

	
	/*effect on search form*/
	
	$('#submit').mouseenter(function() {
			$('.form').animate({width: "144px"}, { queue:false, duration:500 });
			$('.arrow_search').css({display: "block"});
			
    });	
		
		$('.search form').mouseleave(function() {	 
			$('.form').animate({width: "0"}, { queue:false, duration:500 });
			$('.arrow_search').css({display: "none"});
		});
		
		$('.arrow_search').mouseenter(function() {
			$('.form').animate({width: "0"}, { queue:false, duration:500 });
			
    });
	
	
	
		/*same height between left_content and right_content*/
	
		var sLeftHeight = parseInt($('.content .left_content').height());
		var sRightHeight = parseInt($('.content .right_content').height());
		
		var sBlockVisit = parseInt($('.content .visit').height() + 25); // 25px for padding-top/bottom .bg_left
		
		if($('.content .block_flash').length)	
			var sElementsRight = (parseInt($('.content .block_flash').height()) + parseInt($('.content .footer').height()));	
		else	
			var sElementsRight = parseInt($('.content .footer').height());
		
		
		
		if ((sLeftHeight < sRightHeight)) {
			$('.content .bg_left').css('height', (sRightHeight - sBlockVisit)+'px');  // -blockVisit for blockVisit's height
		}
		
		if ((sRightHeight < sLeftHeight)){
			$('.right_content .main_content').css('height', (sLeftHeight - sElementsRight - 127)+'px');  // -127 for element's padding-top/bottom 
		}

});

