function ChkForm(theForm){
 if(theForm.txtName.value == ""){
 	alert("Please provide your name.");
	theForm.txtName.focus();
	return(false);
 }
 if(theForm.txtOrg.value == ""){
 	alert("Please provide the name of your company or organization.");
	theForm.txtOrg.focus();
	return(false);
 }
 if(theForm.txtPhone.value == ""){
 	alert("Please provide your telephone number.");
	theForm.txtPhone.focus();
	return(false);
 }
  var chkPhone = strip(theForm.txtPhone.value);
  if (chkPhone.length < 10){
    alert("Your telephone number needs to be at least 10 digits.");
	theForm.txtPhone.value = chkPhone;
    theForm.txtPhone.focus();
    return (false);
  }
 if(theForm.txtEmail.value == ""){
 	alert("Please provide your email address.");
	theForm.txtEmail.focus();
	return(false);
 }
var EMValue = theForm.txtEmail.value;	
	var delim1 = EMValue.indexOf("@");
	var delim2 = EMValue.indexOf(".");
	if (delim1 == -1) {
		alert("Please fix your email address.");
		theForm.txtEmail.focus();
		return (false);
	}		
	if (delim2 == -1) {
		alert("Please fix your email address.");
		theForm.txtEmail.focus();
		return (false);
	}		
	if ((delim2 - delim1) < 3) {
		alert("Please fix your email address.");
		theForm.txtEmail.focus();
		return (false);
	}

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@.-_";
  var checkStr = theForm.txtEmail.value;
  var allValid = true;
  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 (!allValid)  {
    alert("Your EMail Address contains characters we don't recognize.");
    theForm.txtEmail.focus();
    return (false);
  }

//  Loop through categories
	var category = false;
	for (var i=0; i < theForm.rdoCat.length; i++){
		if(theForm.rdoCat[i].checked)
			category = true;	
	}

if(!category){
	alert("Please select a consulting category");
	theForm.rdoCat[0].focus();
	return(false);
	}

if(theForm.txtService.value == ""){
 	alert("Please provide a description of the service you would like Tom to provide.");
	theForm.txtService.focus();
	return(false);
 }

return(true)
}

function strip(number) {
 var sOut = '';
 mask = '1234567890';
 for(count = 0; count <= number.length; count++) {
 	if(mask.indexOf(number.substring(count, count+1),0) != -1 ) 
	sOut += number.substring(count,count+1);
 }
 return sOut;
}
