$(document).ready(function(){
  //Stretch the shadow height
  $('#shadow').height($('#content').height() + 1);

  //NAV nudge on mouseover
  $('#nav .item').hover(
    function(){
      $(this).stop().animate({left: '-20px'}, 50);
    },
    function(){
      $(this).stop().animate({left: '-40px'}, 50);
    }
  );
  
  //Map nudge on mouseover
  $('#nav-map').hover(
    function(){
      $(this).stop().animate({right: '-5px'}, 30);
    },
    function(){
      $(this).stop().animate({right: '-20px'}, 30);
    }
  );
  
  //Map
  $('#nav-map').bind('mouseenter mousemove', function(event){
    if($("#map[display='none']")){
      $('#map').stop().css('display', 'block').animate({opacity: 1}, 100);
    }
    $('#map').css('left', event.pageX + 10);
    $('#map').css('top', event.pageY - 360);
  });
  
  $('#nav-map').mouseleave(function(event){
    $('#map').stop().animate({opacity: 0}, 100, function(){
      $(this).hide();
    });
  });
  
  //Set the link locations for the NAV items
  $('#nav .item').click(function(){
    document.location = $('a', this).attr('href');
  });
});
