function check(){
var digits="0123456789"
var temp
var noEmail = "The e-mail address you have entered is incorrect. Please correct it!";
var EmailError = "The e-mail address that you have entered is incorrect. Please correct it!";



if (document.pres_form.Text3.value == ''){
alert("The 'Where did you first see the post advertised?' field is empty! Please correct it!")
document.pres_form.Text3.focus()
return false
}

if (document.pres_form.Text5.value == ''){
alert("The 'Title' field is empty! Please correct it!")
document.pres_form.Text5.focus()
return false
}

if (document.pres_form.Text6.value == ''){
alert("The 'Surname' field is empty! Please correct it!")
document.pres_form.Text6.focus()
return false
}

if (document.pres_form.Text7.value == ''){
alert("The 'Forename(s)' field is empty! Please correct it!")
document.pres_form.Text7.focus()
return false
}

if (document.pres_form.Text8.value == ''){
alert("The 'Gender' field is empty! Please correct it!")
document.pres_form.Text8.focus()
return false
}

if (document.pres_form.cday.value == ''){
alert("The 'Day' field is empty! Please correct it!")
document.pres_form.cday.focus()
return false
}

if (document.pres_form.cmonth.value == ''){
alert("The 'Month' field is empty! Please correct it!")
document.pres_form.cmonth.focus()
return false
}

if (document.pres_form.cyear.value == ''){
alert("The 'Year' field is empty! Please correct it!")
document.pres_form.cyear.focus()
return false
}

if (document.pres_form.Text10.value == ''){
alert("The 'I am' field is empty! Please correct it!")
document.pres_form.Text10.focus()
return false
}

if (document.pres_form.Text12.value == ''){
alert("The 'Home Address Line 1' field is empty! Please correct it!")
document.pres_form.Text12.focus()
return false
}

if (document.pres_form.Text14.value == ''){
alert("The 'Home Postal Code' field is empty! Please correct it!")
document.pres_form.Text14.focus()
return false
}

if (document.pres_form.Text15.value == ''){
alert("The 'Country' field is empty! Please correct it!")
document.pres_form.Text15.focus()
return false
}

if (document.pres_form.Text17.value == ''){
alert("The 'Telephone Number' field is empty! Please correct it!")
document.pres_form.Text17.focus()
return false
}

if (document.pres_form.Text18.value == ''){
alert("The 'Mobile Number' field is empty! Please correct it!")
document.pres_form.Text18.focus()
return false
}

if (document.pres_form.Text26.value == ''){
alert("The 'Period of notice in present post' field is empty! Please correct it!")
document.pres_form.Text26.focus()
return false
}

if (document.pres_form.Text27.value == ''){
alert("The 'Are you over 16 and under 65?' field is empty! Please correct it!")
document.pres_form.Text27.focus()
return false
}

if (document.pres_form.Text28.value == ''){
alert("The 'Are you in good health?' field is empty! Please correct it!")
document.pres_form.Text28.focus()
return false
}

if (document.pres_form.Text31.value == ''){
alert("The 'How many days sickness absence have you taken in the last two years?' field is empty! Please correct it!")
document.pres_form.Text31.focus()
return false
}

if (document.pres_form.Text32.value == ''){
alert("The 'Have you ever been convicted of...' field is empty! Please correct it!")
document.pres_form.Text32.focus()
return false
}

if (document.pres_form.Text34.value == ''){
alert("The 'Have you applied to/been employed by Praesidium before?' field is empty! Please correct it!")
document.pres_form.Text34.focus()
return false
}

if (document.pres_form.Text36.value == ''){
alert("The 'Please give your present/last annual salary and details of any additional benefits/allowances' field is empty! Please correct it!")
document.pres_form.Text36.focus()
return false
}

if (isEmpty(document.pres_form.Text19.value)) {
		alert(noEmail);
		document.pres_form.Text19.select()
        document.pres_form.Text19.focus()
		return false;
	}
 invalidCharsList = " /:,;~#";
    if (document.pres_form.Text19.value.indexOf('@',0)==-1 ||
        document.pres_form.Text19.value.indexOf('@',0)== 0 ||
        document.pres_form.Text19.value.indexOf('.',0)==-1) {
        alert(EmailError)      
        document.pres_form.Text19.select()
        document.pres_form.Text19.focus()
        return false
   }
    for (i = 0; i < invalidCharsList.length; i++) {
        errorChar = invalidCharsList.charAt(i);
        if (document.pres_form.Text19.value.indexOf(errorChar,0) != -1) {
            alert(EmailError)
            document.pres_form.Text19.select()
            document.pres_form.Text19.focus()
            return false
        }
    }
 
}
function isEmpty(data){
   for (var i=0; i<data.length; i++){
      if(data.substring(i, i+1) != " ")
         return (false);
   }

   
}
