if (typeof dynamo == "undefined") { 
  var dynamo = new Object();
}

if (typeof dynamo.directInterface == "undefined") {

  dynamo.directInterface = function() {
    this.ajax = new luckymarble.ajaxUtil();
    
    
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
      window.onload = function () {
      
        directInterface.initialize();
      }
    } else {
      window.onload = function() {
        if (oldonload) {
          oldonload();
        }
        directInterface.initialize();
      }
    }
  }
  
  dynamo.directInterface.prototype = {
    processDirectInterface: function() {
      var myAjax     = dynamo.directInterfaceObj.ajax.ajaxObj;
      var myFileType = dynamo.directInterfaceObj.ajax.fileType;
      if (myAjax.readyState == "4") {
        if (myAjax.status == 200 || window.location.href.indexOf("http") == -1) {
          if (myFileType == "txt") {
            var myInterfaceContainer = document.getElementById("interface-container");
            var myHTMLContainer = document.createElement("div");
            myHTMLContainer.innerHTML = myAjax.responseText;
            myInterfaceContainer.appendChild(myHTMLContainer);
          }             
        } else  {
          // error processing request
        }
      } 
    },
    initialize: function() {   
      this.ajax.getAjaxRequest("ajax/" , "module=" + module, this.processDirectInterface, "txt");
    }
  }

  dynamo.directInterfaceObj = new dynamo.directInterface();
  directInterface = dynamo.directInterfaceObj;
}
