function Form_Validator(theForm)
{
  if (theForm.Company.value == "")
  {
    alert("Please enter a \"Company Name\".");
    theForm.Company.focus();
    return (false);
  }
  
  if (theForm.Name.value == "")
  {
    alert("Please enter a \"Contact Name\".");
    theForm.Name.focus();
    return (false);
  }
  
  if (theForm.Email.value == "")
  {
    alert("Please enter an \"Email Address\".");
    theForm.Email.focus();
    return (false);
  }

  var checkStr    = theForm.Email.value;
  var atFound     = false;
  var periodFound = false;

  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);

    if (ch == '@')
       atFound = true;
    else
    if (ch == '.' && atFound)
      periodFound = true;

  }
  if (!atFound || !periodFound)
  {
    alert("Please enter a valid \"Email Address\". Example: yourname@yourdomain.com.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Phone.value == "")
  {
    alert("Please enter a \"Phone Number\".");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length < 8)
  {
    alert("Please complete the \"Phone Number\".");
    theForm.Phone.focus();
    return (false);
  }

  if (!theForm.Fax.value == "")
  {
    if (theForm.Fax.value.length < 8)
    {
      alert("Please complete the \"Fax Number\".");
      theForm.Fax.focus();
      return (false);
	 }
  }

  if (theForm.fromCity.value == "")
  {
    alert("Please enter a \"Origin City\".");
    theForm.fromCity.focus();
    return (false);
  }
  
  if (theForm.fromProvince.value == "")
  {
    alert("Please select a \"Origin Province/State\".");
    theForm.fromProvince.focus();
    return (false);
  }
  
  if (theForm.fromPostalCode.value == "")
  {
    alert("Please enter a \"Origin Postal/Zip Code\".");
    theForm.fromPostalCode.focus();
    return (false);
  }
  
    if (theForm.toCity.value == "")
  {
    alert("Please enter a \"Destination City\".");
    theForm.toCity.focus();
    return (false);
  }
  
  if (theForm.toProvince.value == "")
  {
    alert("Please select a \"Destination Province/State\".");
    theForm.toProvince.focus();
    return (false);
  }
  
  if (theForm.toPostalCode.value == "")
  {
    alert("Please enter a \"Destination Postal/Zip Code\".");
    theForm.toPostalCode.focus();
    return (false);
  }
  
  if (theForm.Commodity.value == "")
  {
    alert("Please enter a \"Commodity Description\".");
    theForm.Commodity.focus();
    return (false);
  }

  if (theForm.Quantity.value == "")
  {
    alert("Please enter a \"Quantity\".");
    theForm.Quantity.focus();
    return (false);
  }
  
  if (isNaN(theForm.Quantity.value))
  {
  	alert("Please use numbers only for the \"Quantity\".");
	theForm.Quantity.focus();
	return (false);
  }
  
  var qty = -1;
  for (i=theForm.QuantityType.length-1; i > -1; i--) 
  {
  	if (theForm.QuantityType[i].checked) 
	{
      qty = i; i = -1;
    }
  }
  if (qty == -1) 
  {
    alert("You must select a \"Quantity Type\"; pallets or other.");
	theForm.Quantity.focus();
    return (false);
  }
   
  if (theForm.QuantityType[1].checked)
  {
    if (theForm.QuantityOtherType.value == "")
    {
      alert("Please enter a \"Quantity Type Other\".");
      theForm.QuantityOtherType.focus();
      return (false);
    }
  }
  
  if (theForm.TotalWeight.value == "")
  {
    alert("Please enter a \"Total Weight\".");
    theForm.TotalWeight.focus();
    return (false);
  }
   
  var tw = -1;
  for (i=theForm.TotalWeightUnit.length-1; i > -1; i--) 
  {
  	if (theForm.TotalWeightUnit[i].checked) 
	{
      tw = i; i = -1;
    }
  }
  if (tw == -1) 
  {
    alert("You must select a \"Total Weight Unit\"; lbs or kg.");
	theForm.TotalWeight.focus();
    return (false);
  }
  
  if (theForm.Length.value == "" && theForm.Diameter.value == "" && theForm.MultipleDimensions.value == "")
  {
    alert("Please enter a \"Dimension\" or \"Diameter\" or \"Multiple Dimension\".");
    theForm.Length.focus();
    return (false);
  }
  
  if (!theForm.Length.value == "")
  {
    if (theForm.Width.value == "")
    {
  	  alert("Please enter a \"Dimension Width\".");
	  theForm.Width.focus();
	  return (false);
    }
  }
  
  if (!theForm.Width.value == "")
  {
    if (theForm.Height.value == "")
    {
  	  alert("Please enter a \"Dimension Height\".");
	  theForm.Height.focus();
	  return (false);
    }
  }
    
  if (theForm.DryVan.checked == false && theForm.Flatbed.checked  == false && theForm.LiftGate.checked == false && theForm.LiveLoad.checked == false && theForm.BlanketWrapped.checked == false && theForm.Heated.checked == false && theForm.Refrigerated.checked == false&& theForm.LiveUnload.checked == false)
  {
    alert("Please select \"Equipment Requirement\"; Dry Van, Flatbed, Lift Gate, Live Load, Blanket Wrapped, Heated, Refrigerated or Live Unload.");
    return (false);
  }
  
  var sr = -1;
  for (i=theForm.ServiceRequirement.length-1; i > -1; i--) 
  {
  	if (theForm.ServiceRequirement[i].checked) 
	{
      sr = i; i = -1;
    }
  }
  if (sr == -1) 
  {
    alert("You must select a \"Service Requirement\"; LTL, Full Load, Expedite or Other.");
    return (false);
  }
   
  if (theForm.ServiceRequirement[3].checked)
  {
    if (theForm.ServiceOther.value == "")
    {
      alert("Please enter a \"Required Service Other\".");
      theForm.ServiceOther.focus();
      return (false);
    }
  }
  
  return (true);
}



function setChecked(radioObj, z) 
{
	radioObj[z].checked = true;
}
function clearField(Obj) 
{
	Obj.value ="";
}
function setToFocus(Obj)
{
	Obj.focus();
}