var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-21475692-2']);
  _gaq.push(['_trackPageview']); //track this pages view

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

  //the above code is Google's default code, below is my addition (using jQuery)
  $(document).ready(function(){
    var domain = document.location.host; //includes port if exists, whereas hostname does not
    var curPage = document.location.href;
    $('a[href^="http"]:not([href*="'+domain+'"])').each(function(){
      //track the events (string unless noted): 1st = method, 2nd = category, 3rd = action, 4th = label, 5th = (int)value
      //http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
      $(this).click(function(){
        //track an outbound link-click event
        _gaq.push(['_trackEvent', 'Outbound', curPage, $(this).attr('href')]);
      });
    });
  });
