I want to put a book up on my site - it is a tech manual of some 500 pages and they are all scanned in as jpg images.

the viewer will want to be able to enter at the beginning of any chapter and from there scroll rapidly through the pages to find the page they want.

There are 22 chapters. Some only a few dozen pages, a couple with more than 100 pages. So clicking on 'Next Page' is not an option.

I currently have a working algorithm that does that: allows starting at the beginning of a chosen chapter and from there one can click to go 'Next Chapter', 'Last Chapter', 'Last Page' or 'Next Page' and though it works it is not reasonable to expect anyone to go through those big chapters with this methodology.

It is written in PHP

Any ideas? Any existing algorithms/code ?