  function select_nav() {
     var nav_links = document.getElementById('subnav')
       .getElementsByTagName('a');
     var selected = location.pathname;

     // Now, we can loop through each list item using a FOR loop:
		  //for (var i = 0, length = nav_links.length; i < length; i++) {
		      // Extract text node within and alert its content:
		  //    alert( nav_links[i].firstChild.data );
 //}

		  for (var i = 0, length = nav_links.length; i < length; i++) {
       var link = nav_links[i].pathname;

       // fiddle IEs view of the link
       if (link.substring(0, 1) != '/')
         link = '/' + link;
				 if (link == selected) {
					 nav_links[i].setAttribute('class', 'selected');
					 nav_links[i].style.color = '#000';				//this works for IE
					 i = nav_links.length;
			 }
   	}
   }

   window.onload = function() {
     select_nav();
   };

