Toggle 2 Div's

Toggle 2 Div's

Hi,

Wondered if someone could help me with a problem I'm having.

I have 2 links, one for "Search" and one for "Filter". I have code in place to handle the show/hide of one link. this code (below) changes the link text and shows a div and does the reverse.

I need to modify the code so that it can work with 2 Div's. For example, if the Div for "filter" is showing and "search" is clicked, then, hide "filter" and show "search. And vice versa.

The code below is what I use to handle one toggle...

//Search show/hide facility
   var showText='Search within';
   var hideText='Hide Search';
   $('a#filter',top.document).text(showText);
   $('.search',top.document).hide();
   $('a#filter',top.document).click(function() {
      $(this).html ($(this).html()==showText ? hideText : showText);
      $('.search',top.document).toggle('slow');
      return false;
   });