// JavaScript Document

var undefined;



function LinkAlert(URL,target,type) {

	BANKNAME = "American Bank and Trust Company";
	MSG = new Array();
	MSG[0] =       "You are now leaving "+BANKNAME+"’s website and will be redirected to another site. "+BANKNAME+" makes no endorsement or claims about the accuracy or content of information contained within  third party sites to which you may be going. The security and privacy policies on these sites may be different from "+BANKNAME+".";
	
	myTarget = "_blank";
	if (target!=undefined) myTarget = target;
	if (type!="" && type!=undefined) alert(MSG[type]);
	else if (confirm(MSG[0])) window.open(URL,myTarget);
	}

function Calculator(myURL)
	{
	myBase = "https://gateway.fundsxpress.com/calculators/";
	window.open(myBase + myURL,'','width=585,height=450,scrollbars=yes,resizable=yes');
	}

function EmailWarning()  {
        if(confirm("Please do NOT transmit any confidential material via the e-mail address on this page. If you are sending us any personal or account information, please use our secure e-mail function through our online banking service. To access our secure e-mail service, log onto your Online bank account and click on Messages and then select Contact Us.")) { return true;
} 
history.go(0);
return false;
}

function newWindow() {
	window.open("","launch","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=400");
	}

function isValidEmail(parmValue) {
	var rex = new RegExp("^[\\w\\+-]+(\\.[\\w\\+-]+)?@((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\|([\\w\\+-]+\\.[a-zA-Z]{2,}))$");
	var pos = parmValue.search(rex);
	if (pos < 0) {
		return false;
		} 
	else {
		return true;
		}
	}

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 "";
    }
  }


// This layer finds an object by ID and is cross-browser compliant.

function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

