function confirmDelete(url, id){
var b = {};
b[dle_act_lang[1]] = function() {
$(this).dialog(\"close\");
};
b['{$lang['p_message']}'] = function() {
$(this).dialog(\"close\");
var bt = {};
bt[dle_act_lang[3]] = function() {
$(this).dialog('close');
};
bt['{$lang['p_send']}'] = function() {
if ( $('#dle-promt-text').val().length < 1) {
$('#dle-promt-text').addClass('ui-state-error');
} else {
var response = $('#dle-promt-text').val()
$(this).dialog('close');
$('#dlepopup').remove();
$.post('engine/ajax/message.php', { id: id, text: response, user_hash: '{$dle_login_hash}' },
function(data){
if (data == 'ok') { document.location=url; } else { DLEalert('{$lang['p_not_send']}', '{$lang['p_info']}'); }
});
}
};
$('#dlepopup').remove();
$('body').append(\"<div id='dlepopup' title='{$lang['p_title']}' class='dle-promt' style='display:none'>{$lang['p_text']}<br /><br /><textarea name='dle-promt-text' id='dle-promt-text' class='ui-widget-content ui-corner-all' style='width:97%;height:100px; padding: .4em;'></textarea></div>\");
$('#dlepopup').dialog({
autoOpen: true,
width: 500,
resizable: false,
buttons: bt
});
};
b[dle_act_lang[0]] = function() {
$(this).dialog(\"close\");
document.location=url;
};
$(\"#dlepopup\").remove();
$(\"body\").append(\"<div id='dlepopup' title='{$lang['p_confirm']}' class='dle-promt' style='display:none'><div id='dlepopupmessage'>{$lang['edit_cdel']}</div></div>\");
$('#dlepopup').dialog({
autoOpen: true,
width: 500,
resizable: false,
buttons: b
});
}
// Сама кнопка
<button onclick="confirmDelete('?mod=editnews&action=doeditnews&ifdelete=yes&id=$id&user_hash=$dle_login_hash', '{$id}'); return false;" class="btn btn-red"><i class="icon-trash"></i> {$lang['edit_dnews']}</button>