// hide
function checkForm() {
	var error_string = "";
	var onlineStore = "no";

// check text fields
if(document.catalog_request.fullName.value == "") {
	error_string += "You must include your name\n";
	}
if(document.catalog_request.storeName.value == "") {
	error_string += "You must include a store name\n";
	}	
if(document.catalog_request.address.value == "") {
	error_string += "You must include an address\n";
	}		
if(document.catalog_request.city.value == "") {
	error_string += "You must include a city\n";
	}		
if(document.catalog_request.state.value == "") {
	error_string += "You must include a state or province\n";
	}			
if(document.catalog_request.zip.value == "") {
	error_string += "You must include a zip\n";
	}
if(document.catalog_request.email.value == "") {
	error_string += "You must include a valid email address\n";
	}
if(!document.catalog_request.email.value == "") {
	var str=document.catalog_request.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	// check submitted string for match with regex filter
	if (filter.test(str)) {
		error_string == "";
		}
	else {
		error_string += "your e-mail address is not quite correct\n";
		}
	}

if(document.catalog_request.phone.value == "") {
	error_string += "You must include a phone number\n";
	}			

for(var loop1 = 0; loop1 < document.catalog_request.onlineStore.length; loop1++) {
	if(document.catalog_request.onlineStore[loop1].checked == true) {
		onlineStore = "yes";
		}
	}
	if(onlineStore == "no") {
		error_string += "We need to know if you already have an online store\n";			
		}	
	
if(error_string == "") {
	return true;
	}
else {
	error_string ="We found the following omissions in your catalog request sumbission: \n" + error_string;
	alert (error_string);
	return false;
	}
}		

