var countryList = [['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'], ['BH', 'Bahrain'], ['BD', 'Bangladesh'], ['BB', 'Barbados'], ['BY', 'Belarus'], ['BE', 'Belgium'], ['BZ', 'Belize'], ['BJ', 'Benin'], ['BM', 'Bermuda'], ['BT', 'Bhutan'], ['BO', 'Bolivia'], ['BA', 'Bosnia and Herzegovina'], ['BW', 'Botswana'], ['BV', 'Bouvet Island'], ['BR', 'Brazil'], ['IO', 'British Indian Ocean Territory'], ['VG', 'British Virgin Islands'], ['BN', 'Brunei'], ['BG', 'Bulgaria'], ['BF', 'Burkina Faso'], ['MM', 'Burma'], ['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'], ['CD', 'Congo Democratic Republic of the'], ['CG', 'Congo Republic of the'], ['CK', 'Cook Islands'], ['CR', 'Costa Rica'], ['CI', 'Coast Ivory'], ['HR', 'Croatia'], ['CU', 'Cuba'], ['CY', 'Cyprus'], ['CZ', 'Czech Republic'], ['DK', 'Denmark'], ['DJ', 'Djibouti'], ['DM', 'Dominica'], ['DO', 'Dominican Republic'], ['TL', 'East Timor'], ['EC', 'Ecuador'], ['EG', 'Egypt'], ['SV', 'El Salvador'], ['GQ', 'Equatorial Guinea'], ['ER', 'Eritrea'], ['EE', 'Estonia'], ['ET', 'Ethiopia'], ['FK', 'Falkland Islands (Islas Malvinas)'], ['FO', 'Faroe Islands'], ['FJ', 'Fiji'], ['FI', 'Finland'], ['FR', 'France'], ['GF', 'French Guiana'], ['PF', 'French Polynesia'], ['TF', 'French Southern and Antarctic Lands'], ['GA', 'Gabon'], ['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 Island and McDonald Islands'], ['VA', 'Holy See (Vatican City)'], ['HN', 'Honduras'], ['HK', 'Hong Kong (SAR)'], ['HU', 'Hungary'], ['IS', 'Iceland'], ['IN', 'India'], ['ID', 'Indonesia'], ['IR', 'Iran'], ['IQ', 'Iraq'], ['IE', 'Ireland'], ['IL', 'Israel'], ['IT', 'Italy'], ['JM', 'Jamaica'], ['JP', 'Japan'], ['JO', 'Jordan'], ['KZ', 'Kazakhstan'], ['KE', 'Kenya'], ['KI', 'Kiribati'], ['KP', 'Korea North'], ['KR', 'Korea South'], ['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 The Former Yugoslav Republic of'], ['MG', 'Madagascar'], ['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'], ['MC', 'Monaco'], ['MN', 'Mongolia'], ['MS', 'Montserrat'], ['MA', 'Morocco'], ['MZ', 'Mozambique'], ['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 Occupied'], ['PA', 'Panama'], ['PG', 'Papua New Guinea'], ['PY', 'Paraguay'], ['PE', 'Peru'], ['PH', 'Philippines'], ['PN', 'Pitcairn Islands'], ['PL', 'Poland'], ['PT', 'Portugal'], ['PR', 'Puerto Rico'], ['QA', 'Qatar'], ['RE', 'Reunion'], ['RO', 'Romania'], ['RU', 'Russia'], ['RW', 'Rwanda'], ['SH', 'Saint Helena'], ['KN', 'Saint Kitts and Nevis'], ['LC', 'Saint Lucia'], ['PM', 'Saint Pierre and Miquelon'], ['VC', 'Saint Vincent and the Grenadines'], ['WS', 'Samoa'], ['SM', 'San Marino'], ['ST', 'Sao Tome and Principe'], ['SA', 'Saudi Arabia'], ['SN', 'Senegal'], ['SC', 'Seychelles'], ['SL', 'Sierra Leone'], ['SG', 'Singapore'], ['SK', 'Slovakia'], ['SI', 'Slovenia'], ['SB', 'Solomon Islands'], ['SO', 'Somalia'], ['ZA', 'South Africa'], ['GS', 'South Georgia and the South Sandwich Islands'], ['ES', 'Spain'], ['LK', 'Sri Lanka'], ['SD', 'Sudan'], ['SR', 'Suriname'], ['SJ', 'Svalbard'], ['SZ', 'Swaziland'], ['SE', 'Sweden'], ['CH', 'Switzerland'], ['SY', 'Syria'], ['TW', 'Taiwan'], ['TJ', 'Tajikistan'], ['TZ', 'Tanzania'], ['TH', 'Thailand'], ['BS', 'The Bahamas'], ['GM', 'The Gambia'], ['TG', 'Togo'], ['TK', 'Tokelau'], ['TO', 'Tonga'], ['TT', 'Trinidad and Tobago'], ['TN', 'Tunisia'], ['TR', 'Turkey'], ['TM', 'Turkmenistan'], ['TC', 'Turks and Caicos Islands'], ['TV', 'Tuvalu'], ['UG', 'Uganda'], ['UA', 'Ukraine'], ['AE', 'United Arab Emirates'], ['GB', 'United Kingdom'], ['UM', 'United States Minor Outlying Islands'], ['US', 'United States'], ['UY', 'Uruguay'], ['UZ', 'Uzbekistan'], ['VU', 'Vanuatu'], ['VE', 'Venezuela'], ['VN', 'Vietnam'], ['VI', 'Virgin Islands'], ['WF', 'Wallis and Futuna'], ['EH', 'Western Sahara'], ['YE', 'Yemen'], ['YU', 'Yugoslavia'], ['ZM', 'Zambia'], ['ZW', 'Zimbabwe']];var StateList = [['AL', 'Alabama'], ['AK', 'Alaska'], ['AZ', 'Arizona'], ['AR', 'Arkansas'], ['CA', 'California'], ['CO', 'Colorado'], ['CT', 'Connecticut'], ['DE', 'Delaware'], ['DC', 'District of Columbia'], ['FL', 'Florida'], ['GA', 'Georgia'], ['HW', 'Hawaii'], ['ID', 'Idaho'], ['IL', 'Illinois'], ['IN', 'Indiana'], ['IA', 'Iowa'], ['KS', 'Kansas'], ['KY', 'Kentucky'], ['LA', 'Louisiana'], ['ME', 'Maine'], ['MD', 'Maryland'], ['MA', 'Massachusetts'], ['MI', 'Michigan'], ['MN', 'Minnesota'], ['MS', 'Mississippi'], ['MO', 'Missouri'], ['MT', 'Montana'], ['NE', 'Nebraska'], ['NV', 'Nevada'], ['NH', 'New Hampshire'], ['NJ', 'New Jersey'], ['NM', 'New Mexico'], ['NY', 'New York'], ['NC', 'North Carolina'], ['ND', 'North Dakota'], ['OH', 'Ohio'], ['OK', 'Oklahoma'], ['OR', 'Oregon'], ['PA', 'Pennsylvania'], ['RI', 'Rhode Island'], ['SC', 'South Carolina'], ['SD', 'South Dakota'], ['TN', 'Tennessee'], ['TX', 'Texas'], ['UT', 'Utah'], ['VE', 'Vermont'], ['VA', 'Virginia'], ['WA', 'Washington'], ['WV', 'West Virginia'], ['WI', 'Wisconsin'], ['WY', 'Wyoming'], ['PR', 'Puerto Rico']];var adForm = new Ext.form.FormPanel({    url: '/do_advertise',    title: 'Advertiser Contact Form',    id: 'advertise_form',    method: 'POST',    labelAlign: top,    width: 450,    frame: true,    defaults: {        width: 300,        xtype: 'textfield',        allowBlank: false,        msgTarget: 'side'    },    items: [{        name: 'company',        fieldLabel: 'Company',        allowBlank: true    }, {        name: 'website',        fieldLabel: 'Website',        emptyText: 'http://www.website.com',        vtype: 'url',        allowBlank: true    }, {        name: 'contact',        fieldLabel: 'Contact Name'    }, {        name: 'contactemail',        vtype: 'email',        fieldLabel: 'Contact Email'    }, {        name: 'contactphone',        fieldLabel: 'Contact Phone',        allowBlank: true    }, {        hiddenName: 'agency',        fieldLabel: 'Are you with an advertising agency?',        xtype: 'combo',        valueField: 'value',        displayField: 'display',        editable: false,        selectOnFocus: true,        store: new Ext.data.SimpleStore({            fields: ['value', 'display'],            data: [['0', 'No'], ['1', 'Yes']]        }),        triggerAction: 'all',        mode: 'local',        allowBlank: true    }, {        name: 'client',        fieldLabel: 'Client',        emptyText: 'If you are with an agency',        allowBlank: true    }, {        name: 'product',        fieldLabel: 'Product / Service',        allowBlank: true    }, {        name: 'city',        fieldLabel: 'City',        allowBlank: true    }, {        xtype: 'combo',        hiddenName: 'country',        fieldLabel: 'Country',        valueField: 'value',        displayField: 'display',        triggerAction: 'all',        mode: 'local',        store: new Ext.data.SimpleStore({            fields: ['value', 'display'],            data: countryList        }),        allowBlank: true,        emptyText: 'Select One',        listeners: {            select: function(a){                if (a.getValue() != 'US') {                    Ext.getCmp('stateSelect').clearValue();                    Ext.getCmp('stateSelect').store.loadData([]);                }                else {                    Ext.getCmp('stateSelect').store.loadData(StateList);                }            }        },        value: 'US'    }, {        id: 'stateSelect',        xtype: 'combo',        hiddenName: 'state',        fieldLabel: 'State',        valueField: 'value',        displayField: 'display',        triggerAction: 'all',        mode: 'local',        store: new Ext.data.SimpleStore({            fields: ['value', 'display'],            data: StateList        }),        allowBlank: true,        emptyText: 'Select One if applicable'    }, {        name: 'budget',        fieldLabel: 'Campaign Budget',        xytpe: 'numberfield',        allowNegative: false,        allowDecimals: false,        allowBlank: true    }, {        name: 'startdate',        fieldLabel: 'Campaign Start Date',        allowBlank: true    }, {        hiddenName: 'advertisingexperience',        fieldLabel: 'Advertised online before?',        xtype: 'combo',        valueField: 'value',        displayField: 'display',        editable: false,        selectOnFocus: true,        store: new Ext.data.SimpleStore({            fields: ['value', 'display'],            data: [['0', 'No'], ['1', 'Yes']]        }),        triggerAction: 'all',        mode: 'local',        allowBlank: true    }, {        xtype: 'textarea',        name: 'campaigndescription',        fieldLabel: 'Additional ad campaign information or questions?',        maxLength: 3000,        allowBlank: true    }],    buttons: [{        text: 'Submit',        handler: function(){            var formPanel = this.ownerCt;            this.ownerCt.form.submit({                waitMsg: 'Sending Message...',                success: function(){                    Ext.get('formContainer').dom.innerHTML = "Thank you for your submission. We will get back to you shortly.";					Ext.get('formContainer').dom.style.marginTop = '25px';					Ext.get('formContainer').dom.style.paddingTop = '25px';                }            });        }    }]});Ext.onReady(function(){    adForm.render('formContainer');});