
//Automatically show "Opens in new window" icon if the URLs are different from the domain name of the host website.
function furnishExternals() {
	var strHref = window.location.href;
	var objAnchors = document.getElementsByTagName('a');
	var objImages;
	var strhostname;
	strhostname = location.hostname;

	for (var iCounter=0; iCounter<objAnchors.length; iCounter++)
	{
		objImages = objAnchors[iCounter].getElementsByTagName('img');
		if (!objAnchors[iCounter].name) {

	//		if (objImages.length == 0 && objAnchors[iCounter].href.indexOf('http://juicystudio') == -1 && objAnchors[iCounter].href.indexOf('http://www.juicystudio') == -1 && objAnchors[iCounter].href.indexOf('http://localhost') == -1)
			if (objImages.length == 0 && objAnchors[iCounter].href.indexOf(strhostname) == -1 && objAnchors[iCounter].href.indexOf(strhostname) == -1 && objAnchors[iCounter].href.indexOf(strhostname) == -1) {
				var objSpan = document.createElement('span');
				objSpan.appendChild(document.createTextNode('\u00a0'));
				objSpan.className = 'externallink';
				objSpan.title = 'Opens in a new window.';
				objAnchors[iCounter].parentNode.insertBefore(objSpan, objAnchors[iCounter].nextSibling);
			}
		}
	}
}

