// include_once("AE-Debug.js");

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 AEA_Boot(screen, debugLevel)
{
  if (debugLevel > -1)
  {
    D = new Debug(debugLevel);

    D.debug("ACTIVE ELEMENT DEBUG SESSION");
  }
  else
  {
    D = new function()
    {
      this.debugStartFunction = function()
      {
      }
      this.debugEndFunction = function()
      {
      }
      this.debug = function()
      {
      }
      this.warn = function()
      {
      }
      this.info = function()
      {
      }
      this.error = function()
      {
      }
    }
  }

  if (D.FVL_LOG_ON)
  {
    window.onerror = windowError;
  }
 
    createPageAE(screen);
    pageAE.aeOutputDebugInformation();
}    