function validateForm(f)
{
	// Require Name
	if (f.name.value == '')
	{
		alert('Please enter your name.')
		f.name.focus()
		return;
	}

	// Require Comment
	if (f.comment.value == '')
	{
		alert('Please enter your question or situation.')
		f.comment.focus()
		return;
	}

	// check the phone number if they enter it
	if (validPhone(f.phone.value) != true)
	{
		f.phone.focus()
		return;
	}
	
	
	// Passed the edits, submit the form
	f.submit()
	
}

function validPhone(phone)
{
    var validchars = '0123456789()- ';
    var badchars = "";
    for (var j=0; j<phone.length; j++) {
         if (validchars.indexOf(phone.charAt(j)) == -1) {
           badchars += phone.charAt(j);
         }
    }
    if (badchars.length > 0) {
      	alert ('Phone Number contains the following invalid characters. "' + badchars + '"');
	   	return false;
	}
	if (phone.length < 10)  {
		alert ('The phone number must be at least 10 characters.');
		return false;
	}
	return true;
}

