$(function () {
    new MainNavigation('#main_navigation');

    function logoHighlight(anchor) {
        var $anchor = $(anchor),
        $header = $anchor.parents('header');

        $anchor.hover(
      function () {
          $header.css({
              'background-position': '0 0'
          });
      },
      function () {
          $header.css({
              'background-position': '0 -54px'
          });
      }
    );
    };
    logoHighlight('.logoSwap');

    function socialMediaButtons(button, index) {
        $(button).hover(
      function () {
          $(this).animate({
              top: 1
          }, 80, function () {
              $(this).addClass('highlight_' + index);
          });
      },
      function () {
          $(this).removeClass('highlight_' + index).animate({
              top: -5
          }, 90, function () {
              $(this).animate({
                  top: 12
              }, 120);
          });
      }
    );
    };
    $('.social_media_links a').each(function (index) {
        socialMediaButtons(this, index);
    });
});
