  function FrameHorizontal(){

    this.m_sIdContainerLeft  = 'frame-horizontal-container-left';
    this.m_sIdContainerRight = 'frame-horizontal-container-right';

    var m_oDivLeft = null;
    var m_oDivRight = null;    
    var m_oSelf = this;
    var m_oDivSplitter = null;
    var m_oSplitter = null;
    
    // -----------------------------------------------------           
    // Private method
    // -----------------------------------------------------               
    function createElement(type, parent) {
      var el = null;
      if(document.createElementNS) {
        // use the XHTML namespace; IE won't normally get here unless
        // _they_ "fix" the DOM2 implementation.
        el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
      } 
      else{
        el = document.createElement(type);
      }
      if (typeof(parent) != "undefined" && parent != null) {
        parent.appendChild(el);
      }
      return el;
    };   
    // -------------------------------------------------------------------
    function unit(value){
      if(value.toString().indexOf('%') != -1){
        return value;
      }
      return value + 'px';        
    };
    // --------------------------------------------------------------------------          
    this._create = function(){
      var oContainer =  document.getElementById(FrameHorizontal.IdContainer);     
      with(oContainer){
        style.position = 'relative';                // It's important for IE
        style.borderWidth = unit(FrameHorizontal.borderWidth);
      }      

      var offsetSize = FrameHorizontal.borderWidth * 2;

      m_oDivLeft  = createElement('div',oContainer);
      m_oDivSplitter   = createElement('div',oContainer);
      m_oDivRight = createElement('div',oContainer);
      m_oSplitter = new cSplitter(m_oDivSplitter,m_oDivLeft,oContainer,'H',m_oDivRight);  
      m_oSplitter.setProperties(FrameHorizontal.widthMin);    


      with(m_oDivSplitter){
        className = 'frame-horizontal-splitter-element';
        style.position = 'relative';
        style.height = unit('100%');
        onmousedown = m_oSplitter.onmousedown;
        onmouseover = m_oSplitter.onmouseover;    
      }

      with(m_oDivLeft){
        id = this.m_sIdContainerLeft;
        className = id;
        style.position = 'relative';
        style.height = unit('100%');
        style.width = unit(Math.round((oContainer.offsetWidth * (FrameHorizontal.widthTreeview/100)) - m_oDivSplitter.offsetWidth) - offsetSize);
      }

      with(m_oDivRight){
        id = this.m_sIdContainerRight;
        className = id;
        style.position = 'relative';
        style.height = unit('100%');     
        style.width  = unit(oContainer.offsetWidth - m_oDivLeft.offsetWidth - m_oDivSplitter.offsetWidth - offsetSize);  
      }
    };
  }
  
  
  //------------------------------------------------------------------------------  
  // Public function
  //------------------------------------------------------------------------------  
  //------------------------------------------------------------------------------  
  // Setup of treeview
  //------------------------------------------------------------------------------  
  
  FrameHorizontal.setup = function (params) {
    function param_default(pname, def) { 
      if (typeof params[pname] == "undefined") { 
        FrameHorizontal[pname] = def; 
      } 
      else{
        FrameHorizontal[pname] = params[pname]; 
      }
    };  
    
    param_default("IdContainer", null);
    param_default("widthTreeview", 30);  /* 0-100% */
    param_default("borderWidth", 1);      
    param_default("widthMin", 60);

  
    if(FrameHorizontal.IdContainer == null){
      alert("FrameHorizontal.Setup:\n  Nothing to setup (no fields found).  Please check your code");  
    }
    
    FrameHorizontal.Instance = new FrameHorizontal();    
  };  
  
  //------------------------------------------------------------------------------  
  // Display the explorer
  //------------------------------------------------------------------------------  
  FrameHorizontal.show = function(){
    FrameHorizontal.Instance._create();
  };  