 
function showPage() {
   window.location.hash = this.identifier;
   var content = aaElem('page');
   if (!content) {
      content = document.createElement('div');
      content.id = 'page';
      aaElem('main').appendChild(content);
      aaElem('slideshow').style.display = 'block';
   }
   content.innerHTML = aaElem(this.identifier).innerHTML; 
}

aaManageEvent(window,'load',function() {
   var past;
   var home;
   var current;

   var pageCount = 11;

   var index;
   var hash = window.location.hash;
   if (hash) {
      index = hash.split("#")[1];
   }

   var elems = document.getElementsByTagName('div');
   var pages = [];
   for (var j = 0; j < elems.length; j++)
      if (elems[j].className == 'section') {
         elems[j].style.display = 'none';
         pages[pages.length] = elems[j];
      }

   for (var i = 0; i < pages.length; i++) {
      var id = pages[i].id;
      var nav = Navigation.addNavigationNode(past,id,showPage);
      if (!past) {
        home = nav;
      }
      past = nav;
      if (index && id == index)
        current = nav;
   }

   Navigation.setHome(home);
  
   if (!current) {
      Navigation.setCurrentPage(home);
   } else {
      Navigation.setCurrentPage(current);
   }

   aaManageEvent(aaElem('next'),'click',aaBindObjMethod(Navigation,Navigation.nextPage));
   aaManageEvent(aaElem('previous'),'click',aaBindObjMethod(Navigation,Navigation.prevPage));
   aaManageEvent(aaElem('home'),'click', Navigation.returnHome);
});

