$(document).ready(function(){   
	
	// MENU
	$('.first-level').hover(function(){
			$(this).addClass('hover').find('div').filter(':not(:animated)').slideDown('fast');
	 },function(){
	   		$(this).removeClass('hover').find('div').slideUp('fast');
	 });
    
	$('#nav-principale h3').each(function(){  
		var menuHeight = $(this).siblings('ul').height();
		var menuPosit = menuHeight/2;
		$(this).parents('li').hover(function(){
			    $(this).find('h3').addClass('hover-menu').next('ul')
					.css({top: -menuPosit, display: "inline"}).stop(true, true)
					.fadeIn();     
		 },function(){ 
				$(this).find('h3').removeClass('hover-menu').next('ul').stop(true, true).fadeOut();
		 });		
	});

	
	// gestion des block clickable	
	$('.bk-hover').live('mouseover mouseout',function(){
		$(this).toggleClass('hover');
	});

	$("bg-click").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;
			}
		}
	); 


  Cufon.replace('.custom-font', { fontFamily: 'gotham', hover: true });
  Cufon.replace('.custom-font-serif', { fontFamily: 'sentinel', hover: true });

  $("#newsleter").prettyPopin({width: 710});
  $("#newsletter").prettyPopin({width: 710});
  
  //gestion formulaire mot de passe oublié
  $('#pass_recover_form').hide();
  $('#pass_recover').click(function(){
	$('#pass_recover_form').slideToggle();
    return false;
  });
});

