function validate(){
    var thefrm = document.frm_online_app;

    for(i=0; i<thefrm.txt_applicant_gender.length; i++){
        if(thefrm.txt_applicant_gender[i].checked){
            var check_txt_applicant_gender = 1;
            var value_txt_applicant_gender = thefrm.txt_applicant_gender[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.sibling.length; i++){
        if(thefrm.sibling[i].checked){
            var check_sibling = 1;
            var value_sibling = thefrm.sibling[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_custodial.length; i++){
        if(thefrm.rad_custodial[i].checked){
            var check_rad_custodial = 1;
            var value_rad_custodial = thefrm.rad_custodial[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_synod.length; i++){
        if(thefrm.rad_synod[i].checked){
            var check_rad_synod = 1;
            var value_rad_synod = thefrm.rad_synod[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_vocational_intent_agree.length; i++){
        if(thefrm.rad_vocational_intent_agree[i].checked){
            var check_rad_vocational_intent_agree = 1;
            var value_rad_vocational_intent_agree = thefrm.rad_vocational_intent_agree[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_pastor_intent.length; i++){
        if(thefrm.rad_pastor_intent[i].checked){
            var check_rad_pastor_intent = 1;
            var value_rad_pastor_intent = thefrm.rad_pastor_intent[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_teacher_intent.length; i++){
        if(thefrm.rad_teacher_intent[i].checked){
            var check_rad_teacher_intent = 1;
            var value_rad_teacher_intent = thefrm.rad_teacher_intent[i].value;
            break;
        }
    }
    for(i=0; i<thefrm.rad_other_intent.length; i++){
        if(thefrm.rad_other_intent[i].checked){
            var check_rad_other_intent = 1;
            var value_rad_other_intent = thefrm.rad_other_intent[i].value;
            break;
        }
    }

    if(!thefrm.txt_applicant_firstname.value){
        alert('You must enter the applicant\'s first name.');
	thefrm.txt_applicant_firstname.focus();
	return;
    }
    else if(!thefrm.txt_applicant_lastname.value){
	alert('You must enter the applicant\'s last name.');
	thefrm.txt_applicant_lastname.focus();
	return;
    }
    else if(!thefrm.txt_applicant_middleinitial.value){
	alert('You must enter the applicant\'s middle name.');
	thefrm.txt_applicant_middleinitial.focus();
	return;
    }
    else if(!thefrm.txt_applicant_streetaddress.value){
	alert('You must enter the applicant\'s street address.');
	thefrm.txt_applicant_streetaddress.focus();
	return;
    }
    else if(!thefrm.txt_applicant_city.value){
	alert('You must enter the applicant\'s city.');
	thefrm.txt_applicant_city.focus();
	return;
    }
    else if(!thefrm.txt_applicant_state.value){
	alert('You must enter the applicant\'s state.');
	thefrm.txt_applicant_state.focus();
	return;
   }
   else if(!thefrm.txt_applicant_zip.value){
	alert('You must enter the applicant\'s zip.');
	thefrm.txt_applicant_zip.focus();
	return;
   }
   else if(!thefrm.txt_primary_day_phone.value){
	alert('You must enter a valid primary day phone.');
	thefrm.txt_primary_day_phone.focus();
	return;
   }
   else if(!thefrm.txt_primary_evening_phone.value){
	alert('You must enter a valid primary evening phone.');
	thefrm.txt_primary_evening_phone.focus();
	return;
   }
   else if(!thefrm.txt_primary_email.value){
	alert('You must enter a valid primary email address.');
	thefrm.txt_primary_email.focus();
	return;
   }
   else if(!thefrm.txt_applicant_dob.value){
	alert('You must enter the applicant\'s date of birth.');
	thefrm.txt_applicant_dob.focus();
	return;
   }
   else if(!thefrm.txt_applicant_pob.value){
	alert('You must enter the applicant\'s place of birth.');
	thefrm.txt_applicant_pob.focus();
	return;
   }
   else if(check_txt_applicant_gender != 1){
	alert('You must enter the applicant\'s gender.');
	thefrm.txt_applicant_gender[0].focus();
	return;
   }
   else if(check_sibling != 1){
	alert('Does the applicant have a sibling attending MLS?');
	thefrm.sibling[0].focus();
	return;
   }
   else if(value_sibling == 'yes' && !thefrm.yearsibattended.value){
	alert('What is the most recent year the applicant\'s sibling attended?');
	thefrm.yearsibattended.focus();
	return;
   }
   else if(thefrm.chk_parents_married.checked == false && thefrm.chk_parents_divorced.checked == false && thefrm.chk_father_deceased.checked == false && thefrm.chk_father_remarried.checked == false && thefrm.chk_father_single.checked == false && thefrm.chk_mother_deceased.checked == false && thefrm.chk_mother_remarried.checked == false && thefrm.chk_mother_single.checked == false && thefrm.chk_parents_other.checked == false){
	alert('What is the marital status of the applicant\'s parents?');
	thefrm.chk_parents_married.focus();
	return;
   }
   else if(thefrm.chk_parents_other.checked == true && !thefrm.txt_parents_other.value){
	alert('Please describe the applicant\'s parent\'s marital status.');
	thefrm.txt_parents_other.focus();
	return;
   }
   else if(thefrm.chk_parents_divorced.checked == true && check_rad_custodial != 1){
	alert('Which parent is the custodial parent?');
	thefrm.rad_custodial[0].focus();
	return;
   }
   else if(thefrm.chk_father_alumnus.checked == true && !thefrm.txt_father_alumnus_years.value){
	alert('What year did the applicant\'s father graduate from MLS?');
	thefrm.txt_father_alumnus_years.focus();
	return;
   }
   else if(thefrm.chk_mother_alumna.checked == true && !thefrm.txt_mother_alumna_years.value){
	alert('What year did the applicant\'s mother graduate from MLS?');
	thefrm.txt_mother_alumna_years.focus();
	return;
   }
   else if(!thefrm.txt_applicant_home_cong.value){
	alert('You must enter the applicant\'s home congregation.');
	thefrm.txt_applicant_home_cong.focus();
	return;
   }
   else if(!thefrm.txt_applicant_home_cong_city_state.value){
	alert('You must enter the city and state of the home congregation.');
	thefrm.txt_applicant_home_cong_city_state.focus();
	return;
   }
   else if(check_rad_synod != 1){
	alert('What synod is the applicant\'s congregation?');
	thefrm.rad_synod[0].focus();
	return;
   }
   else if(check_rad_synod == 'O' && !thefrm.txt_synod_other.value){
	alert('What synod is the applicant\'s congregation?');
	thefrm.txt_synod_other.focus();
	return;
   }
   else if(!thefrm.txt_pastor_name.value){
	alert('You must entered the applicant\'s pastor(s).');
	thefrm.txt_pastor_name.focus();
	return;
   }
   else if(!thefrm.txt_applicant_dobaptism.value){
	alert('You must entered the applicant\'s date of baptism.');
	thefrm.txt_applicant_dobaptism.focus();
	return;
   }
   else if(!thefrm.txt_applicant_doc.value){
	alert('You must entered the applicant\'s planned date of confirmation.');
	thefrm.txt_applicant_doc.focus();
	return;
   }
   else if(check_rad_vocational_intent_agree != 1){
	alert('Please enter the applicant\'s vocational intent.');
	thefrm.rad_vocational_intent_agree[0].focus();
	return;
   }
   else if(check_rad_pastor_intent != 1){
	alert('Please enter the applicant\'s pastor intent.');
	thefrm.rad_pastor_intent[0].focus();
	return;
   }
   else if(check_rad_teacher_intent != 1){
	alert('Please enter the applicant\'s teacher intent.');
	thefrm.rad_teacher_intent[0].focus();
	return;
   }
   else if(check_rad_other_intent != 1){
	alert('Please enter the applicant\'s other intent.');
	thefrm.rad_other_intent[0].focus();
	return;
   }
   else if(thefrm.chk_policy.checked == false){
	alert('Please check the box at the bottom to agree with the policies and regulations of MLS.');
	thefrm.chk_policy.focus();
	return;
   }

   thefrm.submit();
}
