function init()
{


	$('.vignette').click(function(){
			
		var index = $('.vignette').index(this);
		var target = $('.vignette:eq('+index+')').attr('alt');
		var preview = $('.vignette:eq('+index+')').attr('src');
		var titre = $('.vignette:eq('+index+')').attr('title');
		
		loadPlayer(target,preview,titre);
		setInfos(titre);	
		
	});
}

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();
    });
};

function setInfos(infos)
{
	$('#now').text(infos);
}

function loadPlayer(target,preview,name)
{
	
		var flashvars = {
			video:target,
			photo:preview,
			titre:name,
			autoplay:"1",
			buffer:"5",
			data:"swf/PlayerAlone.swf",
			width:"690",
			height:"394",
			allowFullScreen:"true",
			wmode:"opaque"
			};
		var params = {allowFullScreen:"true"};
		var attributes = {};
		swfobject.embedSWF("swf/PlayerAlone.swf", "player", "690", "394", "9.0.0","swf/expressInstall.swf", flashvars, params, attributes);
	
	
}
