// Functions provided by RAD
<!--
function validateText( text, field ) {
    var mes = "";
    if ( text == "" ) {
        mes = "- Please fill in the " + field + ".\r\n";
        return mes;
    }   
    return "";
}
function validateDOB( dob ) {
	var mes = "";
	if ( dob.length < 8 || dob.length > 10 ) {
		mes = "- Please enter a valid date of birth.\r\n";
		return mes;
	} else {
		return "";
	}
}
function validateEmail( email, text ) {
    var mes = "";
    var validemail = /^[^@]+@[^@.]+\.[^@]*\w\w$/  ;
    if ( email == "" ) {
        mes = "- Please fill in your " + text + ".\r\n";
        return mes;
    } else {
        if (!validemail.test(email)) {
            mes = "- Please enter a valid " + text + ".\r\n";
            return mes;
        }
    }
    return "";
}
function validateOnSubmit( theForm ) {
    var m_firstname = "";
    var m_surname = "";
    var m_email = "";
    var m_postcode = "";
    var m_country = "";
    var m_character = "";
	var m_parent_email = "";
	var m_dateofbirth = "";
    var message = "";
    m_firstname = validateText( theForm.firstname.value, "Firstname" );
    m_surname = validateText( theForm.surname.value, "Surname" );
    m_email = validateEmail( theForm.email.value, "Email address" );
    m_postcode = validateText( theForm.Post_Code.value, "Postcode" );
    m_country = validateText( theForm.Country.value, "Country" );
    if(theForm.Jake_or_Jasmine)
		m_character = validateText( theForm.Jake_or_Jasmine.value, "Character" );
	m_parent_email = validateEmail( theForm.Parent_guardian_email.value, "Parent/Guardian email" );
	m_dateofbirth = validateDOB( theForm.Date_of_birth.value, "Date of birth" );
    message = m_firstname + m_surname + m_email + m_postcode + m_country + m_character + m_parent_email + m_dateofbirth;
    if ( message != "" ) {
        alert( "There are errors with your form submission.\r\nPlease correct the errors listed below and try again.\r\n \r\n" + message );
        return false;
    }
    else {
        return true;
    }
}
//-->
