function mycarousel_itemLoadCallback(carousel, state) {
	for (var i = carousel.first; i <= carousel.last; i++) {
		if (carousel.has(i)) { continue; }
		if (i > mycarousel_itemList.length) { break; }
		carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
	}

/*
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal',
		padding: 40,
		opacity: 0.6,
		showTitle: true,
		allowresize: true,
		counter_separator_label: '/',
		theme: 'dark_rounded',
		callback: function(){ $("#video").css('visibility', 'visible'); }
	});
*/
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item) {
		//return '<a href="' + item.url + '" rel="prettyPhoto[1]" title="Afbeelding"><img src="' + item.url + '" width="180" height="100" alt="" /></a>';
		return '<img src="' + item.url + '" width="180" height="100" alt="" />';
};

$(document).ready(function() {
	$('#mycarousel').jcarousel({
		size: mycarousel_itemList.length,
		itemLoadCallback: { onBeforeAnimation: mycarousel_itemLoadCallback }
	});
});