here's how we do it at work:
first modify the nav table to add extra classes defining sections.
Code:
<ul id="nav">
<li class="nav_item illust"><a href="illustration/index.html">Illustration</a></li>
<li class="nav_item photo"><a href="photography/index.html">Photography</a></li>
<li class="nav_item design"><a href="design/index.html">Design</a></li>
<li class="nav_item stories"><a href="stories/index.html">Stories</a></li>
<li class="nav_item profile"><a href="profile.html" title="Profile">Profile</a></li>
<li class="nav_item contact"><a href="contact.html" title="Contact">Contact</a></li>
<li class="nav_item links"><a href="links.html" title="Links">Links</a></li>
</ul>
now edit each and every page (sorry), and add a class to the body tag defining the section, using the same classes as before.
example:
Code:
<body class="illust">
now make a css stylesheet to modify only the active link (according to body's class):
Code:
<style>
.illust .illust a,
.photo .photo a,
.design .design a,
.stories .stories a,
.profile .profile a,
.contact .contact a,
.links .links a { background-color:yellow; color:blue; }
</style>
that's it.
now, you won't rely on javascript or brittle file naming conventions to show the active section. You can change the section by editing the body class. Also, don't forget that you can define more than one class per class attrib, so you can even pool your sections together in this manner.
advantages to not using javascript for this:
CSS will appear faster than javascript would because styles are typically parsed before the page is shown,
whereas javascript typically has to wait for everything (or at least the whole page) to load before running.
CSS also uses less CPU than JS, so you site will be snappier on iPhones and other slow machines.
There are also about 5% of surfer who disable javascript by default, but CSS use is near 100%, so everyone will see it.