/**
*  Function that replaces the picture inside the gallery
*/

function setupThumbnailObserve() {
    var selectFunction = function(imgName, imgCaption) {
	var photo = $('photoDisplay').getElement('img');
	photo.setProperty('src', imgName);
	var caption = $('photoDisplay').getElement('p');
	caption.empty();
	if ($chk(imgCaption)) {
	    caption.appendText(imgCaption);
	}
	return false;
    };
    
    var thumbnailArray = $('photoStrip').getElements('img');
    thumbnailArray.each(function(photo, i) {
	    var src = photo.getProperty('bigsrc');
	    var caption = photo.getProperty('caption');
	    photo.addEvent('click', selectFunction.pass([src, caption], this));
	});
}

function repositionMenu() {
    var wholeMenu = $("menu");
    var bottomOffset = wholeMenu.getStyle("bottom");
    bottomOffset = $("maincontent").getSize().y + $("footer").getSize().y;
    wholeMenu.setStyle("bottom", bottomOffset);
};

