/**************************************************************************
 *                                                                        *
 *  JAVASCRIPT MENU HIGHLIGHTER v.1.0 (051123)                            *
 * --------------------------------------------                           *
 * ©2005 Media Division (www.MediaDivision.com)                           *
 *                                                                        *
 * Written by Marius Smarandoiu & Armand Niculescu                        *
 *                                                                        *
 * You are free to use, modify and distribute this file, but please keep  *
 * this header and credits                                                *
 *                                                                        *
 * Usage:                                                                 *
 * - the script will apply the .current class to the <a> and its parent   *
 *   <li> that is contained in the element with id="primarynav" and points*
 *   to the current URL                                                   *
 * - works in IE6, Firefox and Opera  
                                   *
 **************************************************************************/

 function setPage() {
   var nav_links = document.getElementById('sidebar')
     .getElementsByTagName('a');
   var selected = location.pathname;
   
   for (var i = 0; i < nav_links.length; i++) {
     var link = nav_links[i].pathname;
     
     // fiddle IE's view of the link
     if (link.substring(0, 1) != '/')
       link = '/' + link;
     
     if (link == selected)
       nav_links[i].className = "current";
       nav_links[i].parentNode.className = "current";
   }
 }
