Change dialog buttons

Change dialog buttons


Hello guys,
I'm new to jQuery UI. I have the interface that can use only one
dialog at once, but the dialog buttons need to be changed depending on
the method that initiated the dialog.
This is how I define th dialog:
$('#dialog').dialog({
    bgiframe: true,
    autoOpen: false,
    width: 600,
    show: 'clip',
    hide: 'clip',
    resizable: false,
    modal: true,
    close: function() {
     $(this).empty();
    }
});
Then when the I need to open the actual dialog window:
$('#dialog').dialog({buttons: {
    "Close": function() {
        $(this).dialog("close");
}}});
or
$('#dialog').dialog({buttons: {
    "Confirm": function() {
        $(this).empty();
    },
    "Close": function() {
        $(this).dialog("close");
}}});
depending on the action that pops up the dialog. The problem is that
the dialog opens, but without buttons. I'm using the 1.6rc6
Any ideas?
Thanks,
Xobb