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("Are You Sure You Want To 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.ssn.value, '- Social Security Number');
	doesexist(document.app.address.value, '- Address');
	doesexist(document.app.city.value, '- City');
	doesexist(document.app.state.value, '- State');
	doesexist(document.app.zip.value, '- Zip/Postal Code');
	doesexist(document.app.phone_part_1.value, '- Phone Number Part 1');
	doesexist(document.app.phone_part_2.value, '- Phone Number Part 2');
	doesexist(document.app.phone_part_3.value, '- Phone Number Part 3');
	doesexist(document.app.time_to_call.value, '- Best Time to Call');
	doesexist(document.app.experience.value, '- Years Driving Experience');
	doesexist(document.app.dob_month.value, '- DOB Month');
	doesexist(document.app.dob_day.value, '- DOB Day');
	doesexist(document.app.dob_year.value, '- DOB Year');

	if ((document.app.owner_operator.checked == "")&&(document.app.company_driver.checked == 0)&&(document.app.student.checked == 0)){
		inputExpected = '- I am now a (C/D, O/O, Student)\n ';
		bigstring = bigstring += inputExpected;
	}
	if (bigstring != " "){
		alert("Please complete the following fields: \n" + bigstring);
		bigstring = " ";
		return false;
	}
	return true;
}
