$(
  function () {
    // A quick jQuery-hack to highlight the current page
    // in the menu based on the path prefix.
    $('#menu a').each(
      function () {
        if ($(this).attr('href') == window.location.pathname.substring(0, $(this).attr('href').length)) {
          $(this).addClass('currentpage');
        }
      }
    );

    // Redirect to the first blog page on the main page.
    if (window.location.pathname == '/') {
      window.location.href = $('#content h2 > a').attr('href');
    }
  }
);
