// Copyright (c) 2000-2005 Progeny Systems Corporation.
//
// Consult license.html in the documentation directory for licensing
// information.


// NOTE: This file is replaced by a compressed source file as part of the
// release process. End users will not see this file, but rather a single script
// file containing all the code in the .js files loaded by this file.
//
// See the "Release" directory for the details of this process.

// Load "./Script/xforms.js".
(function() {
  // Find the <script src="formfaces.js"/> element that loaded this .js file so we
  // can figure out the path this script is stored in. For example, if this script
  // was referenced as <script src="/scripts/formfaces.js"/> then we'll prepend
  // /scripts/ to each file name.
  var scriptElements = document.getElementsByTagName("script");
  var scriptPath     = null;
  
  for (var i = 0; i < scriptElements.length; ++i) {
    var scriptElement = scriptElements[i];
    var source        = scriptElement.getAttribute("src");
    
    if (source != null && source.match(/^(.*\/)?formfaces\.js$/)) {
      scriptPath = RegExp.$1;
      break;
    }
  }
  
  // Load "Script/xforms.js".
  var headElement = document.getElementsByTagName("head")[0];
  
  var scriptElement = document.createElement("script");
  
  scriptElement.setAttribute("type", "text/javascript");
  scriptElement.setAttribute("src",  scriptPath + "Source/xforms.js");
  
  headElement  .appendChild (scriptElement);
}) ();
