/*
* File: pagebynumber.js
* Does not check to see if file exists.
* Has no looping function for increment.
* Name file filename1.htm.
*/

function getPageByNum(increment) {
// Arguments:
// increment: +/- integer specifying position of item
// relative to position in href.

	var href = document.URL;
	var pat = /(.*\D+)(\d+)(.*)/;
	var aPat = href.match(pat);
	var path = aPat[1];
	var pos = aPat[2];
	var ext = aPat[3];
										
	pos = 1 * pos + increment;			// Get increment position.
	
	return path + pos + ext;				// Return href with increment position.
}

// Call either function below from onClick event to load next/previous page
// based on current page position.

function nextPage() {
	window.location.href = getPageByNum(1);
}

function prevPage() {
	window.location.href = getPageByNum(-1);
}