/******************************************************************
*  FILE: dualremotelogin.js
*	AUTHOR: Jon Wolski <<jwolski(a)goldleaf.com>>
*	DATE: 2005-07-13
*	DESCIRPTION: Form handler for login form to submit to ITI.
*			Code initially supplied by ITI.  Modified for select
*			element instead of radio buttons
******************************************************************/
function setAction()
{
    if(document.Remote.loginTo.selectedIndex == 2)
    {
       document.Remote.nmUID.value = document.Remote.AccessId.value;
       document.Remote.nmPWD.value = document.Remote.Password.value;
	   // enter the 9 digit Routing and transit number for the bank below in place of XXXXXXX
	   document.Remote.nmRTN.value = '075902188';
       //document.Remote.target = '_top';
	   //enter the domain of the ecorp server in place of ecorp_server_domain_address below
       document.Remote.action = 'https://secure.ufsdata.com/EBC_EBC1961/EBC1961.asp?WCI=Process&WCE=RemoteLogon&IRL=T&nmRTN=';
 	}
   
   if(document.Remote.loginTo.selectedIndex == 1 || document.Remote.loginTo.selectedIndex == 0)
    {
       document.Remote.nmUID.value = document.Remote.AccessId.value;
       document.Remote.nmPWD.value = document.Remote.Password.value;
       //document.Remote.target = '_top';
	   //enter the 9 digit Routing and transit number for the bank below in place of XXXXXXX
	   //enter the domain of the ecom server in place of ecom_server_domain_address
       document.Remote.action = 'https://secure.ufsdata.com/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&amp;Rt=075902188&amp;LogonBy=Connect3&PRMACCESS=Account';
 	}
   
}
   
function doLoginRefresh()
{
	var selectMessage = "Please select \"Personal\" or \"Business\" from the Online Banking drop-down menu.";
	if (document.getElementById && document.getElementById('loginTo').selectedIndex == 0 ) {
		alert (selectMessage);
		return false;
	}
	if (document.Remote.AccessId.value != "" && document.Remote.Password.value != "")
		{
		setAction();
		setTimeout('document.Remote.reset()', 20000);
		document.Remote.AccessId.value=document.Remote.AccessId.value;
		document.Remote.Password.value=document.Remote.Password.value;
		return true;
		}
	else
		{
		alert("\n Please Enter a valid Access ID and Password.  Thank you!\n\n\t"); 
		return false;
		}	
}