﻿// JScript File
window.onload = function(){
                    BuildMenu();
                    //DisplayMenu(0);
                    if(window.DisplayMenuByPage)
                    {DisplayMenuByPage()};
                }
var topLinkElements = [
                    ["Home", "index.htm"],
                    ["Contact Us", "contact.htm"],
                    ["Employee Mail", "webmail"],
                    ["Brochure", "brochure.pdf"],
                    ["Site Map", "sitemap.htm"]
               ];
                 
var mainMenuElements = ["Company", "Services", "Technologies", "Products", "Customers", "Careers"];
var subMenuElements = [
						[
						    ["Who We Are", "whoweare.htm"], 
						    ["Our Expertise", "ourexpertise.htm"], 
						    ["Vision & Mission", "visionandmission.htm"], 
						    ["Brochure", "brochure.pdf"], 
						    ["Locations","locations.htm"]
						],
						[
						    ["Vendor Managed Services", "vendormanagedservice.htm"],
						    ["Staffing Solutions", "staffingsolutions.htm"], 
						    ["Strategic IT Partner", "strategicitpartner.htm"], 
						    ["Training", "training.htm"]
						],
						[
						    ["System Integration", "systemintegration.htm"], 
						    ["Web Services", "webservices.htm"], 
						    ["Database Management", "databasemanagement.htm"], 
						    ["Data Warehousing", "datawarehousing.htm"], 
						    ["ERP", "erp.htm"], 
						    ["CRM", "crm.htm"], 
						    ["Quality Assurance", "qualityassurance.htm"]
						],    
						[
						    ["eBridge Tester", "ebridge_tester.htm"], 
						    ["eBridge Tracker", "ebridge_tracker.htm"], 
						    ["eBridge Handler", "ebridge_error.htm"]
						],
						[
						    ["Clients", "clients.htm"], 
						    ["Partners", "partners.htm"]
						],
						[
						    ["Working With Us", "workingwithus.htm"], 
						    ["Benefits and Policies", "benfitspolicies.htm"], 
						    ["Training", "carrerstraining.htm"], 
						    ["Documents", "documents.htm"], 
						    ["Current Openings", "currentopenings.htm"], 
						    ["Resume Submission", "resumesubmission.htm"], 
						    ["Employee Mail", "webmail"]
						]
					  ];
								


var previousMenu;
var menuFocusOn;
var currentPageMenuIndex = 0;

function DisplayMenu(menuIndex)
{
    if(previousMenu)
    {
        previousMenu.style.visibility = "hidden";
        previousMenu.style.display = "none";
    }

    var objectMenu = document.getElementById("submenu" + menuIndex);
    objectMenu.style.visibility = "visible";
    objectMenu.style.display = "";
    previousMenu = objectMenu;
    menuFocusOn = "yes";
}

function HideMenu(menuIndex)
{
    menuFocusOn = null;
    setTimeout(collapseMenu, 5000);
}

function collapseMenu()
{
    if(!menuFocusOn)
    {
        //alert(currentPageMenuIndex);
        DisplayMenu(currentPageMenuIndex);
    }
}


function BuildMenu()
{
    var mainMenu = "";
    for(mainIndex=0;mainIndex<mainMenuElements.length;mainIndex++)
    {
        mainMenu +=  "<span onmouseover='DisplayMenu("+mainIndex+")' onmouseout='HideMenu("+mainIndex+")'><a id='parentmenu"+mainIndex+"' class='MainMenuLink' href='#'>"+mainMenuElements[mainIndex]+"</a></span>&nbsp;&nbsp;&nbsp;";
        if(mainIndex != mainMenuElements.length-1)
        {
            mainMenu += "|&nbsp;&nbsp;&nbsp";
        }
    }
    document.getElementById("divMainMenu").innerHTML = mainMenu;
    
    var subMenu = "";
    for(subIndex=0;subIndex<subMenuElements.length;subIndex++)
    {
        subMenu += "<div id='submenu"+subIndex+"' onmouseover='menuFocusOn=this' onmouseout='menuFocusOn=null;setTimeout(collapseMenu, 5000);' name='submenu"+subIndex+"' class='SubMenu' style='visibility:hidden;display:none;'>"
        for(subIndex2=0;subIndex2<subMenuElements[subIndex].length;subIndex2++)
        {
            subMenu +=  "<a class='SubMenuLink' href='"+subMenuElements[subIndex][subIndex2][1]+"'>"+subMenuElements[subIndex][subIndex2][0]+"</a>&nbsp;&nbsp;&nbsp;";
            if(document.location.href.indexOf(subMenuElements[subIndex][subIndex2][1]) > 0)
            {
                currentPageMenuIndex = subIndex;
                document.getElementById("parentmenu"+currentPageMenuIndex).style.color = "Yellow";
                document.getElementById("parentmenu"+currentPageMenuIndex).style.FontWeight = "bold";
            }
            if(subIndex2 != subMenuElements[subIndex].length-1)
            {
                subMenu += "|&nbsp;&nbsp;&nbsp";
            }
        }
        subMenu += "</div>\n";
    }
    document.getElementById("divSubMenu").innerHTML = subMenu;
    
    
    
    var topLink = "";
    for(linkIndex=0;linkIndex<topLinkElements.length;linkIndex++)
    {
        
        topLink += "<a href='"+topLinkElements[linkIndex][1]+"' class='TopHyperLink'>"+topLinkElements[linkIndex][0]+"</a>&nbsp;&nbsp;";
        if(linkIndex != topLinkElements.length-1)
        {
            topLink += "|&nbsp;&nbsp;&nbsp";
        }
    }
    
    var bottomLink = "";
    for(linkIndex=0;linkIndex<topLinkElements.length;linkIndex++)
    {
        
        bottomLink += "<a href='"+topLinkElements[linkIndex][1]+"'>"+topLinkElements[linkIndex][0]+"</a>&nbsp;&nbsp;";
        if(linkIndex != topLinkElements.length-1)
        {
            bottomLink += "|&nbsp;&nbsp;&nbsp";
        }
    }
    
    document.getElementById("divTopLink").innerHTML = topLink;
    document.getElementById("divBottomLink").innerHTML = bottomLink;
    document.getElementById("divCopyRight").innerHTML = "&copy;&nbsp;&nbsp;Bridge Logix 2009. All rights reserved.&nbsp;&nbsp;";
    DisplayMenu(currentPageMenuIndex);
}


