jQuery(document).ready(function(){
   
   // fade in header image
   if(jQuery.support.opacity){
      jQuery("#headerImage,.frp_section_home #companyHeader a").animate({opacity: 1},3000, "linear", function(){
         jQuery(this).css("opacity", "auto");   
      });
   } else {
      jQuery("#headerImage,.frp_section_home #companyHeader a").css("opacity", "auto");
   }
   
   
   var navHoverOn = function(){
      var el = jQuery(this);
      el.stop();
      el.animate({
         backgroundPosition: '0px 0px'
      },"fast","swing");
      
   }
   
   // navigation background hover animation
   var navHoverOff = function(){
      var el = jQuery(this);
      var w = el.outerWidth();
      el.stop();
      el.animate({
         backgroundPosition: w+"px 0"   
      },"fast","swing");
   }
   
   jQuery("#navigation a").each(function(){
      var el = jQuery(this);
      var w = el.outerWidth();
      jQuery(this).css("backgroundPosition", w+"px 0px");   
   }).hover(navHoverOn,navHoverOff);
    
});
