function frm_validator(theForm)
{
// check to see if the last name field is blank
if (theForm.security_code.value == "")
{
alert("Please enter the Security Code.");
theForm.security_code.focus();
return (false);
}


// check to see if the last name field is blank
if (theForm.lastname.value == "")
{
alert("Please enter your last name.");
theForm.lastname.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
var checkStr = theForm.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 letters in the \"Last Name\" field.");
theForm.lastname.focus();
return (false);
}


// check to see if the first name field is blank
if (theForm.firstname.value == "")
{
alert("Please enter your first name.");
theForm.firstname.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
var checkStr = theForm.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 letters in the \"First Name\" field.");
theForm.firstname.focus();
return (false);
}

// check if email field is blank
if (theForm.email.value == "")
{
alert("Please enter an email address.");
theForm.email.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("The \"Email\" provided is invalid!");
theForm.email.focus();
return (false);
}

// check to see if the first name field is blank
if (theForm.message.value == "")
{
alert("Please enter a message.");
theForm.message.focus();
return (false);
}



return true;
}



