function validate(frm)
{
        theform = frm;

	if(theform.fname.value.length ==0)
	{
		alert('Please enter a valid First Name');
		theform.fname.focus();
		return false;
	}
	if(theform.lname.value.length ==0)
	{
		alert('Please enter a valid Last Name');
		theform.lname.focus();
		return false;
	}
	if(theform.address.value.length ==0)
	{
		alert('Please enter a valid address');
		theform.address.focus();
		return false;
	}
	if(theform.city.value.length ==0)
	{
		alert('Please enter a valid city');
		theform.city.focus();
		return false;
	}
	if(theform.state.value.length ==0)
	{
		alert('Please enter a valid state');
		theform.state.focus();
		return false;
	}
	if(theform.zip.value.length ==0)
	{
		alert('Please enter a valid zip code');
		theform.zip.focus();
		return false;
	}
	if(theform.phone.value.length ==0)
	{
		alert('Please enter a valid phone number');
		theform.phone.focus();
		return false;
	}
	if(theform.email.value.length ==0)
	{
		alert('Please enter a valid e-mail address');
		theform.email.focus();
		return false;
	}

	if ( ( theform.field1[0].checked == false )
	&& (theform.field1[1].checked == false ) )
	{
		alert ( "Please answer: Has a loved one been diagnosed with Persistent Pulmonary Hypertension Newborn?" );
		theform.field1[0].focus();
		return false;
	}

	if ( ( theform.field2[0].checked == false )
	&& (theform.field2[1].checked == false ) )
	{
		alert ( "Please answer: Did Mom take any antidepressant while pregnant?" );
		theform.field2[0].focus();
		return false;
	}
	if ( ( theform.field3[0].checked == false )
	&& (theform.field3[1].checked == false ) )
	{
		alert ( "Please answer: Did Mom use Celexa while pregnant?" );
		theform.field3[0].focus();
		return false;
	}

	if ( ( theform.field4[0].checked == false )
	&& (theform.field4[1].checked == false ) )
	{
		alert ( "Please answer: Did Mom use Paxil while pregnant?" );
		theform.field4[0].focus();
		return false;
	}	
	
	if ( ( theform.field5[0].checked == false )
	&& (theform.field5[1].checked == false ) )
	{
		alert ( "Please answer: Did Mom use Prozac while pregnant?" );
		theform.field5[0].focus();
		return false;
	}

	if ( ( theform.field6[0].checked == false )
	&& (theform.field6[1].checked == false ) )
	{
		alert ( "Please answer: Did Mom use Zoloft while pregnant?" );
		theform.field6[0].focus();
		return false;
	}	


	if(!checkEmail(theform.email) )
		return false;
	return true;
}


function checkEmail(field)
{
	// Advanced Email Check -- JavaScript Kit (http://www.javascriptkit.com)
	var str = field.value;
	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str))
		return true;
	
	alert("Please enter a valid email address.");
	field.focus();
	return false;
}
