function Form1_Validator(theForm)
{
//   ------ Name Validations ------ 

	if (document.f.name.value == "")
	{
		alert("You must enter your Name")
		document.f.name.focus();
		return (false);
	}

	if (document.f.name.value.length < 3)
	{
		alert("Please enter at least 3 characters in the \"Name\" field.")
		document.f.name.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr =  document.f.name.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 Alphabetic characters in the \" Name\" field.");
		document.f.name.focus();
		return (false);
	}
	





// ----------------- Email  Validation ---------------------

if (document.f.email.value == "")
{
alert("Please enter a value for the \"Email\" field.");
document.f.email.focus();
return (false);
}
if (document.f.email.value.charAt(0)=="@")
{
alert("Invalid \"Email\" Address");
document.f.email.focus();
return (false);
}

if (document.f.email.value.charAt(0)=="\.")
{
alert("Invalid \"Email\" Address");
document.f.email.focus();
return (false);
}



// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = document.f.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\" field must contain an \"@\" and a \".\".");
document.f.email.focus();
return (false);
}

var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890@._-& ";
	var checkStr =  document.f.email.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 a Valid \"Email Address\".");
		document.f.email.focus();
		return (false);
	}

// ------- Phone validation1 --------

var checkOK = "0123456789";
var checkStr = document.f.tel.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;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Country Code\" field.");
document.f.tel.focus();
return (false);
}

// ------- Fax validation1 --------


var checkOK = "0123456789";
var checkStr = document.f.fax.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;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Fax\" field.");
document.f.fax.focus();
return (false);
}


//   ------ Comments Validations ------ 

	if (document.f.name.value == "")
	{
		alert("You must enter your Name")
		document.f.name.focus();
		return (false);
	}

	if (document.f.name.value.length < 3)
	{
		alert("Please enter at least 3 characters in the \"Name\" field.")
		document.f.name.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr =  document.f.name.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 Alphabetic characters in the \" Name\" field.");
		document.f.name.focus();
		return (false);
	}




}