function windowError(message, url, line)
{
  D.FVL_log('Error on line ' + line + ' of document ' + url + ': ' + message, D.FVL_FATAL);
  return true; 
}

function createPageAE(screen)
{
    // This function initiates active elements on this page by creating a master active element
    // The type of the master element is "Page"
    
    D.debugStartFunction("createPageAE", arguments);
    
    // pageAE needs to be a global variable - the gateway to the whole AE object hierarchy

    pageAE = new activeElement("Main", "Page", screen, document.getElementsByTagName("body")[0], null, null);
    D.debugEndFunction("createPageAE");
}

function AEbootstrap(screen)
{
    // Set up debug window here as this will always be called first
    // TEMP - D is invoked from page template until problems sorted out
    
    D.debug("ACTIVE ELEMENT DEBUG SESSION");

    // WHERE SHOULD THIS CODE BE EXECUTED? CONSTRUCTOR?
    if (D.FVL_LOG_ON)
    {
      window.onerror = windowError; // Will this work from within an object?
    }
 
    createPageAE(screen);
    // pageAE.aeInitialise();
    // pageAE.aeUpdateContent();
    pageAE.aeOutputDebugInformation();
}    