// Функция вызывается при нажатии на кнопку.
function Send() {
    var st={};
    for(j=0; j<window.document.forms['formcomments'].elements.length; j++) {
        formObj=window.document.forms['formcomments'].elements[j];
        st[formObj.name]=formObj.value;
    }
//    document.getElementById("comment").innerHTML = '<img src=\"/i/loadingAnimation.gif\" width=\"150\" height=\"13\">';

    // Create new JsHttpRequest object.
    var req = new JsHttpRequest();
    // Enable caching of the query results
    req.caching = false;

    // Code automatically called on load finishing.
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            // Write result to page element (_RESULT becomes responseJS).
            document.getElementById("comment").innerHTML = req.responseJS.comment ;
        }
    }
    // Prepare request object (automatically choose GET or POST).
    req.open(null, '/save_comment.php', false);
    // Send data to backend.
    req.send( st );
    return false;
}