



function isNum(passedVal) {					// Is this a number?
	if (passedVal == "") {
		return false
	}
	for (i=0; i<passedVal.length; i++) {
		if (passedVal.charAt(i) < "0") {
			return false
		}
		if (passedVal.charAt(i) > "9") {
			return false
		}
	}
	return true
}

function validZip(inZip) {					// Is this a valid Zip code?
//	if (inZip == "") {
	//	return true
//	}
	if (isNum(inZip)) {						// Check if Zip is numeric
		return true
	}
	return false
 //   return true
}


function Form1_Validator(theForm)
{
		// remove the next var lines for direct mail
		//var codestr = location.search.substring(1, location.search.length);
		//alert("The content of code is " + codestr)
		
		//alert(codestr.indexOf('='));
		//alert(codestr.length);
		//var code = codestr.substring(codestr.indexOf('=')+1, codestr.length);
		//alert(code);
	
  		if (theForm.First_name.value == "")
  		{
    		alert("Please enter a value for the \"First Name\" field.");
    		theForm.First_name.focus();
    		return (false);
  		}
  	
	


	
		
		
  		
if (theForm.Emailid.value == "")
  		{
    		alert("Please enter a valid email for the \"Email\" field.");
    		theForm.Emailid.focus();
    		return (false);
  		}

		var checkEmail = "@.";
		var checkStr = theForm.Emailid.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 is invalid, please try again. It must contain an \"@\" and a \".\".");
		  theForm.Emailid.focus();
		  return (false);
		}
		

 

		
		



 
 
	return (true);
	
}




	

