/*jQuery(function($) {
  $('#menuThis ul').hide();
  var path = location.pathname.substring(1);
  $('#menuThis a[@href$="' + path + '"]').addClass('active').siblings("ul").slideDown();
  $('#menuThis a[@href$="' + path + '"]').parents("ul").show();
});
*/


jQuery(function($) {
	// Figure out the location based on the browser URL
	var path = location.pathname;

	// Set your homepage here, eg. /index.php or /
	var home = "/";
	// Check the home link against the path and set the navigation accordingly. 
	if (path == home || path == "/") {
		// Note that the jQuery selector matches *only* the home link
		var $nav = $('#menuThis a[@href="' + home + '"]');
	} else {
		var $nav = $('#menuThis a[@href$="' + path + '"]');
	}

	// Hide all subnavigation
	$('#menuThis li ul').hide();

	// Add the active class to the current path and activate it's subnavigation
	$nav.addClass('active').siblings("ul").slideDown();
	
	// If the active class has subnavigation, show it
	$nav.parents("ul").show();
	
});
