//
// This JavaScript fixes the omission of the 'target' attribute
// in the anchor-tag in XHTML 1.0 Strict.
//
// Further reading: http://www.sitepoint.com/article/standards-compliant-world
//
// Copyright (c) 16 Mar 2006 by Peter Bittner

//
// Tells the browser to open any 'a href's, which are specifying a
// 'rel="external"' attribute, in a new browser window.
//
// NOTE: You need to specify a rel-attribute with value "external" in
//       any anchor tag you want to have opened in a new window!
//
// e.g. <a href="http://peter.bittner.it/" rel="external">...</a>
//

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";
	}
}

// run the function above when finished loading the document
window.onload = externalLinks;

