Jquery dialog close

Jquery dialog close

hello i want to have two close functions in a dialog one that when the user click in the 'X' icon closes the dialog and do some work and when the user click's a button in the dialog it only closes the dialog

            $("#hiddenPaisExtras").dialog({
                modal: true,
                autoOpen: false,
                height: 'auto',
                width: '600px',
                draggable: true,
                resizeable: true,
                closeOnEscape: false,
                close: function(ev, ui)
                {
                    hideDiv('GuardasAlbumPaisExtra', 'ddlGuardasPaisExtra');
                    hideDiv('CapaAlbumPaisExtra', 'ddlCapaPaisExtra');
                    hideDiv('CapaAlbumPaisExtra', 'ddlCapaPaisExtra');
                    hideDiv('CostasAlbumPaisExtra', 'ddlCostasPaisExtra');
                    hideDiv('CapaGlamourPaisExtra', 'ddlCapaGlamourPaisExtra');
                    hideDiv('ButaoPaisExtra', '');
                    $(this).close();
                },
            close2: function(ev, ui)
            {  
                  $(this).close();

            }
                title: "Extra"
            });

Like the example i want that function close2 only closes the dialog, but it wont work

please help me

Thanks in advance