function stripSpaces(st, all) {

	var i;
	var loop=true;

	while ( loop ) {
		i=st.indexOf(' ');
		loop = false;
		if (i==0) {
			st = st.substring(1,st.length);
			loop = true;
			}
		if (i==st.length-1) {
			st = st.substring(0,st.length-1);
			loop = true;
			}
		if (all && i>0 && i<st.length-1) {
			st = st.substring(0,i) + st.substring(i+1);
			loop = true;
			}
		}
	return(st);
	}
	

function submitForm() { // make sure all required fields have something in them
	var eform = document.contact;
	
	// do a little checking and pruning on the name, addr, and email fields

	if (eform.fname.value.length==0) {	 // the user's name
		alert('Please enter your first name in the "First Name" field.');
		return(false);
		}

	if (eform.lname.value.length==0) { // last name
		alert('Please enter your last name in the "Last Name" field.');
		return(false);
		}

	if (eform.address.value.length==0) { // the street address
		alert('Please enter your mailing address in the "Address" field.');
		return(false);
		}

	if (eform.city.value.length==0) { // the city
		alert('Please enter your city name in the "City" field.');
		return(false);
		}

	if (eform.state.value=="") { // the state
		alert('Please choose a state abbreviation from the "State" list.');
		return(false);
		}

	if (eform.zip.value=="") { // the zip/postal code
		alert('Please enter your ZIP or postal code in the "Zip" field.');
		return(false);
		}

	// then check the email address
	if (eform.email.value.length==0) {
		alert('Please enter your e-mail address in the "E-mail" field.');
		return(false);
		}

	eform.email.value = "" + stripSpaces(eform.email.value, true);	 // use ""+ to allow for IE 3.x
	eform.email.value = "" + eform.email.value.toLowerCase();

	if (eform.email.value.indexOf('@') < 1 || eform.email.value.length < 6 ||
			eform.email.value.indexOf('@') == eform.email.value.length-1) {
		alert('An email address needs name@domain.com.\r\rAOL users would be name@aol.com\rCompuserve users would be number.number@compusererve.com');
		return(false);
		}

	if (eform.comment.value=="") { // comments
		alert('Please enter your comments in the Comments box.');
		return(false);
		}
	return true;
	}
