
function isNum(value)
{ 
	for (i = 0; i < value.length; i++) 
	{
		c = value.charAt(i);
		if ( c < "0"  ||  c > "9" )
			return false;
	}
	return true;
}

function validator(theForm)
{
  if (theForm.Name.value == "")

  {

    alert("Please enter your name.");

    theForm.Name.focus();

    return (false);

  }

  if (theForm.Organization.value == "")
  {

    alert("Please enter your the name of your organization.");

    theForm.Organization.focus();

    return (false);

  }

 
	if ((theForm.email.value.indexOf ('@',0) == -1) || (theForm.email.value == ""))
  {
    alert("Please verify your email address.");
   
    theForm.email.focus();
 
    return (false);
  } 
		
		if (theForm.areaCode.value=="" || !isNum(theForm.areaCode.value)) 
	{
		alert("Please only enter numeric values into this field.");
		theForm.areaCode.focus();
		return false;
	}
	 
		if (theForm.areaCode.value.length < 3)
  {
    alert("Please enter your 3 digit area code.");
    theForm.areaCode.focus();
    return (false);
  }
						
				 
		if (theForm.phone.value.length < 3)
  {
    alert("Please enter the first 3 digits of your phone number.");
    theForm.phone.focus();
    return (false);
  }
				
				if (theForm.phone.value=="" || !isNum(theForm.phone.value)) 
	{
		alert("Please only enter numeric values into this field.");
		theForm.phone.focus();
		return false;
	}
				
				 
		if (theForm.phone2.value.length < 4)
  {
    alert("Please enter the last 4 digits of your phone number.");
    theForm.phone2.focus();
    return (false);
  }
		if (theForm.phone2.value=="" || !isNum(theForm.phone2.value)) 
	{
		alert("Please only enter numeric values into this field.");
		theForm.phone2.focus();
		return false;
	}		
	
	return true; 
}

