if (window.navigator.platform == 'iPhone' && document.body.id == 'home_page') {
  msg = "Would you like to use the mobile version?"
  if (confirm(msg)) {
    path = window.location.pathname;
    window.location.replace("http://m.nathanborror.com" + path);
  }
}

jQuery(function($) {
  
  /* Navigation */
  if ($('#navigation')) {
    var nav_resting_width = "-44px";/* ændres til at have samme værdi som i style.css' margin-left under navigation li a */
    var nav_hover_width = "0px";
    var delay = 400;
    
    $('#navigation > li').each(function(e) {
      if ($('body').hasClass(this.className)) {
        $('a', this).stop().animate({marginLeft:nav_hover_width}, 600);
      }
      else {
        $(this).hover(function() {
          $('a', this).stop().animate({marginLeft:nav_hover_width}, 200);
        },
        function () {
          $('a', this).stop().animate({marginLeft:nav_resting_width}, 200);
        });
      }
    });
  }

  if (document.body.id == 'home_page') {
    $('#navigation > li').each(function(e) {
      $('a', this)
        .fadeTo(delay, .8)
        .animate({marginLeft:nav_hover_width}, 200)
        .animate({marginLeft:nav_resting_width}, 200);
      delay += 100;
    });
  }

  if ($('body').hasClass('courses')) {
    $('.content blockquote p').wrapInner('<span></span>');
  }
});
