Ext.onReady(function() {
    var form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        labelWidth: 55,
        url:'mailForm.php',
        defaultType: 'textfield',
        standardSubmit: true,
        
        frame:true,

        items: [{
            fieldLabel: 'From',
            name: 'fromName',
            anchor:'90%'  // anchor width by percentage
        },{
            fieldLabel: 'Email',
            name: 'returnAddress',
            anchor: '90%'  // anchor width by percentage
        },{
            fieldLabel: 'Subject',
            name: 'subject',
            anchor: '90%'  // anchor width by percentage
        }, {
            fieldLabel: 'Comments or request',
            xtype: 'textarea',
            hideLabel: false,
            name: 'requestOrComment',
            //anchor: '90% 35%'  // anchor width by percentage and height by raw adjustment

            anchor: '90%'  // anchor width by percentage and height by raw adjustment
        }]
    });

    var window = new Ext.Window({
        title: 'Expand the form from the bottom to request an account or submit comments',
        width: 500,
        minWidth: 300,
        minHeight: 250,
        layout: 'fit',
        plain:true,
        bodyStyle:'padding:5px;',
        buttonAlign:'center',
        items: form,
        //renderTo : "qo-signup-form",
        buttons: [{
                  text: 'Submit',
                  handler: function() {
    					form.getForm().getEl().dom.action = 'mailForm.php';
    					form.getForm().getEl().dom.method = 'POST';
    					form.getForm().submit();
        			}
        },{
        	text:'Cancel',
        	handler: function() {
    			window.close();
    			}
        }
        ]
    });
   
    window.show();
});

