
 $(function() {
      var scrollElement = $("html");
      var scrollValue = scrollElement.scrollTop();
      if (scrollElement.scrollTop(scrollValue + 1).scrollTop() == scrollValue) {
        scrollElement = $("body");
      }
      else {
        scrollElement.scrollTop(scrollValue);
      }
      $("a[href*=#]").click(function() {
        if (location.hostname+location.pathname+location.search == this.hostname+this.pathname.replace(/^([^\/].*)/, "/$1")+this.search) {
          var hash = "#"+$(this).attr("href").split("#")[1];
          var target = $(hash == "#" ? body : hash);
          if (target.length) {
            var id = target.attr("id");
            target.attr("id", "");
            location.hash = hash;
            target.attr("id", id);
            var to = target.offset().top;
            scrollElement.animate({ scrollTop: to }, {
              duration: Math.abs($(window).scrollTop() - to) * 0.45,
              complete: function() { target.focus(); }
            });
            return false;
          }
        }
      });
    });

function DoAgain()
{
    
     $("#moustique").animate({top:"380px", right:"100px" }, 100 )
	 .animate({top:"386px",right:"106px" }, 600 )
	 .animate({top:"392px",right:"96px" }, 700 )
	 .animate({top:"385px",right:"99px" },600,DoAgain);
	 
	     $("#ane").animate({left:"0px" }, 1000 )
		 .animate({left:"0px" }, 2000 )
		  .animate({left:"-300px" }, 1000 )
	 .animate({left:"-300px" }, 5000,DoAgain);
	
	

	
 $("#oeil").animate({top:"480px", marginLeft:"-730px" }, 1400 )
	 .animate({top:"496px",marginLeft:"-736px" }, 900 )
	 .animate({top:"472px",marginLeft:"-726px" }, 1200 )
	 .animate({top:"485px",marginLeft:"-729px" },1400,DoAgain);
	 
	 
	 /* $("#baleine").animate({top:"50px", left:"-245px" }, 200 )
	 .animate({top:"80px",left:"100%" }, 6800 )
	 .animate({top:"-200px",left:"100%",height:"0" }, 100 )
	 .animate({top:"-200px",left:"-45px" }, 5200 )
	 .animate({top:"50px",left:"-502px",height:"168px" },500,DoAgain);
	 */
	 
}




$(document).ready(function() {
///////////////////////////////////////////////////////	

$("#livredor").hide();





$("#menu a").css({'rotate':'-20deg'}).css({'visibility':'visible'});
DoAgain();


$('.photo-link').fancybox();



/*$('#lire-suite').toggle(
  function () {
    $('#edito-suite').slideDown();
	$(this).html('refermer');
	return false;
  }, 
  function () {
	$('#edito-suite').slideUp();
	$(this).html('Lire la suite');
  return false;
  }
);*/

$('#ajouter-message').toggle(
  function () {
    $('#livredor').slideDown();
	
	return false;
  }, 
  function () {
	$('#livredor').slideUp();
	
  return false;
  }
);

	
/////////////////////////////////////////////////	
		});
