/*********************************************************************
				Version 4.0 --> modified Jun 6, 2007
*********************************************************************/

// This is the function you would use to require certain fields to be filled in when submitting a form.
// PLEASE NOTE: If you wish to have another field required, copy/paste the if statement for one of the
// other fields (e.g. first_name) and change the information to match the appropriate field.

function validate_login(form) {
	var e = form.elements, m = '';
	
	if(!e['username'].value) {
		m += '- User Name is required.\n\n';
	}
	if(!e['password'].value) {
		m += '- Password is required.\n\n';
	}
	if(m) {
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}
	return true;
}
function validate_new_member(form) {
	var e = form.elements, m = '';
	
	if(!e['member_firstname'].value) {
		m += '- First name is required.\n\n';
	}
	if(!e['member_lastname'].value) {
		m += '- Last name is required.\n\n';
	}
	
	if(!e['authority_level'].value) {
		m += '- Authority Level is required.\n\n';
	}
	if(!e['username'].value) {
		m += '- Username is required.\n\n';
	}
	if(!e['password'].value) {
		m += '- Password is required.\n\n';
	}
	if(e['password'].value != '') 
	{
		if(!e['confirm_password'].value) 
		{
			m += '- Confirm Password is required.\n\n';
		}
		if(e['confirm_password'].value != e['password'].value) 
		{
			m += '- Passwords do not match.\n\n';
		}
	}
	if(m) {
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}
	return true;
}
// You would also need to make sure you have the onSubmit property declared within the <form> tag.
// For example: <form onSubmit="return validate(this)" method="post" action="process_contact.htm">