//////////////////////////////////////////////////////////////
// Accounts: Users functions
// v1.00 (Budd Wright)
//
// Description:
//////////////////////////////////////////////////////////////
// Contains various user page functions
//////////////////////////////////////////////////////////////
//
// Usage:
//////////////////////////////////////////////////////////////
// <script language="javascript" src="js/accounts_users.js"></script>
//////////////////////////////////////////////////////////////
//
// v1.00 Notes
// -----------
//
// Known Issues
// ------------
// 
//////////////////////////////////////////////////////////////



/* ValidatePassword function */
// Forces a user to type the same password twice in order to change it
function ValidatePassword()
{
	// References to the password fields
	var newPassword = document.getElementById("password");
	var newPassword2 = document.getElementById("password2");

	// Verify that the password has not been left blank
	if(newPassword.value.length < 1)
	{
		alert("You must enter a password.");
		newPassword.value = "";
		newPassword2.value = "";
		newPassword.focus();
		return false;
	}


	// Verify that they match
	if(newPassword.value != newPassword2.value)
	{
		alert("The passwords you entered do not match. Please type the same password into both fields and try again.");
		newPassword.value = "";
		newPassword2.value = "";
		newPassword.focus();
		return false;
	}

	// All is well, submit the form
	document.getElementById("passwordFormTag").submit();
}
