﻿Event.observe(window, "load", function() {
    var numCommentsStories = $$('.numComments');
    for (var i = 0; i<numCommentsStories.length; i++) {
        new Ajax.Request('/private/comment_tally.aspx', {
            method: 'get',
            parameters: { contentId: numCommentsStories[i].id },
            contentType: 'text/plain',
            asynchronous: false,
            onSuccess: function(transport) {
                $(numCommentsStories[i].id).innerHTML = transport.responseText;
            }
        });
    }
});