/* JS */
$(document).ready(function() {
	
	/* MENU **************************************************************************************************/
	$('#menu-menu_haut li:last-child').addClass('last');
	$('#menu-menu_haut > li:last-child a').attr('target','_blank');
	
	/* augmente la hauteur du menu - si sous-menu affiché */
	$('#menu-menu_haut li').each(function() {
		if($(this).find('ul').length && $(this).hasClass('current-menu-item')) {
			$('#header').css('height','202px')
		}
		
		if($(this).find('ul').length && $(this).hasClass('current-menu-parent')) {
			$('#header').css('height','202px')
		}
	});
	
	/* affiche le sous-menu au over */
	$('#menu-menu_haut li').each(function() {
		if($(this).hasClass('current-menu-item') || $(this).hasClass('current-menu-parent') || $(this).hasClass('current-menu-ancestor')){
		
			}else{
			
			$(this).hover(
				function () {
					$(this).find('ul').css('z-index','20');
					$(this).find('ul').animate({
						opacity: 1,
						height: 'toggle'
						}, 150, function() {
						// Animation complete.
					});
				}, 
				function () {
					$(this).find('ul').animate({
						opacity: 0,
						height: 'toggle'
						}, 150, function() {
						$(this).find('ul').css('z-index','10');
					});
				}
				
			);
		}
	});
	
	/* / MENU **************************************************************************************************/
	
	/* FOOTER **************************************************************************************************/
	$('#footer-widget-area .widget-area li:last-child').addClass('last');
	/* / FOOTER **************************************************************************************************/

});
