// JavaScript Document
	function Validate(theForm){
		if (theForm.txtName.value==""){
			document.getElementById("nmsg").innerHTML = "Please provide your Name";
			theForm.txtName.focus();
			return(false);
		}
		if (theForm.cboPos.selectedIndex==0){
			document.getElementById("pmsg").innerHTML = "Please select your Position";
			theForm.cboPos.focus();
			return(false);
		}
		if (theForm.txtPhone.value==""){
			document.getElementById("tmsg").innerHTML = "Please provide your Telephone Number including area code";
			theForm.txtPhone.focus();
			return(false);
		}
  var chkPhone = strip(theForm.txtPhone.value);
  if (chkPhone.length < 10){
			document.getElementById("tmsg").innerHTML = "Please check your Telephone Number";
			theForm.txtPhone.focus();
    return (false);
  }
		if (theForm.cboPhone.selectedIndex==0){
			document.getElementById("ttmsg").innerHTML = "Please select the Phone type";
			theForm.cboPhone.focus();
			return(false);
		}
  if (theForm.txtAltPhone.value != ""){
			var chkAltPhone = strip(theForm.txtAltPhone.value);
				if (chkAltPhone.length < 10){
						document.getElementById("altmsg").innerHTML = "Please check your Alternate Telephone Number";
						theForm.txtAltPhone.focus();
					return (false);
  }		
	}

  if (theForm.txtEmail.value ==""){
    document.getElementById("emsg").innerHTML = "Please enter the Email Address.";
    theForm.txtEmail.focus();
    return (false);
  }
  if (theForm.txtEmail.value.length < 5)  {
    document.getElementById("emsg").innerHTML = "Please enter at least 5 characters for the Email Address.";
    theForm.txtEmail.focus();
    return (false);
  }

  	var EMValue = theForm.txtEmail.value;	
	var delim1 = EMValue.indexOf("@");
if (delim1 < 2) {
	document.getElementById("emsg").innerHTML = "Please fix the 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)  {
    document.getElementById("emsg").innerHTML = "The EMail Address contains characters we don't recognize.";
    theForm.txtEmail.focus();
    return (false);
  }
		if (theForm.cboContact.selectedIndex==0){
			document.getElementById("cmsg").innerHTML = "Please select the best way to contact you";
			theForm.cboContact.focus();
			return(false);
		}
		if (theForm.txtTime.value==""){
			document.getElementById("tmmsg").innerHTML = "Please provide the best time to contact you";
			theForm.txtTime.focus();
			return(false);
		}
		if (theForm.txtFacName.value==""){
			document.getElementById("fnmsg").innerHTML = "Please provide the Facility's Name";
			theForm.txtFacName.focus();
			return(false);
		}
		if (theForm.txtFacLoc.value==""){
			document.getElementById("flmsg").innerHTML = "Please provide the Facility's Location";
			theForm.txtFacLoc.focus();
			return(false);
		}
		if (theForm.cboInstructors.selectedIndex==0){
			document.getElementById("imsg").innerHTML = "Please select the number of Instructors at your facility";
			theForm.cboInstructors.focus();
			return(false);
		}
		if (theForm.cboHostTime.selectedIndex==0){
			document.getElementById("mmsg").innerHTML = "Please select the groups on months you would like to host an event";
			theForm.cboHostTime.focus();
			return(false);
		}
		if (theForm.cboType.selectedIndex==0){
			document.getElementById("etmsg").innerHTML = "Please select the Event Type you wish to host";
			theForm.cboType.focus();
			return(false);
		}
			return(true);
	}
