var whichExample = 1000 * maxExamples;	// Make large and positive

function normalize(num, low, high) {
	return Math.abs(num % (high - low + 1)) + 1;
}
function click() {
	var sound = document.getElementById('bgSound');
	sound.src = 'sounds/click.wav';
}
function previousExample(pageName) {
	var img = document.getElementById('Example');
	
	img.src = 'images/' + pageName + normalize(--whichExample, 1, maxExamples) + '.jpg';
	click();
}
function nextExample(pageName) {
	var img = document.getElementById('Example');
	
	img.src = 'images/' + pageName + normalize(++whichExample, 1, maxExamples) + '.jpg';
	click();
}
function zoomExample(pageName) {
	var now = new Date();
	
	window.open('images/' + pageName + normalize(whichExample, 1, maxExamples) + '.pdf', now.getSeconds());
}
