function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

function mycarousel_initCallback(carousel) {
    jQuery('#gallery-next').bind('click', function() {
        carousel.startAuto(0);
        carousel.next();
        return false;
    });

    jQuery('#gallery-prev').bind('click', function() {
        carousel.startAuto(0);
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(
    function() {
        carousel.stopAuto();
    }, 
    function() {
        carousel.startAuto();
    });

};
