function validateRegister(oForm) {
	if (oForm.terms.checked == false) {
		alert('You must state that you agree to the terms and conditions to register.');
		return false;
	} else {
		var bValid = true;

		//check for registration and password
		if (oForm.password.value.length < 5) {
			alert('Your password must be 5 or more characters');
			return false;
		}
		if (oForm.password.value != oForm.confirm.value) {
			alert('Your password and confirmation do not match');
			return false;
		}

		//check normal form
		if (oForm.name.value == '' || 
			oForm.address1.value == '' || 
			oForm.town.value == '' || 
			oForm.county.value == '' || 
			oForm.postcode.value == '') {
			bValid = false;
		}
		//check email
		if (oForm.email.value == '') {
			bValid = false;
		}

		//return correctly
		if (bValid == false) {
			alert('Please fill out all required fields *');
			return false;
		}
	}
}

function validateChangeDetails(oForm) {
	var bValid = true;

	//check normal form
	if (oForm.name.value == '' || 
		oForm.address1.value == '' || 
		oForm.town.value == '' || 
		oForm.county.value == '' || 
		oForm.postcode.value == '') {
		bValid = false;
	}

	//return correctly
	if (bValid == false) {
		alert('Please fill out all required fields *');
		return false;
	}
}

function validateChangeLogin(oForm) {
	//check password
	if (oForm.currentPassword.value == '') {
		alert('You must specify your current password');
		return false;
	}
	if (oForm.email.value == '') {
		alert('You must specify the email address for your account');
		return false;
	}
	if (oForm.newPassword.value.length < 5) {
		alert('Your new password must be 5 or more characters');
		return false;
	}
	if (oForm.newPassword.value != oForm.confirmPassword.value) {
		alert('Your new password and confirmation do not match');
		return false;
	}
}


