function ajaxifyPageLinks(id, container) {
 
    $$(id).each(function(el) {
        el.addEvent('click', function(e) {
            e = new Event(e).stop();
                        
            var
            alink = el.getProperty('href'),
            url   = alink;
            //url += (alink.indexOf('?') !== -1) ? "&" : "?";
 
            var ajax = new Request.HTML({
                onRequest: function() {},
                onSuccess: function() {
                    ulEvents(container);
                },
                onFailure: function() {},
                update: $(container)
            }).cancel().post(url);
        }); // click
    }); // each
 
} // }}
 
window.addEvent('domready', function() {
    ulEvents('new_container');
    ulEvents('popular_container');
}); // domready

function ulEvents(container) {
    ajaxifyPageLinks('#' + container + ' ul.pagination a', container);
} // }}
