// JavaScript Document
<!--
function keyEnter ()
{
	/*alert ("Some of our customers have reported being presented with an online pop-up message asking them to verify personal information such as their social security number or account number to complete a survey to win a free gift.   This pop-up message is NOT generated by Adams Bank & Trust and you should never share your personal information with anyone unless you are completely sure of their identity. WE WILL NOT EMAIL, GENERATE AN ONLINE POP UP OR CALL YOU TO VERIFY ANY OF YOUR PERSONAL OR FINANCIAL INFORMATION.")*/
		/*alert ("Adams Bank is upgrading its systems and will experience a short internet banking outage from 6-7PM on Thursday Mar 25.  We apologize for any inconvenience this may cause.")*/
	olb('Ecom');
	return false;
}


function doEcom ()
{
	document.REM_LOGIN_FORM.nmUID.value = document.REM_LOGIN_FORM.AccessID.value;
	document.REM_LOGIN_FORM.action = 'https://secure.abtbank.com/pbi_pbi1961/pbi1961.asp?WCI=RemoteLogin&Rt='+document.forms.REM_LOGIN_FORM.nmRTN.value+'&LogonBy=Connect3&PRMAccess=Account';
}

function doEcorp ()
{
	document.REM_LOGIN_FORM.nmUID.value = document.REM_LOGIN_FORM.AccessID.value;
	document.REM_LOGIN_FORM.action = 'https://secure.abtbank.com/EBC_EBC1961/EBC1961.asp?WCI=Process&RTN='+document.forms.REM_LOGIN_FORM.nmRTN.value+'&WCE=RemoteLogon&IRL=T;Rt='+document.forms.REM_LOGIN_FORM.nmRTN.value+'&amp;LogonBy=Connect3&PRMAccess=Account';
}

function doLoginRefreshEcom()
{
	if (document.REM_LOGIN_FORM.AccessID.value != "Enter Access ID")
		{
			if (document.REM_LOGIN_FORM.AccessID.value != "")
				{
				doEcom();
				document.REM_LOGIN_FORM.nmUID.value = document.REM_LOGIN_FORM.AccessID.value;
       			setTimeout('document.REM_LOGIN_FORM.reset()', 20000);
				document.REM_LOGIN_FORM.AccessID.value=document.REM_LOGIN_FORM.AccessID.value;
				return true;
				}
			else
				{
				alert("\n Your Access ID appears to be blank.  Please enter a valid abtbank.com Access ID in the 'Enter Access ID' field and click the 'Ecom Login' button again.  The cursor will be automatically moved to this field.  Thank you!\n\n\t");
				document.forms.REM_LOGIN_FORM.AccessID.focus ();
				return false;
				}
		}
	else
		{
		alert("\n Please enter a valid abtbank.com Access ID in the 'Enter Access ID' field and click the 'Ecom Login' button again.  The cursor will be automatically moved to this field. Thank you!\n\n\t");
		document.forms.REM_LOGIN_FORM.AccessID.focus ();
		return false;
		}	
}

function doLoginRefreshEcorp()
{
	if (document.REM_LOGIN_FORM.AccessID.value != "Enter Access ID")
		{
			if (document.REM_LOGIN_FORM.AccessID.value != "")
				{
				doEcorp();
				document.REM_LOGIN_FORM.nmUID.value = document.REM_LOGIN_FORM.AccessID.value;
       			setTimeout('document.REM_LOGIN_FORM.reset()', 20000);
				document.REM_LOGIN_FORM.AccessID.value=document.REM_LOGIN_FORM.AccessID.value;
				return true;
				}
			else
				{
				alert("\n Your Access ID appears to be blank.  Please enter a valid abtbank.com Access ID in the 'Enter Access ID' field and click the 'Ecorp Login' button again.  The cursor will be automatically moved to this field.  Thank you!\n\n\t");
				document.forms.REM_LOGIN_FORM.AccessID.focus ();
				return false;
				}	
		}
	else
		{
		alert("\n Please enter a valid abtbank.com Access ID in the 'Enter Access ID' field and click the 'Ecorp Login' button again.  The cursor will be automatically moved to this field.  Thank you!\n\n\t"); 
		document.forms.REM_LOGIN_FORM.AccessID.focus ();
		return false;
		}	
}

<!-- THE MEAT -->

function olb(i)
{
	if (document.REM_LOGIN_FORM.AccessID.value != "")
	{
	document.forms.REM_LOGIN_FORM.AccessID.value = document.forms.REM_LOGIN_FORM.AccessID.value;
	document.forms.REM_LOGIN_FORM.nmUID.value = document.forms.REM_LOGIN_FORM.AccessID.value;
	}
	if (i=="Ecom")
	{
		if(doLoginRefreshEcom())
		{
			document.REM_LOGIN_FORM.submit();
		}
	}
	else
	{
		if(doLoginRefreshEcorp())
		{
			document.REM_LOGIN_FORM.submit();
		}
	}
	document.REM_LOGIN_FORM.reset()
}

function loginCheck ()
{
	if (document.REM_LOGIN_FORM.AccessID.value != "")
		{
			keyEnter();
			return false;
		}
	return false;
}
//Here is the stuff to write cookies for the branch pages//
//function writeCookie(name, value, hours)
//  {
  //alert("I gots to the function");
//  var expire = "";
//  if(hours != null)
// {
//    expire = new Date((new Date()).getTime() + hours * 3600000);
//    expire = "; expires=" + expire.toGMTString();
//  }
//  document.cookie = name + "=" + escape(value) + expire + "; path=/";
//  alert ("Your abtbank.com homepage is now "+value+".");
//  document.getElementById('hidehomey').href = '../homepage_hide.css';
//}

//Oh year here is the stuff for the leaving the website function.  Just sorta got stuck in here.//
function leaving(){
	return confirm("You are now leaving www.abtbank.com and being transferred to a 3rd party website. Please note that 3rd party sites may have different standards in privacy and security. You should review that site's privacy and security policy.")
}
function cutoff(){
	/*alert("Some of our customers have reported being presented with an online pop-up message asking them to verify personal information such as their social security number or account number to complete a survey to win a free gift.   This pop-up message is NOT generated by Adams Bank & Trust and you should never share your personal information with anyone unless you are completely sure of their identity. WE WILL NOT EMAIL, GENERATE AN ONLINE POP UP OR CALL YOU TO VERIFY ANY OF YOUR PERSONAL OR FINANCIAL INFORMATION.")*/
	/*alert ("Adams Bank is upgrading its systems and will experience a short internet banking outage from 6-7PM on Thursday Mar 25.  We apologize for any inconvenience this may cause.")*/
	olb('NotEcom');
}


//-->