var country = Array(); country[38] = Array("66|Alberta","67|British Columbia","68|Manitoba","69|New Brunswick","70|Newfowndland","71|Northwest Territories","72|Nova Scotia","73|Nunavut","74|Ontario","75|Prince Edward Island","76|Quebec","77|Saskatchewan","78|Yukon"); country[226] = Array("1|Alaska","2|Alabama","3|American Samoa","4|Arizona","5|Arkansas","6|California","7|Colorado","8|Connecticut","9|Delaware","10|District of Columbia","11|Federated state of Micronesia","12|Florida","13|Georgia","14|Guam","15|Hawaii","16|Idaho","17|Illinois","18|Indiana","19|Iowa","20|Kansas","21|Kentucky","22|Louisiana","23|Maine","24|Marshall Islands","25|Maryland","26|Massachusetts","27|Michigan","28|Minnesota","29|Mississippi","30|Missouri","31|Montana","32|Nebraska","33|Nevada","34|New Hampshire","35|New Jersey","36|New Mexico","37|New York","38|North Carolina","39|North Dakota","40|Northern Mariana Islands","41|Ohio","42|Oklahoma","43|Oregon","44|Palau","45|Pennsylvania","46|Puerto Rico","47|Rhode Island","48|South Carolina","49|South Dakota","50|Tennessee","51|Texas","52|Utah","53|Vermont","54|Virgin Islands","55|Virginia","56|Washington","57|West Virginia","58|Wisconsin","59|Wyoming","60|Armed Forces Africa","61|Armed Forces Americas (except Canada)","62|Armed Forces Canada","63|Armed Forces Europe","64|Armed Forces Middle East","65|Armed Forces Pacific"); function showStates(countryId, prefix) { // Clear existing items while(document.getElementById(prefix+'state').options.length > 2) { document.getElementById(prefix+'state').options[document.getElementById(prefix+'state').options.length-1] = null; } if(country[countryId] && country[countryId].length > 0) { for(x=0;x<=country[countryId].length-1;x++) { tmp = country[countryId][x].split("|"); document.getElementById(prefix+'state').options[x+2] = new Option(tmp[1],tmp[0]); document.getElementById(prefix+'state').disabled = false; document.getElementById(prefix+'zipcode').disabled = false; } } else { document.getElementById(prefix+'state').disabled = true; document.getElementById(prefix+'zipcode').value = ''; document.getElementById(prefix+'zipcode').disabled = true; } } function selectState(stateId, prefix) { for(x=0;x<=document.getElementById(prefix+'state').options.length-1;x++) { if (stateId==document.getElementById(prefix+'state').options[x].value && stateId != '' && stateId != null) { document.getElementById(prefix+'state').selectedIndex = x; } } }