/**

----------------------------------
DOCUMENT HISTORY:
----------------------------------

Created by: Ryan J. Salva, http://www.capitolmedia.com
Date created: July 24, 2004

----------------------------------
DESCRIPTION
----------------------------------

Searches document for hyperlinks that go outside the 
current domain, then updates those links with 
target="_blank"

----------------------------------
TESTED WITH:
----------------------------------
Mozilla Firefox 0.9.1
IE 6.0
Netscape 6.2

----------------------------------
REQUIRED ASSETS: 
----------------------------------
none

----------------------------------
IMPLEMENTATION:
----------------------------------

Simply include this script in the <HEAD>
No other action required.

**/

fnExternalLink = function() {
	// for IE browsers
	if (document.all)
	{
		for(i=0; i<document.all.length; i++)
		{ 
			try 
			{ 
				var l = document.all[i];
				if (l.tagName == 'A') 
				{ 
					if (l.href.indexOf(window.location.hostname) == -1) l.target = '_blank'; 
				} 
			}
			catch(E){} 
		} 
	}
		
	// for Mozilla browsers
	if (document.childNodes)
	{
		d = document.getElementsByTagName("body");
		b = d.item(0);
		a = b.getElementsByTagName("a");
		
		for (var i = 0; i < a.length; i++)
		{
			l = a.item(i);
			if (l.hostname != window.location.hostname) l.target = '_blank'; 
		}
	}	

}

if (window.attachEvent) window.attachEvent('onload', fnExternalLink);
