/*  showPic accepts a photoID via onclick and changes the src attribute
 *  of the main photo to the src of the photo that was clicked on
 *  THIS IS ONLY HERE FOR BACKWARDS COMPATIBILITY AND YOU SHOULD USE SHOWPHOTO.JS INSTEAD!
 */

var path = "/photos/";
var fileExt = ".jpg";

function showPic(photoID, photoHeight, photoWidth, photoCaption) {
    if (photo = document.getElementById('mainPhoto')) {
        photo.src = path + photoID + fileExt;
        photo.width = photoWidth;
        photo.height = photoHeight;
        
        if (photoCaptionTag = document.getElementById('caption')) {
            photoCaptionTag.firstChild.nodeValue = photoCaption;
        }
        
        if (photoTop = document.getElementById('largePhoto')) {
            photoTop.focus();
        }
        
        return false;
    } else {
        return true;
    }
}

