// menu princpal$(function(){	// gestion des drapeaux en header	$('.language-selection-container a img.language-flag').css('opacity', '0.4');	$('.language-selection-container a img.nofade-flag').css('opacity', '1.0');
	// inverse l'opacité sur l'élément survolé et les autres	$('.language-selection-container a img').hover(		function(){			$('.language-selection-container a img.language-flag').css('opacity', '0.4');			if( $(this).hasClass('fade-flag') )			{				$(this).animate({opacity:'1.0'});			}			else			{				$(this).css('opacity', '1.0');			}		},		function(){			$('.language-selection-container a img.fade-flag').animate({opacity:0.4}, 'fast');			$('.language-selection-container a img.nofade-flag').animate({opacity:1.0}, 'fast');		}	);
	// simulation d'un parallax sur le fond	// inspiré par australopitech.com	function getWindowHeight() {	    var windowHeight=0;	    if (typeof(window.innerHeight)=='number') {	        windowHeight=window.innerHeight;	    } else {	        if (document.documentElement && document.documentElement.clientHeight) {	            windowHeight = document.documentElement.clientHeight;	        } else {	            if (document.body && document.body.clientHeight) {	                windowHeight=document.body.clientHeight;	            }	        }	    }	    return windowHeight;	}
	function parallax(){	    scrollTopCur = $(document).scrollTop(); // distance par rapport au haut du document	    heightCur = $(document).height();       // hauteur du document	    windowHeight = getWindowHeight();       // hauteur "utile" de la fenêtre	    $('#parallax-mongolfieres').css(	        "background-position",	        "50% " +	        Math.round( 0 - ( scrollTopCur / (heightCur) * 200) )	        + "px"	    );		$('#parallax-piafs').css(	        "background-position",	        "-40px " +	        Math.round( 0 + ( scrollTopCur / (heightCur) * 40) )	        + "px"	    );	    $('#parallax-big-mongolfiere').css(	        "background-position",	        "70% " +	        Math.round( -20 + ( scrollTopCur / (heightCur) * 120) )	        + "px"	    );	    /*	    $('#parallax-nuages').css(	        "background-position",	        "-40px " +	        Math.round( 0 + ( scrollTopCur / (heightCur) * 500) )	        + "px"	    );	    $('#parallax-big-nuage').css(	        "background-position",	        "-70px " +	        Math.round( 0 + ( scrollTopCur / (heightCur) * 500) )	        + "px"	    );	    */	}
    parallax();                     // calcul au chargement de la page    $(window).scroll(parallax);     // calcul au défilement de la page    $(window).resize(parallax);     // calcul au redimensionnement de la page
	/*   hover   sur   une   area   */	$(".map  .area").hover   (		function   ()   {			  var   ShowItem   =   document.getElementById("area_image");			  var   LinkItem   =   document.getElementById(this.id);			  ShowItem.style.backgroundImage   =   'url(images/map/map-'   +   this.id   +   '.gif)';			  LinkItem.style.textDecoration   =   "underline";			  return   false;			  },			  function   ()   {			  var   ShowItem   =   document.getElementById("area_image");			  var   LinkItem   =   document.getElementById(this.id);			  ShowItem.style.backgroundImage   =   'url(images/map/all.gif)';			  LinkItem.style.textDecoration   =   "none";			  return   false;			  }	   );	/*	 * Version des menus sous forme déroulante et non fadée	 *	var menu1height = $('#menu-dropdown-30000046').height();	var menu2height = $('#menu-dropdown-30000047').height();	var menu3height = $('#menu-dropdown-30000048').height();	var menu4height = $('#menu-dropdown-30000049').height();	$('.menu-list-elements-container').css('height', '0px');	$('.menu-list-container').hover(		function()		{			$('embed').css('visibility', 'hidden');			$('object').css('visibility', 'hidden');			//$(this).find('.menu-list-elements-container').fadeIn('50');			if( $(this).attr('id') == 'menu-overall-30000046' )			{				$(this).find('.menu-list-elements-container').animate({height:menu1height}, 100);			}			if( $(this).attr('id') == 'menu-overall-30000047' )			{				$(this).find('.menu-list-elements-container').animate({height:menu2height}, 100);			}			if( $(this).attr('id') == 'menu-overall-30000048' )			{				$(this).find('.menu-list-elements-container').animate({height:menu3height}, 100);			}			if( $(this).attr('id') == 'menu-overall-30000049' )			{				$(this).find('.menu-list-elements-container').animate({height:menu4height}, 100);			}		},		function()		{			$('.menu-list-elements-container').css('height', '0px');			setTimeout(function(){				$('.menu-list-elements-container').hide();				$('embed').css('visibility', 'visible');				$('object').css('visibility', 'visible');			}, 0); // si vous souhaitez retarder la disparition, c'est ici		}	).end();	*/
	// masque le menu de plus de critères quand on clique à côté
	// gourmand niveau ressources	//$('#lei-top-form-homepage').bind('clickoutside',	$(".zone-recherche").bind('clickoutside',		function(event){			if( $('#search-plus').css('display') == 'block' )
			{				$('#search-plus').fadeOut();				if( $(".bandeau-gauche").length ) {					$(".bandeau-gauche").find("object").show();				}			}			event.preventDefault();			return false;		}	);});


var obj = null;

function checkHover() {
	if (obj) {
		if(jQuery.browser.safari)		{			obj.find('.menu-list-elements-container').hide();		}		else		{			obj.find('.menu-list-elements-container').fadeOut(0);		}
	} //if
} //checkHover

$(document).ready(function() {		var $hasObject = $(".bandeau-gauche").find("object");		if($('#search-plus').length ) {			if ($('#search-plus').css("display") != 'none' )				place_search_plus();				$('#btnMoreCriteria').click(function(){					if ($('#search-plus').css("display") == 'none'){						// positionne et affiche						place_search_plus();						$(this).addClass("openMore");						$('#search-plus').fadeIn('fast');						$('#btnMoreCriteria').val('- de criteres');						if( $(".bandeau-gauche").length ) {							$(".bandeau-gauche").css({'min-height':'165px'});							$hasObject.hide();						}					}					else {						$('#search-plus').fadeOut('fast');						$('#btnMoreCriteria').val('+ de criteres');						$(this).removeClass("openMore");						// reset des donn&eacute;es						$('#search-plus input').each(function(){this.checked = false;});							if( $(".bandeau-gauche").length ) {								$hasObject.show();							}					}				});			$('#search-plus').mouseleave(function() {			/*	$('#search-plus').delay(2500).fadeOut('fast');				$('#btnMoreCriteria').val('+ de criteres');				$(this).removeClass("openMore");				if( $(".bandeau-gauche").length ) {								$hasObject.show();							}*/			});			$('#search-plus').mouseenter(function() {					// positionne et affiche					place_search_plus();					$('#search-plus').fadeIn('fast');					$(this).addClass("openMore");					$('#btnMoreCriteria').val('- de criteres');					if( $(".bandeau-gauche").length ) {						$hasObject.hide();					}			});		}
	$('.menu-list-container').hover(function() {
		if (obj) {
			if(jQuery.browser.safari)			{				obj.find('.menu-list-elements-container').hide();			}			else			{				obj.find('.menu-list-elements-container').fadeOut(0);			}
			obj = null;
			$('embed').css('visibility', 'hidden');
			$('object').css('visibility', 'hidden');
		} //if		if(jQuery.browser.safari)		{
			$(this).find('.menu-list-elements-container').show();		}		else		{			$(this).find('.menu-list-elements-container').fadeIn(250);		}
	}, function() {
		obj = $(this);
		setTimeout(
			"checkHover()",
			0); // si vous souhaitez retarder la disparition, c'est ici
		$('embed').css('visibility', 'visible');
		$('object').css('visibility', 'visible');
	});
	// Pour désactiver les champs du formulaire lorsque l'user a validé ce dernier
	$('.form2010').submit(function(event) {
		event.preventDefault();
		//event.stopPropagation();
		this.submit();
		/*$('.form2010 input:radio, .form2010 input:checkbox, .form2010 input:text, .form2010 select').each(function(index,element){
			$(element).attr('disabled','disabled');
		});*/
	});
});
