

function Page() {} // empty constructor


Page.init = function()
  {
  NavBar.init();
  if ( typeof Widgets != "undefined" )
    Widgets.init();
  return;
  }


// -----------------------------------------------------------------------------


function NavBar() {} // empty constructor


NavBar.doMenus = (Browser.isIE && Browser.major >= 6);


NavBar.init = function()
  {
  if ( ! document.getElementById ) // ignore old browsers
    return;

  if ( ! NavBar.doMenus )
    {
    //var node = document.getElementById( 'navBar2' );
    //node.style.display = 'block';
    return;
    }

  if ( NavBar.doMenus )
    {
    //var node = document.getElementById( 'navBar2' );
    //node.style.display = 'none';
    }

  var node = document.getElementById( 'navBar1' );
    if ( ! node || ! node.hasChildNodes() ) return;
    if ( node.nodeName != 'DIV' ) return;
    if ( node.className != 'navBar' ) return;

  var nodes = node.childNodes;
  for ( var i = 0; i < nodes.length; i++ )
    {
    var node = nodes.item( i );
      if ( ! DOM.isElement( node ) ) continue;
      if ( node.nodeName != 'SPAN' ) continue;
      if ( node.className != 'item' ) continue;

    node.onmouseover = function() { this.className += " over"; }
    node.onmouseout  = function() { this.className = this.className.replace( / over$/, "" ); }

    if ( typeof node.innerHTML == 'undefined' )
      continue;

    var links = node.getElementsByTagName( 'a' );
    if ( ! links || links.length == 0 ) continue;
    var lnk = links[ 0 ];
    var href = lnk.href;

    var s = '';
    if ( href.match( /General_Info.html$/ ) )
      {
      s += NavBar.doMenuItem( 'Contact Info', '../Info/Contact_Info.html' );
      s += NavBar.doMenuItem( 'Directions', '../Info/Directions.html' );
      s += NavBar.doMenuItem( 'Schedule', '../Info/Schedule.html' );
      s += NavBar.doMenuItem( 'Library Cards', '../Info/Library_Cards.html' );
      s += NavBar.doMenuItem( 'Circulation Policies', '../Info/Circulation.html' );
      s += NavBar.doMenuItem( 'Library Services', '../Info/Library_Services.html' );
      //s += NavBar.doMenuItem( 'Library Staff', '../Info/Staff.html' );
      //s += NavBar.doMenuItem( 'Library History', '../Info/History.html' );
      //s += NavBar.doMenuItem( 'Support The Library', '../Info/Support_Us.html' );
      s += NavBar.doMenuItem( '...more', '../Info/General_Info.html' );
      }
    else if ( href.match( /Building.html$/ ) )
      {
      s += NavBar.doMenuItem( 'The Children\'s Room', '../Library/Childrens_Room.html' );
      s += NavBar.doMenuItem( 'The Stacks', '../Library/Stacks.html' );
      s += NavBar.doMenuItem( 'The Media Room', '../Library/Media_Room.html' );
      //s += NavBar.doMenuItem( 'Floor Plan', '../Library/Floor_Plan.html' );
      s += NavBar.doMenuItem( '...more', '../Library/Building.html' );
      }
    else if ( href.match( /Resources.html$/ ) )
      {
      s += NavBar.doMenuItem( 'Find A Book', 'http://68.60.209.147/athcgi/athweb.pl', true );
      s += NavBar.doMenuItem( '<em>iWantToKnow</em>', '../Web/iWantToKnow.html' );
      s += NavBar.doMenuItem( 'Book Talk', '../Books/Book_Talk.html' );
      //s += NavBar.doMenuItem( 'Recent Books', '../Books/Recent_Titles.html' );
      //s += NavBar.doMenuItem( 'Readalikes', '../Web/Readalikes.html');
      s += NavBar.doMenuItem( 'Teen Corner', '../Web/Teen_Corner.html' );
      s += NavBar.doMenuItem( 'The Kids\' Page', '../Web/Kids_Page.html' );
      s += NavBar.doMenuItem( 'Web Links', '../Links/Links.html' );
      //s += NavBar.doMenuItem( 'Library Terms', '../Web/Library_Terms.html' );
      s += NavBar.doMenuItem( '...more', '../Web/Resources.html' );
      }
/*
    else if ( href.match( /Activities_Events.html$/ ) )
      {
      s += NavBar.doMenuItem( 'Monthly Calendars', Calendar.getCurCalFilename() );
      s += NavBar.doMenuItem( '...more', '../Main/Activities_Events.html' );
      }
*/
    if ( s )
      {
      node.innerHTML += '<div class="menu">\n' + s +  '</div><!-- menu -->\n';
      //Diag.showCode( node.innerHTML );
      }
    }
  return;
  }


NavBar.doMenuItem = function( pLabel, pHref, pNewWindow )
  {
  pLabel = Utils.doSmallCaps( pLabel );

  var s = '<div>\n';
  s += '<a href="' + pHref + '"';
  if ( pNewWindow )
    s += ' target="_blank"';
  s += '>' + pLabel + '</a>\n';
  s += '</div>\n';
  return s;
  }


