<!--

// ******** FORM VALIDATION *********
// function validate_name(field) 
// function validate_email(field) 
// function check_for_blanks(theForm)

function validate_name(field) 
{
	var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'"
	var ok = "yes";
	var temp;

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (ok == "no") 
	{
		alert("Alphabetic characters only in the name field please.");
		field.focus();
		field.select();
	}
}


function validate_email(field) 
{
	var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-@."
	var ok = "yes";
	var temp;

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (ok == "no") 
	{
		alert("Only alpha-numeric characters and _ - @ . are allowed in the email field please.");
		field.focus();
		field.select();
	}
}


function check_for_blanks(theForm)
{
	var required = "@."
	var ok = "no";

  if (theForm.fname.value == "")
  {
    alert("Please enter a value for the First Name field.");
    theForm.fname.focus();
	theForm.fname.select();
    return (false);
  }

  if (theForm.lname.value == "")
  {
    alert("Please enter a value for the Last Name field.");
    theForm.lname.focus();
	theForm.lname.select();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the Email Address field.");
    theForm.email.focus();
	theForm.email.select();
    return (false);
  }

  if (theForm.email2.value == "")
  {
    alert("Please enter a value for the Verify Email Address field.");
    theForm.email2.focus();
	theForm.email2.select();
    return (false);
  }

	for (var i=0; i<theForm.email.value.length; i++) 
	{
		temp = "" + theForm.email.value.substring(i, i+1);
		if (required.indexOf(temp) != "-1") ok = "yes";
	}

	if (ok == "no") 
	{
		alert("E-mail address must contain @ and . to be valid.");
		theForm.email.focus();
		theForm.email.select();
		return (false);
	}

//	for (var i=0; i<theForm.email2.value.length; i++) 
//	{
//		temp = "" + theForm.email2.value.substring(i, i+1);
//		if (required.indexOf(temp) != "-1") ok = "yes";
//	}
//
//	if (ok == "no") 
//	{
//		alert("E-mail address must contain @ and . to be valid.");
//		theForm.email2.focus();
//		theForm.email2.select();
//	    return (false);
//	}

  var chkVal = theForm.email2.value;
  var prsVal = theForm.email.value;
//  var prsVal = chkVal;
  if (chkVal != "" && !(prsVal == chkVal))
  {
    alert("The E-mail addresses you entered do not match.");
    theForm.email2.focus();
    return (false);
  }
  return (true);
}
// ******** END FORM VALIDATION *********

//-->