/* depliants
 * Fonction jQuery 
 * 
 * Intègre des menus dépliants 
 *
 */
$(document).ready(
  function(){
    // Depliants en listes à puces (<ul.depliant><li><a>)
	$("ul .depliant").parents("li").find("div").toggle("fast");
    $("ul .depliant").click(
      function() {
        if($(this).parent("li").attr("class").indexOf("depliantPuce2") != -1) {
          $(this).parent("li").children("div").hide("fast");
          $(this).parent("li").removeClass("depliantPuce2");
          $(this).parent("li").addClass("depliantPuce1");
        } else {
          $(this).parent("li").children("div").show("fast");
          $(this).parent("li").removeClass("depliantPuce1");
          $(this).parent("li").addClass("depliantPuce2");
        }
      }
    );
	// Depliants en boîtes (<div.collaps><div><a.switch>)
	$("a.switch").parent(".head1").parents(".collaps").find(".body").toggle("fast");
    $("a.switch").parent("div").click(
      function() {
        if($(this).attr("class").indexOf("head2") != -1) {
          $(this).parents(".collaps").children(".body").hide("fast");
          $(this).removeClass("head2");
          $(this).addClass("head1");
        } else {
          $(this).parents(".collaps").children(".body").show("fast");
          $(this).removeClass("head1");
          $(this).addClass("head2");
        }
      }
    );
  }
);


