/*var mycarousel_itemList = [
    {url: '/images/refuel-home/1.jpg', title: '1'},
    {url: '/images/refuel-home/2.jpg', title: '2'},
    {url: '/images/refuel-home/3.jpg', title: '3'},
    {url: '/images/refuel-home/4.jpg', title: '4'},
    {url: '/images/refuel-home/5.jpg', title: '5'},
    {url: '/images/refuel-home/6.jpg', title: '6'},
    {url: '/images/refuel-home/7.jpg', title: '7'},
    {url: '/images/refuel-home/8.jpg', title: '8'},
    {url: '/images/refuel-home/9.jpg', title: '9'},
    {url: '/images/refuel-home/10.jpg', title: '10'},
    {url: '/images/refuel-home/11.jpg', title: '11'},
    {url: '/images/refuel-home/12.jpg', title: '12'},
    {url: '/images/refuel-home/13.jpg', title: '13'},
    {url: '/images/refuel-home/14.jpg', title: '14'},
    {url: '/images/refuel-home/15.jpg', title: '15'},
    {url: '/images/refuel-home/16.jpg', title: '16'},
    {url: '/images/refuel-home/17.jpg', title: '17'}
];
*/

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="170" height="170" alt="' + item.title + '" />';
};

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();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        wrap: 'circular',
		auto: 0.01,
		animation:10000,
		
		initCallback: mycarousel_initCallback,
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
});
