// JavaScript Document
<!--

function checkForm(theForm)

{

  if (theForm.uname.value == "")

  {

    alert("Please enter a value for the \"Name\" field.");

    theForm.uname.focus();

    return (false);

  }








  if (theForm.email.value == "")

  {

    alert("Please enter a value for the \"Email\" field.");

    theForm.email.focus();

    return (false);

  }

  

  invalidChars = " /:,;"

  for (i=0; i<invalidChars.length; i++)

  	badChar = invalidChars.charAt(i)

  	if (theForm.email.value.indexOf(badChar,0) > -1) {

  		alert ('email address contains invalid chars.');

  		return (false);

  		}

  		

  atPos = theForm.email.value.indexOf("@",1)

  if (atPos == -1) {

  	alert ('email address doesn\'t contain \"@\" ');

  	return (false);

  	}

  	

 if (theForm.email.value.indexOf("@",atPos+1) >	 -1) {

 	alert ('email address contains 2 \"@s\" ');

  	return (false);

  	}

  	

  	periodPos = theForm.email.value.indexOf(".",atPos)

  	if (periodPos == -1) {

  		alert ('email address doesn\'t contain \".\" ');

		return (false);

  	}

  

   if (periodPos +3 > theForm.email.value.length) {

		alert ('email address incorrect. ');

		return (false);

	}

	

	

  if (theForm.street.value == "")

  {

    alert("Please enter a value for the \"Address\" field.");

    theForm.street.focus();

    return (false);

  }

  

  if (theForm.city.value == "")

  {

    alert("Please enter a value for the \"City\" field.");

    theForm.city.focus();

    return (false);

  }

  

 if (theForm.state.value == "")

  {

    alert("Please enter a value for the \"State\" field.");

    theForm.state.focus();

    return (false);

  }
  

  

  if (theForm.zip.value == "")

  {

    alert("Please enter a value for the \"Zip\" field.");

    theForm.zip.focus();

    return (false);

  }



  if (theForm.dphone.value == "")

  {

    alert("Please enter a value for the \"Day Phone\" field.");

    theForm.dayphone.focus();

    return (false);

  }



  if (theForm.dayphone.value.length < 7)

  {

    alert("Please enter at least 7 characters in the \"Day Phone\" field.");

    theForm.dayphone.focus();

    return (false);

  }



  if (theForm.dayphone.value.length > 14)

  {

    alert("Please enter at most 14 characters in the \"Day Phone\" field.");

    theForm.dayphone.focus();

    return (false);

  }



  var checkOK = "0123456789-()- \t\r\n\f";

  var checkStr = theForm.dayphone.value;

  var allValid = true;

  var validGroups = 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 digit, whitespace and \"()-\" characters in the \"Day Phone\" field.");

    theForm.dayphone.focus();

    return (false);

  }







 

check_email = confirm(" Is your email address, \"" +  theForm.email.value + "\" correct?")

  if (check_email != "0")

  {

    theForm.Submit.value="Processing...";

    theForm.Submit.disabled = true;

    return (true);

  }

  else

  {

    theForm.email.focus();

    return (false);

  }

}



//-->