    $(function(){
        // hide the large photo pop up
        var lrgPhotoDiv = $("#mainPhoto");
        lrgPhotoDiv.hide();
        
        // set up the click event for all of the thumbnails    
        $(".photoThumbs a").click(function(){
            var imageSource = $(this).children("img").attr("src");
            showImage(imageSource);
            return false;
        });
        
        // activate the close link on the pop up
        $("#closeLink a").click(function(){
            $("#mainPhoto").fadeOut("slow");
        });
    });
    
    //center the large photo pop up
    function centerElement(popUp) {
        var dimensions = {width: 0, height: 0};

        dimensions.width = document.documentElement.clientWidth;
        dimensions.height = document.documentElement.clientHeight;
       
        var pageContainerWidth = $("#masterDiv").width();
        var pageContainerHeight = document.documentElement.clientHeight;
        
        var popWidth = $(popUp).width();
        var popHeight = $(popUp).height();
        
        var topPos = (pageContainerHeight/2) - (popHeight/2);
        var leftPos = (pageContainerWidth/2) - (popWidth/2);
        
        //alert("topPos: "+ topPos + "\nleftPos: " + leftPos);
        $(popUp).css({top:topPos, left:leftPos});
    }
    function showImage(src){
        centerElement($("#mainPhoto"));
        
        $("#mainPhoto img:not(.close)").fadeOut("slow").remove();
        var largeImage = new Image();
        
        $(largeImage).load(function(){
            $(largeImage).hide();
            $("#mainPhoto").append(largeImage);
            $("#mainPhoto").fadeIn("slow");
            $(largeImage).fadeIn("slow");
        });
        $(largeImage).attr("src", src);
    }
    //-->