/* This JS file is used to manipulate the navigation links so that the
 * the main navigation menu can be an uneditable part of the template 
 * Date created: 8-10-09 by D.C.
 */
 
 /* Used to remove the link off of the desired link (of the current page)
  * and to change its styling so that it is highlighted 
  */
 function selectLink(id){
     //Changes selected link
     var link = document.getElementById(id);
     link.removeAttribute("href");
     link.className += " selected";
     var menuId = id + "_menu";

     //Checks to see if selected link is part of a submenu
     if(link.parentNode.className == "submenu hidemenu"){
         link.parentNode.className = "submenu";          //makes submenu visible
         var parentName = link.parentNode.id.substring(0,link.parentNode.id.length-5);
         document.getElementById(parentName).className += " selected";
     }
     //If not, checks if selected link has a submenu
     else if(document.getElementById(menuId)){
         document.getElementById(menuId).className = "submenu";
     }
 }

 

