$(function(){
    $('div.blockPager').hide();
    $('div#blockResultBody').after("<div class='nextPageLoading' style='border: 1px solid #ccc; padding: 10px; display:none; text-align: center;'>"
        +"<img src='/img/search/loading.gif' alt='' width='32px' height='32px' class='loading' /></div>");


    //AutoPagarize
    $.autopager({
        nextLink   : 'div.blockPager a:last.next',
        pageElement: 'div#blockResultBody',
        
        // before matched element, page contents will be inserted. (optional)             
        //insertBefore: 'div.searchListPager',
        
        // where page loading will be excuted. pixels from end of page. (optional) 
        pagingPoint: 700,
        
        // a function to be executed when next page was loaded. (optional) 
        // receive "this" as a element of page content.
//        load: function(i) {
//        },
    
        // a function to be executed when page content was inserted. (optional)
        // receive "this" as a element of page content.
        success: function(i) {
            $(this).fadeIn('slow');
            $(this).find('div.blockPager').hide();
            $('div.nextPageLoading').hide();
        },
        beforeLoad: function(i){
            $('div.nextPageLoading').show();
        }
        
    });
});
