/*
 * Ext JS Library 2.1
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */



Ext.onReady(function(){
 
	var simple = new Ext.form.FormPanel({
        standardSubmit: true,
        frame:true,
        title:'DataMomentum CMS Login',
        width: 390,
        defaults: {width: 250},
        defaultType: 'textfield',
		items: [{
			        fieldLabel: 'Login',
			        name: 'handle',
			        id: 'handle',
			        allowBlank:false,
			        width: 200
			      },{
			        fieldLabel: 'Password',
			        name: 'passwd',
			        inputType: 'password',
			        allowBlank:false,
			        width: 200
			       }
			    ],
        buttons: [{
            text: 'Forgot Password ?',
            handler: function() {
				location.href = "/login/show_forgotpass"
            }
        }, {
            text: 'Login',
            handler: function() {
			simple.getForm().getEl().dom.action = '/login/checklogin';
	        simple.getForm().getEl().dom.method = 'POST';
            simple.getForm().submit();
            }
        }]
 
 
    });
    simple.render('login');
});