{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fnil\fcharset77 Geneva;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww13100\viewh14780\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\fs24 \cf0 //(c) SJ JS Field Validations Nov 2001, Revised for AHA 2007 KP\
\
function checkForm()\{\
	if (checkPara() && checkPnumber() && (checkEmail())\
	\{\
		document.
\fs22 AhAJoinForm
\fs24 .submit()		\
	\}\
\}\
\
\
\
\
\
\
function checkParea()\{\
	x=document.
\fs22 AhAJoinForm
\fs24 .parea.value.length\
	if (x != 3)\{\
		alert("Please enter a 3 digit area code")\
		document.
\fs22 AhAJoinForm
\fs24 .parea.value=""\
		document.
\fs22 AhAJoinForm
\fs24 .parea.focus()\
	\}else \{\
		xv=document.
\fs22 AhAJoinForm
\fs24 .parea.value\
		if (isNaN(xv))\{\
			alert('Please enter a numeric area code only')\
			document.AhAJoinForm.parea.value=""\
			document.AhAJoinForm.parea.focus()\
		\}else \{\
			return true\
		\}\
	\}\
return false\
\}\
\
function checkPnumber()\{\
	y=document.AhAJoinForm.pnumber.value.length\
	if (y != 7)\{\
		alert("Please enter a 7 digit telephone number")\
		document.AhAJoinForm.pnumber.value=""\
		document.AhAJoinForm.pnumber.focus()\
	\}else \{\
		yv=document.AhAJoinForm.pnumber.value\
		if (isNaN(yv))\{\
			alert('Please enter a numeric telephone number only')\
			document.AhAJoinForm.pnumber.value=""\
			document.AhAJoinForm.pnumber.focus()\
		\}else \{\
			return true\
		\}\
	\}\
return false\
\}\
\
\
function isEmail(string) \{\
    if (string.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/) != -1)\
        return true;\
    else\
        return false;\
\}\
\
\
\
function checkEmail()\{\
	if (isEmail(document.AhAJoinForm.email.value))\{\
		//alert("Voila "+document.AhAJoinForm.email.value)\
		return true\
	\} else \{\
		alert("Email you entered is invalid")\
		document.AhAJoinForm.email.value=""\
		document.AhAJoinForm.email.focus()\
		return false\
	\} \
\}}