function mycarousel_initCallback(carousel, state)
{

    carousel.lock();

    jQuery.get(
        'http://www.13emerue.fr/13emeruev2/sources/GetBarillet.ashx?ProgId=',
        {
            'feed': ''
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, xml)
{
    var $items = jQuery('item', xml);
    
    $items.each(function(i) {
        carousel.add(i + 1, mycarousel_getItemHTML(this));
    });

    carousel.size($items.size());
    //carousel.startValue(jQuery('OnIndex', xml).text());
    jQuery('.programmes').jcarousel({
		vertical: true,
		animation: "fast",
		ease: "slow",
		scroll: 4,
		start: jQuery('OnIndex', xml).text()
		});
		
    // Unlock and setup.
    carousel.unlock();
    carousel.setup();
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    //return '<h3><a href="'+$('link', item).text()+'">'+$('title', item).text()+'</a></h3>';
    //return '<li class="'+$('class', item).text()+'"><a href="'+$('link', item).text()+'"><span class="heure_prg">'+$('hour', item).text()+'</span><span class="titre_Prg">'+$('title', item).text()+'</span></a></li>'
    return '<li class="'+$('class', item).text()+'"><span class="heure_prg">'+$('hour', item).text()+'</span><span class="titre_Prg">'+$('title', item).text()+'</span></li>'


};