// default

$(function(){

	// event tracker for outgoing links/file downloads
	$('a').each(function(){
		var path;
		
		if(path = $(this).attr('href')){
			var outgoing 	= /^(http|https)/i;
			var ext 		= /[^/].(?:doc|eps|jpg|jpeg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3|mp4)/i;
			
			if (path.match(outgoing) && !path.match(document.domain) ) {
				$(this).click(function(){
					// old ga code
					//pageTracker._trackEvent('Link', 'Outgoing', $(this).attr('href'));
					
					// new ga code
					_gaq.push(['_trackEvent', 'Link', 'Outgoing', $(this).attr('href')]);
				});
			} else if(path.match(ext)){
				$(this).click(function(){
					// old ga code
					//pageTracker._trackEvent('File', 'Download', $(this).attr('href'));
					
					// new ga code
					_gaq.push(['_trackEvent', 'File', 'Download', $(this).attr('href')]);
				});	
			}
		}
	});
	
});