Problem height and scroll bar after closing dialog with "X" button

Problem height and scroll bar after closing dialog with "X" button


Hello everyone, I've used in my intranet the JQuery Dialog. It work
fine but I've always a problem when after closing a dialog with the
title bar "X" button. In fact when I close the dialog with the "X"
button all the dialog called after that are showen with a différent
height that I've attribute to them and the verticla scroll bar is not
present yet.
This the function I've used
function load_sub(url, specialite, var_sub_exp, titre)
{
    var recipient = $('#CMP_ajax_recipient');
    recipient.load('view/'+url+'.php','SPECIALITE='+specialite
+'&VAR='+var_sub_exp);
    recipient.dialog({
        modal: true,
         autoOpen: false,
         title:titre,
         height:500,
         width:800,
         maxHeight:500,
         maxWidth:800,
         resizable:false,
         buttons: {
             "Retour": function() {
                 $(this).html("");
                 $(this).dialog("close");
             }
         }
     });
    $(this).parents('.ui-dialog:first').find('.ui-dialog-titlebar-
close').remove();
    //$('#CMP_ajax_recipient').dialog('option', "title", titre);
    recipient.dialog('open');
}
Can anyone telle me how to resolve this problem. Many thanks in
advance.
Best regards.