/*
* noNavBar.js -- Wraps nav bar in "nav" class to allow for CSS.
*
* Copyright (C) 2004 by Deryck Hodge <hodgedg@auburn.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/

function wrapNav() {
    navSection = document.getElementsByTagName('nobr').item(0)
    navSectionParts = navSection.childNodes
    homeLink = document.getElementById('home')
    navWrap = document.createElement('div')
    navWrap.setAttribute('id', 'nav')

    navWrap.appendChild(homeLink)
    tmpNavParts = new Array
    
    for (i=0; i<navSectionParts.length; i++) {
        tmpNavParts[i] = navSectionParts[i]
    }
    
    for (i=0; i<tmpNavParts.length; i++) {
        navWrap.appendChild(tmpNavParts[i])
    }    

    sectionNode = navSection.parentNode
    sectionNode.replaceChild(navWrap, navSection)

    // Account for "You Are Here' on home page
    if (document.getElementsByTagName('H3').item(0)) {
        aboutText = document.getElementsByTagName('H3').item(0).firstChild
        if (aboutText.nodeValue == 'About the AU Libraries Piano Bench Collection') {
            homeText = document.createTextNode('Home')
            navWrap.replaceChild(homeText, homeLink)
        }
    }

}



