/* newspublications form validator */

	function Form_Validator(theForm)
	{
	
	  if (theForm.ContactName.value == "")
	  {
	    alert("Please enter a value for the \"Name\" field.");
	    theForm.ContactName.focus();
	    return (false);
	  }

	  if (theForm.ContactName.value.length < 2)
	  {
	    alert("Please enter at least 2 characters in the \"First Name\" field.");
	    theForm.ContactName.focus();
	    return (false);
	  }
	  
	   if (theForm.ContactEmail.value == "")
	  {
	    alert("Please enter a value for the \"Email\" field.");
	    theForm.ContactEmail.focus();
	    return (false);
	  }

	  if (theForm.ContactEmail.value.length < 2)
	  {
	    alert("Please enter at least 2 characters in the \"Email\" field.");
	    theForm.ContactEmail.focus();
	    return (false);
	  }
	  
	  var regex = new RegExp('([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})','gi');
	  if (!regex.test(theForm.ContactEmail.value))
	  {
	    alert("Please enter a valid email address");
	    theForm.ContactEmail.focus();
	    return (false);
	  }
	  /* 
	   if (theForm.Address1.value == "")
	  {
	    alert("Please enter a value for the \"Address1\" field.");
	    theForm.Address1.focus();
	    return (false);
	  }

	  if (theForm.Address1.value.length < 2)
	  {
	    alert("Please enter at least 2 characters in the \"Address1\" field.");
	    theForm.Address1.focus();
	    return (false);
	  }

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

	  if (theForm.City.value.length < 2)
	  {
	    alert("Please enter at least 2 characters in the \"City\" field.");
	    theForm.City.focus();
	    return (false);
	  }
	  
	  if (theForm.State.value == "--")
	  {
	    alert("Please enter a value for the \"State\" field.");
	    theForm.State.focus();
	    return (false);
	  }

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

	  if (theForm.Zip.value.length < 5)
	  {
	    alert("Please enter at least 2 characters in the \"Zip\" field.");
	    theForm.Zip.focus();
	    return (false);
	  } */
	  
	return (true);
	}

	function IsNumeric(sText)
	
		{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		
		
		for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) 
				{
				IsNumber = false;
				}
			}
		return IsNumber;
		}
