var submitcount=0;

  function emailtest(src,srcValue) 
	     {
	     var sEmail = "" + srcValue;
		 if (srcValue != "")
				{ 	     
				if ((sEmail.indexOf('@') == "-1") || 
				    (sEmail.indexOf('.') == "-1"))
					 {
					 alert("You must enter a valid E-mail address");
					 src.focus();
					 //return false;
					 }
				}
	     }

/*&& (document.RSVPForm.txtBirthday1.value.length >0)*/

     function validate()
     { //Begin Function
		if
		    (	(document.RSVPForm.txtFName1.value.length >0)
		         && (document.RSVPForm.txtLName1.value.length >0)
		         && (document.RSVPForm.txtAddr1.value.length >0)
		         && (document.RSVPForm.txtCity.value.length >0)
		         && (document.RSVPForm.txtState.value.length >0)
		         && (document.RSVPForm.txtZip.value.length >0)
		         && (document.RSVPForm.txtEmail.value.length >0)
		         && (document.RSVPForm.txtPhone.value.length >0)
		         && (document.RSVPForm.txtNumGuest.value.length >0)
				 && ((document.RSVPForm.chkRSVPYes.checked) 
					|| (document.RSVPForm.chkRSVPNo.checked))
		        )
		//begin "if true"
		{ 
		if
		    (	(document.RSVPForm.chkRSVPYes.checked) 
				&& (document.RSVPForm.chkRSVPNo.checked) 
				)
					{
					alert("I'm sorry.  You have to decide whether or not you are coming.  You can't pick both.")
					submitcount=0
					}
				else
					//begin "if still OKAY"
					{
					if (confirm("Your sign up form is about to be submitted. Click Ok to Proceed.")) 
					   {document.RSVPForm.submit(); return true;
					   }
					else
					   {submitcount=0
					   return false;
					   } 
														
					}
		}
		//begin "if false"
		else
		{
			alert("I'm sorry.  You have not completely filled in this form. \nPlease make sure that you have filled in the correct information \nincluding your name, address, city, state, zip, e-mail & phone \nand that you have selected YES or NO at the top of this invitation.");
			submitcount=0
		}

     }
 
 function TestandSubmit(formbtn)
			{
			if (submitcount == 0)
			   {
			   submitcount++;
			   formbtn.value = "  Validating & Sending...  ";
			   validate();
			   //document.RSVPForm.submit();
			   //return true;
			   }
			else 
			   {
			   alert("You\'ve already clicked the submit button. \nPlease be patient while I process your request.");
			   return false;
			   }
			}
