/**
 * Sets up the logic to magnify embedded photos
 */
function setupPhotoMagnification(id, imgWidth, imgHeight) {
    $("#photo-" + id).bind("click",
        function() {
            if ($(this).is(".magnified")) {
                $(this).parent().children(".photo-magnifier").show();

                $(this).parent().animate({ height: Math.ceil(imgHeight / 2) + 18, width: Math.ceil(imgWidth / 2) }, 500);
                $(this).animate({ height: Math.ceil(imgHeight / 2), width: Math.ceil(imgWidth / 2) }, 500);
                $(this).removeClass("magnified");
            }
        });

    $("#photo-magnifier-" + id).bind("click",
        function() {
            $(this).parent().hide();

            var animation = { height: imgHeight, width: imgWidth };
            $("#photo-" + id).animate(animation, 500).addClass("magnified");
            $("#photo-" + id).parent().animate(animation, 500);
        });

}
