var work_thumb_last_shown = null;

function work_thumb_show() {
    var newsrc = $(this).attr("href");

    if(newsrc == work_thumb_last_shown) {
        return;
    }
    work_thumb_last_shown = newsrc;
    
    if(this.large_img) {
        $("#img_lrg img").fadeOut("normal");
        this.large_img.stop().fadeIn("normal");
    } else {
        $("#placeholder").attr("src",newsrc).hide().fadeIn();
    }
}

$(document).ready(function() {
        $("#imagegallery li:not(.last) a").each(function (i) {
                var img = $("<img style='position:absolute; right:0; display: none;' border='0' alt='Rendering'/>").attr("src", $(this).attr("href")).hide();

                this.large_img = img;
                
                $("#img_lrg").append(img);
            }).bind("mouseover", work_thumb_show).bind("click", function(){ return false; });
        work_thumb_last_shown = $("#placeholder").attr("src"); 
    });
