
jQuery(document).ready(function(){
  
  // Menu animations
  jQuery(".page_item").each(function(){
    if(jQuery(this).attr("class").indexOf("current_page_item") === -1){ // We need an animation if the page item is not the current page item
      jQuery(this).hover(
        function(){ // When the mouse is over the page item
          jQuery(this).animate(
            {backgroundPosition:"4px 0px"}, // The page item background moves up
            100,
            function(){
              jQuery(this).find("a").addClass("selected"); // The font has to be white when its background is colored
            });
        },
        function(){ // When the mouse is out of the page item
          jQuery(this).animate(
            {backgroundPosition:"10px 12px"}, // The page item background moves down
            100,
            function(){
              jQuery(this).find("a").removeClass("selected"); // The font can now recover its initial color
            });
        }
      );
    }
  });
      
});