$(document).ready(function() {

	$('a').click(function() {
		var $a = $(this);
		var href = $a.attr('href');
 
		// see if the link is external
		if ( (href.match(/^http/)) && (! href.match(document.domain)) ) {
 
			// if so, register an event
			var category = 'outgoing'; // set this to whatever you want
			var event = 'click'; // set this to whatever you want
			var label = href; // set this to whatever you want
 
			pageTracker._trackEvent(category, event, href);
		}
	});

	var fileTypes = ['doc','xls','pdf','mp3'];
 
	$('a').click(function() {
 	var $a = $(this);
  	var href = $a.attr('href');
  	var hrefArray = href.split('.');
  	var extension = hrefArray[hrefArray.length - 1];
 
  	if ($.inArray(extension,fileTypes) != -1) {
      	pageTracker._trackEvent('download', extension, href);
  	}
 
	});

});

