function fixExitLinks(){
    var myLinks = document.links;
    var btype=0;
    if (window.attachEvent) {
        b=1;
    } else if (window.addEventListener) {
        b=2;
    }
	// run the regular script
    for(var i=0;i < myLinks.length;i++) {
        var thehref = myLinks[i].href.toString();
        if(thehref.indexOf("highmarkfcu") == -1){
            switch (b) {
                case 1:
                    myLinks[i].attachEvent("onclick",confirmExit);
					break;
                case 2:
                    myLinks[i].setAttribute("onclick","return confirmExit()")
					break;
                default:
                    //do nothing
            }
        }
    }
	
	
	// break the script for mailto links
	for(var i=0;i < myLinks.length;i++) {
        var thehref = myLinks[i].href.toString();
        if(thehref.indexOf("mailto:") == 0){
            switch (b) {
                case 1:
                    myLinks[i].detachEvent("onclick",confirmExit);
                    break;
                case 2:
                    myLinks[i].removeAttribute("onclick","return confirmExit()")
                    break;
                default:
                    //do nothing
            }
        }
    }
	// break the script for javascript pop ups
	for(var i=0;i < myLinks.length;i++) {
        var thehref = myLinks[i].href.toString();
        if(thehref.indexOf("javascript") == 0){
            switch (b) {
                case 1:
                    myLinks[i].detachEvent("onclick",confirmExit);
                    break;
                case 2:
                    myLinks[i].removeAttribute("onclick","return confirmExit()")
                    break;
                default:
                    //do nothing
            }
        }
    }
	
	// break the script for the external online banking site
	for(var i=0;i < myLinks.length;i++) {
        var thehref = myLinks[i].href.toString();
        if(thehref.indexOf("https://www.itsme247.com") == 0){
            switch (b) {
                case 1:
                    myLinks[i].detachEvent("onclick",confirmExit);
                    break;
                case 2:
                    myLinks[i].removeAttribute("onclick","return confirmExit()")
                    break;
                default:
                    //do nothing
            }
        }
    }
	
	
}

function confirmExit () {
if(confirm('You are now leaving Highmark Federal Credit Union\'s website.\n\nBy clicking the continue button, you will be accessing a website that is not owned or operated by the Credit Union.\n\nHighmark Federal Credit Union has no control over, and is not responsible for, the content of linked sites. The privacy and security policies of the site you are linking to may be different from the privacy and security policies of Highmark Federal Credit Union.\n\nClick Continue to proceed to the linked site or click Cancel to stay at Highmark Federal Credit Union\'s website.')){
    return true;
  } else {
      return false;
  }
}
