/*
 ***********************************************************************
* Copyright by State of Michigan (Unpublished) - All rights reserved.
*********************************************************************
* Name:  state_charter_bank_criteria.js
*
* Description:  Client script for the State-Chartered Bank Criteria web page.
*
* Special Logic:  None
*
***********************************************************************
* Modification Log:
*
* Programmer      Date      Request No.      Version   Changes
* Doug Cook       10/08/01  N/A              1.0       Original Code                      
*
***********************************************************************
*/

// Function:  leftTrim
// Purpose: Remove the leading spaces from the search criteria fields.
function leftTrim(strLeftTrimString)
{
	return strLeftTrimString.replace(/^\s*/gi, "");
}

// Function:  rightTrim
// Purpose: Remove the trailing spaces from the search criteria fields.
function rightTrim(strRightTrimString)
{
	return strRightTrimString.replace(/\s+$/gi, "");
}

// Function: validateForm
// Purpose: Submit event for the form.  Verify the user completed the form
// correctly.
function validateForm()
{
	if (verifySelection())
	{
	  return true;
	}   
	else
	{
	  return false;
	}
}
    
// Function: verifySelection
// Purpose: Trim the leading and trailing spaces from the Bank Name, 
// City, and Zip Code fields.  
function verifySelection()
{
	// Trim the leading and trailing spaces from the Bank Name, City, 
	// and Zip Code fields.  

 	strToTrim = document.frmIndustryCriteria.txtBankName.value;
	strToTrim = rightTrim(strToTrim);
	strToTrim = leftTrim(strToTrim);
	document.frmIndustryCriteria.txtBankName.value = strToTrim;
 	
 	strToTrim = document.frmIndustryCriteria.txtCity.value;
	strToTrim = rightTrim(strToTrim);
	strToTrim = leftTrim(strToTrim);
	document.frmIndustryCriteria.txtCity.value = strToTrim;
	
 	strToTrim = document.frmIndustryCriteria.txtZip.value;
	strToTrim = rightTrim(strToTrim);
	strToTrim = leftTrim(strToTrim);
	document.frmIndustryCriteria.txtZip.value = strToTrim;
	
	document.frmIndustryCriteria.action = "/fis/ind_srch/cht_bank/state_charter_bank_list.asp";
	return true; 
}
	



	



