jQuery(document).ready(function(){
	/* Slideshow de la page d'accueil */
	jQuery('#slideshow').fadeSlideShow({
		PlayPauseElement: false,
		NextElement: false,
		PrevElement: false,
		ListElement: false,
		speed: 1000,
		interval: 5000,
		width: 980,
        height: 355
	});

	/* Scroll horizontal page d'accueil */
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        scroll: 1,
        wrap: 'last',
        buttonNextHTML: '',
        buttonPrevHTML: '',
        visible: 4
    });

	/* initMenu() */
	initMenu();

	$("#commentForm").validate();

	/* DEMANDE DE RENSIGNEMENT */
	$("#envoi-numero").validate({
		errorLabelContainer: $(".message-erreur")
	});
	if($('#confirmation-besoin-renseignement').length){
		window.setTimeout(function(){
			$('#confirmation-besoin-renseignement').fadeOut('fast',function(){
				$('#besoin-renseignement-form').fadeIn();
			});
		},4000);
	}

	$.each($('#allinone-contenu table tr:not(.entete)'),function(i,e){
		var css = '';
		if(i%2==0){
			css = 'odd';
		}else{
			css = 'even';
		}
		$(e).addClass(css);
	});
});
	
// ---------------------------- Sous navigation page type All in one
function initMenu() {
	$('#allinone-sous-nav li a').click(function(){
		if($(this).attr('href') == 'javascript:void(0);'){
			$('#allinone-sous-nav ul li ul').hide();
			$(this).next().slideToggle('normal');
		}
	});
}

// ---------------------------- Zindex fix IE
$(function() {
	var zIndexNumber = 1000;
	$('div.sbHolder').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});
