Ext.onReady(function(){
	Ext.QuickTips.init();	
	var SubmitButton = new Ext.Button({
		text: 'Submit',
		handler: function(){
			Form1.getForm().submit({url: '/login', method: 'post', waitMsg: 'Submiting Data...'});
		}
	});
	var Form1 = new Ext.FormPanel({
		applyTo: 'DivLoginForm',
		frame: false,
		labelAlign: 'right',
		border: false,
		height: 300,
		errorReader: new Ext.form.XmlErrorReader(),
		bodyStyle: 'padding:10px',
		items: [{
			xtype: 'textfield',
			id: 'Username_TextField',
			name: 'Username_TextField',
			fieldLabel: 'Username',
			allowBlank: false
		},{
			xtype: 'textfield',
			name: 'Password_TextField',
			fieldLabel: 'Password',
			inputType: 'password',
			allowBlank: false
		},
			SubmitButton
		]
	});
	Form1.on({
        actioncomplete: function(form, action){
        	window.location = '/'
        }
    });
});
Ext.form.XmlErrorReader = function(){
    Ext.form.XmlErrorReader.superclass.constructor.call(this, {
            record : 'field',
            success: '@success'
        }, [
            'id', 'msg'
        ]
    );
};
Ext.extend(Ext.form.XmlErrorReader, Ext.data.XmlReader);
