<!--

function isNum(value)
{ 
	for (i = 0; i < value.length; i++) 
	{
		c = value.charAt(i);
		if ( c < "0"  ||  c > "9" )
			return false;
	}
	return true;
}

function isEmail(string) 
{
   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      
function isProper(string) 
{
   if (!string) return false;
   var iChars = "*|\\:<>[]{}`/;()@&$#%+~^=";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}    


function validator(contact)
{
var empnum = false;


  
		if (document.contact.Name.value=="" ||  (isProper(document.contact.Name.value) == false))
  {
    alert("Please enter your name.  Characters only.");
    document.contact.Name.focus();
    return (false);
  }
				if (document.contact.Title.value=="" ||  (isProper(document.contact.Title.value) == false))
  {
    alert("Please enter your Title.  Characters only.");
    document.contact.Title.focus();
    return (false);
  }
		
	 if (document.contact.Organization.value == "" || (isProper(document.contact.Organization.value) == false))

  {

    alert("Please enter the name of your Organization.  Alphanumeric only.");

    document.contact.Organization.focus();

    return (false);

  }
		
  if (contact.State.selectedIndex == 0) 
   {
    alert('Please select your state.');
	contact.State.focus();
    return false;
	}

	
   if ((contact.Email.value.indexOf ('@',0) == -1) || (contact.Email.value == ""))
  {
    alert("Please verify your email address.");
   
    contact.Email.focus();
 
    return (false);
  } 
	 
	if (document.contact.Phonearea.value=="" || !isNum(document.contact.Phonearea.value)) 
	{
		alert("Please enter your area code.");
		document.contact.Phonearea.focus();
		return false;
	}
	
		if (document.contact.Phonearea.value.length < 3)
  {
    alert("Please enter your 3 digit area code.");
    document.contact.Phonearea.focus();
    return (false);
  }
 
	if (document.contact.phone.value=="" || !isNum(document.contact.phone.value)) 
	{
		alert("Please enter your phone number.");
		document.contact.phone.focus();
		return false;
	}
	
		if (document.contact.phone.value.length < 3)
  {
    alert("Please enter the first 3 digits of your phone number.");
    document.contact.phone.focus();
    return (false);
  }
				
				 if (document.contact.phone2.value=="" || !isNum(document.contact.phone2.value)) 
	{
		alert("Please enter your phone number.");
		document.contact.phone2.focus();
		return false;
	}	
	
		if (document.contact.phone2.value.length < 4)
  {
    alert("Please enter the last 4 digits of your phone number.");
    document.contact.phone2.focus();
    return (false);
  }

for(var i=0; i<contact.Employees.length; i++)
    {
    if(contact.Employees[i].checked)
	{
     empnum = true;
     }
   }

if (empnum == "")

{

 alert("Please choose the number of employees in your organization.");

return false;

} 

if (contact.Interest.selectedIndex == 0) 
   {
    alert('Please select your area of interest.');
	contact.Interest.focus();
    return false;
  }
 
 
 if (contact.Comments.value == "")

  {

    alert("Please enter your comment or question.");

    contact.Comments.focus();

    return false;

  }

 if  (isProper(contact.Comments.value) == false)

  {

    alert("Please delete special characters from your comments or question.");

    contact.Comments.focus();

    return false;

  }
 
 
 var maxChar = 500
    if (contact.Comments.value.length > maxChar) {
        diff=contact.Comments.value.length - maxChar;
        if (diff>1)
            diff = diff + " characters";
        else
            diff = diff + " character";
            
        alert("This field is limited to " + maxChar + " characters\n" + "Please reduce the text by " + diff);
        contact.Comments.focus();
        return false;
    }


}

//-->

