// typo
Cufon.replace('#nav div a, #title p, #breadcrumb strong,  #subcontent .contact .tel, #subcontent .contact .people, .single h1, .home #maincontent h2, .home #maincontent h3, .category #maincontent h3, .tag #maincontent h3, #subcontent h4, #footer h3', {fontFamily: 'Helvetica Neue'}
);

// empty search form
$(document).ready(function(){
	$('#s').focus(function(){
		$('#s').val('');
	});	
	$('#s').blur(function() {
		if($('#s').val()=='') {
			$('#s').val('Entrez votre recherche');
		}
	});	
});

// empty form
$(document).ready(function(){
	$('.fbmail').focus(function(){
		$('.fbmail').val('');
	});	
	$('.fbmail').blur(function() {
		if($('.fbmail').val()=='') {
			$('.fbmail').val('Entrez votre email');
		}
	});	
});


// smooth scroll
$(document).ready(function(){
  	$('a[href*=#]').click(function() {
 		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   			var $target = $(this.hash);
			// name attribute
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
   			if ($target.length) {
	  			var targetOffset = $target.offset().top;
	  			$('html,body').animate({scrollTop: targetOffset}, 400);
	    		return false;
   			}
 		}
	});
});

// toggle contact form
$(document).ready(function(){
 	$("#contact div.contact").slideUp();
    $("#contact h4").click(		
      function() {
			$('#contact div.contact').slideToggle('slow');
			$('#contact h4').toggleClass('down')
		}
    );
});

// toggle book
$(document).ready(function() {
	$("#book ul").slideUp();
	if ($("body.category-book").length>0) {
		$("#book ul").slideDown();
		$('#book h4').addClass('down');
	}
    $("#book h4").click(
      function() {
			$('#book ul').slideToggle();
			$('#book h4').toggleClass('down')
		}
    );			
});

// toggle archives
$(document).ready(function(){
	$('#archives ul').slideUp();
    $("#archives h4").click(
	    function() {
			$('#archives ul').slideToggle('slow');
			$('#archives h4').toggleClass('down');
		}
    );
});

// open contact form from footer image
$(document).ready(function(){
    $("#footer a.contact").click(		
      function() {
			$('#contact div.contact').slideDown("slow");
			$('#contact h4').addClass('down')
		}
    );			
});

// lightbox
$(document).ready(function() {
	$('.gallery a').lightBox(); // Select all links in object with gallery ID
});


