function validate_email(field,alerttxt)
{
  with (field)
  {
    apos=value.indexOf("@")
    dotpos=value.lastIndexOf(".")
    if (apos<1||dotpos-apos<2) 
     {
	    //alert(alerttxt);
		return false
	  }
     else {return true}
   }
 }

 
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
   
          function valid()
			{
			
			if(document.frm.fname.value=='')
					{
						alert("Please Enter fname.");
						document.frm.fname.focus();
						return false;
					}

			if(document.frm.email.value=='')
				   {
				   alert("please enter the Email")
				   document.frm.email.focus();
				   return false;
				   }
		   if (validate_email(window.document.frm.email,"Not a valid e-mail address!")==false)
                   {
	                  alert("please Valid Email Address")
				   document.frm.email.focus();
				   return false;
                   }
if(document.frm.contact.value=='')
				   {
				   alert("please enter the Phone")
				   document.frm.contact.focus();
				   return false;
				   }
				   if (IsNumeric(window.document.frm.contact.value) == false) 
                   {
                      alert("Please check phone - non numeric value!");
	                  return false;
                   }

			
if(document.frm.mf.value=='')
					{
						alert("Please Enter mf.");
						document.frm.mf.focus();
						return false;
					}

if(document.frm.birth.value=='')
					{
						alert("Please Enter birth.");
						document.frm.birth.focus();
						return false;
					}
if(document.frm.townbirth.value=='')
					{
						alert("Please Enter townbirth.");
						document.frm.townbirth.focus();
						return false;
					}
			if(document.frm.dob.value=='')
			       {
				   alert("please enter the Date  of Birth");
				   document.frm.dob.focus();
				   return false;
				   }
//if(document.frm.tob.value=='')
//			       {
//				   alert("please enter the Time  of Birth if Known:");
//				   document.frm.tob.focus();
//				   return false;
//				   }





		       

else
			  {
			    return true;
			  }

			}
			

