/* validate the registration form */
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 security code
		if (oForm.code.value.length < 4) {
			alert('Please enter the security code');
			return false;
		}

		//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.company.value == '' ||
			oForm.address1.value == '' || 
			oForm.postcode.value == '' ||
			oForm.telephone.value == '' ||
			oForm.country.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;
		}
	}
}