pic1= new Image(16,16); 
pic1.src="/img/loading_cursor.gif";

/* Цитирование текста */
function doQuote(id, obj, bool) {
    if (bool == false) {
        new Ajax.Updater(obj,'/forum/ajaxQuote/', {method: 'post', parameters: '&id='+id, onSuccess:modifySuccess})
    }
    else new Ajax.Updater(obj,'/forum/ajaxQuoteTheme/', {method: 'post', parameters: '&id='+id, onSuccess:modifySuccess})
    
}

/* Редактирование поста */
function doModify(id, boardid) {
    document.getElementById('posting'+id).innerHTML = "<br /><br /><center><img src='"+pic1.src+"' alt='' /></center>";
    new Ajax.Updater('posting'+id,'/forum/ajaxModify/', {method: 'post', parameters: '&id='+id+'&boardid='+boardid, onSuccess:modifySuccess})
}

/* Сохранение отредактированного поста */
function doSaveModify(id, text, boardid) {
    text = encodeURIComponent(text);
    document.getElementById(id).innerHTML = "<br /><br /><center><img src='"+pic1.src+"' alt='' /></center>";
    new Ajax.Updater(id,'/forum/ajaxSaveModify/', {method: 'post', parameters: '&text='+text+'&id='+id+'&boardid='+boardid, onSuccess:modifySuccess})
}

/* Отмена редактирования поста */
function doCancelModify(id, text) {
    document.getElementById(id).innerHTML = "<br /><br /><center><img src='"+pic1.src+"' alt='' /></center>";
    window.setTimeout(new Ajax.Updater(id,'/forum/ajaxCancelModify/', {method: 'post', parameters: '&id='+id+'&text='+text, onSuccess:modifySuccess}), 600);
}

/* Превью текста при создании сообщения */
function doPreview(id, text, title, themeid, boardid, listen, type) {
    text    = encodeURIComponent(text);
    title   = encodeURIComponent(title);
    listen  = encodeURIComponent(listen);
    document.getElementById(id).innerHTML = "<br /><br /><center><img src='"+pic1.src+"' alt='' /></center>";
    new Ajax.Updater(id,'/forum/ajaxPreview/', {method: 'post', parameters: '&text='+text+'&id='+id+'&title='+title+'&themeid='+themeid+'&boardid='+boardid+'&listen='+listen+'&type='+type, onSuccess:modifySuccess})
}

/* Редактирование текста после превью */
function doEditPreview(id, text, title, themeid, boardid, listen, type) {
    text    = encodeURIComponent(text);
    title   = encodeURIComponent(title);
    listen  = encodeURIComponent(listen);
    document.getElementById(id).innerHTML = "<br /><br /><center><img src='"+pic1.src+"' alt='' /></center>";
    new Ajax.Updater(id,'/forum/ajaxEditPreview/', {method: 'post', parameters: '&text='+text+'&id='+id+'&title='+title+'&themeid='+themeid+'&boardid='+boardid+'&listen='+listen+'&type='+type, onSuccess:modifySuccess})
}

/* Что-то выполняем после успешного запроса на сервер и ответа */
function modifySuccess() {
    //document.getElementById('inprocess').style.visibility='hidden';
}