var ExternalLinks={
	init: function () {
		$$('a').each(ExternalLinks.setupLink);
	},

	setupLink: function (a) {
		if (!location.protocol.match(/^http/)) return;

		if (a.protocol.match(/^http/) && a.href.indexOf('http://'+location.host) != 0) {
			a.addClassName('external');
			a.setAttribute('target', '_blank');
		}
	}
};

registerOnLoadFunction(ExternalLinks.init);
