<!--
  //============================================================================
  //  FIND DOM
  //  This function defines which type of document object model is being used by
  //  the browser.
  //============================================================================
  var isDHTML = 0;
  var isID = 0;
  var isAll = 0;
  var isLayers = 0;

  if(document.getElementById)
  {
    isID = 1;
    isDHTML = 1;
  }
  else
  {
    if(document.all)
    {
      isAll = 1;
      isDHTML = 1;
    }
    else
    {
      browserVersion = parseInt(navigator.appVersion);
      if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4))
      {
        isLayers = 1;
        isDHTML = 1;
      }
    }
  }

  function findDOM(objectID,withStyle)
  {
    if(withStyle == 1)
    {
      if(isID)
      {
        return(document.getElementById(objectID).style);
      }
      else
      {
        if(isAll)
        {
          return(document.all[objectID].style);
        }
        else
        {
          if(isLayers)
          {
            return(document.layers[objectID]);
          }
        }
      }
    }
    else
    {
      if(isID)
      {
        return(document.getElementById(objectID));
      }
      else
      {
        if(isAll)
        {
          return(document.all[objectID]);
        }
        else
        {
          if(isLayers)
          {
            return (document.layers[objectID]);
          }
        }
      }
    }
  }
/*************************************************************************
* $file: expander.js,v $
* $Revision: 1.0 $
* $Date: 2006/06/09 11:26:01 $
* @author Chris Potter
* @copyright Copyright © 2006, Chris Potter, All rights reserved.
*************************************************************************/
/*************************************************************************
* Initalize the menu so that it is expandable.
*************************************************************************/
function expandInit(menuDiv)
{
    // The location of the main window.
    var currentLocation = parent.location.href;
    // Get the childNodes of menuDiv
    var menus = menuDiv.childNodes;
    for (var i = 0; i < menus.length; i++)
    {
        // Get all ul lists.
        if (menus[i].nodeName == "UL")
        {
            // Get child nodes.
            var items = menus[i].childNodes;
            for (var j = 0; j < items.length; j++)
            {
                // Find list items.
                if (items[j].nodeName == "LI")
                {
                    // Get child nodes.
                    var childCount = 0;
                    var expandPoints = items[j].childNodes;
                    for (var k = 0; k < expandPoints.length; k++)
                    {
                        // Find sub lists.
                        if (expandPoints[k].nodeName == "UL")
                        {
                            childCount++;
                            // Reset displaySubMenu
                            var displaySubMenu = false;
                            // Check for current page link.
                            var links = expandPoints[k].getElementsByTagName("a")
                            for (var m = 0; m < links.length; m++)
                            {
                                if (links[m].href == currentLocation) displaySubMenu = true;
                            }
                        }
                    }
                    // If the list item has children set it to expandable
                    if (childCount > 0)
                    {
                        items[j].style.listStyleType = "none";
                        items[j].style.marginLeft = "0px";
                        // If there is a heading first set it to inline
                        if (items[j].firstChild.style != null) items[j].firstChild.style.display = "inline";
                        // Create Expand image
                        var expand = document.createElement('img');
                        expand.alt = "collapse";
                        expand.src = "http://www.byui.edu/css/v1/images/collapse.gif"; 
                        expand.style.margin = "0 0 -3px 0";
                        expand.onmouseover = new Function("this.style.cursor='pointer';");
                        expand.onmouseout = new Function("this.style.cursor='auto';");
                        expand.onclick = new Function("changeState(this);");
                        // Add expand image to the start of the list item.
                        items[j].insertBefore(expand,items[j].firstChild);
                        // If there were children and no links to the current page colapse menu
                        if (displaySubMenu == false)
                        {
                            changeState(expandPoints[0]);
                        }
                    }
                }
            }
        }
    }
}
function changeState (element)
{
    // Change Expand Image
    if (element.alt == "Expand")
    {
        element.alt = "Collapse";
        element.src = "http://www.byui.edu/css/v1/images/collapse.gif";
    }
    else
    {
        element.alt = "Expand";
        element.src = "http://www.byui.edu/css/v1/images/expand.gif";
    }
    var parent = element.parentNode;
    var children = parent.childNodes;
    for (var i = 0; i < children.length; i++)
    {
        if (children[i].nodeName == "UL")
        {
            if (children[i].style.display == "none") 
            {
                children[i].style.display = "block";
            }
            else
            {
                children[i].style.display = "none";
            }
        }
    }
}
-->