// Quick Contact Form Validator
function contFormValidate(theForm)
{
	/* Check Name */
  	if ((theForm.realname.value == "Your Name") || (theForm.realname.value == "") ){
    	alert("Please enter your name.");
    	theForm.realname.focus();
    	return (false);
  	}

	/* Require EITHER the email address or phone number */
	/*if ( ( (theForm.email.value == "Your Email") || (theForm.email.value == "") ) && ( (theForm.phone.value == "") || (theForm.phone.value == "Your Phone") ) ) {
		alert("Please enter either your email address or phone number field.");
    	theForm.email.focus();
    	return (false);
	}*/
	
	/* Check Email Address */
 	if ((theForm.email.value == "Your Email") || (theForm.email.value == "") ){
    	alert("Please enter your email.");
    	theForm.email.focus();
    	return (false);
  	}
	if ((theForm.email.value != "Your Email") && (theForm.email.value != "")) {
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if (reg.test(theForm.email.value) == false) {
			alert("Please enter a valid E-mail address.");
			theForm.email.focus();
			return (false);
		}
	}

	/* Check Phone Number */
  	/*if ((theForm.phone.value != "Your Phone") && (theForm.phone.value != "")) {
	  var checkOK = "0123456789-.";
	  var checkStr = theForm.phone.value;
	  var allValid = true;
	  var decPoints = 0;
	  var allNum = "";
	  for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch === checkOK.charAt(j))
			break;
		if (j === checkOK.length) {
		  allValid = false;
		  break;
		}
		if (ch == ".") {
		  allNum += ".";
		  decPoints++;
		}
		else
		  allNum += ch;
	  }
	  if (!allValid) {
		alert("Please enter only digit characters in the \"phone\" field.");
		theForm.phone.focus();
		return (false);
	  }
	}*/
	
	else {
		return (true)
	}
}
