var bigstring = " ";
function doesexist(inputValue, inputExpected) {
	var aCharExists=0
  if (inputValue) {
    for (var i=0; i<inputValue.length; i++) {
      if (inputValue.charAt(i) != " ") {
        aCharExists = 1;
      }
    }
  }
  if (!aCharExists) {
  	bigstring = bigstring +=inputExpected +="\n ";
  }
}

function checkem() {
	var where_to = confirm("Submit Your Application?");
	if (where_to == false)
	{
		return false;
	}
	doesexist(document.app.first_name.value, '- First Name');
  doesexist(document.app.last_name.value, '- Last Name');
  doesexist(document.app.address.value, '- Street Address');
  doesexist(document.app.city.value, '- City');
  doesexist(document.app.state.value, '- State');
  doesexist(document.app.zip.value, '- Zip/Postal Code');
  doesexist(document.app.dob_month.value, '- Birth Date Month');
  doesexist(document.app.dob_day.value, '- Birth Date Day');
  doesexist(document.app.dob_year.value, '- Birth Date Year');
  doesexist(document.app.ssn.value, '- Social Security Number');
  doesexist(document.app.phone_part_1.value, '- Phone Number 1');
  doesexist(document.app.phone_part_2.value, '- Phone Number 2');
  doesexist(document.app.phone_part_3.value, '- Phone Number 3');
  doesexist(document.app.time_to_call.value, '- Best Time to Call');
  doesexist(document.app.experience.value, '- Years Driving Experience');
  
  if ((document.app.owner_operator.checked == "")&&(document.app.company_driver.checked == 0)&&(document.app.student.checked == 0)){
    inputExpected = '- I am now a O/O, C/D, Student)\n ';
    bigstring = bigstring += inputExpected;
  }
  if (bigstring != " "){
    alert("Please complete the following fields: \n" + bigstring);
    bigstring = " ";
    return false;
  }
  return true;
}

function checkemplan() {
//	var where_to = confirm("Send This Contact Form?");
//	if (where_to == false)
//	{
//		return false;
//	}
	doesexist(document.contact.company_name.value, '- Company Name');
  doesexist(document.contact.contact_name.value, '- Contact Name');
  doesexist(document.contact.phone_number.value, '- Phone Number');
  doesexist(document.contact.email.value, '- Email');
   
  if (bigstring != " "){
    alert("Please complete the following fields: \n" + bigstring);
    bigstring = " ";
    return false;
  }
  return true;
}