$(function() {
  var active = window.location.hash.substring(1);
  if (active) {
    switchto(active);
  }
  else {
    switchto('about');
  }
})

var theWidth; // Set up global var so we can count inside a function...
function switchto(elem) {
  $('.content_bubble').hide();
  $('#'+ elem).show();
  theWidth = 54;
  $('#nav_' + elem).parent().prevAll().each(function() {
    theWidth += $(this).outerWidth(true);
  });
  $('#triangle').css('margin-right', theWidth +'px');
}
