All pastes #927975 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-04 18:10 UTC
rendered paste body
var el = $$('input');

		
			var tokens = [['Afghanistan', 'Af'], ['Åland Islands', 'Ax'], ['Albania', 'Al'], ['Algeria', 'Dz'], ['American Samoa', 'As'], ['Andorra', 'Ad'], ['Angola', 'Ao'], ['Anguilla', 'Ai'], ['Antarctica', 'Aq'], ['Antigua And Barbuda', 'Ag'], ['Argentina', 'Ar'], ['Armenia', 'Am'], ['Aruba', 'Aw'], ['Australia', 'Au'], ['Austria', 'At'], ['Azerbaijan', 'Az'], ['Bahamas', 'Bs'], ['Bahrain', 'Bh'], ['Bangladesh', 'Bd'], ['Barbados', 'Bb'], ['Belarus', 'By'], ['Belgium', 'Be'], ['Belize', 'Bz'], ['Benin', 'Bj'], ['Bermuda', 'Bm'], ['Bhutan', 'Bt'], ['Bolivia', 'Bo'], ['Bosnia And Herzegovina', 'Ba'], ['Botswana', 'Bw'], ['Bouvet Island', 'Bv'], ['Brazil', 'Br'], ['British Indian Ocean Territory', 'Io'], ['Brunei Darussalam', 'Bn'], ['Bulgaria', 'Bg'], ['Burkina Faso', 'Bf'], ['Burundi', 'Bi'], ['Cambodia', 'Kh'], ['Cameroon', 'Cm'], ['Canada', 'Ca'], ['Cape Verde', 'Cv'], ['Cayman Islands', 'Ky'], ['Central African Republic', 'Cf'], ['Chad', 'Td'], ['Chile', 'Cl'], ['China', 'Cn'], ['Christmas Island', 'Cx'], ['Cocos (Keeling) Islands', 'Cc'], ['Colombia', 'Co'], ['Comoros', 'Km'], ['Congo', 'Cg'], ['Congo, The Democratic Republic Of The', 'Cd'], ['Cook Islands', 'Ck'], ['Costa Rica', 'Cr'], ['Cote D\'ivoire', 'Ci'], ['Croatia', 'Hr'], ['Cuba', 'Cu'], ['Cyprus', 'Cy'], ['Czech Republic', 'Cz'], ['Denmark', 'Dk'], ['Djibouti', 'Dj'], ['Dominica', 'Dm'], ['Dominican Republic', 'Do'], ['Ecuador', 'Ec'], ['Egypt', 'Eg'], ['El Salvador', 'Sv'], ['Equatorial Guinea', 'Gq'], ['Eritrea', 'Er'], ['Estonia', 'Ee'], ['Ethiopia', 'Et'], ['Falkland Islands (Malvinas)', 'Fk'], ['Faroe Islands', 'Fo'], ['Fiji', 'Fj'], ['Finland', 'Fi'], ['France', 'Fr'], ['French Guiana', 'Gf'], ['French Polynesia', 'Pf'], ['French Southern Territories', 'Tf'], ['Gabon', 'Ga'], ['Gambia', 'Gm'], ['Georgia', 'Ge'], ['Germany', 'De'], ['Ghana', 'Gh'], ['Gibraltar', 'Gi'], ['Greece', 'Gr'], ['Greenland', 'Gl'], ['Grenada', 'Gd'], ['Guadeloupe', 'Gp'], ['Guam', 'Gu'], ['Guatemala', 'Gt'], ['Guernsey', 'Gg'], ['Guinea', 'Gn'], ['Guinea-Bissau', 'Gw'], ['Guyana', 'Gy'], ['Haiti', 'Ht'], ['Heard Island And Mcdonald Islands', 'Hm'], ['Holy See (Vatican City State)', 'Va'], ['Honduras', 'Hn'], ['Hong Kong', 'Hk'], ['Hungary', 'Hu'], ['Iceland', 'Is'], ['India', 'In'], ['Indonesia', 'Id'], ['Iran, Islamic Republic Of', 'Ir'], ['Iraq', 'Iq'], ['Ireland', 'Ie'], ['Isle Of Man', 'Im'], ['Israel', 'Il'], ['Italy', 'It'], ['Jamaica', 'Jm'], ['Japan', 'Jp'], ['Jersey', 'Je'], ['Jordan', 'Jo'], ['Kazakhstan', 'Kz'], ['Kenya', 'Ke'], ['Kiribati', 'Ki'], ['Korea, Democratic People\'s Republic Of', 'Kp'], ['Korea, Republic Of', 'Kr'], ['Kuwait', 'Kw'], ['Kyrgyzstan', 'Kg'], ['Lao People\'s Democratic Republic', 'La'], ['Latvia', 'Lv'], ['Lebanon', 'Lb'], ['Lesotho', 'Ls'], ['Liberia', 'Lr'], ['Libyan Arab Jamahiriya', 'Ly'], ['Liechtenstein', 'Li'], ['Lithuania', 'Lt'], ['Luxembourg', 'Lu'], ['Macao', 'Mo'], ['Macedonia, The Former Yugoslav Republic Of', 'Mk'], ['Madagascar', 'Mg'], ['Malawi', 'Mw'], ['Malaysia', 'My'], ['Maldives', 'Mv'], ['Mali', 'Ml'], ['Malta', 'Mt'], ['Marshall Islands', 'Mh'], ['Martinique', 'Mq'], ['Mauritania', 'Mr'], ['Mauritius', 'Mu'], ['Mayotte', 'Yt'], ['Mexico', 'Mx'], ['Micronesia, Federated States Of', 'Fm'], ['Moldova, Republic Of', 'Md'], ['Monaco', 'Mc'], ['Mongolia', 'Mn'], ['Montenegro', 'Me'], ['Montserrat', 'Ms'], ['Morocco', 'Ma'], ['Mozambique', 'Mz'], ['Myanmar', 'Mm'], ['Namibia', 'Na'], ['Nauru', 'Nr'], ['Nepal', 'Np'], ['Netherlands', 'Nl'], ['Netherlands Antilles', 'An'], ['New Caledonia', 'Nc'], ['New Zealand', 'Nz'], ['Nicaragua', 'Ni'], ['Niger', 'Ne'], ['Nigeria', 'Ng'], ['Niue', 'Nu'], ['Norfolk Island', 'Nf'], ['Northern Mariana Islands', 'Mp'], ['Norway', 'No'], ['Oman', 'Om'], ['Pakistan', 'Pk'], ['Palau', 'Pw'], ['Palestinian Territory, Occupied', 'Ps'], ['Panama', 'Pa'], ['Papua New Guinea', 'Pg'], ['Paraguay', 'Py'], ['Peru', 'Pe'], ['Philippines', 'Ph'], ['Pitcairn', 'Pn'], ['Poland', 'Pl'], ['Portugal', 'Pt'], ['Puerto Rico', 'Pr'], ['Qatar', 'Qa'], ['Reunion', 'Re'], ['Romania', 'Ro'], ['Russian Federation', 'Ru'], ['Rwanda', 'Rw'], ['Saint Helena', 'Sh'], ['Saint Kitts And Nevis', 'Kn'], ['Saint Lucia', 'Lc'], ['Saint Pierre And Miquelon', 'Pm'], ['Saint Vincent And The Grenadines', 'Vc'], ['Samoa', 'Ws'], ['San Marino', 'Sm'], ['Sao Tome And Principe', 'St'], ['Saudi Arabia', 'Sa'], ['Senegal', 'Sn'], ['Serbia', 'Rs'], ['Seychelles', 'Sc'], ['Sierra Leone', 'Sl'], ['Singapore', 'Sg'], ['Slovakia', 'Sk'], ['Slovenia', 'Si'], ['Solomon Islands', 'Sb'], ['Somalia', 'So'], ['South Africa', 'Za'], ['South Georgia And The South Sandwich Islands', 'Gs'], ['Spain', 'Es'], ['Sri Lanka', 'Lk'], ['Sudan', 'Sd'], ['Suriname', 'Sr'], ['Svalbard And Jan Mayen', 'Sj'], ['Swaziland', 'Sz'], ['Sweden', 'Se'], ['Switzerland', 'Ch'], ['Syrian Arab Republic', 'Sy'], ['Taiwan, Province Of China', 'Tw'], ['Tajikistan', 'Tj'], ['Tanzania, United Republic Of', 'Tz'], ['Thailand', 'Th'], ['Timor-Leste', 'Tl'], ['Togo', 'Tg'], ['Tokelau', 'Tk'], ['Tonga', 'To'], ['Trinidad And Tobago', 'Tt'], ['Tunisia', 'Tn'], ['Turkey', 'Tr'], ['Turkmenistan', 'Tm'], ['Turks And Caicos Islands', 'Tc'], ['Tuvalu', 'Tv'], ['Uganda', 'Ug'], ['Ukraine', 'Ua'], ['United Arab Emirates', 'Ae'], ['United Kingdom', 'Gb'], ['United States', 'Us'], ['United States Minor Outlying Islands', 'Um'], ['Uruguay', 'Uy'], ['Uzbekistan', 'Uz'], ['Vanuatu', 'Vu'], ['Venezuela', 'Ve'], ['Viet Nam', 'Vn'], ['Virgin Islands, British', 'Vg'], ['Virgin Islands, U.S.', 'Vi'], ['Wallis And Futuna', 'Wf'], ['Western Sahara', 'Eh'], ['Yemen', 'Ye'], ['Zambia', 'Zm'], ['Zimbabwe', 'Zw']]

			var tokens2 = tokens.map(function(item) {
				return item[0];
			});



			new Autocompleter.Local(el[1], tokens2, {
				'selectMode': 'type-ahead',
				'forceSelect': true,
				'overflow': true
			});