jq$(function() {
var firstLevel = jq$('.mobilePanel ul.firstLevel > li');
// Find which top-level item is active or contains the active item
var activeBranch = firstLevel.filter(function() {
return jq$(this).hasClass('sel') || jq$(this).find('.sel').length > 0;
});
// If we found an active branch, hide all others except Main
if (activeBranch.length) {
firstLevel.each(function() {
var title = jq$(this).find('> .item > a').attr('title');
if (title !== 'Main' && !jq$(this).is(activeBranch)) {
jq$(this).hide();
}
});
}
});