function checkenquiryFields() { 

if (document.Contactus.Firstname.value == "") { 
alert("Details incorrect. Please enter your First Name."); 
document.Contactus.Firstname.focus(); return;

}

if (document.Contactus.Email.value.indexOf("@")<3){ // checks for at least 3 characters before the @

alert("The email entered appears to be incorrect - please check the username and format of the email that it contains '@' ");
document.Contactus.Email.focus(); return;

}

if (document.Contactus.Contact.value == "Phone" & document.Contactus.Phone.value == "")  { 
alert("Details incorrect. You have requested to be contacted by phone but you have not entered a valid telephone number."); 
document.Contactus.Phone.focus(); return;

}

if (document.Contactus.Contact.value == "Null") { 
alert("Details incorrect. Please enter your preferred contact method."); 
document.Contactus.Contact.focus(); return;

}

if (document.Contactus.Found.value == "Null") { 
alert("Details incorrect. Please enter how you found us."); 
document.Contactus.Found.focus(); return;

}


else {  // if none of the fields have any errors then submit the form

document.Contactus.submit(); // In this document,  submit the form called notify

}


}
function checkenquiryFieldsapprent() { 

if (document.Apprenticeshipquery.Firstname.value == "") { 
alert("Details incorrect. Please enter your First Name."); 
document.Apprenticeshipquery.Firstname.focus(); return;

}

if (document.Apprenticeshipquery.Email.value.indexOf("@")<3){ // checks for at least 3 characters before the @

alert("The email entered appears to be incorrect - please check the username and format of the email that it contains '@' ");
document.Apprenticeshipquery.Email.focus(); return;

}

if (document.Apprenticeshipquery.Contact.value == "Phone" & document.Apprenticeshipquery.Phone.value == "")  { 
alert("Details incorrect. You have requested to be contacted by phone but you have not entered a valid telephone number."); 
document.Apprenticeshipquery.Phone.focus(); return;

}

if (document.Apprenticeshipquery.Contact.value == "Null") { 
alert("Details incorrect. Please enter your preferred contact method."); 
document.Apprenticeshipquery.Contact.focus(); return;

}

if (document.Apprenticeshipquery.Found.value == "Null") { 
alert("Details incorrect. Please enter how you found us."); 
document.Apprenticeshipquery.Found.focus(); return;

}



else {  // if none of the fields have any errors then submit the form

document.Apprenticeshipquery.submit(); // In this document,  submit the form called notify

}


}

function checkenquiryFieldshost() { 

if (document.Hostquery.Firstname.value == "") { 
alert("Details incorrect. Please enter your First Name."); 
document.Hostquery.Firstname.focus(); return;

}

if (document.Hostquery.Email.value.indexOf("@")<3){ // checks for at least 3 characters before the @

alert("The email entered appears to be incorrect - please check the username and format of the email that it contains '@' ");
document.Hostquery.Email.focus(); return;

}

if (document.Hostquery.Contact.value == "Phone" & document.Hostquery.Phone.value == "")  { 
alert("Details incorrect. You have requested to be contacted by phone but you have not entered a valid telephone number."); 
document.Hostquery.Phone.focus(); return;

}

if (document.Hostquery.Contact.value == "Null") { 
alert("Details incorrect. Please enter your preferred contact method."); 
document.Hostquery.Contact.focus(); return;

}

if (document.Hostquery.Found.value == "Null") { 
alert("Details incorrect. Please enter how you found us."); 
document.Hostquery.Found.focus(); return;

}



else {  // if none of the fields have any errors then submit the form

document.Hostquery.submit(); // In this document,  submit the form called notify

}


}

function checkrequest() { 

if (document.Request.Firstname.value == "") { 
alert("Details incorrect. Please enter your First Name."); 
document.Request.Firstname.focus(); return;

}

if (document.Request.Email.value.indexOf("@")<3){ // checks for at least 3 characters before the @
alert("The email entered appears to be incorrect - please check the username and format of the email that it contains '@' ");
document.Request.Email.focus(); return;

}

if (document.Request.Contact.value == "Phone" & document.Request.Phone.value == "")  { 
alert("Details incorrect. You have requested to be contacted by phone but you have not entered a valid telephone number."); 
document.Request.Phone.focus(); return;

}

if (document.Request.Contact.value == "Null") { 
alert("Details incorrect. Please enter your preferred contact method."); 
document.Request.Contact.focus(); return;

}

if (document.Request.Found.value == "Null") { 
alert("Details incorrect. Please enter how you found us."); 
document.Request.Found.focus(); return;

}

else {  // if none of the fields have any errors then submit the form

document.Request.submit(); // In this document,  submit the form called notify

}

}

function checkADDdoc() {


if (document.test.titleDesc.value == "") { 
alert("Details incorrect. Please select file to upload."); 
document.test.titleDesc.value.focus(); return;

}

else {  // if none of the fields have any errors then submit the form

document.test.submit(); // In this document,  submit the form called notify

}

}

function checkADDmembers() { 

if (document.form1.firstName.value == "") { 
alert("Details incorrect. Please enter Member First Name."); 
document.form1.firstName.focus(); return;

}

if (document.form1.lastName.value == "") { 
alert("Details incorrect. Please enter Member Last Name."); 
document.form1.lastName.focus(); return;

}
if (document.form1.username.value == "") { 
alert("Details incorrect. Please enter Member Username."); 
document.form1.username.focus(); return;

}

if (document.form1.phone.value == "") { 
alert("Details incorrect. Please enter valid phone number."); 
document.form1.phone.focus(); return;

}

if (document.form1.email.value.indexOf("@")<3){ // checks for at least 3 characters before the @

alert("The email entered appears to be incorrect - please check the username and format of the email that it contains '@' ");
document.form1.email.focus(); return;

}

if (document.form1.password.value.length <6 | document.form1.password.value.length >10) { 
alert("Details incorrect. Password must between 6 - 10 characters long"); 
document.form1.password.focus(); return;

}

if (!(document.form1.password.value == document.form1.password2.value)) { 
alert("Passwords do not match! Please type and confirm password again"); 
document.form1.password.focus(); return;

}

if (!(document.form1.access.value == "Apprentice" | document.form1.access.value == "Host" | document.form1.access.value == "Administrator")) { 
alert("Details incorrect. Please enter Member Acess Level 1,2 or 3."); 
document.form1.access.focus(); return;

}

if (document.form1.access.value == "Host" & document.form1.company.value == "")  { 
alert("Details incorrect. You have selected Host Employer access level but failed to enter a company or organisation name."); 
document.form1.company.focus(); return;

}


else {  // if none of the fields have any errors then submit the form

document.form1.submit(); // In this document,  submit the form called notify

}


}

function checkUPDATEmembers() {
	
if (!(document.form1.password.value == document.form1.password2.value)) { 
alert("Passwords do not match! Please type and confirm password again"); 
document.form1.password.focus(); return;

}


else {  // if none of the fields have any errors then submit the form

document.form1.submit(); // In this document,  submit the form called notify

}


}