		var URL = unescape(location.href)	// get current URL in plain ASCII
		var xstart = URL.lastIndexOf("/") + 1
		var xend = URL.length
		var digitOnePlace = URL.lastIndexOf('.') - 2
		var digitTwoPlace = URL.lastIndexOf('.') - 1
		var digitOne = URL.charAt(digitOnePlace)
		var digitTwo = URL.charAt(digitTwoPlace)
		var filePrefix = URL.substring(xstart,digitOnePlace)
		var suffixStart = URL.lastIndexOf('.')
		var fileSuffix = URL.substring(suffixStart,xend)

		/* The following lines provide a workaround for the JS
		implementation in Opera 3.0, which treats all elements
		of a string as string values, and therefore cannot
		perform arithmatical operations on them correctly;
		to get around this, I create new variables with number
		values equivalent to the values of digitOne and digitTwo
		*/

		var dig1 = null
		var dig2 = null
		dig1=parseInt(digitOne)
		dig2=parseInt(digitTwo)
		
	function prevPage() {

		if (dig2 == 0) {
			dig2 = 9
			dig1--
		}
		else {
			dig2--
		}
		previousFileName = filePrefix + dig1 + dig2 + fileSuffix
			if (previousFileName != "000.html") {
				location.href = previousFileName
			} else {
				location.href = "index.html"
			}
	}
	
	function nextPage() {
	if (dig2 == 9) {
			dig2 = 0
			dig1++
		}
		else {
			dig2++
		}
		nextFileName = filePrefix + dig1 + dig2 + fileSuffix
		location.href = nextFileName
	
	}

	function firstPage() { // construct the name of the first file in the set and jump to it
			dig2 = 0
			dig1 = 0
		firstFileName = filePrefix + dig1 + dig2 + fileSuffix
		location.href = firstFileName
	}

	function indexPage() {
		location.href = "index.html"
	}