jQuery:
Code:
$("a").click(function() {
	var link = $(this).attr("href");
	var portal = "http://"+document.domain+"/portal?url=";
	$(this).prop("href", portal+link);
});
Basic w\o
Code:
onload = function () {
	for (var i = 0; i < document.links.length; i++) {
	if(document.links[i].indexOf(document.domain) == -1)
	document.links[i].onclick = function(){this.href = 'http://myportal.com/?'+this.href;}}
}
Super basic but a friend asked for it, it will show the target link when you hover and such but when you click it will make you go through a portal(similar to what google does).