Toggle 2 divs with 2 links
<p>I'm pretty new to jquery and here's what I'm trying to do:</p>

<p>I have two links: link1 - link2
And 2 divs: div1, div2</p>

<p>What I would like to do:</p>

<p>If you click on link1 it slideDown the div1, if you click on link1 again, it slideUp div1
BUT
If you click on link1 and then on link2 I want the div1 to slideUp and then slideDown the div2</p>

<p>Here's the code that I was playing with:</p>

<pre><code>$(document).ready(function(){

   $("#div1").hide();
   $("#div2").hide();
   $('.link1').click(function(){
       $("#div2").slideUp();
       $("#div1").slideToggle();
   });
   $('.link2').click(function(){
       $("#div1").slideUp();
       $("#div2").slideToggle();
   });

});
</code></pre>
