                                                                                                                                                                                                                               
var loginForm = new Ext.FormPanel({
	url:'logincheck.php',
    method:'post',
	standardSubmit:true,
	frame:true,
	layout:'form',
	bodyStyle:'padding:10px',
	labelWidth:75,
	items:[{
		xtype : 'textfield',
		fieldLabel: 'Password',
		name: 'password',
		id:'password',
		inputType:'password',
		tabIndex: 2,
		allowBlank: false,				
		listeners: {
			specialkey: function(f,e){
				if (e.getKey() == e.ENTER){
					formsubmit();
				}
			}
		}
	}]
});
	
var loginWindow = new Ext.Window({
	title: 'Confirmation Password',
	width:260,		
	height:124,		
	closeAction:'hide',
	closeable:false,
	modal:true,
	collapsible:true,
	items: loginForm,
	buttonAlign: 'center',
	buttons: [{
		text: 'Confirm',
		tabIndex: 4,
		width:60,
		handler: function(){
			formsubmit();
		}
	},{
		text: 'Reset',
		width:60,
		tabIndex: 5,
		handler: function(){
			loginForm.getForm().reset();
		}
	}]
});
var varWidth =  (screen.width - loginWindow.width)/2;
loginWindow.setPosition(varWidth,((screen.height/4)-30));
	
function formsubmit(){
	if(Ext.getCmp('password').getValue() != ""){
		var password=Ext.getCmp('password').getValue();
		Ext.Ajax.request({
			loadMask: true,
			sync : true,
			url: 'data/getRelatedRecord.php',
			params: {action:'password',username:username,password:password},
			success: function(resp){
				var str = "";
				resbool=resp.responseText;
				if(resbool == "right"){
					Ext.getCmp('password').reset();
					loginWindow.hide();
					deletedata();
				}
				else{
					Ext.MessageBox.show({
						title: 'Error',
						msg: 'Wrong Password.',
						buttons: Ext.MessageBox.OK,
						icon:Ext.MessageBox.ERROR
					});			
					Ext.getCmp('password').reset();
					Ext.getCmp('password').focus(true,500);
				}
			}				
		});
	}
}	