with (classes) {
//
with (OCP) {
//
with (Book) {
//
Book.CriticalApparatus = function ()
{
 with (Common.Observable) call(this);
 with (GUI.Common.Alignable) call(this, AlignBottom, null, null, CriticalApparatus.minimum_height);

 // Handle close event...

 with (CriticalApparatus)
 {
  // Event Handlers

  this[XHTML.Form.Button.events.click] = close;

  this[XHTML.events.mouseout] = // Unfortunately necessary
  this[XHTML.events.mouseup] = draggingEnded;
  this[XHTML.events.mousedown] = draggingStarted;
  this[XHTML.events.mousemove] = dragged;

  // Methods

  this.showHelp = showHelp;
  this.showUnit = showUnit;

  // Member variables

  this.Title_HTMLHeadingElement =
  this.Help_HTMLDivElement =
  this.Readings_HTMLTableElement =

  this.The_XSLTProcessor =

  this.the_readings =

  this.starting_height =
  this.starting_y = null;

  with (this)
  {
   with (ownerDocument)
   {
    Title_HTMLHeadingElement = getElementById(id + ".Title_HTMLHeadingElement");
    Help_HTMLDivElement = getElementById(id + ".Help_HTMLDivElement");
    Readings_HTMLTableElement = getElementById(id + ".Readings_HTMLTableElement");
   }

   with (XHTML.events) call(Title_HTMLHeadingElement, mousedown);

   Title_HTMLHeadingElement.addObserver(this);

   // with (GUI.Common.Alignable) call(Title_HTMLHeadingElement, AlignTop, null, null, 24);

   The_XSLTProcessor = new XML.XSLTProcessor;
/*
  var Stylesheet_Document; // = Application.contentDocument.implementation.createDocument(null, null, null);

  // with (Stylesheet_Document) { async = false; load(the_stylesheet); }
*/
   var Stylesheet_Document = Application.The_LSParser.parseURI(reading_stylesheet);

   The_XSLTProcessor.importStylesheet(Stylesheet_Document);

   with (XHTML.Form.Button) call(getElementsByTagName("button").item(0)).addObserver(this);

   the_readings = getElementsByTagName("tbody").item(0);

   removeChild(Readings_HTMLTableElement);
  }
 }

 return this;
}
//
// CriticalApparatus.readings = dom.html2.HTMLTableSectionElement;
// CriticalApparatus.mss = dom.html2.HTMLTableCellElement;
// CriticalApparatus.reading = dom.html2.HTMLTableCellElement;
//
CriticalApparatus.maximum_height = 280;
CriticalApparatus.minimum_height = 160;
//
CriticalApparatus.Events =
{
 closeRequested : "OCP_Book_CriticalApparatus_closeRequested",
 resized : "OCP_Book_CriticalApparatus_resized"
}
//
CriticalApparatus.reading_stylesheet = "classes/OCP/Book/CriticalApparatus/the_readings.xsl";
//
CriticalApparatus.construct = function (This_HTMLDivElement) { with (CriticalApparatus) { return call(This_HTMLDivElement); }}
//
CriticalApparatus.close = function ()  { with (CriticalApparatus) with (this)
{
 broadcast(Events.closeRequested);
}}
//
CriticalApparatus.draggingEnded = function () { with (CriticalApparatus) with (this)
{
 with (XHTML.events) with (Title_HTMLHeadingElement)
 {
  disableEvents(mouseup, mouseout, mousemove);
  enableEvents(mousedown);
 }

 broadcast(Events.resized);
}}
//
CriticalApparatus.draggingStarted = function (The_MouseEvent) { with (CriticalApparatus) with (this)
{
 starting_y = The_MouseEvent.clientY;
 starting_height = minimum_height;

 with (XHTML.events) with (Title_HTMLHeadingElement)
 {
  disableEvents(mousedown);
  enableEvents(mouseup, mouseout, mousemove);
 }
}}
//
CriticalApparatus.dragged = function (The_MouseEvent) { with (CriticalApparatus) with (this)
{
 var new_height = starting_height + starting_y - The_MouseEvent.clientY;

 minimum_height =
    new_height > CriticalApparatus.maximum_height? CriticalApparatus.maximum_height
  : new_height < CriticalApparatus.minimum_height? CriticalApparatus.minimum_height
  : new_height;

 position();
}}
//
CriticalApparatus.showHelp = function () { with (CriticalApparatus) with (this)
{
 if (Help_HTMLDivElement.parentNode != this) replaceChild(Help_HTMLDivElement, Readings_HTMLTableElement);
}}
//
CriticalApparatus.showUnit = function (Unit_Element) { with (CriticalApparatus) with (this)
{
 var Readings_Element = The_XSLTProcessor.transformToDocument(Unit_Element).documentElement;

 var current_readings = the_readings;

 // IE 7 will not set innerHTML of TBODY properly
 the_readings = Application.contentDocument.importNode(Readings_Element, true).firstChild; // adoptNode not implemented in FF, IE

 if (the_readings) current_readings.parentNode.replaceChild(the_readings, current_readings);

 if (Readings_HTMLTableElement.parentNode != this) replaceChild(Readings_HTMLTableElement, Help_HTMLDivElement);
}}
//
}
//
}
//
}
