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

$(document).ready(function() {
	//document.getElementById('NL_box').innerHTML="<span>Inscrivez-vous</span> à notre lettre d'information";
	$("a.thickbox, a[rel='lightbox']").fancybox({'hideOnContentClick': false,imageScale : true}); 
	$("a#box_ami").fancybox({frameWidth : 300,frameHeight : 200}); 
	if(document.all){$("a#box_fav").click(function(){window.external.AddFavorite(location.href, document.title);});
	}else{$("a#box_fav").fancybox({'hideOnContentClick': true,frameWidth : 400,frameHeight : 100});}
			
	$('#logo').hover(function() { //mouse in
   		$(this).find('img').stop().animate({ opacity: '0' }, 250);
  	}, function() { //mouse out
    	$(this).find('img').stop().animate({ opacity: '1' }, 250);
   	});
	
	$('#nav li ul.sousMenu').css({'height':0});
	var h=0;
	var v=24;
	var q=32;
	$('#nav li').hover(function() { //mouse in
		h=($(this).find('ul > li').length)*v;
		h+=q;
   		$(this).find('ul.sousMenu').stop().animate({ 'height': h }, 250);
  	}, function() { //mouse out
    	$(this).find('ul.sousMenu').stop().animate({ 'height': 0 }, 250);
   	});
	
	jQuery('#carrousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
	
	$('#formulaire_2 fieldset input.xx').click(function() {
		if($(this).attr('checked'))
			$(this).parent().parent().parent().parent().parent().find('div.yy').css({'display':'block'});
		else
			$(this).parent().parent().parent().parent().parent().find('div.yy').css({'display':'none'});
	}) 
});


      

