var url = window.location.href,
last_part = url.substring(url.lastIndexOf('/') + 1);
if ($('body').hasClass('isdesktop')) {
if(last_part == 'news') {
$('#mega-menu-main-menu li:first-child a').addClass('active');
}
else if (last_part == 'search?field_category_value=news&combine=') {
$('#mega-menu-main-menu li:nth-child(2) a').addClass('active');
}
else if (last_part == 'search?field_category_value=indepth&combine=') {
$('#mega-menu-main-menu li:nth-child(3) a').addClass('active');
}
else if (last_part == 'search?field_category_value=lifestyle&combine=') {
$('#mega-menu-main-menu li:nth-child(4) a').addClass('active');
}
else if (last_part == 'search?field_category_value=%E6%96%B0%E9%97%BB&combine=') {
$('#mega-menu-main-menu li:nth-child(5) a').addClass('active');
}
else if (last_part == 'pullout') {
$('#mega-menu-main-menu li:nth-child(6) a').addClass('active');
}
else if (last_part == 'edgeproptv') {
$('#mega-menu-main-menu li:nth-child(7) a').addClass('active');
}
else if (last_part == 'events') {
$('#mega-menu-main-menu li:nth-child(8) a').addClass('active');
}
}