function submitIt() {
	if(validate() == true) {
		document["sendmail"].submit();
	}
}

function validate() {
	var fname = document.sendmail.firstname.value;
	var street = document.sendmail.street.value;
	var city = document.sendmail.city.value;
	var state = document.sendmail.state.value;
	var zip = document.sendmail.zip.value;
	var phone = document.sendmail.phone.value;
	var email = document.sendmail.email.value;
	var fcontent;

	if (fname.length < 1) {
		alert("First name must be at least one character long.");
		return false;
	}
	else if (phone.length < 10) {
		alert("Phone number must be at least 10 digits long.");
		return false;
	}
	else if(email != "" && email.indexOf("@") == -1) {
		alert("Not a valid email address.");
		return false;
	}
	else if(email != "" && email.indexOf(".") == -1) {
		alert("Not a valid email address.");
		return false;
	}
	else { 
		fcontent = "<html><head><title></title></head><body>";
		fcontent = fcontent + fname;
		fcontent = fcontent + "&nbsp;";
		fcontent = fcontent + street;
		fcontent = fcontent + "<br>";
		fcontent = fcontent + city;
		fcontent = fcontent + ",&nbsp;";
		fcontent = fcontent +  state;
		fcontent = fcontent + "&nbsp;";
		fcontent = fcontent + zip;
		fcontent = fcontent + "<br>";
		fcontent = fcontent + phone;
		fcontent = fcontent + "<br>";
		fcontent = fcontent + email;
		fcontent = fcontent + "</body></html>";

		document.sendmail.thecontent.value = fcontent;

		return true;	
	}
}	