// hide
function checkSurvey() {
	var rad_own = "no";
	var rad_recommend = "no";
	var rad_helpful = "no";	
	
	var error_string = "";

	// check the text inputs
	if(document.the_survey.name.value == '') {
		error_string +="You will need to add your name to the form to submit this survey.\n";
		}
	if(document.the_survey.city.value == '') {
		error_string +="You will need to add your city to continue.\n";
		}
	if(document.the_survey.state.value == '') {
		error_string +="You will need to add your state to continue.\n";
		}
	
	// check the radio buttons
	for (var loop1 = 0; loop1 < document.the_survey.own_lupine.length; loop1++) {
		if(document.the_survey.own_lupine[loop1].checked == true) {
			rad_own = "yes";
			}
		}
		
	if(rad_own == "no") {
		error_string += "Please tell us whether or not you own lupine products.\n";
		}

	for(var loop2 = 0; loop2 < document.the_survey.recommend_lupine.length; loop2++) {
		if(document.the_survey.recommend_lupine[loop2].checked == true) {
			rad_recommend = "yes";
			}
		}
		
	if(rad_recommend == "no") {
		error_string += "Please tell us how likely you are to recommend our products to friends.\n";
		}		
		
	for(var loop3 = 0; loop3 < document.the_survey.lupine_helpful.length; loop3++) {
		if(document.the_survey.lupine_helpful[loop3].checked == true) {
			rad_helpful = "yes";
			}
		}
		
	if(rad_helpful == "no") {
		error_string += "Please tell us if you find Lupinepet.com helpful.\n";
		}
		
		

if(error_string == "") {
	return true;
	}
else {
	error_string ="We found the following omissions in your Survey Sumbission: \n\n" + error_string;
	alert (error_string);
	return false;
	}
}		
