function doExternalLink(myLink){
	// This function opens a link to another page/website in a new window.
	// This is to replace the target attribute on the anchor elements, as the target attribute is NOT valid XHTML 1.0 STRICT.
	// Check to make sure that the "href" property is valid.
	if(this.href){
		// Open a new window using the "href" variable.
		window.open(this.href);
	}
	else if(myLink.href){
		// Open a new window using the "href" variable.
		window.open(myLink.href);
	}
	// End of IF statement.
	return false;
}
// End of function "doExternalLinks()"

function initExternalLinks(siteAddr){
	// Check to see if there is a "siteAddr" property.
	// If there is, then assign this property to the "siteAddr" varaible.
	if(this.siteAddr) siteAddr = this.siteAddr;
	// Get all of the ANCHOR element.
	var anchors = document.getElementsByTagName("a");
	// Check to see if there is at least one anchor element.
	if(anchors.length > 0){
		// Loop through each of the anchor elements in the "anchors" array.
		for(i=0; i<anchors.length; i++){
			// Check to see if the "siteAddr" varaible is an empty string.
			if(siteAddr == ""){
				// OnClick event is to be assigned to all anchors that have a class name of "extLink".
				// Check to see if the "className" property is equal to "extLink".
				if(anchors[i].className == "extLink"){
					// Set the onclick event handler.
					anchors[i].onclick = doExternalLink;
				}
				// End of IF statement.
			}
			else{
				// OnClick event is to be assigned to all anchors that do not have the same website address as the current website (the current website address is stored in the varaible "siteAddr").
				// Get the HREF protocol of the current anchor.
				var hrefProtocol = anchors[i].href.substring(0, anchors[i].href.indexOf(":"));
				// Check to see if the protocol is "http".
				if(hrefProtocol.toLowerCase() == "http"){
					// Get the current site address on the current anchor (this will only obtain the letters up to the same length of the "siteAddr" variable).
					var curSiteAddr = anchors[i].href.substring(0, siteAddr.length)
					// Check to see if the "curSiteAddr" is NOT equal to the "siteAddr" varaible.
					if(curSiteAddr !== siteAddr){
						// Set the onclick event handler.
						anchors[i].onclick = doExternalLink;
					}
					// End of IF statement.
				}
				// End of IF statement.
			}
			// End of IF Else statement.
		}
		// End of FOR Loop.
	}
	// End of IF statement.
}
// End of function "initExternalLinks()".

//window.siteAddr = "http://localhost";
//window.onload = initExternalLinks;
//window.onload = function(){ initExternalLinks(""); };