

var domain = 'kybank.com';
var exceptionDomain = 'web13.secureinternetbank.com';
$(document).ready(function () {
    $("a[href^=http]").each(
        function () {
            if ((this.href.indexOf(domain) == -1) && (this.href.indexOf(exceptionDomain) == -1)) {
				var originalHref = this.href;
                $(this).click(function () {
                    LeavingSite(originalHref);
				});
				$(this).removeAttr('target');
				this.href = "javascript:void(0);";
			}
        }
    )
});

function MenuOpenUrl(url)
{
    if ((url.indexOf('http') == 0) && (url.indexOf(domain) == -1) && (url.indexOf(exceptionDomain) == -1)) {
        LeavingSite(url);
	} else {
        location.href = url;
    }
}

function LeavingSite(url)
{
    if(confirm("Notice:  Your are leaving Kentucky Bank website - - -  Kentucky Bank (including its directors, employees or its affiliates) is not responsible or liable for the content, information or security; the failure of any products or services advertised or promoted on this linked site and any issues that may arise out of the site's privacy policy\n\n" +
                "Press OK to continue.\n\n" +
                "Press CANCEL to return to the web page.\n\n" +
                                "Thank You.\n" +
                "")) {
        window.open(url, "_blank");
    }
        
}
