// jmenu plugin.

(function($){
    $.fn.jmenu = function(options) {
        return this.each(function() {   
            
	  $('ul:not(.active)', this).hide();
	  $('li a', this).each(function() { if ($(this).next().is('ul')) $(this).addClass("parent");  });
	  //$('ul:first', this).show();
	  $('li a', this).click( 
		function() {
		  var checkElement = $(this).next();
		  if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
		  $(this).removeClass("ouvert");
		  checkElement.slideUp('fast');
		  return false;
		  }
		  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
		  $('#menu ul:visible').slideUp('normal');
		  $(this).addClass("ouvert");
		  checkElement.slideDown('fast');
		  return false;
		  }
		}
	  ); //end click
			
        }); //end each
    }; //end jmenu
		
})(jQuery);






