// 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;	  
	});

//Academics
$("#openacademics").click(function() {
/* */
$("#academics li").removeClass("c");
return false;
	});

$("#closeacademics").click(function() {
/* */
$("#academics li").addClass("c");
return false;	  
	});

//faculty
$("#openfaculty").click(function() {
/* */
$("#faculty li").removeClass("c");
return false;
	});

$("#closefaculty").click(function() {
/* */
$("#faculty li").addClass("c");
return false;	  
	});

//programs
$("#openprograms").click(function() {
/* */
$("#programs li").removeClass("c");
return false;
	});

$("#closeprograms").click(function() {
/* */
$("#programs li").addClass("c");
return false;	  
	});

//public
$("#openpublic").click(function() {
/* */
$("#public li").removeClass("c");
return false;
	});

$("#closepublic").click(function() {
/* */
$("#public li").addClass("c");
return false;	  
	});

//prospective
$("#openprospective").click(function() {
/* */
$("#prospective li").removeClass("c");
return false;
	});

$("#closeprospective").click(function() {
/* */
$("#prospective li").addClass("c");
return false;	  
	});

//current
$("#opencurrent").click(function() {
/* */
$("#current li").removeClass("c");
return false;
	});

$("#closecurrent").click(function() {
/* */
$("#current li").addClass("c");
return false;	  
	});

//facultystaff
$("#openfacultystaff").click(function() {
/* */
$("#facultystaff li").removeClass("c");
return false;
	});

$("#closefacultystaff").click(function() {
/* */
$("#facultystaff li").addClass("c");
return false;	  
	});

//alumni
$("#openalumni").click(function() {
/* */
$("#alumni li").removeClass("c");
return false;
	});

$("#closealumni").click(function() {
/* */
$("#alumni li").addClass("c");
return false;	  
	});

//employers
$("#openemployers").click(function() {
/* */
$("#employers li").removeClass("c");
return false;
	});

$("#closeemployers").click(function() {
/* */
$("#employers li").addClass("c");
return false;	  
	});

//utility
$("#openutility").click(function() {
/* */
$("#utility li").removeClass("c");
return false;
	});

$("#closeutility").click(function() {
/* */
$("#utility 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");
}

																														});
