$(document).ready(function () {
    $(".page_content a[href$='pdf']").attr('target', '_blank');

    var thehost = window.location.hostname;

    $("a[href^='http:']").not("[href*='" + thehost + "']").bind('click', function () {

        var thehref = $(this).attr("href");

        if (thehref.indexOf("ibank.fsb1879") == -1 && thehref.indexOf("fsb1879.mortgagewebcenter.com") == -1 && thehref.indexOf(".cre8mycard.com") == -1) {
            if (confirm("You are about to leave the FSB Bank website.\n\n" + thehref + "\n\nis not a direct representation of and is not controlled by FSB Bank.\n\nTo remain on the banks site, click Cancel.  To continuing leaving our site click OK.")) {
                return true;
            } else {
                return false;
            }
        } else {
            return true;
        }

    });

    $("a[href^='https:']").not("[href*='" + thehost + "']").bind('click', function () {
        var thehref = $(this).attr("href");

        if (thehref.indexOf("ibank.fsb1879") == -1 && thehref.indexOf("fsb1879.mortgagewebcenter.com") == -1 && thehref.indexOf(".cre8mycard.com") == -1) {
            if (confirm("You are about to leave the FSB Bank website.\n\n" + thehref + "\n\nis not a direct representation of and is not controlled by FSB Bank.\n\nTo remain on the banks site, click Cancel.  To continuing leaving our site click OK.")) {
                return true;
            } else {
                return false;
            }
        } else {
            return true;
        }
    });
});


