 function validate(theForm){

  if (theForm.CourierIdName.value == ""){
   alert("Please enter a company name.");
   theForm.CourierIdName.focus();
   return (false);
   }

  if (theForm.CourierIdName.value.length > 35){
   alert("Please enter no more then 35 characters in the company name field.");
   theForm.CourierIdName.focus();
   return (false);
   }
  
  if (theForm.CourierIdAddress.value == ""){
   alert("Please enter a company address.");
   theForm.CourierIdAddress.focus();
   return (false);
   }

  if (theForm.CourierIdCity.value == ""){
   alert("Please enter the city where this operation is located.");
   theForm.CourierIdCity.focus();
   return (false);
   }

  if (theForm.CourierIdCity.value.length > 16){
   alert("Please enter no more then 16 characters for the city where this operation is located.");
   theForm.CourierIdCity.focus();
   return (false);
   }

  if (theForm.CourierIdZip.value == ""){
   alert("Please enter a valid zip-code for the city where this operation is located.");
   theForm.CourierIdZip.focus();
   return (false);
   }

  if (theForm.CourierIdZip.value.length > 5){
   alert("Please enter no more then 5 characters for the zip-code of the city where this operation is located.");
   theForm.CourierIdZip.focus();
   return (false);
   }

  if (theForm.PhoneArea.value == ""){
   alert("Please enter a valid area code.");
   theForm.PhoneArea.focus();
   return (false);
   }

  if (theForm.PhoneArea.value.length > 3){
   alert("Please enter at most 3 characters in the area code field.");
   theForm.PhoneArea.focus();
   return (false);
   }

  if (theForm.PhonePrefix.value == ""){
   alert("Please enter a valid phone prefix.");
   theForm.PhonePrefix.focus();
   return (false);
   }

  if (theForm.PhonePrefix.value.length > 3){
   alert("Please enter at most 3 characters in the phone prefix field.");
   theForm.PhonePrefix.focus();
   return (false);
   }

  if (theForm.PhoneSufix.value == ""){
   alert("Please enter a valid phone sufix.");
   theForm.PhoneSufix.focus();
   return (false);
   }

  if (theForm.PhoneSufix.value.length > 4){
   alert("Please enter at most 4 characters in the phone sufix field.");
   theForm.PhoneSufix.focus();
   return (false);
   }
  
  if (theForm.Airport1.selectedIndex == 0){
   alert("It was detected that a valid airport was not selected. Please double check this information and try again.");
   theForm.Airport1.focus();
   return (false);
   }

  var radioSelected = false;
  for (i = 0;  i < theForm.HrsOpenGP.length;  i++){
   if (theForm.HrsOpenGP[i].checked)
    radioSelected = true;
    }
   if (!radioSelected){
    alert("Please select the hours that your company will be available to process shipments.");
    return (false);
  }

  return (true);
}