function removeSpaces(string) {

	// remove all spaces from a string
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];

	return tstring;
}

function Validator() {
//validate mandatory form informaton

	if (removeSpaces(document.contact_form.Name.value) == "")
	{
	alert("The \"Name\" field is mandatory and can not be blank.");
	document.contact_form.Name.focus();
	return (false);
	}

	if (removeSpaces(document.contact_form.Company_Name.value) == "")
	{
	alert("The \"Company Name\" field is mandatory and can not be blank.");
	document.contact_form.Company_Name.focus();
	return (false);
	}

	if (removeSpaces(document.contact_form.Contact.value) == "")
	{
	alert("The \"Email\" field is mandatory and can not be blank.");
	document.contact_form.Contact.focus();
	return (false);
	}

	if (removeSpaces(document.contact_form.Phone.value) == "")
	{
	alert("The \"Phone #\" field is mandatory and can not be blank.");
	document.contact_form.Phone.focus();
	return (false);
	}

	//made it here so the form looks ok for submission
	return (true);

}

function Validator_order() {
//validate mandatory form informaton

	if (removeSpaces(document.order_form.Date.value) == "")
	{
	alert("The \"Date\" field is mandatory and can not be blank.");
	document.order_form.Date.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Function_date_dd.value) == "")
	{
	alert("The \"Function Date\" field is mandatory and can not be blank.");
	document.order_form.Function_date_dd.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Function_date_mm.value) == "")
	{
	alert("The \"Function Month\" field is mandatory and can not be blank.");
	document.order_form.Function_date_mm.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Function_date_yyyy.value) == "")
	{
	alert("The \"Function Year\" field is mandatory and can not be blank.");
	document.order_form.Function_date_yyyy.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Day.value) == "")
	{
	alert("The \"Day\" field is mandatory and can not be blank.");
	document.order_form.Day.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Del_Time.value) == "")
	{
	alert("The \"Delivery Pickup Time\" field is mandatory and can not be blank.");
	document.order_form.Del_Time.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Serving_Time.value) == "")
	{
	alert("The \"Serving Time\" field is mandatory and can not be blank.");
	document.order_form.Serving_Time.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.email.value) == "")
	{
	alert("The \"Email\" field is mandatory and can not be blank.");
	document.order_form.email.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Company_Name.value) == "")
	{
	alert("The \"Company Name\" field is mandatory and can not be blank.");
	document.order_form.Company_Name.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Contact.value) == "")
	{
	alert("The \"Contact\" field is mandatory and can not be blank.");
	document.order_form.Contact.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Phone.value) == "")
	{
	alert("The \"Phone\" field is mandatory and can not be blank.");
	document.order_form.Phone.focus();
	return (false);
	}
	

	if (removeSpaces(document.order_form.Delivery_Address.value) == "")
	{
	alert("The \"Delivery Address\" field is mandatory and can not be blank.");
	document.order_form.Delivery_Address.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Delivery_Contact.value) == "")
	{
	alert("The \"Delivery Contact\" field is mandatory and can not be blank.");
	document.order_form.Delivery_Contact.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Delivery_Phone.value) == "")
	{
	alert("The \"Delivery Phone\" field is mandatory and can not be blank.");
	document.order_form.Delivery_Phone.focus();
	return (false);
	}

	if (removeSpaces(document.order_form.Guests.value) == "")
	{
	alert("The \"Guests\" field is mandatory and can not be blank.");
	document.order_form.Guests.focus();
	return (false);
	}


	//made it here so the form looks ok for submission
	return (true);

}