// A function that finds all links with the attribute rel="external" and sets them to open in a new window.
// Original code from SitePoint Pty. Ltd. (http://www.sitepoint.com/article/standards-compliant-world/3)
ExternalLinks = 
{
	TAG_NAME:    "a",
	REL_ATTR:    "external",
	TARGET_ATTR: "_blank"
};

ExternalLinks.init = function()
{
	if (!document.getElementsByTagName) { return; }
	var anchors = document.getElementsByTagName(ExternalLinks.TAG_NAME);
	
	for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == ExternalLinks.REL_ATTR)
		{
			anchor.target = ExternalLinks.TARGET_ATTR;
		}
	}
}

YAHOO.util.Event.addListener(window, "load", ExternalLinks.init);
