// JavaScript Document

var undefined;



function LinkAlert(URL)
	{
	MSG =       "You are leaving American National Bank's website and will be redirected to another site.\n";
	MSG = MSG + "American National Bank makes no endorsements or claims about the accuracy or content of \n";
	MSG = MSG + "the information contained in these sites.  The security and privacy policies on \n";
	MSG = MSG + "these sites may be different than those of American National Bank.";
	if (URL!=undefined) 
		{
		if (confirm(MSG)) window.open(URL,"_blank");
		}
	else return confirm(MSG);
	}
	
function LaunchCalc(URL)
	{
	window.open (URL,'myCalculator','width=580,height=450');
	}


function mail(link_string,user,domain,nickname,subject) {
    var nn = "";
    var s = "";

    if (nickname != "") nn = nickname + " ";
	else  nn = make_nickname(link_string);
    if (subject != "") s = "?subject=" + subject ;
    document.write(link_string.link(make_href(user,domain,nn,s)));
  }
 
function make_href(user,domain,nickname,subject) {
    address = "mail" + "to" + ":" + nickname + make_address(user,domain);
	if (subject!=undefined) address = address + subject;
	return address;
    }

function make_address(user,domain) {
    return "&lt;" + user + "@" + domain + "&gt;" ;
    }

function make_nickname(link_string) {
    var names = link_string.split(",");
    if (names.length == 2) {
      return names[1] + " " + names[0] + " ";
    } else {
      return "";
    }
  }

