// JavaScript Document FOR SITEMAP

$(document).ready(function() {

$("#sitemap li").addClass("c");  //add close class to all li's in #nav

/*
This menu script requires the jQuery library.  It will turn a standard html list (using ul/li tags) into a basic accordion menu. It has been altered to work with the above script which target the link to the active page.  This will open the menu to the link to the current page, in addition to adding a class to it.

To use:
1. Add the id "nav" to the containing ul tag of the entire menu.
2. add the following style to a linked stylesheet.
.c ul {display: none}
*/


$("#sitemap a").click(function() {
/* */

if ($(this).parent().is("li.c") ){	
	$(this).parent("li.c").removeClass("c").siblings().not(".c").addClass("c");			
}
/* */	
else {
	$(this).parent().addClass("c");
	}

if ($(this).parent().children().is("ul")) {
return false;
}
	  
	});

$("#opentree").click(function() {
/* */

$("#sitemap li").removeClass("c");
return false;

	  
	});

$("#closetree").click(function() {
/* */

$("#sitemap li").addClass("c");
return false;

	  
	});
//ABOUT
$("#openabout").click(function() {
/* */
$("#about li").removeClass("c");
return false;
	});

$("#closeabout").click(function() {
/* */
$("#about li").addClass("c");
return false;	  
	});

//Collections
$("#opencollections").click(function() {
/* */
$("#collections li").removeClass("c");
return false;
	});

$("#closecollections").click(function() {
/* */
$("#collections li").addClass("c");
return false;	  
	});

	  
//E-Journals
$("#openejournals").click(function() {
/* */
$("#ejournals li").removeClass("c");
return false;
	});

$("#closeejournals").click(function() {
/* */
$("#ejournals li").addClass("c");
return false;	  
	});
	
//Research
$("#openresearch").click(function() {
/* */
$("#research li").removeClass("c");
return false;
	});

$("#closeresearch").click(function() {
/* */
$("#research li").addClass("c");
return false;	  
	});
	
	

// JavaScript Document

$('#nav a[@href$="' + location.pathname.substring(1) + '"]').addClass("activeLink").parents().removeClass("c");
//This is for the code to choose a section to highlight in the main nav, if the page is not in the navigation.

if ($("#nav").children().is("a")) {
$("#nav a[@href=" + $("#contentleft a").attr("href") + "]").addClass("activeLink").parents().removeClass("c");
}

																														});
