// JavaScript Document

function validate()
{
	x=document.pricingForm;
	var event_planner_option = -1;
	var food_cater_option = -1;
	var include_estimate_option = -1;
	if (isBlank(x.fname.value))
	{
		alert("Please enter First Name");
		x.fname.focus();
		return false;
	}
	if (isBlank(x.lname.value))
	{
		alert("Please enter Last Name");
		x.lname.focus();
		return false;
	}
	if (isBlank(x.phone.value))
	{
		alert("Please enter Phone Number");
		x.phone.focus();
		return false;
	}
	if (!isValidEmail(x.email.value))
	{
		//alert("Please enter correct email id");
		x.email.focus();
		return false;
	}
	if (isBlank(x.event_date.value))
	{
		alert("Please enter Event Date");
		x.event_date.focus();
		return false;
	}
	if (isBlank(x.no_guest.value))
	{
		alert("Please enter Number of Guests");
		x.no_guest.focus();
		return false;
	}
	if (x.start_time.value == '1')
	{
		alert("Please select Start Time");
		x.start_time.focus();
		return false;
	}
	if (x.end_time.value == '1')
	{
		alert("Please select End Time");
		x.end_time.focus();
		return false;
	}
	if
   ((x.budget_range.value == '1') && (isBlank(x.budgetamt.value)))
   {
	alert("Please choose a budget range or enter your own.");
	x.budgetamt.focus();
	return false;
	}

	if(event_planner_option == -1)
	{
		for (i=x.event_planner.length-1; i > -1; i--) {
		if (x.event_planner[i].checked) {
			event_planner_option = i; i = -1;
			}
		}
		if (event_planner_option == -1) {
		alert("Please select an option for industry type");
		return false;
		}
	}
	if((x.event_planner[event_planner_option].value == 1) && (isBlank(x.event_title.value)))
	{
			alert("Please enter your title");
			x.event_title.focus();
			return false;		
	}
	if(food_cater_option == -1)
	{
		for (i=x.food_cater.length-1; i > -1; i--) {
		if (x.food_cater[i].checked) {
			food_cater_option = i; 
			i = -1;
			}
		}		
	}
	if (food_cater_option == -1) {
		alert("Please select an option for Food Catering");
		return false;
	}
	if (include_estimate_option == -1)
	{
		for (i=x.include_estimate.length-1; i > -1; i--) {
		if (x.include_estimate[i].checked) {
			include_estimate_option = i; i = -1;
			}
		}
	}
	if (include_estimate_option == -1) {
		alert("Please select an option for Catering Estimate");
		return false;
	}
	if((x.include_estimate[include_estimate_option].value == 1) && (isBlank(x.fooddesc.value)))
	{
			alert("Please enter your comments/suggestions");
			x.fooddesc.focus();
			return false;
	}
	else
	{
		document.pricingForm.action="pricingForm_email.php";
		document.pricingForm.submit();
	}
		
}
	
