// +++++++++++ set target attribute +++++++++++ 
// utilizes library files >>> dom.js

// sets the target attribute of <a> (anchor) tag with specified relValue via the DOM
// xhtml 1.0 strict compliant; DOM2.0 compliant
// used instead of js command window.open() because most browsers
// do not correctly report the referring URL in the request for the new page
// (a serious issue for inter-site links.)
// code based on http://www.sitepoint.com/article/standards-compliant-world
function setTarget(relValue, targetValue) {

	// check to see if browser supports DOM1.0
	// if not, do not execute function
	if (!DOM) { return; }

	// find all anchor tags
	var anchors = document.getElementsByTagName('a');

	// for each anchor that has a href attribute and where
	// specified relValue, set targetValue
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && 
		anchor.getAttribute("rel") == relValue) {
			anchor.target = targetValue;
		}
	}
}