<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery(document).ready(function () {
    var title = jQuery(this).attr('title');

	// Auto Active Class Based on Page Title
	
	var title = $(document).attr('title');
	var pageTitle= title.substr(0, title.indexOf('-'));
	console.log(pageTitle);
	
	var pageUrl = document.URL;
	
	
	$( "#sideMenu a" ).each(function( index ) {
		var linkText = $(this).text();
		if(title.match(linkText)) {
			$(this).addClass('active');
		}
		else if (index === 0 &amp;&amp; linkText === 'SBE Home' &amp;&amp; title === 'Student Belonging and Empowerment - Butte College') {
			$(this).addClass('active');
		}
	});	

	$( "#deplinks a" ).each(function( index ) {
		var linkText = $(this).text();
		var startSection = pageUrl.search("student-belonging-empowerment/") + 30;
		var endSection = pageUrl.indexOf('-', startSection );
		var thisSection = pageUrl.substring( startSection, endSection );
		console.log( thisSection );
		if( title.match(linkText) &amp;&amp; linkText.toLowerCase().match(thisSection) ) {
			$(this).addClass('active');
			console.log('hmmm');
		}
		else if (linkText === 'SBE Home' &amp;&amp; title === 'Student Belonging and Empowerment - Butte College') {
			$(this).addClass('active');
		}
		else if (linkText === 'SBE Home' &amp;&amp; title === 'SBE Staff - Butte College') {
			$(this).addClass('active');
		}
		else if ( linkText.toLowerCase().match(thisSection) ) {
			console.log(linkText);
			$(this).addClass('active');
		}
		else if( title.match(linkText) &amp;&amp; endSection === -1 ) {
			$(this).addClass('active');
// 			console.log('hmmm2');
		}
	});

	// Show Collapse Menu if Active
	$( "#sideMenu a" ).each(function( index ) {
		if ($(this).hasClass('dropdown') || $(this).hasClass('active')) {
			var linkParent = $(this).parent();
			var activeDropdown = $(linkParent).children('ul').attr('id');
			$('#' + activeDropdown).collapse('show');
		}
	});
	
	// Expand Active Collapse Menus
  $( "#sideMenu li.dropdown" ).each(function( index ) {
    if($(this).has(".active").length &gt; 0){
      $($(this).children("a")).addClass("active");
      $($(this).children("ul")).collapse("show");
    }
  });
	
});
</pre></body></html>