
/**
 * The Start singleton object has methods for starting a
 * presentation.
 */
Start = {
  /**
   * Start.getFontSize() returns the current font size of the
   * browser.
   * This can be passed as an argument to applets that
   * provide a setFontSize(sz) method, such as those that
   * descend from appBase.AppletBase.
   */
  getFontSize : function() {
    var style = window.getComputedStyle(document.body, null);
    return parseInt(style.fontSize);
  },
  /**
   * Start.start(@width) initializes the layout with a
   * content pane.
   * The content pane initially displays the ROOT section of
   * the current document.
   * The ROOT section is the div tag whose "id" attribute is
   * "ROOT".
   *
   * The ROOT section may contain a menu.
   * A menu is just a div tag whose "class" attribute is
   * "menu".
   * It should contain a tags with "href" attributes that
   * reference div tags elswhere in the document or in other
   * documents.
   *
   * If the ROOT section contains a menu then a navigation
   * pane is inserted to the left of the content pane.
   * The @width argument, if present, specifies the width of
   * the navigation pane.
   * If it is omitted a default width of 12 em is used.
   * The HTML code provides a title for the navigation pane
   * by specifying the "title" attribute of the menu in the
   * ROOT section.
   *
   * The a tags in the menu are converted into a menu that
   * is added to the navigation pane.
   * A menu in the navigation pane allows the user to select
   * the content displayed in the content pane.
   *
   * Div tags referenced by a menu item may recursively
   * contain their own menus.
   * Whenever a menu item is selected that references a div
   * tag with a menu, a menu for the selected div tag is
   * added to the navigation pane below the parent menu.
   * The navigation pane thus displays the entire chain of
   * menus that select the current contents of the content
   * pane.
   */
  start: function(width) {
    var rootContent = Repository.initialize();
    Section.installOn(rootContent, Pane.getRootPane());
    if (rootContent.MENU) {
      var navigationVisual = Visual.create("navigation");
      navigationVisual.ADD_CLASS("navigation");
      if (!width) {
        width = "12em"
      }
      var rootMenu = rootContent.MENU;
      navigationVisual.appendChild(rootMenu);
      rootMenu.FRAME.putLeft(navigationVisual, width);
    }
  },
  /**
   * Start.startFree() is an alias for Start.start().
   * This will be removed when all web pages that invoke
   * startFree() have been modified to invoke start().
   */
  startFree: function(width) {
    Start.start(width);
  }
};



