var mycarousel_itemList = [
  
   {url: '/_resources/images/wij-werken-aan/thumb_merck.jpg', 							title: 'Merck'}
,   {url: '/_resources/images/wij-werken-aan/thumb_e_on.jpg', 								title: 'E.on | Bespaartest'}
,   {url: '/_resources/images/wij-werken-aan/thumb_victoria.jpg', 							title: 'Victoria | Corparate website voor squash, hockey en tennis'}
,   {url: '/_resources/images/wij-werken-aan/thumb_media_markt.jpg', 						title: 'Media Markt | Voorspel met Media Markt'}
,   {url: '/_resources/images/wij-werken-aan/thumb_berkhout_wonen.jpg', 					title: 'Berkhout Wonen | webshops'}
,   {url: '/_resources/images/wij-werken-aan/thumb_spangas.jpg', 							title: 'NCRV | Spangas'}
,   {url: '/_resources/images/wij-werken-aan/thumb_sanoma.jpg', 						title: 'Sanama Digital'}
,   {url: '/_resources/images/wij-werken-aan/thumb_europoint.jpg', 							title: 'Europoint | website'}
//	Je kunt een complete regel weghalen als je er 1 wilt verwijderen.
//	Als je er 1 wilt toevoegen kun je onderstaande regel gebruiken en // ervoor weghalen
// ,   {url: '', title: ''}
];

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="67" height="67" title="' + item.title + '" 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()
{
	$('#carousel').jcarousel({
		 auto: 						2, /* seconds */
		 scroll:					1, /* number of items */ 
		 wrap: 						'circular',
		 animation: 				'slow',
		 size: 						mycarousel_itemList.length,
		 initCallback: 				mycarousel_initCallback,
         itemVisibleInCallback: 	{onBeforeAnimation: mycarousel_itemVisibleInCallback},
         itemVisibleOutCallback: 	{onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
});
