var carouselcinema_itemList = [
    {url: '../img/photos/deux-freres_s.jpg', title: '<em>Deux Frères</em>'},
	{url: '../img/photos/jean-jacques-annaud_s.jpg', title: 'Jean-Jacques Annaud'},
	{url: '../img/photos/delicatessen_s.jpg', title: '<em>Delicatessen</em>'},
	{url: '../img/photos/tcheky-karyo_s.jpg', title: 'Tchéky Karyo dans <em>Le Baiser Mortel du Dragon</em>'},
	{url: '../img/photos/dragon_s.jpg', title: '<em>Le Baiser Mortel du Dragon</em>'},
	{url: '../img/photos/les-yeux-de-laura_s.jpg', title: '<em>Les Yeux de Laura</em>'},
	{url: '../img/photos/obispo_s.jpg', title: 'Obispo'},
	//{url: '../img/photos/adriana-flavien-cauet_s.jpg', title: 'Adriana, B. Flavien &amp; Cauet'},
	{url: '../img/photos/l-embellie_s.jpg', title: 'L&rsquo;<em>Embellie</em> avec Jean-Pierre Cassel'},
	{url: '../img/photos/chedid_s.jpg', title: 'Chedid'}
];

function carouselcinema_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > carouselcinema_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(carouselcinema_getItemHTML(carouselcinema_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};
 
/**
 * Item html creation helper.
 */
function carouselcinema_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
	return '<a href="' + url_m + '" alt="' + item.title + '" name="' + item.title + '" class="thickbox" style="text-decoration:none;"><img src="' + item.url + '" alt="' + item.title + '" width="159px" height="152px" /><div style="color:#fff; position:relative; bottom:12px; font-size:9px; text-align:center; width:159px;">' + item.title + '</div></a>';
};
 
jQuery(document).ready(function() {
    jQuery('#carousel-cinema').jcarousel({
		size: carouselcinema_itemList.length,
		scroll: 2,
        itemLoadCallback: {onBeforeAnimation: carouselcinema_itemLoadCallback},
    });
});
