function checkform(which){	
	var errmsg = "";	
	if (which.fname.value==""){errmsg = errmsg + "· The First Name field does not appear to be filled out correctly.\n";}
	if (which.lname.value==""){errmsg = errmsg + "· The Last Name field does not appear to be filled out correctly.\n";}
	if ((which.email.value == "")||(!isEmailAddr(which.email.value))||(which.email.value.length < 3)){
    errmsg = errmsg + "· The Email field does not appear to be filled out correctly.\n";
  	}
	if (which.phone.value==""){errmsg = errmsg + "· The Phone field does not appear to be filled out correctly.\n";}
	if (which.address.value==""){errmsg = errmsg + "· The Address field does not appear to be filled out correctly.\n";}
	if (which.city.value==""){errmsg = errmsg + "· The City field does not appear to be filled out correctly.\n";}
	if (which.state.value==""){errmsg = errmsg + "· The State field does not appear to be filled out correctly.\n";}
	if (which.zip.value==""){errmsg = errmsg + "· The Zip or Postal Code field does not appear to be filled out correctly.\n";}
	if (which.title.value==""){errmsg = errmsg + "· The Title field does not appear to be filled out correctly.\n";}
	if (which.location.value==""){errmsg = errmsg + "· The Location field does not appear to be filled out correctly.\n";}
	if (which.date.value==""){errmsg = errmsg + "· The Date field does not appear to be filled out correctly.\n";}
	if (which.athlete_names.value==""){errmsg = errmsg + "· The Athlete Names field does not appear to be filled out correctly.\n";}
	if (errmsg!=""){
		errmsg="The following errors were found:\n\n"+errmsg+"\nPlease fix these errors and try again.";
		alert(errmsg);
		return false;
	}else{
		return true;
		location.href='contests_thankyou.html';
	}
}

// email format checker

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}