//
// Set menu links as active based on current path
//
// Replace , with / since IE6 incorrectly returns window.location.pathname
// with , instead of /
//
$(function() {
  var page = window.location.pathname.replace(',', '/').split('/');
  
  // Journal pages, i.e. /journal/*
  if (page[1] == 'journal') {
    var page = window.location;
    var query = page ? '[href^="' + page + '"]' : ':first' ;
    $('#navbar a' + query).addClass('active');
  }

  // Base site, i.e. /*
  else {
    var query = page[page.length-1] ? '[href="' + page[page.length-1] + '"]' : ':first' ;
    $('#menu_wrap a' + query).addClass('current');
  }
});
