$(document).ready(function(){
  
  
  $('ul.toplinks li').hover(
    function(){
      $(this).animate({ opacity: "1", backgroundColor: "#d8d8d8", borderTop: "6px solid #727E2D"}, 400);
      }, 
    function(){
      $(this).animate({ opacity: "0.8", backgroundColor: "#F0F0F0", borderTop: "1px solid #727E2D"}, 400);
      }
  );
 
 
  $('ul.toplinks li.active').hover(
    function(){
      $(this).animate({ opacity: "1"}, 400);
      }, 
    function(){
      $(this).animate({ opacity: "1"}, 400);
      }
  );
 
 
 $('ul.rss-items li a').hover(
   function(){
     $(this).animate({backgroundColor: "#eee", color: "#333"}, 500);
   },
   function(){
     $(this).animate({backgroundColor: "white", color: "#555"}, 200);
   }
   );
 
 
 $('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);
   }
   );
  
   $('#languages a').hover(
     function(){
       $(this).animate({padding: "6px"}, 500);
     },
     function(){
       $(this).animate({padding: "0px"}, 400);
     }

     );
  
  
  $('ul.questions li a').hover(
    function(){
      $(this).animate({paddingLeft: "5px", color: "#E7BA20"}, 400);
    },
    function(){
      $(this).animate({paddingLeft: "0px", color: "#9B9C61"}, 200);
    }
    );
  
  
   // 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");
}



