

Ext.onReady(function(){

    var conwin;
    var button = Ext.get('show-form');

    button.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        if(!conwin){
			
			 var simple = new Ext.form.FormPanel({
 
 
        standardSubmit: true, 
        frame:true,
        title: '',
        baseCls: 'x-plain',
        layout:'absolute',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',
		items: [{
            x: 10,
            y: 14,
            xtype:'label',
            text: 'E-mail:'
			
        },{
            x: 60,
            y: 10,
            name: 'email',
            anchor:'90%',
			 allowBlank:false  // anchor width by percentage
        },{
            x: 10,
            y: 47,
            xtype:'label',
            text: 'Oggetto:'
        }
		
			
		,{
            x: 60,
            y: 45,
            name: 'subject',
            anchor: '90%',
			allowBlank:false  // anchor width by percentage
        }
		
			,{
            x: 12,
            y: 80,
            xtype:'label',
            text: 'Note:'
        }
		
		,{
            x:60,
            y: 80,
            xtype: 'textarea',
            name: 'note',
            anchor: '90% 80%',
			 //allowBlank:false  // anchor width and height
        },
			{
                inputType: 'hidden',
                id: 'submitbutton',
                name: 'myhiddenbutton',
                value: 'hiddenvalue'
            }
 
        ],
        buttons: [{
            text: 'Submit',
			x:40,
            handler: function() {
		simple.getForm().getEl().dom.action = 'inc/form.php';
	        simple.getForm().getEl().dom.method = 'POST';
                simple.getForm().submit();
            }
        }]
 
 
    });
            conwin = new Ext.Window({
                layout: 'fit',
                title: 'DOT WEB contatti',
                closeAction: 'hide',
                width:400,
				height:400,
                x: 40,
                y: 60,
                items: simple
            });
            
        }
        
        conwin.show();
        
    });
    
 });