function cancelModalDialogIfOpen(dlgClass) {
        $("." + dlgClass + ".instance").each(function (index, dlg) {
            if ($(dlg).is(":visible")) {   // Bootstrap breaks if try to hide dialog that's already hidden
                _dismissDialog($(dlg), DIALOG_CANCELED);
            }
        });
    }
Immediately closes any dialog instances with the given class. The dialog callback for each instance will 
be called with the special buttonId DIALOG_CANCELED (note: callback is run asynchronously).