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({
		scroll: 1,
		start: 0,
		 easing: 'swing',
        initCallback: mycarousel_initCallback
    });
	
	/*jQuery('#clientlogo').jcarousel({
		scroll: 1,
		start: 0,
		 easing: 'swing',
        initCallback: mycarousel_initCallback
    });*/
	
	jQuery('#clientlogo').jcarousel({
		scroll: 1,
		wrap: 'circular',
		itemVisibleInCallback: {onBeforeAnimation: mycarousel_imageVisibleInCallback},
		itemVisibleOutCallback: {onAfterAnimation: mycarousel_imageVisibleOutCallback}				
	});

//--- For Home page Slider--------
function mycarousel_imageVisibleInCallback(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_imgList.length);
	carousel.add(i, mycarousel_getImageItemHTML(mycarousel_imgList[idx - 1]));
};

function mycarousel_imageVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

function mycarousel_getImageItemHTML(item)
{
   return '<li><img src="' + item.url + '" alt="' + item.title + '" /><li>';	
};


});

