function validate_ship(theForm) {

  var serv = theForm.Service[theForm.Service.selectedIndex].value;
  var puCity = theForm.PUCity.value;
  var delCity = theForm.DelCity.value;

  if (theForm.Reference.value == "") {
    alert("There is no Trip Number present for this trip, please refresh the page.\n" +
          "If no Trip Number appears please send an email to bugs@urbandispatch stating your\n" +
          "user id and the time of the incident. Thankyou.");
    return false;
  }

  else if (theForm.BillComp.value == "") {
    alert("Please enter a value for the 'Billing Company Name' field.");
    theForm.BillComp.focus();
    return (false);
  }
  
  else if (theForm.ClientReference.value == "") {
      alert("Please enter a value for the 'Reference' field.");
      theForm.ClientReference.focus();
      return (false);
  }
  
  else if(theForm.BillComp.value.length > 30) {
    alert("Billing Up Company name must be limited to 30 characters.");
    theForm.BillComp.focus();
    return (false);
  }

  else if(theForm.PUComp.value == "") {
    alert("Please enter a value for the 'Pick Up Company Name' field.");
    theForm.PUComp.focus();
    return (false);
  }

  else if(theForm.PUComp.value.length > 30) {
    alert("Pick Up Company name must be limited to 30 characters.");
    theForm.PUComp.focus();
    return (false);
  }

  else if(theForm.DelComp.value == "") {
    alert("Please enter a value for the 'Destination Company Name' field.");
    theForm.DelComp.focus();
    return (false);
  }

  else if(theForm.DelComp.value.length > 30) {
    alert("Destination Company name must be limited to 30 characters.");
    theForm.DelComp.focus();
    return (false);
  }

  else if(theForm.BillStreet.value == "") {
    alert("Please enter a value for the 'Billing Street Address' field.");
    theForm.BillStreet.focus();
    return (false);
  }

  else if(theForm.PUStreet.value == "") {
    alert("Please enter a value for the 'Pick Street Address' field.");
    theForm.PUStreet.focus();
    return (false);
  }

  else if(theForm.PUStreet.value.length  > 24) {
    alert("Pickup Street must be limited to 24 characters.");
    theForm.PUStreet.focus();
    return (false);
  }

  else if(theForm.DelComp.value.indexOf(",") != -1) {
    alert("The 'Delivery Company' may not contain commas.");
    theForm.DelComp.focus();
    return (false);
  }
  
  else if(theForm.PUStreet.value.indexOf(",") != -1) {
      alert("'Pickup Street Address' may not contain commas.");
      theForm.PUStreet.focus();
      return (false);
  }

  else if(theForm.PUStreet.value.indexOf("'") != -1) {
    alert("'Pickup Street Address' may not contain an apostrophe.");
    theForm.PUStreet.focus();
    return (false);
  }

 
  else if(theForm.DelStreet.value == "") {
    alert("Please enter a value for the 'Destination Street Address' field.");
    theForm.DelStreet.focus();
    return (false);
  }

  else if(theForm.DelStreet.value.indexOf(",") != -1) {
    alert("'Destination Street Address' may not contain commas.");
    theForm.DelStreet.focus();
    return (false);
  }

  else if(theForm.DelStreet.value.indexOf("'") != -1) {
    alert("'Destination Street Address' may not contain an apostrophe.");
    theForm.DelStreet.focus();
    return (false);
  }

  else if(theForm.DelStreet.value.length  > 24) {
    alert("Delivery Street must be limited to 24 characters.");
    theForm.DelStreet.focus();
    return (false);
  }

  else if(theForm.BillCity.value == "") {
    alert("Please enter a value for the 'Billing City' field.");
    theForm.BillCity.focus();
    return (false);
  }

  else if(theForm.PUCity.value == "") {
    alert("Please enter a value for the 'Pick Up City' field.");
    theForm.PUCity.focus();
    return (false);
  }

  else if(theForm.DelCity.value == "") {
    alert("Please enter a value for the 'Destination Street Address' field.");
    theForm.DelCity.focus();
    return (false);
  }

  else if(theForm.DelState.selectedIndex == 0) {
    alert("The first 'State / Province' option is not a valid selection.  Please choose one of the other options.");
    theForm.DelState.focus();
    return (false);
  }

  else if(theForm.BillPC.value == "") {
    alert("Please enter a value for the 'BillPC' field.");
    theForm.BillPC.focus();
    return (false);
  }

  else if(theForm.PUPC.value == "") {
    alert("Please enter a value for the 'PUPC' field.");
    theForm.PUPC.focus();
    return (false);
  }

  else if(theForm.BillPhone.value == "") {
    alert("Please enter a value for the 'Billing Phone' field.");
    theForm.BillPhone.focus();
    return (false);
  }

  else if(theForm.BillPhone.value.length < 10) {
    alert("Please enter at least 10 characters in the 'Billing Phone' field.");
    theForm.BillPhone.focus();
    return (false);
  }

  else if(!isAllDigits(theForm.BillPhone.value)) {
    alert("Please enter only digit characters in the 'Billing Phone' field.");
    theForm.BillPhone.focus();
    return (false);
  }

  else if(theForm.PUPhone.value == "") {
    alert("Please enter a value for the 'Pickup Phone' field.");
    theForm.PUPhone.focus();
    return (false);
  }

  else if(theForm.PUPhone.value.length < 10) {
    alert("Please enter at least 10 characters in the 'Pickup Phone' field.");
    theForm.PUPhone.focus();
    return (false);
  }

  else if(!isAllDigits(theForm.PUPhone.value)) {
    alert("Please enter only digit characters in the 'Pickup Phone' field.");
    theForm.PUPhone.focus();
    return (false);
  }

  else if(theForm.DelPhone.value == "") {
    alert("Please enter a value for the 'Destination Phone' field.");
    theForm.DelPhone.focus();
    return (false);
  }

  else if(theForm.DelPhone.value.length < 10) {
    alert("Please enter at least 10 characters in the 'Destination Phone' field.");
    theForm.DelPhone.focus();
    return (false);
  }

  else if(!isAllDigits(theForm.DelPhone.value)) {
    alert("Please enter only digit characters in the 'Destination Phone' field.");
    theForm.DelPhone.focus();
    return (false);
  }

  else if(theForm.Service.selectedIndex == 0) {
    alert("The first 'Choose a Service Level!' option is not a valid selection.  Please choose one of the other options.");
    theForm.Service.focus();
    return (false);
  }

  // do some basic checking on correct service type selections
  else if (puCity == delCity &&
      (serv == "First Overnight" ||
       serv == "Inter-City Overnight")) {
    alert("You have seleced an Inter-City Service Level for same city delivery");
    return false;
  }

  else if (puCity != delCity &&
      (serv == "Regular (4hrs)" ||
        serv == "Rush (1-2hrs)" ||
        serv == "Direct")) {
      if (!confirm("You have seleced a direct service for an out of town delivery.\n" +
                   "This will increase the trip cost. For regular Inter-City service\n" +
                   "select First Overnight or Inter-City Overnight service level.\n" +
                   "Click OK to continue using the current service level or cancel to change it"))
        return false;
  }

  else if(theForm.PkgType.selectedIndex == 0) {
    alert("The first 'Package Description' option is not a valid selection.  Please choose one of the other options.");
    theForm.PkgType.focus();
    return (false);
  }

  else if(theForm.User.value == "") {
    alert("Please enter a value for the 'Your Name' field.");
    theForm.User.focus();
    return (false);
  }

  else if(theForm.UserEmail.value == "") {
    alert("Please enter a value for the 'UserEmail' field.");
    theForm.UserEmail.focus();
    return (false);
  }

  return (true);
}
