﻿var DialogboxError= function() {
}
DialogboxError.Show = function(element,html) {
    return this.ShowInternal(false, element,html);
}

DialogboxError.ShowModal = function(element,html) {
    return this.ShowInternal(true, element,html);
}

DialogboxError.HideTitleBar = function(element) {
    $(element).dialog().parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
}

DialogboxError.ShowInternal = function(isModal, element, html) {
    // initializing dialog
    $(element).dialog({
        bgiframe: true,
        autoOpen: false,
        height: 600,
        width: 700,
        modal: isModal,
        title: "Désolé, une erreur s'est produite...",
        show: null, // effect while opening the window
        hide: null, // effect while closing the window
        buttons: { "Fermer": function() { $(this).dialog("close"); }},
        open: function(event, ui) {
            /* TODO */
        },
        close: function() {
            $(element).dialog('destroy');
        }
    });

    // opening dialog
    $(element).html(html);
    $(element).dialog('open');
    return false;
}
    


