var leaveColor;

function changeImage(controlID, changeTo)
{
    document.getElementById(controlID).src = "images/buttons/NewButtons/" + changeTo;
}

function changeButtonImage(controlID, changeTo, rootPath)
{
    document.getElementById(controlID).src = rootPath + "images/buttons/NewButtons/" + changeTo;
}

function gotoReports(rootPath)
{

    document.location.href = rootPath + "Common/ReportListing.asp";

}

function gotoPainter(rootPath)
{

    document.location.href = rootPath + "MFG/PainterMaintenance.asp";

}

function closeOpenMenus()
{
    
    document.getElementById("BRIMenuFloatingDiv").style.display = "none";
    
}

function changeMenuColorForSelect(controlID)
{

    document.getElementById(controlID).style.cursor = "hand";
    document.getElementById(controlID).style.background = "#7e93a7";
    document.getElementById(controlID).style.color = "White";
    
    leaveColor = false;

}

function changeMenuColorForLeave(controlID)
{

    if (!leaveColor)
    {

        document.getElementById(controlID).style.cursor = "default";
        document.getElementById(controlID).style.background = "";
        document.getElementById(controlID).style.color = "#3f3f3f";
    
    }

}

function displayBRIMenu(controlID, menuType, rootPath)
{

    var DivHTML;

    leaveColor = true;

    switch (menuType)
    {
    
        case "BRIMYACCOUNT":
            
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            document.getElementById("spaBRIAdministrative").style.cursor = "default";
            document.getElementById("spaBRIAdministrative").style.background = "";
            document.getElementById("spaBRIAdministrative").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIBuilder").style.cursor = "default";
            document.getElementById("spaBRIBuilder").style.background = "";
            document.getElementById("spaBRIBuilder").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIManufacturer").style.cursor = "default";
            document.getElementById("spaBRIManufacturer").style.background = "";
            document.getElementById("spaBRIManufacturer").style.color = "#3f3f3f";
            
            document.getElementById("spaBRISales").style.cursor = "default";
            document.getElementById("spaBRISales").style.background = "";
            document.getElementById("spaBRISales").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIReports").style.cursor = "default";
            document.getElementById("spaBRIReports").style.background = "";
            document.getElementById("spaBRIReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/News.asp' class='BreadCrumbs'>News</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Company.asp' class='BreadCrumbs'>Edit Information</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/Contacts.asp?ContactID=-1' class='BreadCrumbs'>Add Contact/User</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/LearningCenter/BRILearningCenter.htm' class='BreadCrumbs' target='_blank'>Learning Center</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;

            break;
            
        case "BRIADMIN":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
        
            document.getElementById("spaBRIMyAccount").style.cursor = "default";
            document.getElementById("spaBRIMyAccount").style.background = "";
            document.getElementById("spaBRIMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIBuilder").style.cursor = "default";
            document.getElementById("spaBRIBuilder").style.background = "";
            document.getElementById("spaBRIBuilder").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIManufacturer").style.cursor = "default";
            document.getElementById("spaBRIManufacturer").style.background = "";
            document.getElementById("spaBRIManufacturer").style.color = "#3f3f3f";
            
            document.getElementById("spaBRISales").style.cursor = "default";
            document.getElementById("spaBRISales").style.background = "";
            document.getElementById("spaBRISales").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIReports").style.cursor = "default";
            document.getElementById("spaBRIReports").style.background = "";
            document.getElementById("spaBRIReports").style.color = "#3f3f3f";
        
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/ImpersonateList.asp' class='BreadCrumbs'>Impersonate</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/AdminNews.asp' class='BreadCrumbs'>Administer News</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/BlanketEmail.asp' class='BreadCrumbs'>Generic Email</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "BRI/administerusersearch.asp' class='BreadCrumbs'>Manage Users</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BRIBLD":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
        
            document.getElementById("spaBRIMyAccount").style.cursor = "default";
            document.getElementById("spaBRIMyAccount").style.background = "";
            document.getElementById("spaBRIMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIAdministrative").style.cursor = "default";
            document.getElementById("spaBRIAdministrative").style.background = "";
            document.getElementById("spaBRIAdministrative").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIManufacturer").style.cursor = "default";
            document.getElementById("spaBRIManufacturer").style.background = "";
            document.getElementById("spaBRIManufacturer").style.color = "#3f3f3f";
            
            document.getElementById("spaBRISales").style.cursor = "default";
            document.getElementById("spaBRISales").style.background = "";
            document.getElementById("spaBRISales").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIReports").style.cursor = "default";
            document.getElementById("spaBRIReports").style.background = "";
            document.getElementById("spaBRIReports").style.color = "#3f3f3f";
        
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/PaymentScheduleSummary.asp' class='BreadCrumbs'>Exhibits</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "MFG/AllowAttribute.asp?Companyid=-1&RoleCode=BLD' class='BreadCrumbs'>Attribute Availability</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BRIMFG":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
        
            document.getElementById("spaBRIMyAccount").style.cursor = "default";
            document.getElementById("spaBRIMyAccount").style.background = "";
            document.getElementById("spaBRIMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIAdministrative").style.cursor = "default";
            document.getElementById("spaBRIAdministrative").style.background = "";
            document.getElementById("spaBRIAdministrative").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIBuilder").style.cursor = "default";
            document.getElementById("spaBRIBuilder").style.background = "";
            document.getElementById("spaBRIBuilder").style.color = "#3f3f3f";
            
            document.getElementById("spaBRISales").style.cursor = "default";
            document.getElementById("spaBRISales").style.background = "";
            document.getElementById("spaBRISales").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIReports").style.cursor = "default";
            document.getElementById("spaBRIReports").style.background = "";
            document.getElementById("spaBRIReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/AddModifyUplift.asp' class='BreadCrumbs'>Incentives</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Company.asp?Companyid=-1&RoleCode=MFG' class='BreadCrumbs'>Add New Manufacturer</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/AddProdCategory.asp' class='BreadCrumbs'>Product Catagories</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "MFG/PainterMaintenance.asp' class='BreadCrumbs'>Painter Maintenance</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BRISALES":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
        
            document.getElementById("spaBRIMyAccount").style.cursor = "default";
            document.getElementById("spaBRIMyAccount").style.background = "";
            document.getElementById("spaBRIMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIAdministrative").style.cursor = "default";
            document.getElementById("spaBRIAdministrative").style.background = "";
            document.getElementById("spaBRIAdministrative").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIBuilder").style.cursor = "default";
            document.getElementById("spaBRIBuilder").style.background = "";
            document.getElementById("spaBRIBuilder").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIManufacturer").style.cursor = "default";
            document.getElementById("spaBRIManufacturer").style.background = "";
            document.getElementById("spaBRIManufacturer").style.color = "#3f3f3f";
            
            document.getElementById("spaBRIReports").style.cursor = "default";
            document.getElementById("spaBRIReports").style.background = "";
            document.getElementById("spaBRIReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/RegionSummary.asp' class='BreadCrumbs'>Manage Regions</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BRI/IRRegion.asp' class='BreadCrumbs'>RSM Assignment</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "IR/AddIR.asp' class='BreadCrumbs'>Add New RSM</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "RVP/AddRVP.asp' class='BreadCrumbs'>Add New RVP</a>&nbsp;&nbsp;</span>";

	    switch (userLogonName)
	    {

		case "JThompson":

			DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='https://www.homesphere.com/enrollmentcenter/ManagementEntry.aspx?ContactID=3914&CompanyID=0' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";		
			break;

		case "DGlover":

			DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='https://www.homesphere.com/enrollmentcenter/ManagementEntry.aspx?ContactID=7736&CompanyID=0' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";		
			break;

		case "LSewell":

			DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='https://www.homesphere.com/enrollmentcenter/ManagementEntry.aspx?ContactID=97&CompanyID=0' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";		
			break;

		case "TGlissmann":

			DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='https://www.homesphere.com/enrollmentcenter/ManagementEntry.aspx?ContactID=5692&CompanyID=0' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";		
			break;

		case "sthorne":

			DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='https://www.homesphere.com/enrollmentcenter/ManagementEntry.aspx?ContactID=8427&CompanyID=0' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";		
			break;

	    }

            DivHTML += "<span>&nbsp;&nbsp;<a href='https://www.homesphere.com/HomeSphereRebateCalculator' class='BreadCrumbs' target='_blank'>Rebate Estimator</a>&nbsp;&nbsp;</span>";

            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
    
    }

}

function displayMFGMenu(controlID, menuType, rootPath, showProductMenus, enrollmentCount, impersonate, userContactID, showPainter)
{

    var DivHTML;

    leaveColor = true;
    
    switch (menuType)
    {
    
        case "MFGBRIACTIONS":
            
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            document.getElementById("spaMFGMyAccount").style.cursor = "default";
            document.getElementById("spaMFGMyAccount").style.background = "";
            document.getElementById("spaMFGMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaMFGProductMaintenance").style.cursor = "default";
            document.getElementById("spaMFGProductMaintenance").style.background = "";
            document.getElementById("spaMFGProductMaintenance").style.color = "#3f3f3f";
            
            document.getElementById("spaMFGReports").style.cursor = "default";
            document.getElementById("spaMFGReports").style.background = "";
            document.getElementById("spaMFGReports").style.color = "#3f3f3f";
            
            if (showPainter == "true")
            {
            
                document.getElementById("spaMFGPainter").style.cursor = "default";
                document.getElementById("spaMFGPainter").style.background = "";
                document.getElementById("spaMFGPainter").style.color = "#3f3f3f";
            
            }       
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BRI/EndImpersonate.asp' class='BreadCrumbs'>Stop Impersonate</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/BuilderUplift.asp' class='BreadCrumbs'>Special Incentive</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;

            break;
            
        case "MFGMYACCOUNT":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaMFGBRIActions").style.cursor = "default";
                document.getElementById("spaMFGBRIActions").style.background = "";
                document.getElementById("spaMFGBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaMFGProductMaintenance").style.cursor = "default";
            document.getElementById("spaMFGProductMaintenance").style.background = "";
            document.getElementById("spaMFGProductMaintenance").style.color = "#3f3f3f";
            
            document.getElementById("spaMFGReports").style.cursor = "default";
            document.getElementById("spaMFGReports").style.background = "";
            document.getElementById("spaMFGReports").style.color = "#3f3f3f";
            
            if (showPainter == "true")
            {
            
                document.getElementById("spaMFGPainter").style.cursor = "default";
                document.getElementById("spaMFGPainter").style.background = "";
                document.getElementById("spaMFGPainter").style.color = "#3f3f3f";
            
            }          
        
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/News.asp' class='BreadCrumbs'>News</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/MFGSummaryPage.asp' class='BreadCrumbs'>Account Summary</a>&nbsp;&nbsp;</span>";
            
            if (showProductMenus == "false")
            {
                DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Company.asp' class='BreadCrumbs'>Edit Information</a>&nbsp;&nbsp;</span>";
            }
            else
            {
                DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Company.asp' class='BreadCrumbs'>View Information</a>&nbsp;&nbsp;</span>";
            }
            
            if (showProductMenus == "true")
            {
                DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Contacts.asp?ContactID=-1' class='BreadCrumbs'>Add Contact/User</a>&nbsp;&nbsp;</span>";
            }
            else
            {
                DivHTML += "<span>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Contacts.asp?ContactID=-1' class='BreadCrumbs'>Add Contact/User</a>&nbsp;&nbsp;</span>";
            }
            
            if (showProductMenus == "true")
            {
                if (enrollmentCount == 1)
                {
                    DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Contract.asp' class='BreadCrumbs'>Edit Contract</a>&nbsp;&nbsp;</span>";
                }
                else
                {
                    DivHTML += "<span>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/Contract.asp' class='BreadCrumbs'>Edit Contract</a>&nbsp;&nbsp;</span>";
                }
            }
            
            if (enrollmentCount == 1)
            {
                DivHTML += "<span>&nbsp;&nbsp;<a href='https://www.homesphere.com/EnrollmentCenter/Default.aspx?ForRSM=FALSE&ContactID=" + userContactID + "' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";
            }
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "MFGPRODUCT":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaMFGBRIActions").style.cursor = "default";
                document.getElementById("spaMFGBRIActions").style.background = "";
                document.getElementById("spaMFGBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaMFGMyAccount").style.cursor = "default";
            document.getElementById("spaMFGMyAccount").style.background = "";
            document.getElementById("spaMFGMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaMFGReports").style.cursor = "default";
            document.getElementById("spaMFGReports").style.background = "";
            document.getElementById("spaMFGReports").style.color = "#3f3f3f";
            
            if (showPainter == "true")
            {
            
                document.getElementById("spaMFGPainter").style.cursor = "default";
                document.getElementById("spaMFGPainter").style.background = "";
                document.getElementById("spaMFGPainter").style.color = "#3f3f3f";
            
            }   
        
            if (impersonate == "true")
            {
            
                if (showProductMenus == "true")
                {
                
                    DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/ProductDrillDown.asp' class='BreadCrumbs'>Product Catalog</a>&nbsp;&nbsp;</span>";
                
                }
                else
                {
                
                    DivHTML = "<span>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/ProductDrillDown.asp' class='BreadCrumbs'>Product Catalog</a>&nbsp;&nbsp;</span>";
                
                }
            
            }
            else
            {
        
                DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/ProductDrillDown.asp' class='BreadCrumbs'>Product Catalog</a>&nbsp;&nbsp;</span>";
        
            }
        
            if (impersonate == "true")
            {
            
                if (showProductMenus == "true")
                {
                
                    DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/AddModifyProduct.asp?ProductID=-1&amp;Parent=1' class='BreadCrumbs'>Add New Parent Product</a>&nbsp;&nbsp;</span>";
                    DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "MFG/AddModifyProduct.asp?ProductID=-1' class='BreadCrumbs'>Add New Product</a>&nbsp;&nbsp;</span>";
                            
                }
            
            }
            
            //if (impersonate == "true")
            //{
            
                //if (showProductMenus == "true")
                //{
                
                    DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "MFG/ManufacturerBuilderRef.asp' class='BreadCrumbs'>Manage Direct Programs</a>&nbsp;&nbsp;</span>";
                
                //}
            
            //}
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
    }
    
}

function displayBLDMenu(controlID, menuType, rootPath, showContractMenu, showBuilderProfileMenu, showTracking, impersonate, forBuilder, myCompanyID, impCompanyID)
{

    var DivHTML;

    leaveColor = true;
    
    switch (menuType)
    {
    
        case "BLDBRIACTIONS":
            
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            document.getElementById("spaBLDMyAccount").style.cursor = "default";
            document.getElementById("spaBLDMyAccount").style.background = "";
            document.getElementById("spaBLDMyAccount").style.color = "#3f3f3f";
            
            if (showTracking == "true")
            {
            
                document.getElementById("spaBLDTracking").style.cursor = "default";
                document.getElementById("spaBLDTracking").style.background = "";
                document.getElementById("spaBLDTracking").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDPlans").style.cursor = "default";
            document.getElementById("spaBLDPlans").style.background = "";
            document.getElementById("spaBLDPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDBulkPlans").style.cursor = "default";
            document.getElementById("spaBLDBulkPlans").style.background = "";
            document.getElementById("spaBLDBulkPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDCommunities").style.cursor = "default";
            document.getElementById("spaBLDCommunities").style.background = "";
            document.getElementById("spaBLDCommunities").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";           
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BRI/EndImpersonate.asp' class='BreadCrumbs'>Stop Impersonate</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/BuilderUplift.asp' class='BreadCrumbs'>Special Incentive</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;

            break;
            
        case "BLDMYACCOUNT":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaBLDBRIActions").style.cursor = "default";
                document.getElementById("spaBLDBRIActions").style.background = "";
                document.getElementById("spaBLDBRIActions").style.color = "#3f3f3f";
            
            }
            
            if (showTracking == "true")
            {
            
                document.getElementById("spaBLDTracking").style.cursor = "default";
                document.getElementById("spaBLDTracking").style.background = "";
                document.getElementById("spaBLDTracking").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDPlans").style.cursor = "default";
            document.getElementById("spaBLDPlans").style.background = "";
            document.getElementById("spaBLDPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDBulkPlans").style.cursor = "default";
            document.getElementById("spaBLDBulkPlans").style.background = "";
            document.getElementById("spaBLDBulkPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDCommunities").style.cursor = "default";
            document.getElementById("spaBLDCommunities").style.background = "";
            document.getElementById("spaBLDCommunities").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";
        
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "Common/News.asp' class='BreadCrumbs'>News</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;&nbsp;<a href='" + rootPath + "BLD/BLDSummaryPage.asp' class='BreadCrumbs'>Account Summary</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/Company.asp' class='BreadCrumbs'>Edit Information</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/Contacts.asp?ContactID=-1' class='BreadCrumbs'>Add Contact/User</a>&nbsp;&nbsp;</span>";
        
            if (showContractMenu == "true")
            {
                DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/Contract.asp' class='BreadCrumbs'>Edit Contract</a>&nbsp;&nbsp;</span>";            
            }
            
            if (showBuilderProfileMenu == "true")
            {
                //DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='https://www.homesphere.com/BuilderProfile/Default.aspx?BuilderID=" + myCompanyID + "' class='BreadCrumbs' target='_blank'>Manage Product Profile</a>&nbsp;&nbsp;</span>";
            }
        
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/LearningCenter/BRILearningCenter.htm' class='BreadCrumbs' target='_blank'>Learning Center</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BLDTRACKING":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaBLDBRIActions").style.cursor = "default";
                document.getElementById("spaBLDBRIActions").style.background = "";
                document.getElementById("spaBLDBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDMyAccount").style.cursor = "default";
            document.getElementById("spaBLDMyAccount").style.background = "";
            document.getElementById("spaBLDMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDPlans").style.cursor = "default";
            document.getElementById("spaBLDPlans").style.background = "";
            document.getElementById("spaBLDPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDBulkPlans").style.cursor = "default";
            document.getElementById("spaBLDBulkPlans").style.background = "";
            document.getElementById("spaBLDBulkPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDCommunities").style.cursor = "default";
            document.getElementById("spaBLDCommunities").style.background = "";
            document.getElementById("spaBLDCommunities").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/TrackSummaryPage.asp' class='BreadCrumbs'>Tracking Summary</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/AddClosing.asp' class='BreadCrumbs'>Add 1 Closing</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BulkLotBlockAddClosing.asp' class='BreadCrumbs'>Add 1-15 Closings</a>&nbsp;&nbsp;</span>";
            
            document.getElementById("divSubMenu").innerHTML = DivHTML;
            
            break;
            
        case "BLDPLANS":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaBLDBRIActions").style.cursor = "default";
                document.getElementById("spaBLDBRIActions").style.background = "";
                document.getElementById("spaBLDBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDMyAccount").style.cursor = "default";
            document.getElementById("spaBLDMyAccount").style.background = "";
            document.getElementById("spaBLDMyAccount").style.color = "#3f3f3f";
            
            if (showTracking == "true")
            {
            
                document.getElementById("spaBLDTracking").style.cursor = "default";
                document.getElementById("spaBLDTracking").style.background = "";
                document.getElementById("spaBLDTracking").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDBulkPlans").style.cursor = "default";
            document.getElementById("spaBLDBulkPlans").style.background = "";
            document.getElementById("spaBLDBulkPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDCommunities").style.cursor = "default";
            document.getElementById("spaBLDCommunities").style.background = "";
            document.getElementById("spaBLDCommunities").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/PlanDrillDown.asp' class='BreadCrumbs'>Plan List</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/AddModifyPlan.asp' class='BreadCrumbs'>Add New Plan</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/CopyPlan.asp' class='BreadCrumbs'>Copy Plan</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BlockExpiredUpdate.asp' class='BreadCrumbs'>Block/Expired Products</a>&nbsp;&nbsp;</span>";

            /*if (forBuilder = "true")
            {
                DivHTML += "<span>&nbsp;&nbsp;<a href='http://64.78.144.113/BuilderPlanValidation/Login.aspx?BuilderID=" + myCompanyID + "&RSMID=" + impCompanyID + "' class='BreadCrumbs' target='_blank'>Plan Validation</a>&nbsp;&nbsp;</span>";
            }
            else
            {
                DivHTML += "<span>&nbsp;&nbsp;<a href='http://64.78.144.113/BuilderPlanValidation/Login.aspx?BuilderID=" + myCompanyID + "' class='BreadCrumbs' target='_blank'>Plan Validation</a>&nbsp;&nbsp;</span>";
            }*/
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BLDBULKPLANS":
            
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaBLDBRIActions").style.cursor = "default";
                document.getElementById("spaBLDBRIActions").style.background = "";
                document.getElementById("spaBLDBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDMyAccount").style.cursor = "default";
            document.getElementById("spaBLDMyAccount").style.background = "";
            document.getElementById("spaBLDMyAccount").style.color = "#3f3f3f";
            
            if (showTracking == "true")
            {
            
                document.getElementById("spaBLDTracking").style.cursor = "default";
                document.getElementById("spaBLDTracking").style.background = "";
                document.getElementById("spaBLDTracking").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDPlans").style.cursor = "default";
            document.getElementById("spaBLDPlans").style.background = "";
            document.getElementById("spaBLDPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDCommunities").style.cursor = "default";
            document.getElementById("spaBLDCommunities").style.background = "";
            document.getElementById("spaBLDCommunities").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BulkPlanUpdate.asp?view=PART' class='BreadCrumbs'>Manufacturer View</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BulkPlanUpdate.asp?view=DEFAULT' class='BreadCrumbs'>Plan View</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/ProductAdd.asp' class='BreadCrumbs'>Add Product</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BulkPlanUpdate.asp?view=SUMMARY' class='BreadCrumbs'>Delete Product</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "BLD/BulkPlanUpdateLabel.asp' class='BreadCrumbs'>Supply Information</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "BLDCOMMUNITIES":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaBLDBRIActions").style.cursor = "default";
                document.getElementById("spaBLDBRIActions").style.background = "";
                document.getElementById("spaBLDBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDMyAccount").style.cursor = "default";
            document.getElementById("spaBLDMyAccount").style.background = "";
            document.getElementById("spaBLDMyAccount").style.color = "#3f3f3f";
            
            if (showTracking == "true")
            {
            
                document.getElementById("spaBLDTracking").style.cursor = "default";
                document.getElementById("spaBLDTracking").style.background = "";
                document.getElementById("spaBLDTracking").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaBLDPlans").style.cursor = "default";
            document.getElementById("spaBLDPlans").style.background = "";
            document.getElementById("spaBLDPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDBulkPlans").style.cursor = "default";
            document.getElementById("spaBLDBulkPlans").style.background = "";
            document.getElementById("spaBLDBulkPlans").style.color = "#3f3f3f";
            
            document.getElementById("spaBLDReports").style.cursor = "default";
            document.getElementById("spaBLDReports").style.background = "";
            document.getElementById("spaBLDReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BLD/subdrilldown.asp?Sub=DD' class='BreadCrumbs'>Community List</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "BLD/AddModifySubdivision.asp?SubdivisionID=-1' class='BreadCrumbs'>Add New Community</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
    }
    
}

function displayIRMenu(controlID, menuType, rootPath, impersonate, showContractMenu, myContactID, myCompanyID)
{

    var DivHTML;

    leaveColor = true;
    
    switch (menuType)
    {
    
        case "IRBRIACTIONS":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            document.getElementById("spaIRMYAccount").style.cursor = "default";
            document.getElementById("spaIRMyAccount").style.background = "";
            document.getElementById("spaIRMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaIRSalesTasks").style.cursor = "default";
            document.getElementById("spaIRSalesTasks").style.background = "";
            document.getElementById("spaIRSalesTasks").style.color = "#3f3f3f";
            
            document.getElementById("spaIRReports").style.cursor = "default";
            document.getElementById("spaIRReports").style.background = "";
            document.getElementById("spaIRReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "BRI/EndImpersonate.asp' class='BreadCrumbs'>Stop Impersonate</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/BuilderUplift.asp' class='BreadCrumbs'>Special Incentive</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "IRMYACCOUNT":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaIRBRIActions").style.cursor = "default";
                document.getElementById("spaIRBRIActions").style.background = "";
                document.getElementById("spaIRBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaIRSalesTasks").style.cursor = "default";
            document.getElementById("spaIRSalesTasks").style.background = "";
            document.getElementById("spaIRSalesTasks").style.color = "#3f3f3f";
            
            document.getElementById("spaIRReports").style.cursor = "default";
            document.getElementById("spaIRReports").style.background = "";
            document.getElementById("spaIRReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/News.asp' class='BreadCrumbs'>News</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "IR/IRSummaryPage.asp' class='BreadCrumbs'>Account Summary</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "IR/IRGoalSummary.asp' class='BreadCrumbs'>Edit/View Goals</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='http://mail.homesphere.com' class='BreadCrumbs' target='_blank'>Email</a>&nbsp;&nbsp;</span>";
            
            if (showContractMenu == "true")
            {
                DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "Common/Contract.asp' class='BreadCrumbs'>Edit Contract</a>&nbsp;&nbsp;</span>";
            }
            
            DivHTML += "<span>&nbsp;&nbsp;<a href='" + rootPath + "bld/LearningCenter/BRILearningCenter.htm' class='BreadCrumbs' target='_blank'>Learning Center</a>&nbsp;&nbsp;</span>";
        
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
            
        case "IRSALESTASKS":
        
            document.getElementById(controlID).style.background = "#7e93a7";
            document.getElementById(controlID).style.color = "White";
            
            if (impersonate == "true")
            {
            
                document.getElementById("spaIRBRIActions").style.cursor = "default";
                document.getElementById("spaIRBRIActions").style.background = "";
                document.getElementById("spaIRBRIActions").style.color = "#3f3f3f";
            
            }
            
            document.getElementById("spaIRMyAccount").style.cursor = "default";
            document.getElementById("spaIRMyAccount").style.background = "";
            document.getElementById("spaIRMyAccount").style.color = "#3f3f3f";
            
            document.getElementById("spaIRReports").style.cursor = "default";
            document.getElementById("spaIRReports").style.background = "";
            document.getElementById("spaIRReports").style.color = "#3f3f3f";
            
            DivHTML = "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "IR/EstimatedBuilderClosing.asp' class='BreadCrumbs'>Builder Estimates</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='" + rootPath + "MFG/PainterMaintenance.asp' class='BreadCrumbs'>Painter Maintenance</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span style='border-right: solid; border-right-color: #7e93a7; border-right-width: 1px;'>&nbsp;&nbsp;<a href='https://www.homesphere.com/HomeSphereRebateCalculator' class='BreadCrumbs' target='_blank'>Rebate Estimator</a>&nbsp;&nbsp;</span>";
            DivHTML += "<span>&nbsp;&nbsp;<a href='https://www.homesphere.com/EnrollmentCenter/Entry.aspx?ForRSM=TRUE&ContactID=" + myContactID + "&CompanyID=" + myCompanyID + "&Login=FALSE' class='BreadCrumbs' target='_blank'>Sales Center</a>&nbsp;&nbsp;</span>";
            
            document.getElementById("divSubMenu").innerHTML = DivHTML;
        
            break;
    
    }
    
}
