addClass - Please Help!

addClass - Please Help!

This is the JS for a very simple accordion menu:

$(document).ready(function(){
$('#accordion-container > li > a').bind('click',function() {
  var $next = $(this).next().addClass("class1");
  if ($next.is(':visible')) return false;
 
  $(this).parent().parent().find('li > ul:visible').slideUp('normal').removeClass("class1");
  $next.slideDown('normal');
  return false;
  });
});


What do I need to modify to be able to ADD class "active" when a menu is opened (via the <a> trigger) and REMOVE the same class and/or apply it to the other menu that is opened?

Many thanks.