function showDisclaimer() {
	alert("You are now leaving Star Harbor's web site.  We only link to sites that we feel will be valuable to our members, but we have no control over these external sites.  If you find that there is anything we should be aware of on the site you are visiting, please let us know at info@starharbor.org");
}

function checkExternalLink(link) {

	internal = ['#', '/', 'http://starharbor.cu.trabian.com', 'http://www.starharbor.org', 'http://starharbor.org', 'https://www.starharbor.org', 'https://starharbor.org'];
	for (var i = 0; i < internal.length; i++) {
		if (link.indexOf(internal[i]) == 0) {
			return false;
		}
	}

	return true;

}

function externalLinks()
{

   if (!document.getElementsByTagName)
   {
       return;
   }

   var anchors = document.getElementsByTagName("a");

   for (var i=0; i<anchors.length; i++)
   {
       var anchor = anchors[i];

       if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "external" || checkExternalLink(anchor.getAttribute("href"))))
       {
           anchor.target = "_blank";
           anchor.onclick = showDisclaimer;
       }
   }
}

window.onload = externalLinks;