;;; locale.mhtml: -*- Meta-HTML -*-  DESCRIPTIVE TEXT.

;;;  Copyright (c) 1996 Brian J. Fox
;;;  Author: Brian J. Fox (bfox@ai.mit.edu) Sat Dec 28 08:36:45 1996.
<set-var locale::country-names[] =
  <prog
    USA
    Afghanistan
    Albania
    Algeria
    American Samoa
    Andorra
    Angola
    Anguilla
    Antigua & Barbuda
    Argentina
    Armenia
    Aruba
    Ascension
    Australia
    Austria
    Azerbaijan
    Azores
    Bahamas
    Bahrain
    Bangladesh
    Barbados
    Belarus
    Belgium
    Belize
    Benin
    Bermuda
    Bhutan
    Bolivia
    Bonaire
    Bosnia
    Botswana
    Brazil
    British Virgin Islands
    Brunei
    Bulgaria
    Burkina Faso
    Myanmar (Burma)
    Burundi
    Cameroon
    Canada
    Cape Verde
    Cayman Islands
    Central African Republic
    Chad
    Channel Islands (U.K.)
    Chile
    China
    Colombia
    Comoros
    Congo
    Cook Islands (Australia)
    Corsica (France)
    Costa Rica
    Croatia
    Cuba
    Curacao (Neth.Ant.)
    Cyprus
    Czech Republic
    Denmark
    Djibouti
    Dominica
    Dominican Republic
    East Timor
    Ecuador
    Egypt
    El Salvador
    UK
    Equatorial Guinea
    Estonia
    Ethiopia
    Falkland Islands
    Faroe Islands
    Fiji
    Finland
    France
    French Guyana
    French Polynesia
    Gabon
    Gambia
    Georgia
    Germany
    Ghana
    Gibraltar
    Greece
    Greenland
    Grenada
    Guadeloupe
    Guam (U.S. Terr.)
    Guatemala
    Guinea
    Guinea-Bissau
    Guyana
    Haiti
    Honduras
    Hong Kong
    Hungary
    Iceland
    India
    Indonesia
    Iran
    Iraq
    Ireland
    Israel
    Italy
    Ivory Coast (Cote D' Iv.)
    Jamaica
    Japan
    Jordan
    Cambodia
    Kenya
    Kiribati
    Korea, North
    Korea, South
    Kosrae
    KSA
    Kuwait
    Laos
    Latvia
    Lebanon
    Lesotho
    Liberia
    Libya
    Liechtenstein
    Lithuania
    Luxembourg
    Macau
    Macedonia
    Madagascar
    Madeira Islands
    Malawi
    Malaysia
    Maldives
    Mali
    Malta
    Martinique
    Mauritania
    Mauritius
    Mexico
    Micronesia (U.S. Terr.)
    Moldova
    Monaco
    Mongolia
    Montserrat
    Morocco
    Mozambique
    Namibia
    Nauru
    Nepal
    Netherlands
    Netherlands Antilles
    Nevis (St. Christopher)
    New Caledonia
    New Zealand
    Nicaragua
    Niger
    Nigeria
    Northern Mariana Islands
    Norway
    Oman
    Pakistan
    Palau (U.S. Terr.)
    Panama
    Papua New Guinea
    Paraguay
    Peru
    Philippines
    Pitcairn Islands
    Poland
    Ponape (U.S. Terr.)
    Portugal
    Qatar
    Reunion
    Romania
    Rota (U.S. Terr.)
    Rwanda
    Russia
    Saba (Neth.Ant.)
    Saint Barthelemy (Guadlp.)
    Saint Christopher & Nevis
    Saint Croix (U.S. Terr.)
    Saint Eustatius (Neth.Ant.)
    Saint Helena
    Saint Kitts and Nevis
    Saint Lucia
    Saint Maarten (Neth.Ant.)
    Saint Martin
    Saint Pierre & Miquelon
    Saint Thomas (U.S. Terr.)
    Saint Vincent /Grenadines
    Saipan (U.S. Terr.)
    San Marino
    Sao Tome & Principe
    Saudi Arabia
    Senegal
    Serbia
    Seychelles
    Sierra Leone
    Singapore
    Slovakia
    Slovenia
    Solomon Islands
    Somalia
    South Africa
    Spain
    Sri Lanka
    Sudan
    Suriname
    Swaziland
    Sweden
    Switzerland
    Syria
    Tahiti (French Polynesia)
    Taiwan
    Tanzania
    Thailand
    Tinian
    Togo
    Tonga
    Tortola
    Trinidad and Tobago
    Tristan da Cunha
    Truk (U.S. Terr.)
    Tunisia
    Turkey
    Turks & Caicos Islands
    Tuvalu
    U.S. Virgin Islands
    Uganda
    Ukraine
    Union Island
    United Arab Emirates
    Uruguay
    USA
    Uzbekistan
    Vanuatu
    Vatican City
    Venezuela
    Vietnam
    Wake Island (U.S. Terr.)
    Wallis & Futuna Islands
    West Indies
    Western Samoa
    Yap (U.S. Terr.)
    Yemen,  (North) Arab Rep.
    Yemen,  (South) Peoples D.
    Yugoslavia
    Zaire>>

<defun locale::select-country postname sitename>
  <select name="<get-var postname>">
    <concat "\n">
    <option value=none>Select Country
    <concat "\n">
    <set-var i=0>
    <while <get-var locale::country-names[i]>>
      <concat
       "<option value=\"<get-var locale::country-names[i]>\""
       <if <string-eq <get-var posted::<get-var postname>>
		      <get-var locale::country-names[i]>>
	   " SELECTED"
	 <if <string-eq <get-var <get-var sitename>>
			<get-var locale::country-names[i]>>
	     " SELECTED">>
       "><get-var locale::country-names[i]>\n">
      <increment i>
    </while>
    </select>
</defun>
<set-var locale::state-names[]=
  <prog
    AL,Alabama
    AK,Alaska
    AZ,Arizona
    AR,Arkansas
    CA,California
    CO,Colorado
    CT,Connecticut
    DE,Delaware
    DC,District of Columbia
    FL,Florida
    GA,Georgia
    HI,Hawaii
    ID,Idaho
    IL,Illinois
    IN,Indiana
    IA,Iowa
    KS,Kansas
    KY,Kentucky
    LA,Louisiana
    ME,Maine
    MD,Maryland
    MA,Massachusetts
    MI,Michigan
    MN,Minnesota
    MS,Mississippi
    MO,Missouri
    MT,Montana
    NE,Nebraska
    NV,Nevada
    NH,New Hampshire
    NJ,New Jersey
    NM,New Mexico
    NY,New York
    NC,North Carolina
    ND,North Dakota
    OH,Ohio
    OK,Oklahoma
    OR,Oregon
    PA,Pennsylvania
    RI,Rhode Island
    SC,South Carolina
    SD,South Dakota
    TN,Tennessee
    TX,Texas
    UT,Utah
    VT,Vermont
    VA,Virginia
    WA,Washington
    WV,West Virginia
    WI,Wisconsin
    WY,Wyoming>>

<defun locale::select-state postname sitename>
  <select name="<get-var postname>">
    <concat "\n">
    <option value=none>Select State
    <concat "\n">
    <set-var i=0>
    <while <get-var locale::state-names[i]>>
      <set-var state[] =
        <subst-in-string <get-var locale::state-names[i]> "," "\n">>
      <concat
       "<option value=\"<get-var state>\""
       <if <string-eq <get-var posted::<get-var postname>>
                      <get-var state>>
           " SELECTED"
         <if <string-eq <get-var <get-var sitename>>
                        <get-var state>>
             " SELECTED">>
       "><get-var state[1]>">
      <increment i>
    </while>
    </select>
</defun>
