var countryArray = new Array();
countryArray =  Array("Select",
"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla",
"Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
"Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
"Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia And Herzegovina", "Botswana",
"Bouvet Island", "Brazil", "British Indian Ocean Terr.", "Brunei", "Bulgaria", "Burkina Faso",
"Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands",
"Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos(Keeling) Islands",
"Columbia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus",
"Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor",
"Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia",
"Faeroe (Faroe) Islands", "Falkland Islands", "Fiji", "Finland", "France", "French Guyana",
"French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany",
"Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala",
"Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and McDonald Islands", "Honduras",
"Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland",
"Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati",
"Korea (North)", "Korea (South)", "Kuwait", "Kyrgyzstan", "Laos Peoples Dem. Rep.", "Latvia",
"Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao",
"Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
"Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
"Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru",
"Nepal", "Netherlands", "Netherlands Ant", "New Caledonia", "New Zealand", "Nicaragua", "Niger",
"Nigeria", "Niue", "Norfolk Island", "Northern Mariana Island", "Norway", "Oman", "Pakistan",
"Palau", "Panama", "Papuan W Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Island",
"Poland", "Portugal", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda",
"S. Georgia and the S. Sandwich Island", "Samoa", "San Marino", "Saotome and Principe", "Saudi Arabia",
"Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
"Somalia", "South Africa", "Spain", "Sri Lanka", "St .Pierre and Miquelon", "St. Helena",
"St. Lucia", "St.Kitts-Nevis-Anguilla", "St.Vincent and the Grenadines", "Sudan", "Suriname",
"Svalbard and Janmayen Islands", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan",
"Tajikistan", "Tanzania", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago",
"Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda",
"Ukraine SSR", "United Arab Emirates", "United Kingdom", "Uruguay", "USA", "Uzbekistan",
"Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)",
"Wallis And Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zaire", "Zambia", "Zimbabwe");

function populateCountry(inForm) {
inForm.country.options.length = countryArray.length;
for (var i=0; i < countryArray.length; i++) {
   inForm.country.options[i].text = countryArray[i];
   inForm.country.options[i].selected = 0;
}
inForm.country.options.selectedOption = 0;
}

function populatePubCountry(inForm) {
inForm.pub_country.options.length = countryArray.length;
for (var i=0; i < countryArray.length; i++) {
   inForm.pub_country.options[i].text = countryArray[i];
   inForm.pub_country.options[i].selected = 0;
}
inForm.pub_country.options.selectedOption = 0;
}


function populateAnyCountry(inObject) {
inObject.options.length = countryArray.length;
for (var i=0; i < countryArray.length; i++) {
   inObject.options[i].text = countryArray[i];
   inObject.options[i].selected = 0;
}
inObject.options.selectedOption = 0;
}

function populateState(inForm,selected) {
var stateArray = new Array();
switch (countryArray[selected]) {  
case "USA":
stateArray.length = 52;
stateArray =  Array("Select",
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia",
"Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine",
"Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada",
"New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma",
"Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
"Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming");
break;
case "Canada":
stateArray.length=14;
stateArray = Array("Select",
"Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland & Labrador", "Nova Scotia",
"Northwest Territories", "Nunavut", "Ontario", "Prince Edward Island", "Québec", "Saskatchewan", "Yukon");
break;
case "United Kingdom":
stateArray.length=8;
stateArray = Array("Select",
"Channel Islands", "England", "Isle of Man", "Isle of Wight", "Northern Ireland", "Scotland", "Wales");
break;
case "Australia":
stateArray.length=9;
stateArray = Array("Select",
"Australia Capital Territory", "New South Wales", "Northern Territory", "Queensland", "South Australia", "Tasmania",
"Victoria", "Western Australia");
break;
default:
stateArray.length = 0;
}
inForm.state.options.length = stateArray.length;
for (var i=0; i < stateArray.length; i++) {
   inForm.state.options[i].text = stateArray[i];
   inForm.state.options[i].selected = 0;
}
inForm.state.selectedIndex = 0
}
