$('.search_form').each(function() {
    var form = this;
 
    // Change each link's GET request into a POST when switching between pages.
    $('a', this).click(function() {
        var search_url = $(this).attr('href');
        var offset = search_url.substring(search_url.lastIndexOf('/') + 1);
 
        var item_search = $(form);
        item_search.append('<input type="hidden" name="offset" value="' + offset + '">');
        item_search.attr('action', item_search.attr('action') + '/' + offset);
 
        item_search.submit();
 
        return false;
    });
});