

function contact_onsubmit()
{
   var ok = false;

   if( document.ContactInfo.Name.value == "" )
   {
      	alert( "Please enter your name." );
     	document.ContactInfo.Name.focus();
   }
   else if( validName( document.ContactInfo.Name.value ) == false )
   {
	alert( "Name must contain alphabetic characters only." );
	document.ContactInfo.Name.focus();
   }
   else if( document.ContactInfo.Zip.value != "" &&
	    validZip( document.ContactInfo.Zip.value ) == false )
   {
	alert( "Zip code must be in 5 or 9 digit format." );
	document.ContactInfo.Zip.focus();
   }
   else if( document.ContactInfo.phone.value != "" &&
	    validPhone( document.ContactInfo.phone.value ) == false )
   {
      	alert( "Phone number must be in the format xxx-xxx-xxxx." );
	document.ContactInfo.phone.focus();
   }
   else if( document.ContactInfo.emailAddy.value != "" &&
	    validEmail( document.ContactInfo.emailAddy.value ) == false )
   {
      	alert( "Email address must be in the format name@provider.xyz." );
	document.ContactInfo.emailAddy.focus();
   }
   else if( document.ContactInfo.phone.value == "" &&
	    document.ContactInfo.emailAddy.value == "" ) 
   {
	alert( "You must fill in either an email address or a phone number." );
   }
   else
   {
	ok = true;
   }

   return ok;
}

