// JavaScript Document<script>

// List of domains or web addresses that do not require an external website disclosure - separate each URL with semi-colons
var strDomainFilters = "fivecounty.com;synergentcorp.com;www.fivecounty.com;secure.loanspq.com"
var strMessage = "You are now leaving the Five County Credit Union Web site.\n\nPlease be advised that Five County Credit Union is not liable for either the content or availability of external Web sites.";
// Do not edit below this point

var nav4 = window.Event ? true : false;

function processClicks(e) {
	// Grab the Source Element based on browser type
  if (nav4) 
	{
    var srcElem = e.target
  } 
	else 
	{
    var srcElem = event.srcElement
  }
	
	// Code to Check for linked images
	if(srcElem.tagName == "IMG")
	{
		srcElem = srcElem.parentElement;
	}
	
	// If this clicked object is a link check the URL against  Domain Filters
	if(srcElem.tagName == "A")
	{
		var strURL = srcElem.href;
		// Determine if this is an external link, internal links are ok by default
		if(strURL.indexOf("http:") > -1 || strURL.indexOf("https:") > -1)
		{
			// Setup variables; by default we'll show the message unless the url contains one of the filters
			var bShowAlert = true;
			var i = 0
			// Create an array of filters
			var arrDomainFilters = strDomainFilters.split(";");
			// Loop through filters and check against the URL
			for(i=0; i<arrDomainFilters.length;i++)
			{
				// if the filter is in the URL, we will NOT show the Message
				if(strURL.indexOf(arrDomainFilters[i]) != -1)
					bShowAlert = false;
			}
			// If the message is determined to be displayed, display it
			if(bShowAlert)
				alert(strMessage);
		}
	}	
}

// trap the click even based on browser type
if (nav4)
  document.captureEvents(Event.CLICK);
document.onclick = processClicks;

// function to open external links w/ the alert message
function openExtLink(strURL, strTarget)
{
	alert(strMessage);
	window.open(strURL, strTarget);
}