function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Contact_FirstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.Contact_FirstName.focus();
    return (false);
  }

  if (theForm.Contact_FirstName.value.length > 80)
  {
    alert("Please enter at most 80 characters in the \"First Name\" field.");
    theForm.Contact_FirstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Contact_FirstName.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("Please enter only letter, digit, and whitespace characters in the \"First Name\" field.");
    theForm.Contact_FirstName.focus();
    return (false);
  }

  if (theForm.Contact_LastName.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.Contact_LastName.focus();
    return (false);
  }

  if (theForm.Contact_LastName.value.length > 80)
  {
    alert("Please enter at most 80 characters in the \"Last Name\" field.");
    theForm.Contact_LastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Contact_LastName.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("Please enter only letter, digit, and whitespace characters in the \"Last Name\" field.");
    theForm.Contact_LastName.focus();
    return (false);
  }

  if (theForm.Contact_BirthDate.value == "")
  {
    alert("Please enter a value for the \"Date of Birth\" field.");
    theForm.Contact_BirthDate.focus();
    return (false);
  }

  if (theForm.Contact_BirthDate.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Date of Birth\" field.");
    theForm.Contact_BirthDate.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-/- \t\r\n\f";
  var checkStr = theForm.Contact_BirthDate.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("Please enter only letter, digit, whitespace, and \"/-\" characters in the \"Date of Birth\" field.");
    theForm.Contact_BirthDate.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Contact_Age.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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Age\" field.");
    theForm.Contact_Age.focus();
    return (false);
  }

  if (theForm.Contact_Gender.selectedIndex == 0)
  {
    alert("The first \"Sex\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Contact_Gender.focus();
    return (false);
  }

  if (theForm.Contact_StreetAddress.value == "")
  {
    alert("Please enter a value for the \"Street Address (Personal)\" field.");
    theForm.Contact_StreetAddress.focus();
    return (false);
  }

  if (theForm.Contact_StreetAddress.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Street Address (Personal)\" field.");
    theForm.Contact_StreetAddress.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Contact_StreetAddress.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("Please enter only letter, digit, and whitespace characters in the \"Street Address (Personal)\" field.");
    theForm.Contact_StreetAddress.focus();
    return (false);
  }

  if (theForm.Contact_City.value == "")
  {
    alert("Please enter a value for the \"City (Personal)\" field.");
    theForm.Contact_City.focus();
    return (false);
  }

  if (theForm.Contact_City.value.length > 80)
  {
    alert("Please enter at most 80 characters in the \"City (Personal)\" field.");
    theForm.Contact_City.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Contact_City.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("Please enter only letter, digit, and whitespace characters in the \"City (Personal)\" field.");
    theForm.Contact_City.focus();
    return (false);
  }

  if (theForm.Contact_State.value == "")
  {
    alert("Please enter a value for the \"State (Personal)\" field.");
    theForm.Contact_State.focus();
    return (false);
  }

  if (theForm.Contact_State.value.length > 3)
  {
    alert("Please enter at most 3 characters in the \"State (Personal)\" field.");
    theForm.Contact_State.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
  var checkStr = theForm.Contact_State.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("Please enter only letter characters in the \"State (Personal)\" field.");
    theForm.Contact_State.focus();
    return (false);
  }

  if (theForm.Contact_ZipCode.value == "")
  {
    alert("Please enter a value for the \"ZIP (Personal Address)\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  if (theForm.Contact_ZipCode.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"ZIP (Personal Address)\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.Contact_ZipCode.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("Please enter only letter and digit characters in the \"ZIP (Personal Address)\" field.");
    theForm.Contact_ZipCode.focus();
    return (false);
  }

  if ((theForm.Contact_WorkPhone.value == "") && (theForm.Contact_HomePhone.value == "") && (theForm.Contact_Cell.value == ""))
  {
    alert("Please enter at least one phone number.");
    theForm.Contact_WorkPhone.focus();
    return (false);
  }
  
  
  if (theForm.ClassDate.selectedIndex == 0)
  {
    alert("The first \"Date of Class Applying For\" option is not a valid selection.  Please choose one of the other options.");
    theForm.ClassDate.focus();
    return (false);
  }
  

  
  if ((theForm.ClassOption[0].checked) || (theForm.ClassOption[1].checked) || (theForm.ClassOption[2].checked) || (theForm.ClassOption[3].checked) || (theForm.ClassOption[4].checked))
  {
  flag = 0
  if (theForm.ClassOption[0].checked) {
  	for (i=0; i < theForm.OneTwoWeekOption.length; i++) {
		if (theForm.OneTwoWeekOption[i].checked) {
				flag += 1;
		}
	}
    if (flag > 2) {
	    alert("You have selected more than two courses. Please select two or less.");
	    return (false);
	} else if (flag == 0) {
	    alert("Please select at least one course.");
		return (false);
	} 
  }	
	
  if ((theForm.ClassOption[3].checked) || (theForm.ClassOption[4].checked)) {
  	return OnCheck_OneYear(theForm)
  }
  
  return (true);
  }
  else
  {
    alert("Please choose a course.");
    theForm.ClassOption[1].focus();
    return (false);
  }

  
  
  return (true);
}

function OnCheck_OneTwoWeek(theForm) {
	for (i=0; i < theForm.ThreeWeekOption.length; i++) {
		theForm.ThreeWeekOption[i].disabled = true
	}
	for (i=0; i < theForm.OneTwoWeekOption.length; i++) {
		theForm.OneTwoWeekOption[i].disabled = false
	}
}	

function OnCheck_ThreeWeek(theForm) {
	for (i=0; i < theForm.OneTwoWeekOption.length; i++) {
		theForm.OneTwoWeekOption[i].disabled = true
	}
	for (i=0; i < theForm.ThreeWeekOption.length; i++) {
		theForm.ThreeWeekOption[i].disabled = false
	}
}	


function OnCheck_OneYear(theForm) {
	OnCheck_DisableSubOptions(theForm);
	var ClassDate = theForm.ClassDate.value;
	if ((!(ClassDate.indexOf("Jul") >= 0)) && (!(ClassDate.indexOf("Jan") >= 0))) {
	    alert("Please choose a January or July class date.");
	    theForm.ClassDate.focus();
	    return (false);
	}
}	


function OnCheck_DisableSubOptions(theForm) {
	for (i=0; i < theForm.OneTwoWeekOption.length; i++) {
		theForm.OneTwoWeekOption[i].disabled = true
	}
	for (i=0; i < theForm.ThreeWeekOption.length; i++) {
		theForm.ThreeWeekOption[i].disabled = true
	}
}	
