function validateGroupDiningForm()
{
	var firstName = document.getElementById("first_name");
	
	if (firstName.value == "")
	{
		return invalidField("First name", firstName);
	}
	
	var lastName = document.getElementById("last_name");
	
	if (lastName.value == "")
	{
		return invalidField("Last name", lastName);
	}
	
	var phone = document.getElementById("phone");
	
	if (phone.value == "")
	{
		return invalidField("Phone", phone);
	}
	
	var email = document.getElementById("email");
	
	if (email.value == "")
	{
		return invalidField("Email", email);
	}
	
	var atPos = email.value.indexOf("@");
	var dotPos = email.value.lastIndexOf(".");
	
	if (atPos < 2 || atPos == email.value.length - 1 || dotPos < 5 || dotPos > email.value.length - 3 || dotPos < atPos || email.value.indexOf("@", atPos + 1) != -1 || dotPos < atPos + 3 || email.value.indexOf(" ") != -1)
	{
		alert("Email address in not in a valid format.");
		
		return invalidField("", email);
	}
	
	var month = document.getElementById("month");
	var day = document.getElementById("day");
	var year = document.getElementById("year");
	
	if (month.value == "" || day.value == "" || year == "")
	{
		return invalidField("Date of Your Event", month);
	}
	
	var start_hour = document.getElementById("start_hour");
	var start_minute = document.getElementById("start_minute");
	var start_timeofday = document.getElementById("start_timeofday");
	
	if (start_hour.value == "" || start_minute.value == "" || start_timeofday == "")
	{
		return invalidField("Start Time", start_hour);
	}
	
	
	
	var people = document.getElementById("people");
	
	if (people.value == "")
	{
		return invalidField("Number of People", people);
	}
	
	var occasion = document.getElementById("occasion");
	
	if (occasion.value == "")
	{
		return invalidField("Occasion", occasion);
	}
	
	var type = document.getElementById("type");
	
	if (type.value == "")
	{
		return invalidField("Type of Dining", type);
	}
	
	var alcohol = document.getElementById("alcohol");
	
	if (alcohol.value == "")
	{
		return invalidField("Alcohol Beverage Interest", alcohol);
	}
}

function validateGiftCardForm()
{
	var sendersName = document.getElementById("senders_name");
	
	if (sendersName.value == "")
	{
		return invalidField("Sender's name", sendersName);
	}
	
	var phone = document.getElementById("phone");
	
	if (phone.value == "")
	{
		return invalidField("Phone", phone);
	}
	
	var email = document.getElementById("email");
	
	if (email.value == "")
	{
		return invalidField("Email", email);
	}
	
	var atPos = email.value.indexOf("@");
	var dotPos = email.value.lastIndexOf(".");
	
	if (atPos < 2 || atPos == email.value.length - 1 || dotPos < 5 || dotPos > email.value.length - 3 || dotPos < atPos || email.value.indexOf("@", atPos + 1) != -1 || dotPos < atPos + 3 || email.value.indexOf(" ") != -1)
	{
		alert("Email address in not in a valid format.");
		
		return invalidField("", email);
	}
	
	var recipientsName = document.getElementById("recipients_name");
	
	if (recipientsName.value == "")
	{
		return invalidField("Recipient's name", recipientsName);
	}
	
	var cardValue = document.getElementById("card_value");
	
	if (cardValue.value == "")
	{
		return invalidField("Card value", cardValue);
	}
	
	/*var occasion = document.getElementById("occasion");
	
	if (occasion.value == "")
	{
		return invalidField("Occasion", occasion);
	}*/
	
	var address = document.getElementById("address");
	
	if (address.value == "")
	{
		return invalidField("Mailing address", address);
	}
	
	var city = document.getElementById("city");
	
	if (city.value == "")
	{
		return invalidField("Mailing city", city);
	}
	
	var state = document.getElementById("state");
	
	if (state.value == "")
	{
		return invalidField("Mailing state", state);
	}
	
	var zip = document.getElementById("zip");
	
	if (zip.value == "")
	{
		return invalidField("Mailing zip", zip);
	}
}

function invalidField(text, field)
{
	if (text != "")
	{
		alert(text + " is a required field.");
	}
	
	field.focus();
	
	return false;
}
