// vim: enc=utf-8 fenc=utf-8 ts=4 sts=4 et cindent fdm=marker sw=4
function processComment(response) {
    var result;
    eval('result = ' + response);
    if (result.d == 1 && result.comment) {
        // remove this row, maybe putting some animating effect?
        var el = document.getElementById('comment_' + result.comment);
        var ani = new YAHOO.util.Anim(el, {
            opacity: { to: 0 },
            height: { to: 0 }
        }, 1, YAHOO.util.Easing.easeOut);
        ani.onComplete.subscribe(function() {
            el.parentNode.removeChild(el);
        });

        ani.animate();
    }
    if (result.b == 1 && result.url) // redirect to blacklist page
        window.setTimeout(function() {
            window.location.href = decodeURIComponent(result.url);
        }, 2000);
    if (result.w == 1 && result.message)
        window.alert(result.message);
}
