function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

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);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
	return '<table cellpadding="0" cellspacing="0" border="0" width="37" height="40"><tr><td height="40" width="58px" align="center" valign="middle"><a href="' + item.url + '" onMouseOver="' + item.click + '"><img src="' + item.image + '" width="58px" border="0"></a></td><td width="8"></td></tr></table>';
};

function startScroller() {
	jQuery('#mycarousel').jcarousel({auto: 4,wrap: 'circular',itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},scroll: 1,animation: 1000,initCallback: mycarousel_initCallback});
}