// JavaScript Document
var currentThumbId = 0;
function loadPhoto (newIndex,fileName) {
	var tmpObj = document.getElementById('galleryPhoto');
	if (tmpObj) tmpObj.src = '/showimage.php?type=galleryFull&img=' + arrImg[newIndex];
	//tmpObj = document.getElementById('img_frame_' + index);
	//if (tmpObj) swapFrame (tmpObj, 'ff');
	//tmpObj = document.getElementById('img_frame_' + newIndex);
	//if (tmpObj) swapFrame (tmpObj, 'on');
	tmpObj = document.getElementById('thumb_' + newIndex);
	if (tmpObj) {
		if (newIndex%2==0) tmpObj.style.backgroundColor = '#ffedc8';
		else tmpObj.style.backgroundColor = '#ffedc8';
		}
	tmpObj = document.getElementById('thumb_' + currentThumbId);
	if (tmpObj) {
		if (currentThumbId % 2==0 )tmpObj.style.backgroundColor = '';
		else tmpObj.style.backgroundColor = '';
		}
	currentThumbId = newIndex;
}


function loadPrevPhoto () {
	if (galleryIndex == 0) return false;
	loadPhoto(galleryIndex-1);
}

function loadNextPhoto () {
	if (galleryIndex == arrImg.length -1) return false;
	loadPhoto(galleryIndex+1);
}