function externalLinks()
{
	// dont do anything if we cant getElementsByTagName
	if (!document.getElementsByTagName) return;
	
	// get all the links on the page
	var links = document.getElementsByTagName("a");

	// go through and set the target if the rel is external
	for (var i = 0; i < links.length; i++)
	{
		var currentLink = links[i];
		// href must not be null and rel must be set to external
		if (currentLink.getAttribute("href") && currentLink.getAttribute("rel") == "external")
		{
			currentLink.target = "_blank";
		}
	}
}

var oldLoad = window.onload;

function onPageLoad()
{
	if (oldLoad)
	{
		oldLoad();
	}
	// process new window links
	externalLinks();
}

window.onload = onPageLoad;
