/**
 * @author jens-petergrundmann
 * Gefunden auf http://iso-100.com/blog/post/updated-script-for-tracking-outbound-links-in-google-analytics-with-jquery/
 */
jQuery(document).ready(function() {
	jQuery('a').filter(function() {
	var theHref = this;
	if (theHref.hostname && theHref.hostname !== location.hostname) {
/*
		console.log("Attach "+theHref.hostname);
*/
		jQuery(theHref).bind('click keypress', function(event) {
			var code=event.charCode || event.keyCode;
			if (!code || (code && code == 13)) {
				if(pageTracker){
					var fixedLink = this.href;
					fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
					pageTracker._trackEvent('ExternalLink', 'Click', fixedLink);
				};
			};
		});
	};
});
});

