function loadLikeCount(like_url, vote) {
    var div = $("#like_div");
// A "vote" will only be placed if "vote" is true.
// In any case, get the latest "like" fragment.
    div.load(like_url+"/like_json", {"vote": vote}, function(responseText, textStatus, XMLHttpRequest) {
        if(vote && textStatus == "error") { alert("Server error while attempting to process your vote."); }
    });
}

function likeFormOnSubmit(like_url) {
    var submit = $("#like_button");
    submit.attr("disabled", true);
    loadLikeCount(like_url, "yes");
    return false;
}

function registerLike(like_url) {
// Most likely the entire article (or whatever) page will be cached.
// We want to replace the "like" content with the very latest from the server.
    $(document).ready(function() {
        loadLikeCount(like_url, "");
    });
}
