Secure includes + more...?

Hey!

Heres the situation:

I have a website. In this website, I have the following structure:

folder1/folder2/folder4/index.html
folder1/folder3/folder5/index.html

OR

folder1
  |- folder 2
      |- folder 4
          |- index.html
  |- folder 3
       |- folder 5
          |- index.html

So. I need to write a script that will be able to do this:
Include /folder1/folder2/folder4/index.html or /folder1/folder3/folder5/index.html.

I will have a few folders in folder 3/5…

How can I do this?

I have seen scripts to include from one source, but how do I gain the ability to include from either source?

I would think the url should be something like viewer.php?class=folder2&id=folder4 but I have no idea…

Would appreciate any help…