if (__g_LoggedIn == 'true') {
    var welcomeText = document.getElementById('WelcomeText');
    var fullNameSpan = document.getElementById('FullNameSpan');
    if (welcomeText != null) welcomeText.style.display = 'inline';
    if ((typeof (__g_IsCommunity) == 'undefined' || !__g_IsCommunity) && fullNameSpan != null) fullNameSpan.innerHTML = __g_UserFullName;
}
var b_subnavvisible = false;
var g_navList = document.getElementById('primarynav');
var urlparts = document.location.href.split('/')
var g_RequestedMajorSection = urlparts[3];
var g_RequestedMinorSection = '';
if (urlparts.length > 4) {
    g_RequestedMinorSection = urlparts[4];
}
if (g_RequestedMajorSection == '') {
    g_RequestedMajorSection = 'home'
}
if (g_RequestedMajorSection == 'chat') {
    g_RequestedMajorSection = 'services'
    g_RequestedMinorSection = 'chat'
}
if (g_RequestedMajorSection == 'blogs' || g_RequestedMinorSection.toLowerCase() == "blogs") {
    g_RequestedMajorSection = 'blog'
    g_RequestedMinorSection = 'blog';
}
if (g_RequestedMajorSection == "incidents" || g_RequestedMajorSection == "incident") {
    g_RequestedMajorSection = "about";
    g_RequestedMinorSection = 'incident-center';
}
if (g_RequestedMajorSection == "ask" || g_RequestedMajorSection == "t" || (g_RequestedMajorSection.toLowerCase() == "community" && g_RequestedMinorSection.toLowerCase() != "blogs")) {
    g_RequestedMajorSection = "forums";
}

if(g_RequestedMajorSection == "about" || g_RequestedMinorSection == "problems"){
	g_RequestedMajorSection = "services";
}

if(g_RequestedMajorSection == "about" || g_RequestedMinorSection == "how-it-works"){
	g_RequestedMajorSection = "services";
}

for(var i = 0; i < g_navList.getElementsByTagName('li').length; i++)
{
    var majorsection = g_navList.getElementsByTagName('li')[i];
    if (majorsection.getAttribute("majorsection") == g_RequestedMajorSection) {
        var subnavcontainer = document.getElementById(g_RequestedMajorSection + '_subnav');
        if (subnavcontainer != null) {
            subnavcontainer.style.display = 'block';
            b_subnavvisible = true;
        }
    }
}
if (!b_subnavvisible) {
    document.getElementById('no_subnav').style.display = 'block';
}
