


$(document).ready(function() {
						  

  $("#navigation li:last-child").addClass("last")
  
  // Open external links in a new window the semantic way.
  hostname = window.location.hostname
  $("a[href^=http]")
    .not("a[href*='" + hostname + "']")
    .addClass('link external')
    .attr('target', '_blank');
	
	
    
  
  // Current class
  /*
    I'm appending a classname to the body tag of the current page.
    After that, I'm checking whether the class name is the same as one of the
    links on the page.
    
    If the href of a link is exactly the same as the classname as the body tag, 
    it will highlight. All other links on the page will not be affected.
    
  */
  
  // capture what page is currently in the location bar
  var currentPage = window.location.href
  $('a').each(function(index) {
    // capture the page being linked to
    var linkHref = $(this)[0].href
    // check if the href of the link is same as the current page
    if (linkHref == currentPage) {
      $(this).addClass('current');
    };
  });
  
  // Last child
  $('html.ie6 *:last-child').addClass('last')

  // Initialize calendar
  $('#calendar').fullCalendar({ })

  
});


