function checkForm1(){
    // CCJ's
    if(document.formPage1.q1_6.value == 'Yes'){
        if(confirm('Having County Court Judgements or bankruptcies is not a bar to applying to esure.  Would you like to continue with your application?')){
            // Credit check again
            if(document.formPage1.q1_5.value == 'Yes'){
                if(confirm('Having a poor credit history is not necessarily a bar to being employed by esure.  Would you like to continue with your application?')){
                    return true;
                }
                else{
                    window.location = 'esure_form_fail.php';
                    return false;
                }
            }
            else{
                return true;
            }
        }
        else{
            window.location = 'esure_form_fail.php';
            return false;
        }
    }
    // Credit check
    if(document.formPage1.q1_5.value == 'Yes'){
        if(confirm('Having a poor credit history is not necessarily a bar to being employed by esure.  Would you like to continue with your application?')){
            return true;
        }
        else{
            window.location = 'esure_form_fail.php';
            return false;
        }
    }
}

function checkForm3(){
    if(
      document.formPage3.nos1.value == '' &&
      document.formPage3.from_month_1.value == '' &&
      document.formPage3.from_year_1.value == '' &&
      document.formPage3.to_month_1.value == '' &&
      document.formPage3.to_year_1.value == '' &&
      
      document.formPage3.nos2.value == '' &&
      document.formPage3.from_month_2.value == '' &&
      document.formPage3.from_year_2.value == '' &&
      document.formPage3.to_month_2.value == '' &&
      document.formPage3.to_year_2.value == '' &&
      
      document.formPage3.nos3.value == '' &&
      document.formPage3.from_month_3.value == '' &&
      document.formPage3.from_year_3.value == '' &&
      document.formPage3.to_month_3.value == '' &&
      document.formPage3.to_year_3.value == '' 
    ){
        if(confirm('Are you sure you have entered all your education details?')){
            return true;
        }
        else{
            return false;
        }
    }
}

function checkForm4(){
    if(
      document.formPage4.noc1.value == '' &&
      document.formPage4.from_month_1.value == '' &&
      document.formPage4.from_year_1.value == '' &&
      document.formPage4.to_month_1.value == '' &&
      document.formPage4.to_year_1.value == '' &&
      document.formPage4.job_title_1.value == '' &&
      document.formPage4.reason_leaving_1.value == '' &&
      
      document.formPage4.noc2.value == '' &&
      document.formPage4.from_month_2.value == '' &&
      document.formPage4.from_year_2.value == '' &&
      document.formPage4.to_month_2.value == '' &&
      document.formPage4.to_year_2.value == '' &&
      document.formPage4.job_title_2.value == '' &&
      document.formPage4.reason_leaving_2.value == '' &&
      
      document.formPage4.noc3.value == '' &&
      document.formPage4.from_month_3.value == '' &&
      document.formPage4.from_year_3.value == '' &&
      document.formPage4.to_month_3.value == '' &&
      document.formPage4.to_year_3.value == '' &&
      document.formPage4.job_title_3.value == '' &&
      document.formPage4.reason_leaving_3.value == '' &&
      
      document.formPage4.noc4.value == '' &&
      document.formPage4.from_month_4.value == '' &&
      document.formPage4.from_year_4.value == '' &&
      document.formPage4.to_month_4.value == '' &&
      document.formPage4.to_year_4.value == '' &&
      document.formPage4.job_title_4.value == '' &&
      document.formPage4.reason_leaving_4.value == '' &&
      
      document.formPage4.noc5.value == '' &&
      document.formPage4.from_month_5.value == '' &&
      document.formPage4.from_year_5.value == '' &&
      document.formPage4.to_month_5.value == '' &&
      document.formPage4.to_year_5.value == '' &&
      document.formPage4.job_title_5.value == '' &&
      document.formPage4.reason_leaving_5.value == ''
      
    ){
        if(confirm('Are you sure you have entered all your job details?')){
            return true;
        }
        else{
            return false;
        }
    }
}