function Dialog(container)
{
    this.container = container;

    this.container.dialog(
         {modal : true},
         {resizable : false},
         {autoOpen : false},
         {zIndex : 99999},
         {width : 600}
    );

    this.show = function(message, title, buttons)
    {
        this.setMessage(message);

        if(title !== undefined)
        {
            this.setTitle(title);
        }

        this.setButtons(this.container, buttons);

        this.container.dialog("open");
    }

    this.setMessage = function(message)
    {
        this.container.empty();
        this.container.html(message);
    }

    this.setTitle = function(title)
    {
        this.container.dialog("option", "title", title);
    }

    this.setButtons = function(container, customButtons)
    {
        buttons = {
            'cancel': function() {
                container.dialog("close");
             }
        }

        if(customButtons !== undefined)
        {
            $.extend(buttons, customButtons);
        }

        this.container.dialog("option", "buttons", buttons);
    }
}
