
function validateFields(){
    var errorMsg = "";
    var shallWeContinue;
       //This variable stays true until a test fails.
    shallWeContinue = true; //If it becomes false the remaining tests will not run
    if(shallWeContinue){

    }//end if
   //"yes" has been changed to false and no has been changed to true
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_applicationdate',document.forms['frmApplyOnline'].rmwebsvc_applicationdate.value,'Application Date','',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_location',document.forms['frmApplyOnline'].rmwebsvc_pudf_location.value,'Location','Description',true);}
    //if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_leasest',document.forms['frmApplyOnline'].rmwebsvc_leasest.value, 'Lease Start','', true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_term',document.forms['frmApplyOnline'].rmwebsvc_pudf_term.value, 'Lease Terms','Description',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_rent_max',document.forms['frmApplyOnline'].rmwebsvc_rent_max.value, 'Rent','',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_fname',document.forms['frmApplyOnline'].rmwebsvc_fname.value, 'First Name','Alpha',true);}
	
	 if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_applicant_middle_name',document.forms['frmApplyOnline'].rmwebsvc_pudf_applicant_middle_name.value, 'Middle Name','',true);}
	
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_lname',document.forms['frmApplyOnline'].rmwebsvc_lname.value, 'Last Name','Alpha',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_street1',document.forms['frmApplyOnline'].rmwebsvc_street1.value, 'Street Address','Description',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_city',document.forms['frmApplyOnline'].rmwebsvc_city.value, 'City','Alpha',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_state',document.forms['frmApplyOnline'].rmwebsvc_state.value, 'State','Alpha',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_zip',document.forms['frmApplyOnline'].rmwebsvc_zip.value, 'Zip Code','',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_carphone',document.forms['frmApplyOnline'].rmwebsvc_carphone.value, 'Mobile Phone','',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_bdate',document.forms['frmApplyOnline'].rmwebsvc_bdate.value, 'Date of Birth','Date',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_ssn',document.forms['frmApplyOnline'].rmwebsvc_ssn.value, 'Social Security Number','',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_monthly_income',document.forms['frmApplyOnline'].rmwebsvc_pudf_monthly_income.value, 'Monthly Income','NumericCurrency',true);}
    if(shallWeContinue){shallWeContinue =  fieldProfiler('frmApplyOnline','rmwebsvc_cudf_citizenship',document.forms['frmApplyOnline'].rmwebsvc_cudf_citizenship.value, 'Citizenship','Alpha',true);}
    if(shallWeContinue){shallWeContinue =  fieldProfiler('frmApplyOnline','rmwebsvc_email',document.forms['frmApplyOnline'].rmwebsvc_email.value, 'Email Address','Email',true);}	
	
	 if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_rental_#1_startdate',document.forms['frmApplyOnline'].rmwebsvc_pudf_rental_1_startdate.value,'Rental 1 Start Date','',true);}
	 
	  if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_rental_#1_enddate',document.forms['frmApplyOnline'].rmwebsvc_pudf_rental_1_enddate.value,'Rental 1 End Date','',true);}
	  
	   if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_rental_1_owner/agent',document.forms['frmApplyOnline'].rmwebsvc_pudf_rental_1_owner_agent.value,'Rental 1 Owner','',true);}
	
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_rental_#1_owner_phone',document.forms['frmApplyOnline'].rmwebsvc_pudf_rental_1_owner_phone.value,'Rental 1 Owner Phone','',true);}
	
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_startdate',document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_startdate.value, 'Current Employment Start Date','Date',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_enddate', document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_enddate.value, 'Current Employment End Date','Date', false);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_employer',document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_employer.value, 'Current Employment Name','Alphanumeric',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_title', document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_title.value, 'Current Employment Title','Description',true);}
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_supervisor', document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_supervisor.value, 'Current Employment Supervisor','Alpha',true);}
	if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_phone', document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_phone.value, 'Current Employment Phone','',true);}
	
if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_curremployment_salary', document.forms['frmApplyOnline'].rmwebsvc_pudf_curremployment_salary.value, 'Current Employment Salary','',true);}

    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_license',document.forms['frmApplyOnline'].rmwebsvc_license.value,'Driver License','',false);}
	
	 if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_felony?',document.forms['frmApplyOnline'].rmwebsvc_pudf_felony.value,'Have you ever been convicted of a felony?','',true);}
	 
	  if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_misdemeanor?',document.forms['frmApplyOnline'].rmwebsvc_pudf_misdemeanor.value,'Have you ever been convicted of a misdemeanor?','',true);}
	  
	   if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_bankruptcy?',document.forms['frmApplyOnline'].rmwebsvc_pudf_bankruptcy.value,'Have you ever filed for bankruptcy?','',true);}
	   
	    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_evicted?',document.forms['frmApplyOnline'].rmwebsvc_pudf_evicted.value,'Have you ever been evicted?','',true);}
    
    
   
//    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_bankruptcy?','Bankrupt','Alpha','no');}
    if(document.forms['frmApplyOnline'].rmwebsvc_pudf_felony.value=='yes')
    {
        
        if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_felony_date',document.forms['frmApplyOnline'].rmwebsvc_pudf_felony_date.value,'Felony Date','Date',true);}
    }
    if(document.forms['frmApplyOnline'].rmwebsvc_pudf_misdemeanor.value=='yes')
    {
        
        if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_misdemeanor_date',document.forms['frmApplyOnline'].rmwebsvc_pudf_misdemeanor_date.value,'Misdemeanor Date','Date',true);}
    }
    if(document.forms['frmApplyOnline'].rmwebsvc_pudf_bankruptcy.value=='yes')
    {
        
        if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_bankruptcy_date',document.forms['frmApplyOnline'].rmwebsvc_pudf_bankruptcy_date.value,'Bankruptcy Date','Date',true);}
    }
    if(document.forms['frmApplyOnline'].rmwebsvc_pudf_evicted.value == 'yes')
    {
      if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_evicted_date',document.forms['frmApplyOnline'].rmwebsvc_pudf_evicted_date.value,'Evicted Date','Date',true);}
    }
   
   // if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_emergency_contact_person',document.forms['frmApplyOnline'].rmwebsvc_pudf_emergency_contact_person.value,'Contact','Alphanumeric',false);
    if(shallWeContinue){shallWeContinue = fieldProfiler('frmApplyOnline','rmwebsvc_pudf_emergency_contact_number',document.forms['frmApplyOnline'].rmwebsvc_pudf_emergency_contact_number.value,'Contact Phone','',false);}
	if (shallWeContinue){
        //Pass the name of the current form, and the typed-in-captcha-text for prevalidation
	    shallWeContinue = captchaPrevalidation('frmApplyOnline',document.forms["frmApplyOnline"].CaptchaChallenge.value);
	}
	//Check last name for occupants and send alert message if last name is not given
	if(shallWeContinue){shallWeContinue = lastNameRequiredMessage(document.forms["frmApplyOnline"].rmwebsvc_people_lname_1.value, '1');}
	if(shallWeContinue){shallWeContinue = lastNameRequiredMessage(document.forms["frmApplyOnline"].rmwebsvc_people_lname_2.value, '2');}
	if(shallWeContinue){shallWeContinue = lastNameRequiredMessage(document.forms["frmApplyOnline"].rmwebsvc_people_lname_3.value, '3');}
	//Check for people last name set all other people related information to blank if last name is  not set.
    //if(shallWeContinue) checkPeopleLastName(document.forms["frmApplyOnline"].rmwebsvc_people_lname_1.value, '1');
    //if(shallWeContinue) checkPeopleLastName(document.forms["frmApplyOnline"].rmwebsvc_people_lname_2.value, '2');
    //if(shallWeContinue) checkPeopleLastName(document.forms["frmApplyOnline"].rmwebsvc_people_lname_3.value, '3');
	if (shallWeContinue){document.frmApplyOnline.submit();}
  
}//end function call

function captchaPrevalidation(formName, givenValue)
{
    if(givenValue ==  "")
    {
        alert("Please enter captcha image information");
        return false;
    }
    return true;
}