var Dialog = {

    option: {},
    
    openDialog: function(dialogId, closeId, options){
        options.bgiframe = true;
        options.modal = true;
        options.resizable = false;
        
        $("[id=" + dialogId + "]").dialog(options).dialog("open");
        var bodyWidth = $("body").width();
        jQuery(".ui-widget-overlay").css({
            width: bodyWidth
        });
        $(".ui-dialog-titlebar").hide();
        $("[id=" + closeId + "]").bind("click", function(){
            Dialog.closeDialog(dialogId);
        });
        jQuery(".ui-widget-overlay").bind("click", function(){
            $("[id=" + dialogId + "]").dialog('close');
        });
        
        if (options.isBlack) {
            jQuery(".ui-widget-overlay").attr("class", "ui-widget-overlay-black");
        }
        
    },
    
    closeDialog: function(dialogId){
        $("[id=" + dialogId + "]").dialog('close');
    }
    
}

