/*

	To use:
	
	1. Copy this file and the file 'addListener.js' into a directory on the site.
	2. Call BOTH files on whatever pages they're needed like this (adjusting the paths as needed):
	
		<script type="text/javacript" src="addListener.js"></script>
		<script type="text/javacript" src="externalLinks.js"></script>
		
	3. Delete this comment
		
*/

function externalLinks() {
	if (!document.getElementsByTagName) {
		return;
	}
	var anchors = document.getElementsByTagName('a');
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') {
			anchor.target = '_blank';
		}
	}
}
addListener(window, 'load', externalLinks);
