//Grab the name of the HTML file and either increment/decrement to the next file
function GoToPage(documentObj,direction) {
	var currentPage = (+documentObj.substr(-8,3));
	
	//Account for substr bug in IE
	if(isNaN(currentPage)) {
		currentPage = (+documentObj.substr(37,3));
		//Check for lack of www. in URL
		if(isNaN(currentPage)) {
			currentPage = (+documentObj.substr(33,3));
		}
	}
	
	if(direction == "next") {
		currentPage++;
	}
	else if(direction == "prev" && currentPage > 1) {
		currentPage--;
	}
	else {
		return false;
	}
	//Append either 0 or 00 in front of the HTML file to maintain filename consistency regardless of the value of currentPage
	var newPage = currentPage < 10 ? "00"+currentPage+".html" : (currentPage < 100 ? "0"+currentPage+".html" : currentPage+".html");
	location.href= newPage;
}