﻿/// <reference path="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js" />
/// <reference path="http://extjs.cachefly.net/ext-3.3.1/ext-all.js" />
/// <reference path="locale.js" />


var CountryValues = [
    { CountryCode: '', Country: 'Select Country' },
    { CountryCode: 'AF', Country: 'Afghanistan' },
    { CountryCode: 'AL', Country: 'Albania' },
    { CountryCode: 'DZ', Country: 'Algeria' },
    { CountryCode: 'AS', Country: 'American Samoa' },
    { CountryCode: 'AD', Country: 'Andorra' },
    { CountryCode: 'AO', Country: 'Angola' },
    { CountryCode: 'AI', Country: 'Anguilla' },
    { CountryCode: 'AQ', Country: 'Antarctica' },
    { CountryCode: 'AG', Country: 'Antigua And Barbuda' },
    { CountryCode: 'AR', Country: 'Argentina' },
    { CountryCode: 'AM', Country: 'Armenia' },
    { CountryCode: 'AW', Country: 'Aruba' },
    { CountryCode: 'AU', Country: 'Australia' },
    { CountryCode: 'AT', Country: 'Austria' },
    { CountryCode: 'AZ', Country: 'Azerbaijan' },
    { CountryCode: 'BS', Country: 'Bahamas' },
    { CountryCode: 'BH', Country: 'Bahrain' },
    { CountryCode: 'BD', Country: 'Bangladesh' },
    { CountryCode: 'BB', Country: 'Barbados' },
    { CountryCode: 'BY', Country: 'Belarus' },
    { CountryCode: 'BE', Country: 'Belgium' },
    { CountryCode: 'BZ', Country: 'Belize' },
    { CountryCode: 'BJ', Country: 'Benin' },
    { CountryCode: 'BM', Country: 'Bermuda' },
    { CountryCode: 'BT', Country: 'Bhutan' },
    { CountryCode: 'BO', Country: 'Bolivia' },
    { CountryCode: 'BA', Country: 'Bosnia And Herzegowina' },
    { CountryCode: 'BW', Country: 'Botswana' },
    { CountryCode: 'BV', Country: 'Bouvet Island' },
    { CountryCode: 'BR', Country: 'Brazil' },
    { CountryCode: 'IO', Country: 'British Indian Ocean Territory' },
    { CountryCode: 'BN', Country: 'Brunei Darussalam' },
    { CountryCode: 'BG', Country: 'Bulgaria' },
    { CountryCode: 'BF', Country: 'Burkina Faso' },
    { CountryCode: 'BI', Country: 'Burundi' },
    { CountryCode: 'KH', Country: 'Cambodia' },
    { CountryCode: 'CM', Country: 'Cameroon' },
    { CountryCode: 'CA', Country: 'Canada' },
    { CountryCode: 'CV', Country: 'Cape Verde' },
    { CountryCode: 'KY', Country: 'Cayman Islands' },
    { CountryCode: 'CF', Country: 'Central African Republic' },
    { CountryCode: 'TD', Country: 'Chad' },
    { CountryCode: 'CL', Country: 'Chile' },
    { CountryCode: 'CN', Country: 'China' },
    { CountryCode: 'CX', Country: 'Christmas Island' },
    { CountryCode: 'CC', Country: 'Cocos (Keeling) Islands' },
    { CountryCode: 'CO', Country: 'Colombia' },
    { CountryCode: 'KM', Country: 'Comoros' },
    { CountryCode: 'CG', Country: 'Congo' },
    { CountryCode: 'CK', Country: 'Cook Islands' },
    { CountryCode: 'CR', Country: 'Costa Rica' },
    { CountryCode: 'CI', Country: 'Cote D\'Ivoire' },
    { CountryCode: 'HR', Country: 'Croatia (Local Name: Hrvatska)' },
    { CountryCode: 'CU', Country: 'Cuba' },
    { CountryCode: 'CY', Country: 'Cyprus' },
    { CountryCode: 'CZ', Country: 'Czech Republic' },
    { CountryCode: 'DK', Country: 'Denmark' },
    { CountryCode: 'DJ', Country: 'Djibouti' },
    { CountryCode: 'DM', Country: 'Dominica' },
    { CountryCode: 'DO', Country: 'Dominican Republic' },
    { CountryCode: 'TP', Country: 'East Timor' },
    { CountryCode: 'EC', Country: 'Ecuador' },
    { CountryCode: 'EG', Country: 'Egypt' },
    { CountryCode: 'SV', Country: 'El Salvador' },
    { CountryCode: 'GQ', Country: 'Equatorial Guinea' },
    { CountryCode: 'ER', Country: 'Eritrea' },
    { CountryCode: 'EE', Country: 'Estonia' },
    { CountryCode: 'ET', Country: 'Ethiopia' },
    { CountryCode: 'FK', Country: 'Falkland Islands (Malvinas)' },
    { CountryCode: 'FO', Country: 'Faroe Islands' },
    { CountryCode: 'FJ', Country: 'Fiji' },
    { CountryCode: 'FI', Country: 'Finland' },
    { CountryCode: 'FR', Country: 'France' },
    { CountryCode: 'GF', Country: 'French Guiana' },
    { CountryCode: 'PF', Country: 'French Polynesia' },
    { CountryCode: 'TF', Country: 'French Southern Territories' },
    { CountryCode: 'GA', Country: 'Gabon' },
    { CountryCode: 'GM', Country: 'Gambia' },
    { CountryCode: 'GE', Country: 'Georgia' },
    { CountryCode: 'DE', Country: 'Germany' },
    { CountryCode: 'GH', Country: 'Ghana' },
    { CountryCode: 'GI', Country: 'Gibraltar' },
    { CountryCode: 'GR', Country: 'Greece' },
    { CountryCode: 'GL', Country: 'Greenland' },
    { CountryCode: 'GD', Country: 'Grenada' },
    { CountryCode: 'GP', Country: 'Guadeloupe' },
    { CountryCode: 'GU', Country: 'Guam' },
    { CountryCode: 'GT', Country: 'Guatemala' },
    { CountryCode: 'GN', Country: 'Guinea' },
    { CountryCode: 'GW', Country: 'Guinea-Bissau' },
    { CountryCode: 'GY', Country: 'Guyana' },
    { CountryCode: 'HT', Country: 'Haiti' },
    { CountryCode: 'HM', Country: 'Heard And Mc Donald Islands' },
    { CountryCode: 'VA', Country: 'Holy See (Vatican City State)' },
    { CountryCode: 'HN', Country: 'Honduras' },
    { CountryCode: 'HK', Country: 'Hong Kong' },
    { CountryCode: 'HU', Country: 'Hungary' },
    { CountryCode: 'IS', Country: 'Iceland' },
    { CountryCode: 'IN', Country: 'India' },
    { CountryCode: 'ID', Country: 'Indonesia' },
    { CountryCode: 'IR', Country: 'Iran (Islamic Republic Of)' },
    { CountryCode: 'IQ', Country: 'Iraq' },
    { CountryCode: 'IE', Country: 'Ireland' },
    { CountryCode: 'IL', Country: 'Israel' },
    { CountryCode: 'IT', Country: 'Italy' },
    { CountryCode: 'JM', Country: 'Jamaica' },
    { CountryCode: 'JP', Country: 'Japan' },
    { CountryCode: 'JO', Country: 'Jordan' },
    { CountryCode: 'KZ', Country: 'Kazakhstan' },
    { CountryCode: 'KE', Country: 'Kenya' },
    { CountryCode: 'KI', Country: 'Kiribati' },
    { CountryCode: 'KP', Country: 'Korea, Dem People\'S Republic' },
    { CountryCode: 'KR', Country: 'Korea, Republic Of' },
    { CountryCode: 'KW', Country: 'Kuwait' },
    { CountryCode: 'KG', Country: 'Kyrgyzstan' },
    { CountryCode: 'LA', Country: 'Lao People\'S Dem Republic' },
    { CountryCode: 'LV', Country: 'Latvia' },
    { CountryCode: 'LB', Country: 'Lebanon' },
    { CountryCode: 'LS', Country: 'Lesotho' },
    { CountryCode: 'LR', Country: 'Liberia' },
    { CountryCode: 'LY', Country: 'Libyan Arab Jamahiriya' },
    { CountryCode: 'LI', Country: 'Liechtenstein' },
    { CountryCode: 'LT', Country: 'Lithuania' },
    { CountryCode: 'LU', Country: 'Luxembourg' },
    { CountryCode: 'MO', Country: 'Macau' },
    { CountryCode: 'MK', Country: 'Macedonia' },
    { CountryCode: 'MG', Country: 'Madagascar' },
    { CountryCode: 'MW', Country: 'Malawi' },
    { CountryCode: 'MY', Country: 'Malaysia' },
    { CountryCode: 'MV', Country: 'Maldives' },
    { CountryCode: 'ML', Country: 'Mali' },
    { CountryCode: 'MT', Country: 'Malta' },
    { CountryCode: 'MH', Country: 'Marshall Islands' },
    { CountryCode: 'MQ', Country: 'Martinique' },
    { CountryCode: 'MR', Country: 'Mauritania' },
    { CountryCode: 'MU', Country: 'Mauritius' },
    { CountryCode: 'YT', Country: 'Mayotte' },
    { CountryCode: 'MX', Country: 'Mexico' },
    { CountryCode: 'FM', Country: 'Micronesia, Federated States' },
    { CountryCode: 'MD', Country: 'Moldova, Republic Of' },
    { CountryCode: 'MC', Country: 'Monaco' },
    { CountryCode: 'MN', Country: 'Mongolia' },
    { CountryCode: 'MS', Country: 'Montserrat' },
    { CountryCode: 'MA', Country: 'Morocco' },
    { CountryCode: 'MZ', Country: 'Mozambique' },
    { CountryCode: 'MM', Country: 'Myanmar' },
    { CountryCode: 'NA', Country: 'Namibia' },
    { CountryCode: 'NR', Country: 'Nauru' },
    { CountryCode: 'NP', Country: 'Nepal' },
    { CountryCode: 'NL', Country: 'Netherlands' },
    { CountryCode: 'AN', Country: 'Netherlands Ant Illes' },
    { CountryCode: 'NC', Country: 'New Caledonia' },
    { CountryCode: 'NZ', Country: 'New Zealand' },
    { CountryCode: 'NI', Country: 'Nicaragua' },
    { CountryCode: 'NE', Country: 'Niger' },
    { CountryCode: 'NG', Country: 'Nigeria' },
    { CountryCode: 'NU', Country: 'Niue' },
    { CountryCode: 'NF', Country: 'Norfolk Island' },
    { CountryCode: 'MP', Country: 'Northern Mariana Islands' },
    { CountryCode: 'NO', Country: 'Norway' },
    { CountryCode: 'OM', Country: 'Oman' },
    { CountryCode: 'PK', Country: 'Pakistan' },
    { CountryCode: 'PW', Country: 'Palau' },
    { CountryCode: 'PA', Country: 'Panama' },
    { CountryCode: 'PG', Country: 'Papua New Guinea' },
    { CountryCode: 'PY', Country: 'Paraguay' },
    { CountryCode: 'PE', Country: 'Peru' },
    { CountryCode: 'PH', Country: 'Philippines' },
    { CountryCode: 'PN', Country: 'Pitcairn' },
    { CountryCode: 'PL', Country: 'Poland' },
    { CountryCode: 'PT', Country: 'Portugal' },
    { CountryCode: 'PR', Country: 'Puerto Rico' },
    { CountryCode: 'QA', Country: 'Qatar' },
    { CountryCode: 'RE', Country: 'Reunion' },
    { CountryCode: 'RO', Country: 'Romania' },
    { CountryCode: 'RU', Country: 'Russian Federation' },
    { CountryCode: 'RW', Country: 'Rwanda' },
    { CountryCode: 'KN', Country: 'Saint Kitts And Nevis' },
    { CountryCode: 'LC', Country: 'Saint Lucia' },
    { CountryCode: 'VC', Country: 'Saint Vincent, The Grenadines' },
    { CountryCode: 'WS', Country: 'Samoa' },
    { CountryCode: 'SM', Country: 'San Marino' },
    { CountryCode: 'ST', Country: 'Sao Tome And Principe' },
    { CountryCode: 'SA', Country: 'Saudi Arabia' },
    { CountryCode: 'SN', Country: 'Senegal' },
    { CountryCode: 'SC', Country: 'Seychelles' },
    { CountryCode: 'SL', Country: 'Sierra Leone' },
    { CountryCode: 'SG', Country: 'Singapore' },
    { CountryCode: 'SK', Country: 'Slovakia (Slovak Republic)' },
    { CountryCode: 'SI', Country: 'Slovenia' },
    { CountryCode: 'SB', Country: 'Solomon Islands' },
    { CountryCode: 'SO', Country: 'Somalia' },
    { CountryCode: 'ZA', Country: 'South Africa' },
    { CountryCode: 'GS', Country: 'South Georgia , S Sandwich Is.' },
    { CountryCode: 'ES', Country: 'Spain' },
    { CountryCode: 'LK', Country: 'Sri Lanka' },
    { CountryCode: 'SH', Country: 'St. Helena' },
    { CountryCode: 'PM', Country: 'St. Pierre And Miquelon' },
    { CountryCode: 'SD', Country: 'Sudan' },
    { CountryCode: 'SR', Country: 'Suriname' },
    { CountryCode: 'SJ', Country: 'Svalbard, Jan Mayen Islands' },
    { CountryCode: 'SZ', Country: 'Swaziland' },
    { CountryCode: 'SE', Country: 'Sweden' },
    { CountryCode: 'CH', Country: 'Switzerland' },
    { CountryCode: 'SY', Country: 'Syrian Arab Republic' },
    { CountryCode: 'TW', Country: 'Taiwan' },
    { CountryCode: 'TJ', Country: 'Tajikistan' },
    { CountryCode: 'TZ', Country: 'Tanzania, United Republic Of' },
    { CountryCode: 'TH', Country: 'Thailand' },
    { CountryCode: 'TG', Country: 'Togo' },
    { CountryCode: 'TK', Country: 'Tokelau' },
    { CountryCode: 'TO', Country: 'Tonga' },
    { CountryCode: 'TT', Country: 'Trinidad And Tobago' },
    { CountryCode: 'TN', Country: 'Tunisia' },
    { CountryCode: 'TR', Country: 'Turkey' },
    { CountryCode: 'TM', Country: 'Turkmenistan' },
    { CountryCode: 'TC', Country: 'Turks And Caicos Islands' },
    { CountryCode: 'TV', Country: 'Tuvalu' },
    { CountryCode: 'UG', Country: 'Uganda' },
    { CountryCode: 'UA', Country: 'Ukraine' },
    { CountryCode: 'AE', Country: 'United Arab Emirates' },
    { CountryCode: 'GB', Country: 'United Kingdom' },
    { CountryCode: 'US', Country: 'United States' },
    { CountryCode: 'UM', Country: 'United States Minor Is.' },
    { CountryCode: 'UY', Country: 'Uruguay' },
    { CountryCode: 'UZ', Country: 'Uzbekistan' },
    { CountryCode: 'VU', Country: 'Vanuatu' },
    { CountryCode: 'VE', Country: 'Venezuela' },
    { CountryCode: 'VN', Country: 'Viet Nam' },
    { CountryCode: 'VG', Country: 'Virgin Islands (British)' },
    { CountryCode: 'VI', Country: 'Virgin Islands (U.S.)' },
    { CountryCode: 'WF', Country: 'Wallis And Futuna Islands' },
    { CountryCode: 'EH', Country: 'Western Sahara' },
    { CountryCode: 'YE', Country: 'Yemen' },
    { CountryCode: 'YU', Country: 'Yugoslavia' },
    { CountryCode: 'ZR', Country: 'Zaire' },
    { CountryCode: 'ZM', Country: 'Zambia' },
    { CountryCode: 'ZW', Country: 'Zimbabwe' }
];
var CountryField = new Ext.form.ComboBox({
fieldLabel: '* Country', 
allowBlank: false,   
hiddenName: 'Country',    
store: new Ext.data.JsonStore({
fields: ['CountryCode', 'Country'],        
    data: CountryValues
    }),
    displayField: 'Country',  
valueField: 'Country',  
typeAhead: true,    
mode: 'local',    
emptyText: locale.getLocaleString('chooseCountry')
 , triggerAction: 'all'   
 ,selectOnFocus:true
});
function getLocale() {
    if (navigator) {
        if (navigator.systemLanguage) {
            return navigator.systemLanguage;
        }
        else if (navigator.userLanguage) {
            return navigator.userLanguage;
        }
        else if (navigator.browserLanguage) {
            return navigator.browserLanguage;
        }
        else if (navigator.language) {
            return navigator.language;
        }
    }
}
