Ext.onReady(function(){

	new Ext.FormPanel({ id:'resetForm', renderTo:'reset-box', border:false, bodyStyle:'background:0; margin:0;',
		defaultType:'textfield', labelWidth: 55, waitMsgTarget:'reset-box',
		defaults:{ width: 220, allowBlank:false, style:'margin-bottom:5px;', labelSeparator:'' }, 
		url:'requests/reset-pwd.php',
		items:[
			{ fieldLabel:'Email<sup class="required">*</sup>', name:'email', vtype:'email', validationEvent:false }
		]
	});

});

/****************************************************************************************************/
// FUNCTIONS
/****************************************************************************************************/

function resetPwd() {
	var form=Ext.getCmp('resetForm').getForm();
	if (form.isValid()) {
		form.submit({
			waitMsg:'Wait please...', 
			url:'requests/reset-pwd.php',
			failure: function(){ Ext.Msg.alert('', 'Please check the address you entered. It has not been found.'); },
			success: function(){ location.href='jl_pwd_sent.php'; }
		});
	} else Ext.Msg.alert('', 'Please enter a valid email address.');
}

