$(document).ready(function(){
	<!-- hide all submenus -->
	$('#submenu li ul').hide();
	$('#submenu li ul li ul').hide();
	<!-- show your selected element and this elements child menu if existent -->
	$('#submenu '+$selectedID).parents().show();
	$('#submenu '+$selectedID).children().show();
	<!-- remove the link from the selected menu item -->
	var $linktext = $('#submenu '+$selectedID+' a:first').text();
	var $oldclass = $('#submenu '+$selectedID+' a:first').attr('class');
	var $newclass = $oldclass.split("link")[0];
	if($('#submenu '+$selectedID+':has(ul)') > 0) {
		$newclass = 'sidenavhassub';
	};
	$('#submenu '+$selectedID+' a:first').replaceWith('<span class="'+$newclass+'"><strong>'+$linktext+'</strong></span>')
});