function trim(str) {
	str=str.replace(/(^\s*)/, "");
	str=str.replace(/(\s*$)/, "");
	return (str);
}
function isEmail(str) {
  return ((str.indexOf("@") != -1) && (str.indexOf(".") != -1));
}
function validate(theField)
{
	var msg = "Sorry, you are not eligible for the WISER study.";
	if (trim(theField.hormon.value) == "Yes")
	{ 
		alert(msg);
		return (false);
	}
	if (trim(theField.exercise.value) == "Yes")
	{ 
		alert("msg");
		return (false);
	}
	if (trim(theField.smoke.value) == "Yes")
	{ 
		alert(msg);
		return (false);
	}
	if (trim(theField.pregnant.value) == "Yes")
	{ 
		alert(msg);
		return (false);
	}
	if (trim(theField.alcohol.value) == "Yes" && trim(theField.alcoholAmount.value) == "more")
	{ 
		alert(msg);
		return (false);
	}
	if (trim(theField.msg.value) == "No")
	{ 
		alert(msg);
		return (false);
	}
	return (true)
}