$(document).ready(function(){
	$('a').filter(function() {
		var theHref = this;
		if (theHref.hostname && theHref.hostname !== location.hostname) {
			$(theHref).addClass('outgoing').bind('click keypress', function(event) {
				var code=event.charCode || event.keyCode;
				if (!code || (code && code == 13)) {
					if(pageTracker){
						var fixedLink = $(this).attr('href');
						fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
						fixedLink = '/outgoing/' + fixedLink;
						pageTracker._trackPageview(fixedLink);
					};
				};
			});
		};
	});
	
	$('a[href^="/content/go"]').addClass('outgoing').bind('click keypress', function(event) {
		var code=event.charCode || event.keyCode;
		if (!code || (code && code == 13)) {
			if(pageTracker){
				var fixedLink = $(this).attr('href');
				fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
				fixedLink = '/outgoing/' + fixedLink;
				pageTracker._trackPageview(fixedLink);
			};
		};
	});
	
});

function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}