var state="US:AK:Alaska|US:AL:Alabama|US:AR:Arkansas|US:AS:American Samoa|US:AZ:Arizona|US:CA:California|US:CO:Colorado|US:CT:Connecticut|US:DC:D.C.|US:DE:Delaware|US:FL:Florida|US:FM:Micronesia|US:GA:Georgia|US:GU:Guam|US:HI:Hawaii|US:IA:Iowa|US:ID:Idaho|US:IL:Illinois|US:IN:Indiana|US:KS:Kansas|US:KY:Kentucky|US:LA:Louisiana|US:MA:Massachusetts|US:MD:Maryland|US:ME:Maine|US:MH:Marshall Islands|US:MI:Michigan|US:MN:Minnesota|US:MO:Missouri|US:MP:Marianas|US:MS:Mississippi|US:MT:Montana|US:NC:North Carolina|US:ND:North Dakota|US:NE:Nebraska|US:NH:New Hampshire|US:NJ:New Jersey|US:NM:New Mexico|US:NV:Nevada|US:NY:New York|US:OH:Ohio|US:OK:Oklahoma|US:OR:Oregon|US:PA:Pennsylvania|US:PR:Puerto Rico|US:PW:Palau|US:RI:Rhode Island|US:SC:South Carolina|US:SD:South Dakota|US:TN:Tennessee|US:TX:Texas|US:UT:Utah|US:VA:Virginia|US:VI:Virgin Islands|US:VT:Vermont|US:WA:Washington|US:WI:Wisconsin|US:WV:West Virginia|US:WY:Wyoming|US:AA:Military Americas|US:AE:Military Europe/ME/Canada|US:AP:Military Pacific|CA:AB:Alberta|CA:MB:Manitoba|CA:AB:Alberta|CA:BC:British Columbia|CA:MB:Manitoba|CA:NB:New Brunswick|CA:NL:Newfoundland and Labrador|CA:NS:Nova Scotia|CA:NT:Northwest Territories|CA:NU:Nunavut|CA:ON:Ontario|CA:PE:Prince Edward Island|CA:QC:Quebec|CA:SK:Saskatchewan|CA:YT:Yukon Territory|AU:AAT:Australian Antarctic Territory|AU:ACT:Australian Capital Territory|AU:NT:Northern Territory|AU:NSW:New South Wales|AU:QLD:Queensland|AU:SA:South Australia|AU:TAS:Tasmania|AU:VIC:Victoria|AU:WA:Western Australia|BR:AC:Acre|BR:AL:Alagoas|BR:AM:Amazonas|BR:AP:Amapa|BR:BA:Baia|BR:CE:Ceara|BR:DF:Distrito Federal|BR:ES:Espirito Santo|BR:FN:Fernando de Noronha|BR:GO:Goias|BR:MA:Maranhao|BR:MG:Minas Gerais|BR:MS:Mato Grosso do Sul|BR:MT:Mato Grosso|BR:PA:Para|BR:PB:Paraiba|BR:PE:Pernambuco|BR:PI:Piaui|BR:PR:Parana|BR:RJ:Rio de Janeiro|BR:RN:Rio Grande do Norte|BR:RO:Rondonia|BR:RR:Roraima|BR:RS:Rio Grande do Sul|BR:SC:Santa Catarina|BR:SE:Sergipe|BR:SP:Sao Paulo|BR:TO:Tocatins|NL:DR:Drente|NL:FL:Flevoland|NL:FR:Friesland|NL:GL:Gelderland|NL:GR:Groningen|NL:LB:Limburg|NL:NB:Noord Brabant|NL:NH:Noord Holland|NL:OV:Overijssel|NL:UT:Utrecht|NL:ZH:Zuid Holland|NL:ZL:Zeeland|UK:AVON:Avon|UK:BEDS:Bedfordshire|UK:BERKS:Berkshire|UK:BUCKS:Buckinghamshire|UK:CAMBS:Cambridgeshire|UK:CHESH:Cheshire|UK:CLEVE:Cleveland|UK:CORN:Cornwall|UK:CUMB:Cumbria|UK:DERBY:Derbyshire|UK:DEVON:Devon|UK:DORSET:Dorset|UK:DURHAM:Durham|UK:ESSEX:Essex|UK:GLOUS:Gloucestershire|UK:GLONDON:Greater London|UK:GMANCH:Greater Manchester|UK:HANTS:Hampshire|UK:HERWOR:Hereford & Worcestershire|UK:HERTS:Hertfordshire|UK:HUMBER:Humberside|UK:IOM:Isle of Man|UK:IOW:Isle of Wight|UK:KENT:Kent|UK:LANCS:Lancashire|UK:LEICS:Leicestershire|UK:LINCS:Lincolnshire|UK:MERSEY:Merseyside|UK:NORF:Norfolk|UK:NHANTS:Northamptonshire|UK:NTHUMB:Northumberland|UK:NOTTS:Nottinghamshire|UK:OXON:Oxfordshire|UK:SHROPS:Shropshire|UK:SOM:Somerset|UK:STAFFS:Staffordshire|UK:SUFF:Suffolk|UK:SURREY:Surrey|UK:SUSS:Sussex|UK:WARKS:Warwickshire|UK:WMID:West Midlands|UK:WILTS:Wiltshire|UK:YORK:Yorkshire|EI:CO ANTRIM:County Antrim|EI:CO ARMAGH:County Armagh|EI:CO DOWN:County Down|EI:CO FERMANAGH:County Fermanagh|EI:CO DERRY:County Londonderry|EI:CO TYRONE:County Tyrone|EI:CO CAVAN:County Cavan|EI:CO DONEGAL:County Donegal|EI:CO MONAGHAN:County Monaghan|EI:CO DUBLIN:County Dublin|EI:CO CARLOW:County Carlow|EI:CO KILDARE:County Kildare|EI:CO KILKENNY:County Kilkenny|EI:CO LAOIS:County Laois|EI:CO LONGFORD:County Longford|EI:CO LOUTH:County Louth|EI:CO MEATH:County Meath|EI:CO OFFALY:County Offaly|EI:CO WESTMEATH:County Westmeath|EI:CO WEXFORD:County Wexford|EI:CO WICKLOW:County Wicklow|EI:CO GALWAY:County Galway|EI:CO MAYO:County Mayo|EI:CO LEITRIM:County Leitrim|EI:CO ROSCOMMON:County Roscommon|EI:CO SLIGO:County Sligo|EI:CO CLARE:County Clare|EI:CO CORK:County Cork|EI:CO KERRY:County Kerry|EI:CO LIMERICK:County Limerick|EI:CO TIPPERARY:County Tipperary|EI:CO WATERFORD:County Waterford";var country="AF:Afghanistan|AL:Albania|DZ:Algeria|AS:American Samoa|AD:Andorra|AO:Angola|AI:Anguilla|AQ:Antarctica|AG:Antigua and Barbuda|AR:Argentina|AM:Armenia|AW:Aruba|AU:Australia|AT:Austria|AZ:Azerbaijan|AP:Azores|BS:Bahamas|BH:Bahrain|BD:Bangladesh|BB:Barbados|BY:Belarus|BE:Belgium|BZ:Belize|BJ:Benin|BM:Bermuda|BT:Bhutan|BO:Bolivia|BA:Bosnia And Herzegowina|XB:Bosnia-Herzegovina|BW:Botswana|BV:Bouvet Island|BR:Brazil|IO:British Indian Ocean Territory|VG:British Virgin Islands|BN:Brunei Darussalam|BG:Bulgaria|BF:Burkina Faso|BI:Burundi|KH:Cambodia|CM:Cameroon|CA:Canada|CV:Cape Verde|KY:Cayman Islands|CF:Central African Republic|TD:Chad|CL:Chile|CN:China|CX:Christmas Island|CC:Cocos (Keeling) Islands|CO:Colombia|KM:Comoros|CG:Congo|CD:Congo, The Democratic Republic Of|CK:Cook Islands|XE:Corsica|CR:Costa Rica|CI:Cote d` Ivoire (Ivory Coast)|HR:Croatia|CU:Cuba|CY:Cyprus|CZ:Czech Republic|DK:Denmark|DJ:Djibouti|DM:Dominica|DO:Dominican Republic|TP:East Timor|EC:Ecuador|EG:Egypt|SV:El Salvador|GQ:Equatorial Guinea|ER:Eritrea|EE:Estonia|ET:Ethiopia|FK:Falkland Islands (Malvinas)|FO:Faroe Islands|FJ:Fiji|FI:Finland|FR:France (Includes Monaco)|FX:France, Metropolitan|GF:French Guiana|PF:French Polynesia|TA:French Polynesia (Tahiti)|TF:French Southern Territories|GA:Gabon|GM:Gambia|GE:Georgia|DE:Germany|GH:Ghana|GI:Gibraltar|GR:Greece|GL:Greenland|GD:Grenada|GP:Guadeloupe|GU:Guam|GT:Guatemala|GN:Guinea|GW:Guinea-Bissau|GY:Guyana|HT:Haiti|HM:Heard And Mc Donald Islands|VA:Holy See (Vatican City State)|HN:Honduras|HK:Hong Kong|HU:Hungary|IS:Iceland|IN:India|ID:Indonesia|IR:Iran|IQ:Iraq|IE:Ireland|EI:Ireland (Eire)|IL:Israel|IT:Italy|JM:Jamaica|JP:Japan|JO:Jordan|KZ:Kazakhstan|KE:Kenya|KI:Kiribati|KP:Korea, Democratic People'S Repub|KW:Kuwait|KG:Kyrgyzstan|LA:Laos|LV:Latvia|LB:Lebanon|LS:Lesotho|LR:Liberia|LY:Libya|LI:Liechtenstein|LT:Lithuania|LU:Luxembourg|MO:Macao|MK:Macedonia|MG:Madagascar|ME:Madeira Islands|MW:Malawi|MY:Malaysia|MV:Maldives|ML:Mali|MT:Malta|MH:Marshall Islands|MQ:Martinique|MR:Mauritania|MU:Mauritius|YT:Mayotte|MX:Mexico|FM:Micronesia, Federated States Of|MD:Moldova, Republic Of|MC:Monaco|MN:Mongolia|MS:Montserrat|MA:Morocco|MZ:Mozambique|MM:Myanmar (Burma)|NA:Namibia|NR:Nauru|NP:Nepal|NL:Netherlands|AN:Netherlands Antilles|NC:New Caledonia|NZ:New Zealand|NI:Nicaragua|NE:Niger|NG:Nigeria|NU:Niue|NF:Norfolk Island|MP:Northern Mariana Islands|NO:Norway|OM:Oman|PK:Pakistan|PW:Palau|PS:Palestinian Territory|PA:Panama|PG:Papua New Guinea|PY:Paraguay|PE:Peru|PH:Philippines|PN:Pitcairn|PL:Poland|PT:Portugal|PR:Puerto Rico|QA:Qatar|RE:Reunion|RO:Romania|RU:Russian Federation|RW:Rwanda|KN:Saint Kitts And Nevis|SM:San Marino|ST:Sao Tome and Principe|SA:Saudi Arabia|SN:Senegal|XS:Serbia-Montenegro|SC:Seychelles|SL:Sierra Leone|SG:Singapore|SK:Slovak Republic|SI:Slovenia|SB:Solomon Islands|SO:Somalia|ZA:South Africa|GS:South Georgia And The South Sand|KR:South Korea|ES:Spain|LK:Sri Lanka|NV:St. Christopher and Nevis|SH:St. Helena|LC:St. Lucia|PM:St. Pierre and Miquelon|VC:St. Vincent and the Grenadines|SD:Sudan|SR:Suriname|SJ:Svalbard And Jan Mayen Islands|SZ:Swaziland|SE:Sweden|CH:Switzerland|SY:Syrian Arab Republic|TW:Taiwan|TJ:Tajikistan|TZ:Tanzania|TH:Thailand|TG:Togo|TK:Tokelau|TO:Tonga|TT:Trinidad and Tobago|XU:Tristan da Cunha|TN:Tunisia|TR:Turkey|TM:Turkmenistan|TC:Turks and Caicos Islands|TV:Tuvalu|UG:Uganda|UA:Ukraine|AE:United Arab Emirates|UK:United Kingdom|GB:Great Britain|US:United States|UM:United States Minor Outlying Islands|UY:Uruguay|UZ:Uzbekistan|VU:Vanuatu|XV:Vatican City|VE:Venezuela|VN:Vietnam|VI:Virgin Islands (U.S.)|WF:Wallis and Furuna Islands|EH:Western Sahara|WS:Western Samoa|YE:Yemen|YU:Yugoslavia|ZR:Zaire|ZM:Zambia|ZW:Zimbabwe";var countryFieldCfgArray=document.getElementById("cs_config_country_field").value.split(" ");var stateFieldCfgArray=document.getElementById("cs_config_state_field").value.split(" ");var countryDefaultCfgArray=document.getElementById("cs_config_country_default").value.split(" ");var stateDefaultCfgArray=document.getElementById("cs_config_state_default").value.split(" ");var defaultState=false;var defaultCountry=false;function TrimString(A){if(A){A=A.replace(/^\s+/g,"");return A.replace(/\s+$/g,"")}}function populateCountry(C){var A=country.split("|");var D=document.getElementById(C);D.options[0]=new Option("Select Country","");D.selectedIndex=0;for(var B=0;B<A.length;B++){lineArray=A[B].split(":");countryCode=TrimString(lineArray[0]);countryName=TrimString(lineArray[1]);if(countryCode!=""){D.options[B+1]=new Option(countryName,countryCode)}if(defaultCountry==countryCode){D.selectedIndex=B+1}}}function populateState(E,B){var G=document.getElementById(stateIdName);var C=false;if(G.type=="select-one"){G.options.length=0;G.options[0]=new Option("Select State","");G.selectedIndex=0}var D=state.split("|");var H=1;for(var F=0;F<D.length;F++){lineArray=D[F].split(":");countryCode=TrimString(lineArray[0]);stateCode=TrimString(lineArray[1]);stateName=TrimString(lineArray[2]);if(document.getElementById(B).value==countryCode&&countryCode!=""){if(G.type=="text"){parentObj=document.getElementById(stateIdName).parentNode;parentObj.removeChild(G);var A=document.createElement("SELECT");A.setAttribute("name","state");A.setAttribute("id",stateIdName);parentObj.appendChild(A);G=document.getElementById(stateIdName);G.options[0]=new Option("Select State","");G.selectedIndex=0}if(stateCode!=""){G.options[H]=new Option(stateName,stateCode)}if(stateCode==defaultState&&countryCode==defaultCountry){G.selectedIndex=H}C=true;H++}}if(!C){parentObj=document.getElementById(stateIdName).parentNode;parentObj.removeChild(G);var I=document.createElement("INPUT");I.setAttribute("id",stateIdName);I.setAttribute("type","text");I.setAttribute("name","state");I.setAttribute("size",20);I.setAttribute("value",defaultState);parentObj.appendChild(I)}}function updateState(B){for(var A=0;A<countryFieldCfgArray.length;A++){countryIdName=countryFieldCfgArray[A];stateIdName=stateFieldCfgArray[A];defaultCountry=document.getElementById(countryDefaultCfgArray[A]).value;defaultState=document.getElementById(stateDefaultCfgArray[A]).value;if(B==countryIdName){populateState(stateIdName,countryIdName)}}}function initCountry(){for(var A=0;A<countryFieldCfgArray.length;A++){countryIdName=countryFieldCfgArray[A];stateIdName=stateFieldCfgArray[A];defaultCountry=document.getElementById(countryDefaultCfgArray[A]).value;defaultState=document.getElementById(stateDefaultCfgArray[A]).value;populateCountry(countryIdName);populateState(stateIdName,countryIdName)}};