function registrationValidate() {
    errors = new Array();
	
	// Email address
	str = getElementValue('emailaddress_reg');
    if (empty_string(str)) { 
        errors.push('You must enter your email address');
        reportErrorModif('emailaddress_reg');
    } else if (!valid_emailaddr(str)) {
        errors.push('The email address you have entered is not valid');
        reportErrorModif('emailaddress_reg');
    } else {
        //unReportErrorModif('emailaddress_reg');
		
		var email1 = getElementValue('emailaddress_reg');
		var email2 = getElementValue('emailaddress_reg2');
		if (email1 != email2) {
			errors.push('Email address and its confirmation do not match');
			reportErrorModif('emailaddress_reg');
		}
		else {
			unReportErrorModif('emailaddress_reg');
		}
    }
	
	// confirm Email address
	str = getElementValue('emailaddress_reg2');
    if (empty_string(str)) { 
        errors.push('You must confirm your email address');
        reportErrorModif('emailaddress_reg2');
    } else if (!valid_emailaddr(str)) {
        errors.push('The confirm email address you have entered is not valid');
        reportErrorModif('emailaddress_reg2');
    } else {
        //unReportErrorModif('emailaddress_reg2');
		
		var email1 = getElementValue('emailaddress_reg');
		var email2 = getElementValue('emailaddress_reg2');
		if (email1 != email2) {
			reportErrorModif('emailaddress_reg2');
		}
		else {
			unReportErrorModif('emailaddress_reg2');
		}
    }
	
	// Password
	str = getElementValue('password_reg');
    if (empty_string(str)) { 
        errors.push('You must enter your password');
        reportErrorModif('password_reg');
    } else {
        //unReportErrorModif('password_reg');
		
		var passwd1 = getElementValue('password_reg');
		var passwd2 = getElementValue('password_reg2');
		if (passwd1 != passwd2) {
			errors.push('Password and its confirmation do not match');
			reportErrorModif('password_reg');
		}
		else {
			unReportErrorModif('password_reg');
		}
    }
	
	// confirm password
	str = getElementValue('password_reg2');
    if (empty_string(str)) { 
        errors.push('You must confirm your password');
        reportErrorModif('password_reg2');
    } else {
        //unReportErrorModif('password_reg2');
		
		var passwd1 = getElementValue('password_reg');
		var passwd2 = getElementValue('password_reg2');
		if (passwd1 != passwd2) {
			reportErrorModif('password_reg2');
		}
		else {
			unReportErrorModif('password_reg2');
		}
    }
	
	// first name
    str = getElementValue('firstname');
    if (empty_string(str)) { 
        errors.push('You must enter your first name');
        reportErrorModif('firstname');
    } else {
        unReportErrorModif('firstname');
    }
	
	// last name
    str = getElementValue('lastname');
    if (empty_string(str)) { 
        errors.push('You must enter your last name');
        reportErrorModif('lastname');
    } else {
        unReportErrorModif('lastname');
    }

	// address 1
    str = getElementValue('address1');
    if (empty_string(str)) { 
        errors.push('You must enter your address');
        reportErrorModif('address1');
    } else {
        unReportErrorModif('address1');
    }
	
	// city
    str = getElementValue('city');
    if (empty_string(str)) { 
        errors.push('You must enter your city');
        reportErrorModif('city');
    } else {
        unReportErrorModif('city');
    }

	// post code
    str = getElementValue('pcode');
    if (empty_string(str)) { 
        errors.push('You must enter your post code');
        reportErrorModif('pcode');
    } else {
        unReportErrorModif('pcode');
    }
	
	// verification code
	if (document.getElementById('vercode') != null) {
		str = getElementValue('vercode');
		if (empty_string(str)) { 
			errors.push('You must enter verification code');
			reportErrorModif('vercode');
		} else {
			unReportErrorModif('vercode');
		}
	}
	
	// conditions
    str = getElementValue('dataprot');
    if (empty_string(str)) { 
        errors.push('You must agree to the conditions in order to register');
    }

    
	if (errors.length) { 
		txt = "We do apologise but we found some errors in information you entered. Please look at the highlighted fields below and correct the information:\n\n";
		
		for (i = 0; i < errors.length; i++) { 
				txt += "- " + errors[i] + "\n";
		}

		alert(txt);

		return false;
	}
	
	return true;
}
