function check(str){
	validate = new String(str.value);
	re = /\\|\{|\}|\/|\[|\]|<|>|&|:|\;/g;
	if (validate.search(re)>-1){
		alert("Please do not enter special characters.");
		str.value="";
		str.focus();
	}
}


function isEmailAddr(email){
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0) {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}


function valForm(theForm){
	m = 0; //package will NOT be mailed
	p = 1; //person will be called
/*
	if (theForm.service.value=="vasectomyreversal")
	{
		if (theForm.request[0].checked){
			m = 1; //package WILL be mailed
			p = 0; //person will NOT be called
		} 
	}
*/
//alert ("p: "+p);
//alert ("m: "+m);

  if (theForm.name.value == "" )
  {
    alert("Please enter your name.");
    theForm.name.focus();
    return (false);
  }
  
  if (theForm.address.value == "" && m==1)
  {
    alert("Please enter your address so that we may mail you the Vasectomy Reversal Info Package.");
    theForm.address.focus();
    return (false);
  }
  
  if (theForm.city.value == "" && m==1)
  {
    alert("Please enter your city so that we may mail you the Vasectomy Reversal Info Package.");
    theForm.city.focus();
    return (false);
  }
  
  if (theForm.zip.value == "" && m==1)
  {
    alert("Please enter your Zip Code so that we may mail you the Vasectomy Reversal Info Package.");
    theForm.zip.focus();
    return (false);
  }
  
  if (theForm.phone.value == "" && p==1)
  {
    alert("Please enter a phone number.");
    theForm.phone.focus();
    return (false);
  }
  
  if (theForm.email.value == "" || !isEmailAddr(theForm.email.value))
  {
    alert("Please enter a valid Email Address.");
    theForm.email.focus();
    return (false);
  } 
    
  return (true);
//  return (false); //for testing
}
