
function frm_Validator(theForm)
{

var alertsay = "";

if (theForm.xname.value.length < 1)
{
alert("Please enter your first name in the \"Name\" field.");
theForm.xname.focus();
return (false);
}


var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- '";
var checkStr = theForm.xname.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 \"Name\" field.");
theForm.xname.focus();
return (false);
}

if (theForm.xemail.value == "")
{
alert("Please enter a value for the \"Email\" field.");
theForm.xemail.focus();
return (false);
}



var checkEmail = "@.";
var checkStr = theForm.xemail.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 (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("Please enter a valid email address");
theForm.xemail.focus();
return (false);
}



}


