function verifyZipCode(zipCodeString)
  {
   /*
    Custom-built function that checks for a valid zip code format. The format can be either
    nnnnn (5 digits) or nnnnn-nnnn (5 digits - 4 digits).

    Definition of zip code (example: 60081-9471). The first 5 digits (60081) is the Zip
    Code; it identifies a town, city, etc. The last 4 digits (9471) identify the Sector
    Segment; Sector is the first 2 digits (94) and the Segment within that Sector is the
    last 2 digits (71).
   */

   var matchArray = "";    	// Zip code format. 

   // Regular expressions are delimited by forward slashes (/).
   //   1. Assertions are ^ for matches at the beginning of the string and $ for
   //      matches at the end of the string.
   //   2. Quantifier range of {n} for must occur exactly n times.
   //   3. Character matches \d for a digit (same as [0-9]).
  						 
   if (zipCodeString.length == 5)
      {
       // check for a 5 digit zip code.
       matchArray = zipCodeString.match(/^\d{5}$/);
      }
   else 
      {
       // check for a 10 digit zip code (Zip Code, Sector and Segment).
       matchArray = zipCodeString.match(/^\d{5}-\d{4}$/);
      }

   if (matchArray == null)	// Is the zip code format ok?
      {return false;}		// No, return false (Boolean).
 
   return true;
  }

