function mycarousel_itemLoadCallback(carousel, state)
{
    moreContentPageNumber = moreContentPageNumber + 1;
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }
    if(moreContentDate != '')
    {
        moreContentUrl = moreContentUrl+'/date/'+moreContentDate;
    }
    jQuery.get(
        moreContentUrl+'/page/'+moreContentPageNumber,
        {
            first: carousel.first,
            last: carousel.last
        },
        function(data) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, data);
        },
        'json'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, data)
{

    if(first == 1 && data.total > 0)
    {
        $('.gallery-box').css("visibility","visible");
    }
    // Set the size of the carousel
    carousel.size(parseInt(data.total));

    jQuery(data.rows).each(function(i) {
        var item = '<a href="'+data.rows[i]['link']+'">'+data.rows[i]['image']+data.rows[i]['title']+'</a>';
        carousel.add(first + i, item);
    });
};
