/**********************************************
 menuDiv.js
 file path: /dashboard/themes/$industryName/js/

 - Used to create the cascading dynamic menu contained
   in all 'clean' themes in the following industries:
   - auto

 - This file is basically the same as clean.js, however
   the table is div based instead of table based.

 - NEW PURPOSE: .JS Library for saruman theme. (02/03/2009)
   - Add all global js functions here.

 Created: 02/03/2009
 Changed: 02/03/2009

 Copyright (c) 2006 - 2009
 DnS Inc.
 All Rights Reserved
************************************************/
function expand(s) {

  // Set the divMenu to menuHover
  var divMenu = s;
  if (divMenu != null) {
    divMenu.className = "menuHover";
  }

  // Set all the divSubMenus to menuSubHover
  var divSubMenuArray = divMenu.getElementsByTagName("div");
  if (divSubMenuArray != null) {
    for (key in divSubMenuArray) {
      divSubMenuArray[key].className = "menuSubHover";
    }
  }
}

function collapse(s) {

  // Set the divMenu to menuNormal
  var divMenu = s;
  if (divMenu != null) {
    divMenu.className = "menuNormal";
  }

  // Set all the divSubMenus to menuSubNormal
  var divSubMenuArray = divMenu.getElementsByTagName("div");
  if (divSubMenuArray != null) {
    for (key in divSubMenuArray) {
      divSubMenuArray[key].className = "menuSubNormal";
    }
  }
}