window.onload=initlinks;

var thisPic=0;

function initlinks() {
	document.getElementById("prevlink").onclick=processPrevious;
	document.getElementById("nextlink").onclick=processNext;
}

function processPrevious() {
	if (thisPic == 0) {
	thisPic = myPix.length;
	}
	thisPic--;
	document.getElementById("myPicture").src = myPix[thisPic];
	return false;
}


function processNext() {
	thisPic++;
	if (thisPic == myPix.length) {
		thisPic = 0;
	}
	document.getElementById("myPicture").src = myPix[thisPic];
	return false;
}