jquery function only works once through
<p>I have a gallery type page with thumbnails.  When you click a thumb it loads the images having to do with that thumb into a hidden div, when they're done loading then div then slides open.  If you click another thumb it closes the div, clears the contents, loads the new content and then opens it again.  When you load the page you can click one thumb, then another, but if you go back to the first thumb and click the div won't open again, not sure why.  Thanks for any help on this.</p>

<p>I have a jsbin of it set up here <a href="http://jsbin.com/epawub/12/edit" rel="nofollow">http://jsbin.com/epawub/12/edit</a></p>

<p>the javascript I have set up for the thumbs is as follows:</p>

<pre><code>var imgCount = 0;
var image=$('#images');

$('#klossviolins').click(function() {
  console.log("Loading...");
  $('#images').slideUp(500, function() {
    $("#images").empty().ready(function(){ 
        $("&lt;img&gt;", {
            src: "http://www.klossal.com/images/klossviolins/home.jpg"
        }).appendTo("#images").load(onImage);
        $("&lt;img&gt;", {
            src: "http://www.klossal.com/images/klossviolins/services.jpg"
        }).appendTo("#images").load(onImage);
    });     
  });
  $("#info_header").empty();
  $('#info_header').append("Kloss Violins Website");
});


$('#light_dance').click(function() {
  console.log("Loading...");
  $('#images').slideUp(500, function() {
    $("#images").empty().ready(function(){ 
        $("&lt;img&gt;", {
            src: "http://www.klossal.com/light_dance_1.jpg"
        }).appendTo("#images").load(onImage);
        $("&lt;img&gt;", {
            src: "http://www.klossal.com/light_dance_var.png"
        }).appendTo("#images").load(onImage);
        $("&lt;img&gt;", {
            src: "http://www.klossal.com/light_dance_2.jpg"
        }).appendTo("#images").load(onImage);  
    });     
  });
  $("#info_header").empty();
  $('#info_header').append("Dancing With Light Series");
});




function onImage(e)
{
    console.log("Image loaded");
    imgCount++;

    if (imgCount == image.children().length)
    {
        image.slideDown(500);
    }
}
</code></pre>
