Thanks for prompt reply.
I need navigation of more or less the structures that you have seen from the two examples. The first one was done entirely by me, so I can easily accept the fact that java script might have some errors as I am not java script developer. The other navigation, however, was done by a developer, and, as similar to my original idea, added to test if it's working with in5 - not working as you can see.
I need a lot of features to be included in the navigation, i.e. scrollable table of content with at least one sublevel (there will be lots of chapters in the document); glossary, also run with js, tooltips; some animations (full screen) called from the navigation. This was exactly what I constructed, all working in browsers.
The goal is to have an application for mobile devices with navigation as in the example. I need it to slide over the content (not pushing the content).
If there is another solution for what I need, I would be happy to experiment.