
function showDialog(message, callback, runtimer)
{
    var time = message.length*60;
    var t;
    if(time<1000)
        time = 1000;
    $('body').append('<div id="dialog_msg">'+message+'</div>');
    $('#dialog_msg').dialog({
        modal: true,
        show: 'drop',
        hide: 'explode',
        close: function(event, ui) {
            clearTimeout(t);
            $('.ui-effects-explode').remove();
            $('#dialog_msg').remove();
            if(callback !== undefined && callback !== null)
                callback();
        },
        open: function() {
            if(runtimer)
            {
                t = setTimeout("$('#dialog_msg').dialog('close');", time);
            }
        },
        buttons: {
            ok: function() {
                $('#dialog_msg').dialog('close');
            }
        }
    });
    $('#dialog_msg').dialog('open');
}

