function SwitchImg(ImageName, ImageSrc){
    if(document.getElementById){
        var ImageObj=document.getElementById(ImageName);
        if(ImageObj){
            ImageObj.src=ImageSrc;
        }
    }
}

function CloseLeaveSiteDialog(){
    var oDiv=document.getElementById("GlobalLeaveSiteLayer");
    if(oDiv){
        oDiv.style.display="none";
    }
}

function LeaveSite(sUrl){
    var oDiv=document.getElementById("GlobalLeaveSiteLayer");
    if(!oDiv){
        var oDiv=document.createElement("div");
        oDiv.id="GlobalLeaveSiteLayer";
        oDiv.style.display="none";
        document.body.appendChild(oDiv);
    }
    var sHtml="<div id=\"GlobalLeaveSiteLayerTop\">" +
            "<div id=\"GlobalLeaveSiteLayerClose\"><a href=\"javascript:CloseLeaveSiteDialog()\"><img src=\"images/leavesite-close.gif\" width=\"67\" height=\"16\" /></a></div>" +
        "</div>" +
        "<div id=\"GlobalLeaveSiteLayerContent\">&nbsp;" +
            "<div id=\"GlobalLeaveSiteLayerText\">" +
                "<b>You have reached this page because you are leaving the financialpayments.com domain and entering an external link. The link provides additional information that may be useful and is being provided consistent with the intended purpose of the Financial Payments Online site. However, Financial Payments cannot attest to the accuracy of information provided by this link or any other linked site. Providing links to a non-Financial Payments Web site does not constitute an endorsement by Financial Payments or any of its employees of the sponsors of the site or the information or products presented on the site. Also, be aware that the privacy protection provided on the financialpayments.com domain may not be available at the external link.</b>" +
                "<br /><br />" +
                "If you agree to, and understand the conditions stated above, please continue by clicking on the following external link:<br />" +
                "<div class=\"DottedLink\"><a href=\"" + sUrl + "\" target=\"_blank\" onclick=\"CloseLeaveSiteDialog()\">" + sUrl + "</a></div>" + 
                "<br /><br />" +
                "<a href=\"javascript:CloseLeaveSiteDialog()\" onmouseover=\"SwitchImg('GlobalLeaveSiteCancelButton', 'images/btn-cancel-over.gif')\" onmouseout=\"SwitchImg('GlobalLeaveSiteCancelButton', 'images/btn-cancel-off.gif')\"><img src=\"images/btn-cancel-off.gif\" id=\"GlobalLeaveSiteCancelButton\" width=\"86\" height=\"21\" /></a>" +
            "</div>" +
        "</div>" +
        "<div id=\"GlobalLeaveSiteLayerBottom\"><img src=\"images/leavesite-bottom.gif\" width=\"569\" height=\"14\" /></div>";
    oDiv.innerHTML=sHtml;
    var x=0;
    var y=0;
    var ScrollX=0;
    var ScrollY=0;
    if( typeof( window.innerWidth ) == 'number' ) {
        x = window.innerWidth;
        y = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        x = document.body.clientWidth;
        y = document.body.clientHeight;
      }
      if( typeof( window.pageYOffset ) == 'number' ) {
        ScrollY = window.pageYOffset;
        ScrollX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        ScrollY = document.body.scrollTop;
        ScrollX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        ScrollY = document.documentElement.scrollTop;
        ScrollX = document.documentElement.scrollLeft;
      }
      oDiv.style.top=(y/2)-(288/2)+ScrollY;
      oDiv.style.left=(x/2)-(569/2)+ScrollX;
      oDiv.style.display="";
    return false;
}

function CloseEmailNotice(){
    var oDiv=document.getElementById("GlobalEmailNoticeLayer");
    if(oDiv){
        oDiv.style.display="none";
    }
}


function EmailNotice(sUrl){
    var oDiv=document.getElementById("GlobalEmailNoticeLayer");
    if(!oDiv){
        var oDiv=document.createElement("div");
        oDiv.id="GlobalEmailNoticeLayer";
        oDiv.style.display="none";
        document.body.appendChild(oDiv);
    }
    var sHtml="<div id=\"GlobalEmailNoticeLayerTop\">" +
            "<div id=\"GlobalEmailNoticeLayerClose\"><a href=\"javascript:CloseEmailNotice()\"><img src=\"images/leavesite-close.gif\" width=\"67\" height=\"16\" /></a></div>" +
        "</div>" +
        "<div id=\"GlobalEmailNoticeLayerContent\">&nbsp;" +
            "<div id=\"GlobalEmailNoticeLayerText\">" +
                "<b>You are about to send an unsecured email.</b>" +
                "<br /><br />" +
                "Whether sending an email to Financial Payments, it's affiliates, or to anyone else, YOU are responsible for the content of the email that you send.  You should not include any confidential or otherwise non-public personal information via unsecured email." +
                "<br /><br />" +
                "If you need to send a secure email to a Financial Payments representative, please contact the Financial Payments representative with whom you are conducting business." +
                "<br /><br />" +
                "Click the link to continue:<br />" +
                "<div class=\"DottedLink\"><a href=\"mailto:" + sUrl + "\" target=\"_blank\" onclick=\"CloseEmailNotice()\">" + sUrl + "</a></div>" + 
                "<br /><br />" +
                "<a href=\"javascript:CloseEmailNotice()\" onmouseover=\"SwitchImg('GlobalEmailNoticeCancelButton', 'images/btn-cancel-over.gif')\" onmouseout=\"SwitchImg('GlobalEmailNoticeCancelButton', 'images/btn-cancel-off.gif')\"><img src=\"images/btn-cancel-off.gif\" id=\"GlobalEmailNoticeCancelButton\" width=\"86\" height=\"21\" /></a>" +
            "</div>" +
        "</div>" +
        "<div id=\"GlobalEmailNoticeLayerBottom\"><img src=\"images/leavesite-bottom.gif\" width=\"569\" height=\"14\" /></div>";
    oDiv.innerHTML=sHtml;
    var x=0;
    var y=0;
    var ScrollX=0;
    var ScrollY=0;
    if( typeof( window.innerWidth ) == 'number' ) {
        x = window.innerWidth;
        y = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        x = document.body.clientWidth;
        y = document.body.clientHeight;
      }
      if( typeof( window.pageYOffset ) == 'number' ) {
        ScrollY = window.pageYOffset;
        ScrollX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        ScrollY = document.body.scrollTop;
        ScrollX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        ScrollY = document.documentElement.scrollTop;
        ScrollX = document.documentElement.scrollLeft;
      }
      oDiv.style.top=(y/2)-(288/2)+ScrollY;
      oDiv.style.left=(x/2)-(569/2)+ScrollX;
      oDiv.style.display="";
    return false;
}

