/*
 ***********************************************************************
* Copyright by State of Michigan (Unpublished) - All rights reserved.
*********************************************************************
* Name:  mewa_criteria.js
*
* Description:  Client script for the Multiple Employer Welfare Arrangment
* Criteria web page.
*
* Special Logic:  None
*
***********************************************************************
* Modification Log:
*
* Programmer      Date      Request No.      Version   Changes
* Doug Cook       01/03/02  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 Multiple Employer
// Welfare Arrangement field.  
function verifySelection()
{
 	strToTrim = document.frmIndustryCriteria.txtMEWACompany.value;
	strToTrim = rightTrim(strToTrim);
	strToTrim = leftTrim(strToTrim);
	document.frmIndustryCriteria.txtMEWACompany.value = strToTrim;
 	
 	document.frmIndustryCriteria.action = "/fis/ind_srch/mewa/mewa_list.asp";
	return true; 
}
	



	



