$(document).ready(function(){
	$(".b-ic ul li a").click(function()
	{
		$(this).next(".b-ic ul li ul").slideToggle(400)
		return false;
	});
	$(".b-ic ul li a").click(function()
	  {
		$(this).toggleClass("active")
		return false;
	  });
	$("#compare").click(function(){
		var nb = 0;
		var ids = "";
		var sep = "";
		$("input[name=ids]").each(function(i,el){
			if($(el).attr("checked")){
				ids = ids + sep + $(el).val();
				sep = ",";
				nb+=1;
			}
		});

		if(nb>1&&nb<5) window.location = "http://www.allopneus.com/Compare?id="+ids;
		else alert("Cochez entre 2 et 4 pneumatiques");
	});
});
function affiche(id,oui_non) {
    var element_style=null
    if (document.getElementById) {
        element_style=document.getElementById(id).style;
    } else if (document.all) {
        element_style=document.all[id].style;
    }
    if(element_style) {
        if (oui_non==true){
            element_style.visibility="visible";
            element_style.height="200px";
		}
        if (oui_non==false){
            element_style.visibility="hidden";
            element_style.height="0px";
            }
    }
}
function affiche_home(id,oui_non) {
    var element_style=null
    if (document.getElementById) {
        element_style=document.getElementById(id).style;
    } else if (document.all) {
        element_style=document.all[id].style;
    }
    if(element_style) {
        if (oui_non==true){
            element_style.visibility="visible";
            element_style.height="220px";
		}
        if (oui_non==false){
            element_style.visibility="hidden";
            element_style.height="0px";
            }
    }
}
function affiche_pouce(h,id,oui_non) {
    var element_style=null
    if (document.getElementById) {
        element_style=document.getElementById(id).style;
    } else if (document.all) {
        element_style=document.all[id].style;
    }
    if(element_style) {
        if (oui_non==true){
            element_style.visibility="visible";
            element_style.height=h;
		}
        if (oui_non==false){
            element_style.visibility="hidden";
            element_style.height="0px";
            }
    }
}
function affichebis(id,oui_non) {
    var element_style=null
    if (document.getElementById) {
        element_style=document.getElementById(id).style;
    } else if (document.all) {
        element_style=document.all[id].style;
    }
    if(element_style) {
        if (oui_non==true){
            element_style.visibility="visible";
            element_style.height="120px";
		}
        if (oui_non==false){
            element_style.visibility="hidden";
            element_style.height="0px";
            }
    }
}
function affiche2(h,id,oui_non) {
    var element_style=null
    var lenth=0;
    if (document.getElementById) {
        element_style=document.getElementById(id).style;
    } else if (document.all) {
        element_style=document.all[id].style;
    }
    if(element_style) {
        if (oui_non==true){
             element_style.visibility="visible";
             element_style.padding=h;

		}
        if (oui_non==false){
             element_style.visibility="hidden";
             element_style.height="0px";
             element_style.padding=h;
             }
    }
}
