I'm having trouble with jQuery ui-dialog plugin. What happens is, whenever I have two or more dialogs stacked, the overlay of each dialog goes to the back of ALL the dialogs, and thus none of them are blocked.
Versions:
Jquery: 1.10.2
Jquery-ui: 1.11.1
How I open them:
function openDialog($divDialog, options){
    var optionsDefault = {
        modal : true,
        autoOpen : true,
        resizable : false,
        closeOnEscape : true,
        close: function(){
            $divDialog.dialog('destroy');
        }
    };
    $.extend( true, optionsDefault, options );
    $divDialog.dialog(optionsDefault);
    $divDialog.dialog( "moveToTop" );
    $divDialog.position({
        my: "center",
        at: "center",
        of: window
    });
}


I think I'm missing something basic about dialog stacking, so hopefully you can help. Thanks in advance!