
/**********************************************
This function validates components of the form
**********************************************/
function validate()

{

						/************************************************
						validate contact name field
						*************************************************/

						if(document.inquiry.Contact.value == "")
						{
						//place cursor back in that field
						alert("Contact name is required");
						document.inquiry.Contact.focus();
						return false;
						}

						/*****************************************************
						validate telephone number field
						*****************************************************/
	
						if(document.inquiry.AreaCode1.value == "")
						{
						// place cursor back in that field
						alert("Area code is required");
								document.inquiry.AreaCode1.focus();
						return false;
						}
						
						if(document.inquiry.PhoneNNN1.value == "")
						{
						// place cursor back in that field
						alert("Valid telephone number is required");
								document.inquiry.PhoneNNN1.focus();
						return false;
						}
						
						if(document.inquiry.PhoneNNNN1.value == "")
						{
						// place cursor back in that field
						alert("Valid telephone number is required");
								document.inquiry.PhoneNNNN1.focus();
						return false;
						}
						

						/**********************************************************************
						check that the email
						if the "@" and "." character is not found in the string, will return -1
						**********************************************************************/
	
						if(document.inquiry.Email.value.indexOf("@")== -1)
						{
						//place cursor back in that field
						alert("A valid email is required");
						document.inquiry.Email.focus();
						document.inquiry.Email.select();
						return false;
						}
						if(document.inquiry.Email.value.indexOf(".")== -1)
						{
						//place cursor back in that field
						alert("A valid email is required");
						document.inquiry.Email.focus();
						document.inquiry.Email.select();
						return false;
						}
					
						/*****************************************************
						validate event date field
						*****************************************************/
	
						if(document.inquiry.EventDateMonth.value == "")
						{
						// place cursor back in that field
						alert("Event date required");
								document.inquiry.EventDateMonth.focus();
						return false;
						}
						
						if(document.inquiry.EventDateDay.value == "")
						{
						// place cursor back in that field
						alert("Event date required");
								document.inquiry.EventDateDay.focus();
						return false;
						}
						
						if(document.inquiry.EventDateYear.value == "")
						{
						// place cursor back in that field
						alert("Event date required");
								document.inquiry.EventDateYear.focus();
						return false;
						}
						
						/*****************************************************
						validate number of guests field
						*****************************************************/
	
						if(document.inquiry.GuestNumber.value == "")
						{
						// place cursor back in that field
						alert("Number of guests required");
								document.inquiry.GuestNumber.focus();
						return false;
						}
						
						/*****************************************************
						validate event type field
						*****************************************************/
	
						if(document.inquiry.EventType.value == "")
						{
						// place cursor back in that field
						alert("Event type required");
								document.inquiry.EventType.focus();
						return false;
						}
}



/*********************************************************
this is the function to confirm the submission of the form
*********************************************************/
function confirm_me()

{
// this line returns true or false
return confirm("Are you sure you would like to send this form?");
}