
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 '<img src="' + item.url + '" width="75" height="75" alt="' + item.title + '" />';
    return '<li><a href="/avtosalon/index.php?ID=' + item.link + '"><img src="' + item.url + '" class="png"  alt="' + item.title + '" width="' + item.width + '" height="' + item.height + '" / ></a></li>';
};