$(document).ready(function(){
  
  
  $('ul.toplinks li').hover(
    function(){
      $(this).animate({ opacity: "1", backgroundColor: "#d8d8d8", borderTop: "6px solid #B37F2C"}, 400);
      }, 
    function(){
      $(this).animate({ opacity: "0.8", backgroundColor: "#F0F0F0", borderTop: "1px solid #8B6223"}, 400);
      }
  );
  
 
 
 
 $('div#footer li a').hover(
   function(){
     $(this).animate({ borderBottom: "1px solid #E7BA20", paddingLeft: "5px"},300);
   },
   function(){
     $(this).animate({ borderBottom: "0px dashed #9B9C61", paddingLeft: "0px"},300);
   }
   );
  
  
  
  $('ul.questions li a').hover(
    function(){
      $(this).animate({paddingLeft: "5px", color: "#E7BA20"}, 400);
    },
    function(){
      $(this).animate({paddingLeft: "0px", color: "#9B9C61"}, 200);
    }
    );
  
  $('#languages a').hover(
    function(){
      $(this).animate({padding: "6px"}, 500);
    },
    function(){
      $(this).animate({padding: "0px"}, 400);
    }
    
    );
  
  
  
   // Change the image of hoverable images
   $(".hover").hover( function() {
       var hoverImg = HoverImgOf($(this).attr("src"));
       $(this).attr("src", hoverImg);
     }, function() {
       var normalImg = NormalImgOf($(this).attr("src"));
       $(this).attr("src", normalImg);
     }
   );
});

function HoverImgOf(filename)
{
   var re = new RegExp("(.+)\\.(gif|png|jpg)", "g");
   return filename.replace(re, "$1_hover.$2");
}
function NormalImgOf(filename)
{
   var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
   return filename.replace(re, "$1.$2");
}



