    function ShowAll()
    {
        for (iDep=0;iDep<allDepartments.length;iDep++)
        {
            var depId = allDepartments[iDep];
            // Loop all divs in page
            var allDivs = document.getElementsByTagName('div');
            for (var i=0;i<allDivs.length;i++) {
              iDiv = allDivs[i];
              //If div id is set
              if (iDiv.id != '') {
                //if id starts with departmentid set display='' (visible)
                if (iDiv.id.indexOf(depId)==0) {
                  iDiv.style.display = '';
                }
              }
            }
        }
        window.scroll(0,700); // vertical scroll 
    }
    function HideAll()
    {
        for (iDep=0;iDep<allDepartments.length;iDep++)
        {
          divDep = document.getElementById(allDepartments[iDep]);
          if (divDep==null)
          {
            alert('HideAll Department not found : ' + allDepartments[iDep]);
          } 
          else {
            divDep.style.display='none';
          }
        }
    }

    function Show(div) {
        div.style.display = '';
    }

    function Hide(div) {
        div.style.display = 'none';
    }

    function ToggleVisibility(div) {
        if (div.style.display=='')
          Hide(div);
        else
          Show(div);
    }

    function ShowCity(departmentId, cityId) {
        var div = document.getElementById(cityId);
        Show(div);

        var div = document.getElementById(departmentId);
        ToggleVisibility(div);
    }

    // Hides all Departments and shows the departmentId
    function ShowDepartment(departmentId) {
        HideAll();
        var div = document.getElementById(departmentId);
        if (div==null)
        {
            alert('Department not found : ' + departmentId);
            return;
        }
        ToggleVisibility(div);
        
        // Loop all divs in page
        var allDivs = document.getElementsByTagName('div');
        for (var i=0;i<allDivs.length;i++) {
          iDiv = allDivs[i];
          //If div id is set
          if (iDiv.id != '') {
            //if id starts with departmentid set display
            if (iDiv.id.indexOf(departmentId)==0) {
              iDiv.style.display = div.style.display;
            }
          }
        }
       
        window.scroll(0,700); // vertical scroll 

    }