var state='1:Alabama:Alabama|1:Alaska:Alaska|1:American Samoa:American Samoa|1:Arizona:Arizona|1:Arkansas:Arkansas|1:California:California|1:Colorado:Colorado|1:Connecticut:Connecticut|1:Delaware:Delaware|1:District of Columbia (D.C.):District of Columbia (D.C.)|1:Florida:Florida|1:Georgia:Georgia|1:Guam:Guam|1:Hawaii:Hawaii|1:Idaho:Idaho|1:Illinois:Illinois|1:Indiana:Indiana|1:Iowa:Iowa|1:Kansas:Kansas|1:Kentucky:Kentucky|1:Louisiana:Louisiana|1:Maine:Maine|1:Marianas:Marianas|1:Marshall Islands:Marshall Islands|1:Maryland:Maryland|1:Massachusetts:Massachusetts|1:Michigan:Michigan|1:Micronesia:Micronesia|1:Military Americas:Military Americas|1:Military Europe/ME/Canada:Military Europe/ME/Canada|1:Military Pacific:Military Pacific|1:Minnesota:Minnesota|1:Mississippi:Mississippi|1:Missouri:Missouri|1:Montana:Montana|1:Nebraska:Nebraska|1:Nevada:Nevada|1:New Hampshire:New Hampshire|1:New Jersey:New Jersey|1:New Mexico:New Mexico|1:New York:New York|1:North Carolina:North Carolina|1:North Dakota:North Dakota|1:Ohio:Ohio|1:Oklahoma:Oklahoma|1:Oregon:Oregon|1:Palau:Palau|1:Pennsylvania:Pennsylvania|1:Puerto Rico:Puerto Rico|1:Rhode Island:Rhode Island|1:South Carolina:South Carolina|1:South Dakota:South Dakota|1:Tennessee:Tennessee|1:Texas:Texas|1:Utah:Utah|1:Vermont:Vermont|1:Virgin Islands:Virgin Islands|1:Virginia:Virginia|1:Washington:Washington|1:West Virginia:West Virginia|1:Wisconsin:Wisconsin|1:Wyoming:Wyoming|3:Alberta:Alberta|3:British Columbia:British Columbia|3:Manitoba:Manitoba|3:Manitoba:Manitoba|3:New Brunswick:New Brunswick|3:Newfoundland and Labrador:Newfoundland and Labrador|3:Northwest Territories:Northwest Territories|3:Nova Scotia:Nova Scotia|3:Nunavut:Nunavut|3:Ontario:Ontario|3:Prince Edward Island:Prince Edward Island|3:Quebec:Quebec|3:Saskatchewan:Saskatchewan|17:Burgenland:Burgenland|17:Kärnten:Kärnten|17:Niederösterreich:Niederösterreich|17:Oberösterreich:Oberösterreich|17:Salzburg:Salzburg|17:Steiermark:Steiermark|17:Tirol:Tirol|17:Voralberg:Voralberg|17:Wien:Wien|83:Baden-Württemberg:Baden-Württemberg|83:Bayern:Bayern|83:Berlin:Berlin|83:Brandenburg:Brandenburg|83:Bremen:Bremen|83:Hamburg:Hamburg|83:Hessen:Hessen|83:Mecklenburg-Vorpommern:Mecklenburg-Vorpommern|83:Niedersachsen:Niedersachsen|83:Nordrhein-Westfalen:Nordrhein-Westfalen|83:Rheinland-Pfalz:Rheinland-Pfalz|83:Saarland:Saarland|83:Sachsen:Sachsen|83:Sachsen-Anhalt:Sachsen-Anhalt|83:Schleswig-Holstein:Schleswig-Holstein|83:Thüringen:Thüringen|197:A Coruña:A Coruña|197:Alava:Alava|197:Albacete:Albacete|197:Alicante:Alicante|197:Almeria:Almeria|197:Asturias:Asturias|197:Avila:Avila|197:Badajoz:Badajoz|197:Baleares:Baleares|197:Barcelona:Barcelona|197:Burgos:Burgos|197:Caceres:Caceres|197:Cadiz:Cadiz|197:Cantabria:Cantabria|197:Castellon:Castellon|197:Ceuta:Ceuta|197:Ciudad Real:Ciudad Real|197:Cordoba:Cordoba|197:Cuenca:Cuenca|197:Girona:Girona|197:Granada:Granada|197:Guadalajara:Guadalajara|197:Guipuzcoa:Guipuzcoa|197:Huelva:Huelva|197:Huesca:Huesca|197:Jaen:Jaen|197:La Rioja:La Rioja|197:Las Palmas:Las Palmas|197:Leon:Leon|197:Lleida:Lleida|197:Lugo:Lugo|197:Madrid:Madrid|197:Malaga:Malaga|197:Melilla:Melilla|197:Murcia:Murcia|197:Navarra:Navarra|197:Ourense:Ourense|197:Palencia:Palencia|197:Pontevedra:Pontevedra|197:Salamanca:Salamanca|197:Santa Cruz de Tenerife:Santa Cruz de Tenerife|197:Segovia:Segovia|197:Sevilla:Sevilla|197:Soria:Soria|197:Tarragona:Tarragona|197:Teruel:Teruel|197:Toledo:Toledo|197:Valencia:Valencia|197:Valladolid:Valladolid|197:Vizcaya:Vizcaya|197:Zamora:Zamora|197:Zaragoza:Zaragoza|206:Aargau:Aargau|206:Appenzell Ausserrhoden:Appenzell Ausserrhoden|206:Appenzell Innerrhoden:Appenzell Innerrhoden|206:Basel-Landschaft:Basel-Landschaft|206:Basel-Stadt:Basel-Stadt|206:Bern:Bern|206:Freiburg:Freiburg|206:Genf:Genf|206:Glarus:Glarus|206:Graubünden:Graubünden|206:Jura:Jura|206:Luzern:Luzern|206:Neuenburg:Neuenburg|206:Nidwalden:Nidwalden|206:Obwalden:Obwalden|206:Schaffhausen:Schaffhausen|206:Schwyz:Schwyz|206:Solothurn:Solothurn|206:St. Gallen:St. Gallen|206:Tessin:Tessin|206:Thurgau:Thurgau|206:Uri:Uri|206:Waadt:Waadt|206:Zürich:Zürich|206:Zug:Zug';var edition='1:Boston Area:Boston Area|1:Chicago Area:Chicago Area|1:Dallas Area:Dallas Area|1:Los Angeles Area:Los Angeles Area|1:New York Area:New York Area|1:Other Areas:Other Areas';var country='4:Afghanistan:Afghanistan|5:Albania:Albania|6:Algeria:Algeria|7:American Samoa:American Samoa|8:Andorra:Andorra|9:Angola:Angola|10:Anguilla:Anguilla|11:Antarctica:Antarctica|12:Antigua And Barbuda:Antigua And Barbuda|13:Argentina:Argentina|14:Armenia:Armenia|15:Aruba:Aruba|16:Australia:Australia|17:Austria:Austria|18:Azerbaijan:Azerbaijan|19:Bahamas:Bahamas|20:Bahrain:Bahrain|21:Bangladesh:Bangladesh|22:Barbados:Barbados|23:Belarus:Belarus|24:Belgium:Belgium|25:Belize:Belize|26:Benin:Benin|27:Bermuda:Bermuda|28:Bhutan:Bhutan|29:Bolivia:Bolivia|30:Bosnia And Herzegowina:Bosnia And Herzegowina|31:Botswana:Botswana|32:Bouvet Island:Bouvet Island|33:Brazil:Brazil|34:British Indian Ocean Territory:British Indian Ocean Territory|35:Brunei Darussalam:Brunei Darussalam|36:Bulgaria:Bulgaria|37:Burkina Faso:Burkina Faso|38:Burundi:Burundi|39:Cambodia:Cambodia|40:Cameroon:Cameroon|3:Canada:Canada|41:Cape Verde:Cape Verde|42:Cayman Islands:Cayman Islands|43:Central African Republic:Central African Republic|44:Chad:Chad|45:Chile:Chile|46:China:China|47:Christmas Island:Christmas Island|48:Cocos (Keeling) Islands:Cocos (Keeling) Islands|49:Colombia:Colombia|50:Comoros:Comoros|51:Congo:Congo|52:Cook Islands:Cook Islands|53:Costa Rica:Costa Rica|54:Cote D" Ivoire:Cote D" Ivoire|55:Croatia:Croatia|56:Cuba:Cuba|57:Cyprus:Cyprus|58:Czech Republic:Czech Republic|59:Denmark:Denmark|60:Djibouti:Djibouti|61:Dominica:Dominica|62:Dominican Republic:Dominican Republic|63:East Timor:East Timor|64:Ecuador:Ecuador|65:Egypt:Egypt|66:El Salvador:El Salvador|67:Equatorial Guinea:Equatorial Guinea|68:Eritrea:Eritrea|69:Estonia:Estonia|70:Ethiopia:Ethiopia|71:Falkland Islands:Falkland Islands|72:Faroe Islands:Faroe Islands|73:Fiji:Fiji|74:Finland:Finland|75:France:France|76:France, Metropolitan:France, Metropolitan|77:French Guiana:French Guiana|78:French Polynesia:French Polynesia|79:French Southern Territories:French Southern Territories|80:Gabon:Gabon|81:Gambia:Gambia|82:Georgia:Georgia|83:Germany:Germany|84:Ghana:Ghana|85:Gibraltar:Gibraltar|86:Greece:Greece|87:Greenland:Greenland|88:Grenada:Grenada|89:Guadeloupe:Guadeloupe|90:Guam:Guam|91:Guatemala:Guatemala|92:Guinea:Guinea|93:Guinea-Bissau:Guinea-Bissau|94:Guyana:Guyana|95:Haiti:Haiti|96:Heard And Mc Donald Islands:Heard And Mc Donald Islands|97:Honduras:Honduras|98:Hong Kong:Hong Kong|99:Hungary:Hungary|100:Iceland:Iceland|101:India:India|102:Indonesia:Indonesia|103:Iran:Iran|104:Iraq:Iraq|105:Ireland:Ireland|106:Israel:Israel|107:Italy:Italy|108:Jamaica:Jamaica|109:Japan:Japan|110:Jordan:Jordan|111:Kazakhstan:Kazakhstan|112:Kenya:Kenya|113:Kiribati:Kiribati|116:Kuwait:Kuwait|117:Kyrgyzstan:Kyrgyzstan|118:Lao People" Republic:Lao People" Republic|119:Latvia:Latvia|120:Lebanon:Lebanon|121:Lesotho:Lesotho|122:Liberia:Liberia|123:Libyan Arab Jamahiriya:Libyan Arab Jamahiriya|124:Liechtenstein:Liechtenstein|125:Lithuania:Lithuania|126:Luxembourg:Luxembourg|127:Macau:Macau|128:Macedonia:Macedonia|129:Madagascar:Madagascar|130:Malawi:Malawi|131:Malaysia:Malaysia|132:Maldives:Maldives|133:Mali:Mali|134:Malta:Malta|135:Marshall Islands:Marshall Islands|136:Martinique:Martinique|137:Mauritania:Mauritania|138:Mauritius:Mauritius|139:Mayotte:Mayotte|140:Mexico:Mexico|141:Micronesia:Micronesia|142:Moldova:Moldova|143:Monaco:Monaco|144:Mongolia:Mongolia|145:Montserrat:Montserrat|146:Morocco:Morocco|147:Mozambique:Mozambique|148:Myanmar:Myanmar|149:Namibia:Namibia|150:Nauru:Nauru|151:Nepal:Nepal|152:Netherlands:Netherlands|153:Netherlands Antilles:Netherlands Antilles|154:New Caledonia:New Caledonia|155:New Zealand:New Zealand|156:Nicaragua:Nicaragua|157:Niger:Niger|158:Nigeria:Nigeria|159:Niue:Niue|160:Norfolk Island:Norfolk Island|114:North Korea:North Korea|161:Northern Mariana Islands:Northern Mariana Islands|162:Norway:Norway|163:Oman:Oman|164:Pakistan:Pakistan|165:Palau:Palau|166:Panama:Panama|167:Papua New Guinea:Papua New Guinea|168:Paraguay:Paraguay|169:Peru:Peru|170:Philippines:Philippines|171:Pitcairn:Pitcairn|172:Poland:Poland|173:Portugal:Portugal|174:Puerto Rico:Puerto Rico|175:Qatar:Qatar|176:Reunion:Reunion|177:Romania:Romania|178:Russian Federation:Russian Federation|179:Rwanda:Rwanda|180:Saint Kitts And Nevis:Saint Kitts And Nevis|181:Saint Lucia:Saint Lucia|182:Saint Vincent And The Grenadines:Saint Vincent And The Grenadines|183:Samoa:Samoa|184:San Marino:San Marino|185:Sao Tome And Principe:Sao Tome And Principe|186:Saudi Arabia:Saudi Arabia|187:Senegal:Senegal|188:Seychelles:Seychelles|189:Sierra Leone:Sierra Leone|190:Singapore:Singapore|191:Slovakia:Slovakia|192:Slovenia:Slovenia|193:Solomon Islands:Solomon Islands|194:Somalia:Somalia|195:South Africa:South Africa|196:South Georgia And Islands:South Georgia And Islands|115:South Korea:South Korea|197:Spain:Spain|198:Sri Lanka:Sri Lanka|199:St Helena:St Helena|200:St Pierre and Miquelon:St Pierre and Miquelon|201:Sudan:Sudan|202:Suriname:Suriname|203:Svalbard And Jan Mayen Islands:Svalbard And Jan Mayen Islands|204:Swaziland:Swaziland|205:Sweden:Sweden|206:Switzerland:Switzerland|207:Syrian Arab Republic:Syrian Arab Republic|208:Taiwan:Taiwan|209:Tajikistan:Tajikistan|210:Tanzania:Tanzania|211:Thailand:Thailand|212:Togo:Togo|213:Tokelau:Tokelau|214:Tonga:Tonga|215:Trinidad And Tobago:Trinidad And Tobago|216:Tunisia:Tunisia|240:Turkey:Turkey|218:Turkmenistan:Turkmenistan|219:Turks And Caicos Islands:Turks And Caicos Islands|220:Tuvalu:Tuvalu|221:Uganda:Uganda|222:Ukraine:Ukraine|223:United Arab Emirates:United Arab Emirates|224:United Kingdom:United Kingdom|1:United States of America:United States of America|226:Uruguay:Uruguay|225:US Minor Outlying Islands:US Minor Outlying Islands|227:Uzbekistan:Uzbekistan|228:Vanuatu:Vanuatu|229:Vatican City State:Vatican City State|230:Venezuela:Venezuela|231:Viet Nam:Viet Nam|232:Virgin Islands (British):Virgin Islands (British)|233:Virgin Islands (U.S.):Virgin Islands (U.S.)|234:Wallis And Futuna Islands:Wallis And Futuna Islands|235:Western Sahara:Western Sahara|236:Yemen:Yemen|237:Zaire:Zaire|238:Zambia:Zambia|239:Zimbabwe:Zimbabwe'; var postState = ''; var postCountry = ''; var postEdition = ''; function TrimString(sInString) { if ( sInString ) { sInString = sInString.replace( /^\s+/g, "" );// strip leading return sInString.replace( /\s+$/g, "" );// strip trailing } } // Populates the country selected with the counties from the country list function populateCountry(defaultCountry) { if ( postCountry != '' ) { defaultCountry = postCountry; } var countryLineArray = country.split('|'); // Split into lines var selObj = document.getElementById('countrySelect'); selObj.options[0] = new Option('Select Country',''); selObj.selectedIndex = 0; for (var loop = 0; loop < countryLineArray.length; loop++) { lineArray = countryLineArray[loop].split(':'); countryCode = TrimString(lineArray[0]); countryName = TrimString(lineArray[1]); if ( countryCode != '' ) { selObj.options[loop + 1] = new Option(countryName, countryCode); } if ( defaultCountry == countryCode ) { selObj.selectedIndex = loop + 1; } } } function populateState() { var selObj = document.getElementById('stateSelect'); var foundState = false; // Empty options just in case new drop down is shorter if ( selObj.type == 'select-one' ) { for (var i = 0; i < selObj.options.length; i++) { selObj.options[i] = null; } selObj.options.length=null; selObj.options[0] = new Option('Please select',''); selObj.selectedIndex = 0; } // Populate the drop down with states from the selected country var stateLineArray = state.split("|"); // Split into lines var optionCntr = 1; for (var loop = 0; loop < stateLineArray.length; loop++) { lineArray = stateLineArray[loop].split(":"); countryCode = TrimString(lineArray[0]); stateCode = TrimString(lineArray[1]); stateName = TrimString(lineArray[2]); if (document.getElementById('countrySelect').value == countryCode && countryCode != '' ) { // If it's a input element, change it to a select if ( selObj.type == 'text' ) { parentObj = document.getElementById('stateSelect').parentNode; parentObj.removeChild(selObj); var inputSel = document.createElement("SELECT"); inputSel.setAttribute("name","state"); inputSel.setAttribute("id","stateSelect"); parentObj.appendChild(inputSel) ; selObj = document.getElementById('stateSelect'); selObj.options[0] = new Option('Please select',''); selObj.selectedIndex = 0; } if ( stateCode != '' ) { selObj.options[optionCntr] = new Option(stateName, stateCode); } // See if it's selected from a previous post if ( stateCode == postState && countryCode == postCountry ) { selObj.selectedIndex = optionCntr; } foundState = true; optionCntr++ } } // If the country has no states, change the select to a text box if ( ! foundState ) { parentObj = document.getElementById('stateSelect').parentNode; parentObj.removeChild(selObj); // Create the Input Field var inputEl = document.createElement("INPUT"); inputEl.setAttribute("id", "stateSelect"); inputEl.setAttribute("type", "text"); inputEl.setAttribute("name", "state"); inputEl.setAttribute("size", 20); inputEl.setAttribute("value", postState); parentObj.appendChild(inputEl) ; } } function populateEdition() { var selObj = document.getElementById('stateEdition'); var foundState = false; // Empty options just in case new drop down is shorter if ( selObj.type == 'select-one' ) { for (var i = 0; i < selObj.options.length; i++) { selObj.options[i] = null; } selObj.options.length=null; selObj.options[0] = new Option('Please select',''); selObj.selectedIndex = 0; } // Populate the drop down with states from the selected country var stateLineArray = edition.split("|"); // Split into lines var optionCntr = 1; for (var loop = 0; loop < stateLineArray.length; loop++) { lineArray = stateLineArray[loop].split(":"); countryCode = TrimString(lineArray[0]); stateCode = TrimString(lineArray[1]); stateName = TrimString(lineArray[2]); if (document.getElementById('countrySelect').value == countryCode && countryCode != '' ) { // If it's a input element, change it to a select if ( selObj.type == 'text' ) { parentObj = document.getElementById('stateEdition').parentNode; parentObj.removeChild(selObj); var inputSel = document.createElement("SELECT"); inputSel.setAttribute("name","edition"); inputSel.setAttribute("id","stateEdition"); parentObj.appendChild(inputSel) ; selObj = document.getElementById('stateEdition'); selObj.options[0] = new Option('Please select',''); selObj.selectedIndex = 0; } if ( stateCode != '' ) { selObj.options[optionCntr] = new Option(stateName, stateCode); } // See if it's selected from a previous post if ( stateCode == postEdition && countryCode == postCountry ) { selObj.selectedIndex = optionCntr; } foundState = true; optionCntr++ } } // If the country has no states, change the select to a text box if ( ! foundState ) { parentObj = document.getElementById('stateEdition').parentNode; parentObj.removeChild(selObj); // Create the Input Field var inputSel = document.createElement("SELECT"); inputSel.setAttribute("name","edition"); inputSel.setAttribute("id","stateEdition"); parentObj.appendChild(inputSel) ; selObj = document.getElementById('stateEdition'); selObj.options[0] = new Option('Default Edition ',''); selObj.selectedIndex = 0; } } function initCountry(country) { populateCountry(country); populateState(); populateEdition(); }