function checkForm(theForm)
{
	// Check username.
	invalidChars = "?*+=[]:;\"<>,/\\|";
	if ( !checkHasValue( theForm.passwordusername.value, "TEXT" ) )
		if ( !onError( theForm, theForm.passwordusername, theForm.passwordusername.value, 
			"Please supply a value for\nthe user name field." ) )
			return false;	
	if ( !checkValidChars( theForm.passwordusername.value, true, true, true, invalidChars, false ) )
		if ( !onError( theForm, theForm.passwordusername, theForm.passwordusername.value, 
			 "The user name may contain letters, numbers, spaces,\n"
			+"and special characters excluding: " + invalidChars ) )
			return false;
	
	// Check old password.
	if ( !checkHasValue( theForm.oldpassword, "PASSWORD" ) )
		if ( !onError( theForm, theForm.oldpassword, theForm.oldpassword.value, 
			"Please supply a value for\nthe old password field." ) )
			return false;	

	// Check new password.
	if ( !checkHasValue( theForm.newpassword, "PASSWORD" ) )
		if ( !onError( theForm, theForm.newpassword, theForm.newpassword.value, 
			"Please supply a value for\nthe new password field." ) )
			return false;	

	// Check passwords.
	if ( !( theForm.newpassword.value == theForm.chpassconfirmpassword.value ) )
		if ( !onError( theForm, theForm.newpassword, theForm.newpassword.value, 
			"The passwords do not match." ) )
		{
			theForm.newpassword.value = "";
			theForm.chpassconfirmpassword.value = "";
			return false;	
		}

	return true;
} 

//document.frmMain.passwordusername.focus();
