Can I improve this JQuery image replace code?
<p>The HTML looks kind of like:</p>

<pre><code>&lt;dl&gt;
  &lt;dt&gt;
    &lt;img src='Images\Something\expand-close.gif' /&gt; Something 1
  &lt;/dt&gt;
  &lt;dd&gt;Something 1 Text&lt;/dd&gt;
&lt;/dl&gt;
</code></pre>

<p>This HTML is repeated 1 or more times so there could be many instances of the HTML on the same page.</p>

<p>The Jquery I am using to expand the dd and replace the image is:</p>

<pre><code>$("dl").find("dt").click(function() {
  // toggle the dd
  $(this).next().toggle(200);

  // replace the expand / close image
  var img = $(this).find("img");
  var src = img.attr("src");
  if (src.lastIndexOf("open.gif") != -1)
  {
    img.attr("src", src.replace("open.gif", "closed.gif"));
  }
  else
  {
    img.attr("src", src.replace("closed.gif", "open.gif"));
  }
});
</code></pre>

<p>This all works fine and does exactly what I need it to do. My question is, can the JQuery function be done better?  I am relatively new to using JQuery and this one was a snippet I rattled off.  If it could be done better, please explain the changes as I am trying to learn how to write better JQuery code.  Any other pointers or suggestions would be appreciated as well.</p>
