<!--
//get current pic based on src path
function getCurrentPic(picpath) {
	currentPic = picpath;
	x = currentPic.length;
	// only works if number is 2 digits!!!!!
	begin = x-6;
	end = x-4;
	currentPic = currentPic.substring(begin,end);
	currentPic = parseInt(currentPic,10);
	return currentPic;
}

// displays picture when chosen from gallery
function showPic (whichpic) {
	currentPicNum = getCurrentPic(whichpic.toString()); 
	if (document.getElementById) {
		document.getElementById('placeholder').src = whichpic.href; 
		document.getElementById('placeholder').alt = whichpic.title;
		document.getElementById('count').childNodes[0].nodeValue = currentPicNum + ' of ' + howManyPics;
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}

//uses next and prev links to display photos in gallery
function nextPic () {
	var nextPic;
	p = getCurrentPic(document.getElementById('placeholder').src);
	nextPic = p+1;
	
	if (nextPic > howManyPics) {
		nextPic = 1;
	}
	nextPic = nextPic.toString();
	if (nextPic.length==1) {
		nextPic = "0" + nextPic;
	}
	showPic(document.getElementById('lnk'+nextPic));
}

function prevPic () {
	var prevPic;
	p = getCurrentPic(document.getElementById('placeholder').src);
	prevPic = p-1;
	if (prevPic==0) {
		prevPic = howManyPics;
	}
	prevPic = prevPic.toString();
	if (prevPic.length==1) {
		prevPic = "0" + prevPic;
	}
	showPic(document.getElementById('lnk'+prevPic));
}
//-->

