	$(document).ready(function() {
		anchor = self.document.location.hash;
		if(anchor != '') {
			selectedId = anchor.split("#")[1];
			resetSecondaryContent(selectedId);
		}
		$(".nav li a", this).click(function(e) {
     		e.preventDefault();
     		myId = this.href.split("#")[1];
     		resetSecondaryContent(myId);
     	});
	});
	function resetSecondaryContent(selectedId) {
 		$(".nav li a").each(function (i) {
 			id = this.href.split("#")[1];
 			if(id == selectedId) {
 				$(this).parent().addClass("active");
 	 			$('#' + id).removeClass("inactive");
 	 			$('#' + id).addClass("active");
 			} else {
 				$(this).parent().removeClass("active");
 	 			$('#' + id).removeClass("active");
 	 			$('#' + id).addClass("inactive");
 			}
 		});
	}