function passwordStrength(password){    var score = 1;    if (password.length > 6) {        score++;    }    if (password.match(/[a-z]/) && password.match(/[A-Z]/)) {        score++;    }    if (password.match(/\d+/)) {        score++;    }    if (password.match(/.[!,@,#,$,%,\^,&,*,?,_,~,-,(,)]/)) {        score++;    }    if (password.length > 8) {        score++;    }    return score;}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 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 strengthMeter = function(thisField){    var strength = passwordStrength(thisField.getValue());    var cs = Ext.get('strengthValue');    cs.addClass('str' + strength);};var signupApp = {    formPanel: new Ext.form.FormPanel({		title:'Join for free',        url: '/user/create',        method: 'POST',        layout: 'column',        frame: true,        baseParams: {            newsignup: 1        },        enableKeyEvents: true,        items: [{            id: 'leftColumn',            layout: 'form',            columnWidth: '.5',            labelAlign: 'top',            defaults: {                msgTarget: 'side',                width: 250,                listWidth: 250,                allowBlank: false,                xtype: 'textfield',                validationEvent: 'blur'            },            items: [{                name: 'emailaddress',                fieldLabel: 'Email Address',                vtype: 'email',                emptyText: 'Used to send verification email.'            }, {                name: 'emailaddress_verify',                fieldLabel: 'Verify Email Address',                vtype: 'email',                emptyText: 'Please type again.'            }, {                name: 'password',                fieldLabel: 'Password',                inputType: 'password',                minLength: 6,                xtype: 'textfield',                enableKeyEvents: true,                listeners: {                    valid: strengthMeter,                    keypress: strengthMeter,                    change: strengthMeter                }            }, {                xtype: '',                html: '<div id="passwordStrengthMeter"><div class="lbl">Strength:</div><div id="currentPasswordStrength"><div id="strengthValue"></div></div></div>'            }, {                name: 'password_verify',                fieldLabel: 'Verify Password',                inputType: 'password',                minLength: 6            }, {                name: 'birthdate',                xtype: 'datefield',                fieldLabel: 'Birthday',                format: 'm-d-Y',                emptyText: 'MM-DD-YYYY or Click on Calendar',                maxValue: maxDOB,                maxText: 'You must be 18 years or older to use this site.'            }, {                name: 'profilename',                allowBlank: false,                fieldLabel: 'Profile Name',                empyText: 'Enter a short name for other members to see.'            }, {                name: 'agreement',                xtype: 'checkbox',                bodyStyle: 'clear:both',                id: 'agreement',                hideLabel: true,                allowBlank: false,                inputValue: 1,                boxLabel: 'I am at least 18 years old and have read and agree to the <a href="/terms" target="_blank">Terms of Use</a>, <a href="/privacy" target="_blank">Privacy Policy</a>, <a href="/guidelines">Community Guidelines</a>, and related policies.'            }, {                xtype: '',                html: '<div class="clear"></div>'            }]        }, {            id: 'rightColumn',            layout: 'form',            columnWidth: '.5',            labelAlign: 'top',            defaults: {                msgTarget: 'side',                width: 250,                listWidth: 250,                allowBlank: false,                xtype: 'textfield'            },            items: [{                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.'            }, {                xtype: 'textfield',                name: 'city',                allowBlank: false,                fieldLabel: 'City',                emptyText: ''            }, {                fieldLabel: 'Security Question',                xtype: 'combo',                mode: 'local',                triggerAction: 'all',                editable: false,                valueField: 'value',                displayField: 'display',                hiddenName: 'securityquestion',                store: new Ext.data.SimpleStore({                    fields: ['value', 'display'],                    data: [[1, "What is your mother's maiden name?"], [2, "What is your father's middle name?"], [3, "What are the last 4 digits of your driver's license?"], [4, "What was the last name of your first teacher?"], [5, "Who is your favorite author?"]]                }),                editable: false,                selectOnFocus: true,                emptyText: 'Used to recover your password.'            }, {                fieldLabel: 'Security Answer',                xtype: 'textfield',                name: 'securityanswer',                emptyText: 'Please write this down.'            }, {                fieldLabel: 'Enter the numbers from the image below',                name: 'captcha_string',                xtype: 'textfield',                maskRe: /\d/,                emptyText: 'To check if you are a human.'            }, {                xtype: '',                html: '<img src="/user/captcha">'            }]        }],        buttons: [{            iconCls: 'btn-apply',			text: 'Sign Up',            handler: function(){                var values = signupApp.formPanel.form.getValues();                if (values.agreement != 1) {                    alert('You must check the box certifying that you agree with our the terms and privacy policy');                    return false;                }                if (signupApp.formPanel.form.isValid()) {                    signupApp.formPanel.form.submit({                        waitMsg: 'Submitting Registration...',                        success: function(a, b){                            window.location = '/signup/confirm';                        },                        failure: function(a, b){                        }                    });                }            }        }]    }),    init: function(){        signupApp.formPanel.render('signupContainer');    }};Ext.onReady(function(){    Ext.QuickTips.init();    signupApp.init();});