function mainmenu(){
	 $("#menu-principale li.first-level").hover(function(){
		  $(this).find('ul:first:hidden').css({
				'display': 'block'
		  });
		  $(this).addClass("hover");
	 },function(){
		  $(this).find('ul:first').css({
				'display': 'none'
		  });
		  $(this).removeClass("hover");
	 });
}


$(document).ready(function(){
	 var var_mute = 'false';

	 // gestion du menu
	 mainmenu();
    
	
	 // gestion des block clickable
	 $('.block-hover').hover(function(){
		  $(this).addClass('hover');
	 },function(){
		  $(this).removeClass('hover');
	 });

	 $(".block-hover").click(function(){
		  window.location=$(this).find("a").attr("href");
		  return false;
	 });

	 // gestion des value input
	 $('.inp-value').click(
		  function() {
				if (this.value == this.defaultValue) {
					 this.value = '';
				}
		  })
	 .blur(
		  function() {
				if (this.value == '') {
					 this.value = this.defaultValue;
				}
		  }
		  );

	 $('#btn-switch-lang').click(function () {
		  $(this).siblings('ul').slideToggle('fast');
	 });
	

	 $("#menu-newsletter a").prettyPopin({
		  width: 357,
		  height: 324,
		  loader_path: '/images/loader.gif'
	 });

	 jQuery('.external_link').each(function() {
		  jQuery(this).attr('target','_blank');
	 } );

	 jQuery('.btn-son').click(function(){
		  mute();
		  return false;
	 })

	 function getFlash() {
		  var isIE = navigator.appName.indexOf("Microsoft") != -1;
		  return (isIE) ? window['conteneur-flash'] : document['conteneur-flash'];
	 }
	 function mute() {
		  var_mute = var_mute == 'false' ? 'true' : 'false';
		  getFlash().muteSound(var_mute);
	 }




});
