/*
	Validates user input to ensure no information is missing from the form
*/
function validateInput(theForm)
{
	if (theForm.required_GroupType.selectedIndex == 0)
	{
		alert('Please choose a group type');
		theForm.required_GroupType.focus();
		return (false);
	}
	else if (
			(
			theForm.required_GroupType.selectedIndex == 1 ||
			theForm.required_GroupType.selectedIndex == 2 ||
			theForm.required_GroupType.selectedIndex == 4
			)
				&&
			theForm.required_StaffCount.value == ''
		)
	{
			alert('Please specify the number of staff rooms you require, or enter \'0\'.');
			theForm.required_StaffCount.focus();
			return (false);
	}
	else if (theForm.required_GroupType.selectedIndex == 11 && theForm.required_GroupSpecify.value == '')
	{
		alert('Please specify the group type.');
		theForm.required_GroupSpecify.focus();
		return (false);
	}
	else if (theForm.required_NoOfTravelers.value == '')
	{
		alert('Please specify the approximate number of travelers in your group.');
		theForm.required_NoOfTravelers.focus();
		return (false);
	}
	else if (theForm.required_GuestsUnder18.selectedIndex == 0 && theForm.required_GuestsUnder18AgeInformation.value == '')
	{
		alert('Please tell us the ages or age ranges of the guests under the age of 18.');
		theForm.required_GuestsUnder18AgeInformation.focus();
		return (false);
	}

	if (!theForm.notrequired_DestinationUncertain.checked)
	{
		if (theForm.required_Destination.selectedIndex == 0)
		{
			alert('Please choose a travel destination.');
			theForm.required_Destination.focus();
			return (false);
		}
		else if (theForm.required_Destination.selectedIndex != 0 && !theForm.notrequired_ResortUncertain.checked)
		{
			if (theForm.required_Resort.selectedIndex == 0)
			{
				alert('Please choose a resort.');
				theForm.required_Resort.focus();
				return (false);
			}
		}
	}

	if ((theForm.notrequired_DestinationUncertain.checked || theForm.notrequired_ResortUncertain.checked) && (theForm.required_WhatLookingFor.value == ''))
	{
		alert('Please tell us what you\'re looking for so that we can help you make the best selection.');
		theForm.required_WhatLookingFor.focus();
		return (false);
	}
	else if (theForm.required_ConsideringOthers.selectedIndex == 1 && theForm.required_OtherDestinations.value == '')
	{
		alert('Please tell us what other destinations you are considering.');
		theForm.required_OtherDestinations.focus();
		return (false);
	}
	else if (theForm.required_NoOfRooms.value == '')
	{
		alert('Please tell us approximately how many rooms your group will require.');
		theForm.required_NoOfRooms.focus();
		return (false);
	}
	else if (
			theForm.required_SingleCount.value == '' || theForm.required_DoubleCount.value == '' ||
			theForm.required_TripleCount.value == '' || theForm.required_QuadCount.value == '' ||
			 theForm.required_SuiteCount.value == ''
		)
	{
		alert('Please tell us how many single rooms, double rooms, triple rooms, quad rooms, and suites you will require.  If you do not require any, please enter \'0\'.');
		theForm.required_SingleCount.focus();
		return (false);
	}
	else if (theForm.required_TravelDate.value == '' && !theForm.notrequired_DatesUncertain.checked)
	{
		alert('Please choose a travel date.');
		return (false);
	}
	else if (theForm.required_ReturnDate.value == '' && !theForm.notrequired_DatesUncertain.checked)
	{
		alert('Please choose a return date.');
		return (false);
	}
	else if (
			theForm.required_TravelDate.value != '' && theForm.required_ReturnDate.value != '' &&
			(
				(theForm.travel_year.value + theForm.travel_month.value + theForm.travel_day.value) >
				(theForm.return_year.value + theForm.return_month.value + theForm.return_day.value)
			)
		)
	{
		alert('Please choose a return date that occurs after the travel date.');
		return (false);
	}
	else if (theForm.notrequired_DatesUncertain.checked && (theForm.required_ProjectedMonth.selectedIndex == 0 || theForm.required_ProjectedYear.selectedIndex == 0))
	{
		alert('Please choose a projected month and year for your group program.');
		theForm.required_ProjectedMonth.focus();
		return (false);
	}
	else if (theForm.required_HandleAirTransportation.selectedIndex == 1 && theForm.required_AirTransportationInformation.value == '')
	{
		alert('Please provide us with details on your air transportation requirements.');
		theForm.required_AirTransportationInformation.focus();
		return (false);
	}
	else if (theForm.required_Name.value == '')
	{
		alert('Please enter your name.');
		theForm.required_Name.focus();
		return (false);
	}
	else if (theForm.required_ContactNum1.value == '')
	{
		alert('Please provide us with a contact number.');
		theForm.required_ContactNum1.focus();
		return (false);
	}
	else if (theForm.required_ContactNum1.value != '' && theForm.required_BestTime1.value == '')
	{
		alert('Please tell us the best time(s) to reach you at your first contact number.');
		theForm.required_BestTime1.focus();
		return (false);
	}
	else if (theForm.notrequired_ContactNum2.value != '' && theForm.required_BestTime2.value == '')
	{
		alert('Please tell us the best time(s) to reach you at your second contact number.');
		theForm.required_BestTime2.focus();
		return (false);
	}
	else if (theForm.required_EmailAddress.value == '')
	{
		alert('Please provide us with a valid e-mail address so that we may send you any additional information or questions.');
		theForm.required_EmailAddress.focus();
		return (false);
	}
    else if ( document.getElementById('recaptcha_response_field').value == '' )
    {
        alert('Please answer the CAPTCHA.');
        document.getElementById('recaptcha_response_field').focus();
        return false;
    }
	else
	{
		return(true);
	}
}