if (!$.cookie('seen_navigation')) {
  $(window).load(function () {
    $.cookie('seen_navigation', true);
    $('#nav li').each(function (index) {
      $(this).animate({opacity: 0}, 500).animate({
         marginLeft: '40px',
         top: 0,
         opacity: 1
       }, 800, 'easeOutElastic').animate({opacity: 1.0}, 100 * (3 - index)).animate({
         top: $(this).attr('pt'),
       }, 200 * (index + 1)).animate({
           opacity: 0.5
       }, 200, activateNavigation);
    });
  
  
  });
  $(document).ready(function () {
   $('#nav li').each(function (index) {
     $(this).attr('pt', $(this).css('top'));
     $(this).css('top', '-48px');
     $(this).css('margin-left', '150px');
     $(this).css('opacity', 0);
   
    });
  });
}
else {
  $(document).ready(function () {
    $('#nav li').each(function (index) {
      $(this).css('opacity', 0.5);
     });
    activateNavigation();
  });
}

$(document).ready(function () {
  $("#s").placeholder({message: "Search..."});
});

function activateNavigation () {
  $('map area').mouseover(function () {
   $('#nav li.' + $(this).attr('alt')).stop().animate({
     marginLeft: 0,
     marginTop: '18px',
     opacity: 1,
   }, 400, 'easeOutQuart');
  });

  $('map area').mouseout(function () {
   $('#nav li.' + $(this).attr('alt')).stop().animate({
     marginLeft: '40px',
     marginTop: '0',
     opacity: 0.5
   }, 600, 'easeOutQuart');
  });
}