1function countryList(blnByLimitList) 2{ 3 var _self = this; //handles scope for contructor vars in function, ie this in function != this in constructor 4 this.aCountries = new Array(); 5 this.aDefaults = new Array(); 6 this.aLimitCountries = new Array(); 7 this.bByLimitList = blnByLimitList; 8 this.init = function() 9 { 10 _self.aDefaults['US'] = true; 11 _self.aCountries.push(new _self.country('AL', 'Albania')); 12 _self.aCountries.push(new _self.country('DZ', 'Algeria')); 13 _self.aCountries.push(new _self.country('AS', 'American Samoa')); 14 _self.aCountries.push(new _self.country('AD', 'Andorra')); 15 _self.aCountries.push(new _self.country('AO', 'Angola')); 16 _self.aCountries.push(new _self.country('AI', 'Anguilla')); 17 _self.aCountries.push(new _self.country('AG', 'Antigua & Barbuda')); 18 _self.aCountries.push(new _self.country('AR', 'Argentina')); 19 _self.aCountries.push(new _self.country('AM', 'Armenia')); 20 _self.aCountries.push(new _self.country('AW', 'Aruba')); 21 _self.aCountries.push(new _self.country('AU', 'Australia')); 22 _self.aCountries.push(new _self.country('AT', 'Austria')); 23 _self.aCountries.push(new _self.country('AP', 'Azores')); 24 _self.aCountries.push(new _self.country('BS', 'Bahamas')); 25 _self.aCountries.push(new _self.country('BH', 'Bahrain')); 26 _self.aCountries.push(new _self.country('BD', 'Bangladesh')); 27 _self.aCountries.push(new _self.country('BB', 'Barbados')); 28 _self.aCountries.push(new _self.country('BE', 'Belgium')); 29 _self.aCountries.push(new _self.country('BZ', 'Belize')); 30 _self.aCountries.push(new _self.country('BY', 'Belarus')); 31 _self.aCountries.push(new _self.country('BJ', 'Benin')); 32 _self.aCountries.push(new _self.country('BM', 'Bermuda')); 33 _self.aCountries.push(new _self.country('BT', 'Bhutan')); 34 _self.aCountries.push(new _self.country('BO', 'Bolivia')); 35 _self.aCountries.push(new _self.country('BL', 'Bonaire')); 36 _self.aCountries.push(new _self.country('BA', 'Bosnia')); 37 _self.aCountries.push(new _self.country('BW', 'Botswana')); 38 _self.aCountries.push(new _self.country('BR', 'Brazil')); 39 _self.aCountries.push(new _self.country('VG', 'British Virgin Islands')); 40 _self.aCountries.push(new _self.country('BN', 'Brunei')); 41 _self.aCountries.push(new _self.country('BG', 'Bulgaria')); 42 _self.aCountries.push(new _self.country('BF', 'Burkina Faso')); 43 _self.aCountries.push(new _self.country('BI', 'Burundi')); 44 _self.aCountries.push(new _self.country('KH', 'Cambodia')); 45 _self.aCountries.push(new _self.country('CM', 'Cameroon')); 46 _self.aCountries.push(new _self.country('CA', 'Canada')); 47 _self.aCountries.push(new _self.country('IC', 'Canary Islands')); 48 _self.aCountries.push(new _self.country('CV', 'Cape Verde Islands')); 49 _self.aCountries.push(new _self.country('KY', 'Cayman Islands')); 50 _self.aCountries.push(new _self.country('CF', 'Central African Republic')); 51 _self.aCountries.push(new _self.country('TD', 'Chad')); 52 _self.aCountries.push(new _self.country('CD', 'Channel Islands')); 53 _self.aCountries.push(new _self.country('CL', 'Chile')); 54 _self.aCountries.push(new _self.country('CN', 'China, Peoples Republic of')); 55 _self.aCountries.push(new _self.country('CO', 'Colombia')); 56 _self.aCountries.push(new _self.country('CG', 'Congo')); 57 _self.aCountries.push(new _self.country('CK', 'Cook Islands')); 58 _self.aCountries.push(new _self.country('CR', 'Costa Rica')); 59 _self.aCountries.push(new _self.country('HR', 'Croatia')); 60 _self.aCountries.push(new _self.country('CB', 'Curacao')); 61 _self.aCountries.push(new _self.country('CY', 'Cyprus')); 62 _self.aCountries.push(new _self.country('CZ', 'Czech Republic')); 63 _self.aCountries.push(new _self.country('DK', 'Denmark')); 64 _self.aCountries.push(new _self.country('DJ', 'Djibouti')); 65 _self.aCountries.push(new _self.country('DM', 'Dominica')); 66 _self.aCountries.push(new _self.country('DO', 'Dominican Republic')); 67 _self.aCountries.push(new _self.country('EC', 'Ecuador')); 68 _self.aCountries.push(new _self.country('EG', 'Egypt')); 69 _self.aCountries.push(new _self.country('SV', 'El Salvador')); 70 _self.aCountries.push(new _self.country('EN', 'England')); 71 _self.aCountries.push(new _self.country('GQ', 'Equitorial Guinea')); 72 _self.aCountries.push(new _self.country('ER', 'Eritrea')); 73 _self.aCountries.push(new _self.country('EE', 'Estonia')); 74 _self.aCountries.push(new _self.country('ET', 'Ethiopia')); 75 _self.aCountries.push(new _self.country('FO', 'Faeroe Islands')); 76 _self.aCountries.push(new _self.country('FM', 'Federated States of Micronesia')); 77 _self.aCountries.push(new _self.country('FJ', 'Fiji')); 78 _self.aCountries.push(new _self.country('FI', 'Finland')); 79 _self.aCountries.push(new _self.country('FR', 'France')); 80 _self.aCountries.push(new _self.country('GF', 'French Guiana')); 81 _self.aCountries.push(new _self.country('PF', 'French Polynesia')); 82 _self.aCountries.push(new _self.country('GA', 'Gabon')); 83 _self.aCountries.push(new _self.country('GM', 'Gambia')); 84 _self.aCountries.push(new _self.country('GE', 'Georgia, Republic of'));
85 _self.aCountries.push(new _self.country('GE', 'Georgia')); 86 _self.aCountries.push(new _self.country('DE', 'Germany')); 87 _self.aCountries.push(new _self.country('GH', 'Ghana')); 88 _self.aCountries.push(new _self.country('GI', 'Gibraltar')); 89 _self.aCountries.push(new _self.country('GR', 'Greece')); 90 _self.aCountries.push(new _self.country('GL', 'Greenland')); 91 _self.aCountries.push(new _self.country('GD', 'Grenada')); 92 _self.aCountries.push(new _self.country('GP', 'Guadeloupe')); 93 _self.aCountries.push(new _self.country('GU', 'Guam')); 94 _self.aCountries.push(new _self.country('GT', 'Guatemala')); 95 _self.aCountries.push(new _self.country('GN', 'Guinea')); 96 _self.aCountries.push(new _self.country('GW', 'Guinea-Bissau')); 97 _self.aCountries.push(new _self.country('GY', 'Guyana')); 98 _self.aCountries.push(new _self.country('HT', 'Haiti')); 99 _self.aCountries.push(new _self.country('HO', 'Holland')); 100 _self.aCountries.push(new _self.country('HN', 'Honduras')); 101 _self.aCountries.push(new _self.country('HK', 'Hong Kong')); 102 _self.aCountries.push(new _self.country('HU', 'Hungary')); 103 _self.aCountries.push(new _self.country('IS', 'Iceland')); 104 _self.aCountries.push(new _self.country('IN', 'India')); 105 _self.aCountries.push(new _self.country('ID', 'Indonesia')); 106 _self.aCountries.push(new _self.country('IQ', 'Iraq')); 107 _self.aCountries.push(new _self.country('IR', 'Iran')); 108 _self.aCountries.push(new _self.country('IL', 'Israel')); 109 _self.aCountries.push(new _self.country('IT', 'Italy')); 110 _self.aCountries.push(new _self.country('CI', 'Ivory Coast'));
111 _self.aCountries.push(new _self.country('JM', 'Jamaica')); 112 _self.aCountries.push(new _self.country('JP', 'Japan')); 113 _self.aCountries.push(new _self.country('JO', 'Jordan')); 114 _self.aCountries.push(new _self.country('KZ', 'Kazakhstan')); 115 _self.aCountries.push(new _self.country('KE', 'Kenya')); 116 _self.aCountries.push(new _self.country('KI', 'Kiribati')); 117 _self.aCountries.push(new _self.country('KO', 'Kosrae')); 118 _self.aCountries.push(new _self.country('KW', 'Kuwait')); 119 _self.aCountries.push(new _self.country('KG', 'Kyrgyzstan')); 120 _self.aCountries.push(new _self.country('LA', 'Laos')); 121 _self.aCountries.push(new _self.country('LV', 'Latvia')); 122 _self.aCountries.push(new _self.country('LB', 'Lebanon')); 123 _self.aCountries.push(new _self.country('LS', 'Lesotho')); 124 _self.aCountries.push(new _self.country('LR', 'Liberia')); 125 _self.aCountries.push(new _self.country('LY', 'Libya')); 126 _self.aCountries.push(new _self.country('LI', 'Liechtenstein')); 127 _self.aCountries.push(new _self.country('LT', 'Lithuania')); 128 _self.aCountries.push(new _self.country('LU', 'Luxembourg')); 129 _self.aCountries.push(new _self.country('MO', 'Macau')); 130 _self.aCountries.push(new _self.country('MK', 'Macedonia')); 131 _self.aCountries.push(new _self.country('MG', 'Madagascar')); 132 _self.aCountries.push(new _self.country('ME', 'Madeira')); 133 _self.aCountries.push(new _self.country('MW', 'Malawi')); 134 _self.aCountries.push(new _self.country('MY', 'Malaysia')); 135 _self.aCountries.push(new _self.country('MV', 'Maldives')); 136 _self.aCountries.push(new _self.country('ML', 'Mali')); 137 _self.aCountries.push(new _self.country('MT', 'Malta')); 138 _self.aCountries.push(new _self.country('MH', 'Marshall Islands')); 139 _self.aCountries.push(new _self.country('MQ', 'Martinique')); 140 _self.aCountries.push(new _self.country('MR', 'Mauritania')); 141 _self.aCountries.push(new _self.country('MU', 'Mauritius')); 142 _self.aCountries.push(new _self.country('MX', 'Mexico')); 143 _self.aCountries.push(new _self.country('MD', 'Moldova')); 144 _self.aCountries.push(new _self.country('MC', 'Monaco')); 145 _self.aCountries.push(new _self.country('MC', 'Monogolia')); 146 _self.aCountries.push(new _self.country('MS', 'Montserrat')); 147 _self.aCountries.push(new _self.country('MA', 'Morocco')); 148 _self.aCountries.push(new _self.country('MZ', 'Mozambique')); 149 _self.aCountries.push(new _self.country('MM', 'Myanmar')); 150 _self.aCountries.push(new _self.country('NA', 'Namibia')); 151 _self.aCountries.push(new _self.country('NR', 'Nauru')); 152 _self.aCountries.push(new _self.country('NP', 'Nepal')); 153 _self.aCountries.push(new _self.country('NL', 'Netherlands')); 154 _self.aCountries.push(new _self.country('AN', 'Netherlands Antilles')); 155 _self.aCountries.push(new _self.country('NC', 'New Caledonia')); 156 _self.aCountries.push(new _self.country('NZ', 'New Zealand')); 157 _self.aCountries.push(new _self.country('NI', 'Nicaragua')); 158 _self.aCountries.push(new _self.country('NE', 'Niger')); 159 _self.aCountries.push(new _self.country('NG', 'Nigeria')); 160 _self.aCountries.push(new _self.country('NF', 'Norfolk Island')); 161 _self.aCountries.push(new _self.country('NB', 'Northern Ireland')); 162 _self.aCountries.push(new _self.country('NB', 'Northern Mariana Islands')); 163 _self.aCountries.push(new _self.country('NO', 'Norway')); 164 _self.aCountries.push(new _self.country('OM', 'Oman')); 165 _self.aCountries.push(new _self.country('PK', 'Pakistan')); 166 _self.aCountries.push(new _self.country('PW', 'Palau')); 167 _self.aCountries.push(new _self.country('PA', 'Panama')); 168 _self.aCountries.push(new _self.country('PG', 'Papua New Guinea')); 169 _self.aCountries.push(new _self.country('PY', 'Paraguay')); 170 _self.aCountries.push(new _self.country('PE', 'Peru')); 171 _self.aCountries.push(new _self.country('PH', 'Philippines')); 172 _self.aCountries.push(new _self.country('PN', 'Pitcairn Island')); 173 _self.aCountries.push(new _self.country('PL', 'Poland')); 174 _self.aCountries.push(new _self.country('PO', 'Ponape')); 175 _self.aCountries.push(new _self.country('PO', 'Portugal')); 176 _self.aCountries.push(new _self.country('PR', 'Puerto Rico')); 177 _self.aCountries.push(new _self.country('PR', 'Qatar')); 178 _self.aCountries.push(new _self.country('IE', 'Republic of Ireland')); 179 _self.aCountries.push(new _self.country('YE', 'Republic of Yemen')); 180 _self.aCountries.push(new _self.country('RE', 'Reunion')); 181 _self.aCountries.push(new _self.country('RO', 'Romania')); 182 _self.aCountries.push(new _self.country('RT', 'Rota')); 183 _self.aCountries.push(new _self.country('RU', 'Russia')); 184 _self.aCountries.push(new _self.country('RW', 'Rwanda')); 185 _self.aCountries.push(new _self.country('RW', 'Saba')); 186 _self.aCountries.push(new _self.country('SP', 'Saipan')); 187 _self.aCountries.push(new _self.country('SM', 'San Marino')); 188 _self.aCountries.push(new _self.country('ST', 'Sao Tome and Principe')); 189 _self.aCountries.push(new _self.country('SA', 'Saudi Arabia')); 190 _self.aCountries.push(new _self.country('SF', 'Scotland')); 191 _self.aCountries.push(new _self.country('SN', 'Senegal')); 192 _self.aCountries.push(new _self.country('SC', 'Seychelles')); 193 _self.aCountries.push(new _self.country('SC', 'Sierra Leone')); 194 _self.aCountries.push(new _self.country('SG', 'Singapore'));
195 _self.aCountries.push(new _self.country('SK', 'Slovakia')); 196 _self.aCountries.push(new _self.country('SI', 'Slovenia')); 197 _self.aCountries.push(new _self.country('SB', 'Solomon Islands')); 198 _self.aCountries.push(new _self.country('ZA', 'South Africa')); 199 _self.aCountries.push(new _self.country('KR', 'South Korea')); 200 _self.aCountries.push(new _self.country('ES', 'Spain')); 201 _self.aCountries.push(new _self.country('LK', 'Sri Lanka')); 202 _self.aCountries.push(new _self.country('NT', 'St. Barthelemy')); 203 _self.aCountries.push(new _self.country('SW', 'St. Christopher')); 204 _self.aCountries.push(new _self.country('SX', 'St. Croix')); 205 _self.aCountries.push(new _self.country('EU', 'St. Eustatius')); 206 _self.aCountries.push(new _self.country('UV', 'St. John')); 207 _self.aCountries.push(new _self.country('KN', 'St. Kitts & Nevis')); 208 _self.aCountries.push(new _self.country('LC', 'St. Lucia')); 209 _self.aCountries.push(new _self.country('MB', 'St. Maarten')); 210 _self.aCountries.push(new _self.country('TB', 'St. Martin')); 211 _self.aCountries.push(new _self.country('VL', 'St. Thomas')); 212 _self.aCountries.push(new _self.country('VC', 'St. Vincent & the Grenadines')); 213 _self.aCountries.push(new _self.country('SD', 'Sudan')); 214 _self.aCountries.push(new _self.country('SR', 'Suriname')); 215 _self.aCountries.push(new _self.country('SZ', 'Swaziland')); 216 _self.aCountries.push(new _self.country('SE', 'Sweden')); 217 _self.aCountries.push(new _self.country('CH', 'Switzerland')); 218 _self.aCountries.push(new _self.country('SY', 'Syria')); 219 _self.aCountries.push(new _self.country('TA', 'Tahiti')); 220 _self.aCountries.push(new _self.country('TW', 'Taiwan')); 221 _self.aCountries.push(new _self.country('TJ', 'Tajikistan')); 222 _self.aCountries.push(new _self.country('TZ', 'Tanzania')); 223 _self.aCountries.push(new _self.country('TH', 'Thailand')); 224 _self.aCountries.push(new _self.country('TI', 'Tinian')); 225 _self.aCountries.push(new _self.country('TG', 'Togo')); 226 _self.aCountries.push(new _self.country('TO', 'Tonga')); 227 _self.aCountries.push(new _self.country('TL', 'Tortola')); 228 _self.aCountries.push(new _self.country('TT', 'Trinidad & Tobago')); 229 _self.aCountries.push(new _self.country('TU', 'Truk')); 230 _self.aCountries.push(new _self.country('TN', 'Tunisia')); 231 _self.aCountries.push(new _self.country('TR', 'Turkey')); 232 _self.aCountries.push(new _self.country('TM', 'Turkmenistan')); 233 _self.aCountries.push(new _self.country('TC', 'Turks & Caicos Islands')); 234 _self.aCountries.push(new _self.country('TV', 'Tuvalu')); 235 _self.aCountries.push(new _self.country('UG', 'Uganda')); 236 _self.aCountries.push(new _self.country('UA', 'Ukraine')); 237 _self.aCountries.push(new _self.country('VC', 'Union Island')); 238 _self.aCountries.push(new _self.country('AE', 'United Arab Emirates')); 239 _self.aCountries.push(new _self.country('GB', 'United Kingdom')); 240 _self.aCountries.push(new _self.country('US', 'United States')); 241 _self.aCountries.push(new _self.country('UY', 'Uruguay')); 242 _self.aCountries.push(new _self.country('VI', 'US Virgin Islands')); 243 _self.aCountries.push(new _self.country('UZ', 'Uzbekistan')); 244 _self.aCountries.push(new _self.country('VU', 'Vanuatu')); 245 _self.aCountries.push(new _self.country('VA', 'Vatican City')); 246 _self.aCountries.push(new _self.country('VE', 'Venezuela')); 247 _self.aCountries.push(new _self.country('VN', 'Vietnam')); 248 _self.aCountries.push(new _self.country('VR', 'Virgin Gorda')); 249 _self.aCountries.push(new _self.country('WK', 'Wake Island')); 250 _self.aCountries.push(new _self.country('WL', 'Wales')); 251 _self.aCountries.push(new _self.country('WF', 'Wallis & Futuna Islands')); 252 _self.aCountries.push(new _self.country('WS', 'Western Samoa')); 253 _self.aCountries.push(new _self.country('YA', 'Yap')); 254 _self.aCountries.push(new _self.country('YU', 'Yugoslavia')); 255 _self.aCountries.push(new _self.country('ZR', 'Zaire')); 256 _self.aCountries.push(new _self.country('ZM', 'Zambia')); 257 _self.aCountries.push(new _self.country('ZW', 'Zimbabwe')); 258 }; 259 this.country = function(sCountryCode, sDisplayValue) 260 { 261 this.ctryCode = sCountryCode; 262 this.displayValue = sDisplayValue; 263 }; 264 this.setdefaultSel = function(sCountry) 265 { 266 _self.defaultSel = sCountry; 267 }; 268 this.addSelectCountry = function(sSelectedCountry) 269 { 270 if(!_self.aDefaults[sSelectedCountry]) _self.aDefaults[sSelectedCountry] = true; 271 }; 272 this.removeSelectCountry = function(sSelectedCountry) 273 { 274 if(_self.aDefaults[sSelectedCountry]) _self.aDefaults[sSelectedCountry] = false; 275 }; 276 this.returnCntrySel = function(sTagName, iSize, bMultiple, sInitialOpt) 277 { 278 var aHTML = new Array(); 279 if(!arguments[1]) iSize = 1; 280 var sMultiple = (arguments[2])?' size="' + iSize + '" multiple="multiple"':''; 281 aHTML.push('<select name="' + sTagName + '" id="' + sTagName + '"' + sMultiple + '><option value="">' + ((sInitialOpt != null)?'All Countries':'Select a Country') + '</option>'); 282 for(var i=0; i < _self.aCountries.length; i++) 283 { 284 if( !_self.bByLimitList || (_self.aLimitCountries[_self.aCountries[i].ctryCode] && _self.bByLimitList) ) 285 { 286 var sSelect = (_self.aDefaults[this.aCountries[i].ctryCode])?' selected="selected"':''; 287 aHTML.push('<option value="' + _self.aCountries[i].ctryCode + '"' + sSelect + '>' + _self.aCountries[i].displayValue + '</option>'); 288 } 289 } 290 aHTML.push('</select>'); 291 return aHTML.join(''); 292 }; 293 this.returnCountryName = function(sCode) 294 { 295 for(var i=0; i<_self.aCountries.length; i++) 296 if(sCode.toUpperCase() == _self.aCountries[i].code.toUpperCase()) 297 return _self.aCountries[i].displayValue; 298 return ''; 299 }; 300 this.returnLimitedCountries = function() 301 { 302 var aCountries = new Array();
303 var bIsLimited = false; 304 for(var i=0; i<_self.aCountries.length; i++) 305 { 306 if(_self.aDefaults[_self.aCountries[i].ctryCode]) 307 { 308 aCountries.push(_self.aCountries[i].displayValue) 309 bIsLimited = true; 310 } 311 } 312 return (!bIsLimited)?'You currently allow shipments to all countries':'You currently limit shipments to:<br /><span style="padding-left: 15px;">' + aCountries.join(', ') + '</span>'; 313 }; 314 this.returnUserLimitedCountries = function() 315 { 316 var aCountries = new Array(); 317 var bIsLimited = false; 318 for(var i=0; i<_self.aCountries.length; i++) 319 { 320 if(_self.aLimitCountries[_self.aCountries[i].ctryCode]) 321 { 322 aCountries.push(_self.aCountries[i].displayValue) 323 bIsLimited = true; 324 } 325 } 326 return (!bIsLimited)?'':'<br />Shipments are limited to the following:<br /><span style="padding-left: 15px;">' + aCountries.join(', ') + '</span>'; 327 }; 328 this.addLimitCountry = function(sSelectedCountry) 329 { 330 if(!_self.aLimitCountries[sSelectedCountry]) _self.aLimitCountries[sSelectedCountry] = true; 331 } 332} 333var oCountryList = new countryList(false) 334oCountryList.init();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.