function getElementPosition(elemID){
   var offsetTrail = document.getElementById(elemID);
   var offsetLeft = 0;
   var offsetTop = 0;
   while (offsetTrail){
      offsetLeft += offsetTrail.offsetLeft;
      offsetTop += offsetTrail.offsetTop;
      offsetTrail = offsetTrail.offsetParent;
   }
   if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
      offsetLeft += document.body.leftMargin;
      offsetTop += document.body.topMargin;
   }
return {left:offsetLeft,top:offsetTop};
}

YAHOO.util.Event.onContentReady("leftnav", function () {
    var oMenu = new YAHOO.widget.Menu("leftnav", { position: "static", hidedelay: "750", lazyload: true });

    oMenu.subscribe("beforeRender", function () {
      if (this.getRoot() == this) {
        this.getItem(2).cfg.setProperty("submenu", aSubmenu_aboutthelibrary);
        this.getItem(3).cfg.setProperty("submenu", aSubmenu_usingthelibrary);
        this.getItem(4).cfg.setProperty("submenu", aSubmenu_libraryresources);
        this.getItem(5).cfg.setProperty("submenu", aSubmenu_computeraccess);
        this.getItem(6).cfg.setProperty("submenu", aSubmenu_childrensdept);
        this.getItem(7).cfg.setProperty("submenu", aSubmenu_calendarofevents);
        this.getItem(10).cfg.setProperty("submenu", aSubmenu_contactus);
      }
    });

    oMenu.render();
});
   
