I am making a page for work, sorry I can't show it it's confidential. Anyways, the way the site structure is set up, is like this:


I have a navigation bar at the top of the page, but I want to change the classes depending on what section the user is on. So basically, if the user is at www.server.com/references/doc32.html, the 'references' graphic at the top would have a different style class applied to it. I can get that part done, I just don't know how to get the URL, and strip it, or match parts of it to store in a variable. If i can get javascript to search and strip away everything but 'references' or 'webforms' that would be perfect.

This page will be updated by many people, and many of them don't know html let alone anything script wise, so I have been smart and I'm keeping the files external. The idea was to create a page that will run efficiently, and doesn't require the use of tables, etc.

Anyways, I need a solution to this. The only reason I want this, is so the user will know what "section" they are because the graphic navigation at the top will be highlighted a different color. I just don't want to have to manually change the file, I just want one header file, and a javascript that is external to pull this information for me. The users who update the site will never touch the external files or the header files, etc. All they are worried about is updating the content, so therefor I need to make it where they don't have to ever touch anything else, and I think javascript would be the solution for this.

Any ideas on how to do this or did I make no sense whatsoever? lol.. sorry if i didn't.

Thanks in advance fellow web gurus.