title: Which div is currently active?
body: <p>I have a series of divs ( displaying graphics). Click one graphic div and something is written in a div.</p>
  
  <pre><code>$("#graphic1").click(function(){  
     $("#text").html("Something important goes here.") 
  }
  </code></pre>
  
  <p>But if the user clicks graphic1 when graphic8 is displayed I want it to do something else</p>
  
  <pre><code>if (graphic8 was active before graphic1 was clicked){
     do this
  } else {
     do that
  }
  </code></pre>
  
  <p>To explain further</p>
  
  <ol>
  <li>there are many divs. </li>
  <li>any one of these divs may be active at one time.</li>
  <li>when selecting a new div I would like to know which div was active BEFORE the new div was selected.</li>
  </ol>
  
  <p>EDIT 9/14 in response to answers</p>
  
  <p>Here's a quick example at jsfiddle:  <a href="http://jsfiddle.net/MAYO/2DEnY/2/" rel="nofollow">http://jsfiddle.net/MAYO/2DEnY/2/</a></p>
  
  <p>I would like that for the divs to
  1. toggle
  2. when selecting a new div that the description is displayed below. I tried and failed doing combinations of if/else clauses.
  3. After this little bit is done (and I think solving this would solve the next) I would like it that the text description be able to be different depending upon which div was previously active. </p>