$(document).ready(

  function()
  {
    $($("#thumb-list li")[0]).addClass("selected");
    $("div#big-image-loading").hide();
    $("#thumb-list a").click(
      function()
      {
        $("#thumb-list li").removeClass("selected");
        loadImage( $(this).attr("href"), $(this).attr("title") )
        $(this).parent().addClass("selected");
        return false;
      }
    )
  }

)


function loadImage( url, title )
{
  var img = $("<img />").attr("src", url).attr("title", title).css("display", "none");
  $("div#big-image-loading").show();
  img.load(
    function()
    {
      $("div#big-image-container img").fadeOut(500, function(){
        $(this).remove();
        $("div#big-image-container").append(img);
        $("div#big-image-title").text(title);
        img.fadeIn(500);
        $("div#big-image-loading").hide();
      });
    }
  )
  
  
  
}