function validateAndSubmit(){
var bFormSuccess = false;
var bChecksOk = false;
var bFirst = false;
var bLast = false;
var bPhone = false;
var bPhoneType = false;
var bZip = false;
var bOwn = false;
var bHelp = false;
var bFreeConsult = false;
var bEmail = false;

var strFormErrorMsg = "There was a problem with the following:\n\n";

try{
	$('request_estimate').submit();
	bChecksOk = ($('opt_1').checked == true) || ($('opt_2').checked == true);
	
	// first name
	$('first_name').value = cleanInputString($('first_name').value,2);
	bFirst = $('first_name').value.length > 0;
	
	// last name
	$('last_name').value = cleanInputString($('last_name').value,2);
	bLast = $('last_name').value.length > 0;
	
	// email
	bEmail = checkForValidEmail($('email').value);
	
	if($('opt_4').checked == true){
		
		// phone
		$('phone').value = cleanInputString($('phone').value,9);
		bPhone = $('phone').value.length > 0;
		
		// phone type
		bPhoneType = ($('phone_home').checked == true) || ($('phone_work').checked == true) || ($('phone_mobile').checked == true);
		
		
		// zip
		$('zip').value = cleanInputString($('zip').value,9);
		bZip = ($('zip').value.length > 0)  && ($('zip').value.length <=10);
		
		// own
		bOwn = $('own_a').value.length > 0;
		
		// help
		bHelp = $('help_you').value.length > 0;
		
		
		bFreeConsult = bPhone && bPhoneType && bZip && bOwn && bHelp;
		
		
	}
	else{
		bFreeConsult = true;
	}
	
	
	bFormSuccess = bFirst && bLast && bEmail && bFreeConsult;
	
	if(!bFormSuccess){
		
		if(!bChecksOk){
			strFormErrorMsg += "Please select either \'Free Federal Tax Credit Match Savings Coupon\' or \'Free Report with a 10-Point Energy-Efficiency Test\'.\n\n";
		}
		
		if(!bFirst){
			strFormErrorMsg += "Your First Name is required.\n";
		}
		if(!bLast){
			strFormErrorMsg += "Your Last Name is required.\n";
		}
		if(!bEmail){
			strFormErrorMsg += "A valid Email Address is required.\n";
		}
		
		if(!bFreeConsult){
			if(!bPhone){
				strFormErrorMsg += "A valid Phone Number is required.\n";
			}
			if(!bPhoneType){
				strFormErrorMsg += "Please choose a phone number type (home, work, or mobile).\n";
			}
			if(!bZip){
				strFormErrorMsg += "A valid Home Zip Code is required.\n";
			}
			if(!bOwn){
				strFormErrorMsg += "Please select whether You Own your home.\n";
			}
			if(!bHelp){
				strFormErrorMsg += "Please select How can we best help you.\n";
			}

		}
		
		alert(strFormErrorMsg);
	}
	else{
		$('request_estimate').submit();
	}

	
}
catch(e){
	strFormErrorMsg = "There was a problem with request.  Please reload the page and try again.";
	alert(strFormErrorMsg);
}

}
