Ext.onReady(function(){
    var win;
    var button = Ext.get('show-btn');

    button.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        if(!win){

            win = new Ext.Window({
                applyTo     : 'hello-win',
                layout      : 'fit',
				x:	250,
				y: 450,
                width       : 475,
                height      : 264,
                closeAction :'hide',
				resizable:	false,
                plain       : true,
                items       : new Ext.Panel({
                    applyTo        : 'hello-tabs',
                    //autoTabs       : true,
                    //activeTab      : 0,
                    //deferredRender : false,
                    border         : false
                }),
								
                buttons: [{
                    text     : 'Submit',
                    handler  : function(){
                        var msg = Ext.get('name');
						var phone_msg = Ext.get('phone');
						var country_msg = Ext.get('country');
						var email_msg = Ext.get('email');
                        Ext.Ajax.request({
                            url : 'resultado.php' , 
                            params : { name : msg.dom.value, phone : phone_msg.dom.value, country : country_msg.dom.value, email : email_msg.dom.value },
                            method: 'GET',
                            success: function ( result, request ) { 
                                //Ext.MessageBox.alert('Success', 'Data return from the server: '+ result.responseText);
								Ext.MessageBox.alert('Important', result.responseText);
                            },
                            failure: function ( result, request) { 
                                Ext.MessageBox.alert('Failed', 'Please, verify your information.'); 
                            } 
                        });
                        win.hide();
                    }
                },{
                    text     : 'Close',
                    handler  : function(){
                        win.hide();
                    }
                }]
            });
        }
        win.show(button);
    });
});
