
/* Initiate */

addLoadEvent(function() {
	var exCatcher = new ExternalLinkCatcher("rel", "external");
	exCatcher.Init();
});


/************************/
/* Print this page link */
/************************/

// Constructor

var ExternalLinkCatcher = function(attribute, value)
{
	this.Attribute = attribute;
	this.Value = value;
}

// Public instance methods

ExternalLinkCatcher.prototype.Init = function() {

	if(!document.getElementById || !document.getElementsByTagName || !document.createTextNode) {
		return;
	}

	var linkArray = document.getElementsByTagName("a");
	
	// Find objects
	for(var i = 0; i < linkArray.length; i++)
	{
		if(linkArray[i].getAttribute(this.Attribute) == this.Value)
			linkArray[i].target = "_blank";
	}
}
