﻿jQuery(function() {
    $("#menu-neuf .sub").hide();
    
    $("#menu-neuf .sub").each(function(){
        $("li:first a", this).css("borderRight", "none");
        //$("li:first", this).css("backgroundColor", "#f00");
    });
    
	$("#menu-neuf>li").hover(
	    function() {
	        $(this).fadeTo(200,1);
	        $(".sub", this).show();
	        $(".sub li", this).fadeTo(200,1);
	    },
	    function() {
	        $(this).fadeTo(200, 0.65);
	        $(".sub li", this).fadeTo(200,0.65);
	        $(".sub", this).hide();
	        
	        
	    }
	);
	
	
	//$("#wapper_selecteur_voiture_neuve div.category-wrapper:not(:first)").hide();
	$("#wapper_selecteur_voiture_neuve div.category-wrapper").hide();
	var el = $("#wapper_selecteur_voiture_neuve div.category-wrapper");
	var max_el = $(el).size();
	var current_el = 0;
	$(el[current_el]).show();
	
	$("#bt_haut_selecteur_voiture_neuve").click(function(){
	    $(el[current_el]).hide();
	    current_el++;
	    if (current_el >= max_el) {
	        current_el = 0;
	    }
	    $(el[current_el]).fadeIn("slow");
	});
	
	$("#bt_bas_selecteur_voiture_neuve").click(function(){
	    $(el[current_el]).hide();
	    current_el--;
	    if (current_el < 1) {
	        current_el = max_el-1;
	    }
	    $(el[current_el]).fadeIn("slow");
	});
	
	//alert( c );

});

