// JavaScript Document
<!-- Make sure to include the general JS functions so trim is avaialable -->		
	function validateSignup() {
		var errorString = '';
				
			// Firstname
			if(trim(document.registrationForm.first_name.value) == '') {
				errorString += ' - Please input a first name\n';
			}
			// Lastname
			if(trim(document.registrationForm.last_name.value) == '') {
				errorString += ' - Please input a last name\n';
			}
			// email
			if(trim(document.registrationForm.email.value) == '') {
				errorString += ' - Please input an email address\n';
			}
			// new_password
			if(trim(document.registrationForm.new_password.value) == '') {
				errorString += ' - Please input a password\n';
			}
			// Gender
			if(trim(document.registrationForm.gender.value) == '') {
				errorString += ' - Please input a gender\n';
			}
			// day
			if(trim(document.registrationForm.day.value) == '') {
				errorString += ' - Please input a date of birth day\n';
			}
			// month
			if(trim(document.registrationForm.month.value) == '') {
				errorString += ' - Please input a date of birth month\n';
			}
			// year
			if(trim(document.registrationForm.year.value) == '') {
				errorString += ' - Please input a date of birth year\n';
			}
			//Country
			if(trim(document.registrationForm.country_id.value) == '') {
				errorString += ' - Please select a country\n';
			}
			
			// Check the length of a postcode and its composition
			if(trim(document.registrationForm.postcode.value) == '' && trim(document.registrationForm.country_id.value) == 225) {
				errorString += ' - Please input a postcode\n';
			}
			else if(trim(document.registrationForm.postcode.value) != '' && trim(document.registrationForm.country_id.value) == 225) {		
				// No Space
				var Postcode = trim(document.registrationForm.postcode.value).replace(" ", "");
				
				// Length 
				if(Postcode.length < 4) {
					errorString += ' - The postcode you have enetered is too short\n';
				}
			}
			else {
				//Empty as no other variation
			}
			
				
			//Check it
			if(errorString) {
				alert('There were problems with your login:\n\n'+ errorString +'\nPlease check and try again');
				return false;
			}
			else {
				//Its OK to check
				return true;
			}
		}
		
		<!-- Make sure to include the general JS functions so trim is avaialable -->		
			function validateLogin() {
				var errorString = '';
				
				// Email
				if(trim(document.getElementById('login_email').value) == '') {
					errorString += ' - Please input your email address\n';
				}
				// Password
				if(trim(document.getElementById('login_password').value) == '') {
					errorString += ' - Please input your password\n';
				}
				
				//Check it
				if(errorString) {
					alert('There were problems with your login:\n\n'+ errorString +'\nPlease check and try again');
					return false;
				}
				else {
					//Its OK to check
					return true;
				}
			}
