// Swaps class:active in the nav

/* WORKS BUT GOES AWAY AS SOON AS THE NEW PAGE LOADS
$(document).ready(function() {

	$('#vdividermenu li a').click(function()
	{
	  $('#vdividermenu li').removeClass('active');
	  $(this).parent().addClass('active');
	});

});
*/


/* WORKS BUT YOU NEED FULL PATHS IN NAV

$(document).ready(function() {

$("#vdividermenu a").each(function() {
var hreflink = $(this).attr("href");
if (hreflink.toLowerCase()==location.href.toLowerCase()) {
	$(this).parent("li").addClass("active");
}
});			   			   
						   
});

*/
	

/* NOPE, TOO FANCY??

$(document).ready(function() {
	$('#nav a[href^="/' + location.pathname.split("/")[1] + '"]').parent("li").addClass('active');
});
*/


/* SUPPOSED TO WORK WITH JUST ROOT LINK / ONLY

$(document).ready(function() {
	if(location.pathname != "/") {
		$('#vdividermenu a[href^="/' + location.pathname.split("/")[1] + '"]').addClass('active');
	} else $('#vdividermenu a:eq(0)').addClass('active');
});

*/


// This one works with any naming of links, HTTP or just / and puts the active on the parent LI
// use "2" for first level folders - not sure how to make it work for both? 2 actions in the script??

$(document).ready(function() {
	$('#vdividermenu a[href*="' + location.pathname.split("/")[1] + '"][class!="noselect"]').parent("li").addClass('active'); 
});

