// JavaScript Document<script>

// List of domains that do not need the external website disclosure - split URLs with semi-colons
var strDomainFilters = "mortgagewebcenter.com;avtecmedia.com;www.olincreditunion.org;www.avtecmedia.com;www.netit.financial-net.com;https://ellie.cns.coop"
var strMessage = "Links to other web sites are provided solely as a convenience to visitors. If you use these links, you will leave the Olin Community Credit Union web site.\n\n The credit union does not have any responsibility for, or control over, any of these external web sites, their content or their privacy policies. We do not endorse or make any representations about them, or any information, products, or materials found there, or any results that may be obtained from using them. If you decide to access any of the linked third-party web sites, you do so entirely at your own risk. You are encouraged to review the privacy notice for each linked web site.";
// 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
  }
	
	// 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 show the message unless the domain 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);
		}
	}	
}

document.onclick = processClicks;

// function to open external links w/ the alert message
function openExtLink(strURL, strTarget)
{
	alert(strMessage);
	window.open(strURL, strTarget);
}