ExternalLinks					= {
	init:function() {

		// Fetch all the a elements in the document.
		var links = document.getElementsByTagName('a');

		// Loop through the a elements in reverse order
		// for speed.
		for (var i = links.length; i != 0; i--) {

			// Pull out the element for this iteration.
			var a = links[i-1];

			// If the element doesn't have an href, skip it.
			if (!a.href) continue;

			// If the element links to external address
			// add target="_blank"			
			if (a.href.indexOf(document.domain) == -1 && a.href.indexOf('hbpl.co.uk') == -1 && a.href.indexOf('community.printweek.com') == -1) {
				
				a.target = '_blank';
			}
		}
	}
}
WindowListener.add("load","ExternalLinks.init()");
