/*#############################################################################

FILE:	filterPasswordValue.js

	Copyright (c) 2005 Navitaire Inc. All rights reserved.

	This source code is (i) proprietary to and a trade secret of Navitaire Inc.
	and (ii) protected by copyright law and international treaties.
	Unauthorized disclosure, reproduction, distribution or alteration of this
	source code, or any portion of it, may result in severe civil and criminal
	penalties and will be prosecuted to the maximum extent possible under
	the law.

	www.navitaire.com

DESCRIPTION:

	Contains javascript for the filterPasswordValue function.  Note that this 
	file relies on javascript from the filterFieldValue.js.

#############################################################################*/


/*-----------------------------------------------------------------------

	SUBROUTINE:   	filterPasswordValue()

	DESCRIPTION:	Inserts the JavaScript function
       				filterPasswordValue.  Note that the final
					three parameters passed to the javascript
					function are optional.  Pass them if you
					wish to verify that the 'passwordVerify'
					value matches the 'password' value.

--------------------------------------------------------------------------*/
function filterPasswordValue( fieldToFilter, min, max, fieldPW, fieldPWVer, message )
{
	//last 3 params only needed if verifying PW

	var filtered        = '';
	var chr             = '';
	var okay	    = false;

	okay = filterFieldValue( fieldToFilter, min, max );

	if ( ( fieldPW )
	  && ( fieldPWVer )
	  && ( fieldPW.value != '' )
	  && ( fieldPWVer.value != '' )
	  && ( fieldPW.value.toUpperCase() != fieldPWVer.value.toUpperCase() ))
	{

		alert( "\n" + message + "\n" );
		fieldPWVer.value = '';

		if (document.images)
		{
			fieldPWVer.focus();
		}
		return false;
	}
	
	return okay;
}	// end filterPasswordValue() 


