  function TaskBar(oParent){
  
    this.m_oContainer = null;    
    
    var m_oItems = new Array();
    var m_oParent = oParent;
    var m_oSelf = this;

    // -------------------------------------------------------------------    
    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.formular = function(event) {
      var Item = this;
      var ret = confirm(Item.MsgBox);      
      if(ret){
        with(Item.Parent.getObjFormular()){
          target = Item.Target;  
          //innerHTML='<input type="hidden" name="test" value="4"></input>'; test to pass by post
          action = Item.Url;
          method = 'post';        
          submit();
        }
      }
    }    
    // -------------------------------------------------------------------        
    this.load = function(){
      m_oSelf.m_oContainer = createElement('div');  

      with(m_oSelf.m_oContainer){
        className = 'taskbar-container';
        style.display = 'none';
      }
      
      var oTable = createElement('table', m_oSelf.m_oContainer);
      var oTbody = createElement('tbody', oTable);    
      with(oTable){
        cellSpacing = 0;
        cellPadding = 0;
        className    = 'taskbar-table-body'; 
      }
      
      // Row
      var oTr = createElement('tr', oTbody);    
      with(oTr){
        className = 'taskbar-row';  
      }      
       
      for(var item = 0; item < m_oItems.length ; item++){
        var arr = m_oItems[item].get();

        // Cells
        var oTd = createElement('td',oTr);
        with(oTd){
          className = 'taskbar-cell';
          style.borderLeftWidth = arr['Sep'] == '-' ? unit(1) : unit(0);          
        }
        
        var oA  = createElement('a',oTd);
        m_oItems[item].setUiText(oA); 
        with(oA){
          className = oTd.className + '-link';
          if(arr['MsgBox'] != ''){
            onclick = m_oEvent.bindEvent(m_oSelf.formular, arr);       
            href = '#';         
          }
          else{
            href = arr['Url'];                  
          }
          title       = arr['Title'];
          target      = arr['Target'];
          onmousedown = arr['onmousedown'];
          onmouseup   = arr['onmouseup'];
          onmousemove = arr['onmousemove'];
        }      

        var oTable2 = createElement('table', oA);
        with(oTable2){
          cellSpacing = 0;
          cellPadding = 0;
        }           
        var oTbody2 = createElement('tbody', oTable2);   
        
        if(arr['Icone'] != 'undefined'){
          var oTr2 = createElement('tr', oTbody2);    
          var oTd2 = createElement('td',oTr2);      
          with(oTd2){
            className = oTd.className + '-icone';  
          }
                      
          var oImage = createElement('img',oTd2);                
          m_oItems[item].setUiImage(oImage);  // User interface Image object
          with(oImage){
            className = oTd2.className + '-image';
            src = arr['IconeUrl'] + '/' + arr['Icone'].getIcone();
            border = 0;
            title = arr['Title'];
          }                        
        }   
               
        if(arr['Text'] != 'undefined'){
          var oTr2 = createElement('tr', oTbody2);    
          var oTd2 = createElement('td',oTr2);                  
          with(oTd2){
            innerHTML = arr['Text'];           
            className = oTd.className + '-text';   
          }
        }
      }
    }
    // -------------------------------------------------------------------        
    this.show = function(){
      if(m_oSelf.m_oContainer == null) this.load();
      m_oSelf.m_oContainer.style.display = 'block';
    }    
    // -------------------------------------------------------------------        
    this.addItem = function(){
      var oItem = new cItem(this);
      m_oItems[m_oItems.length] = oItem;
      return oItem;
    }; 
    // -------------------------------------------------------------------        
    this.getHeight = function(){
      if(m_oSelf.m_oContainer == null) return 0;
      return m_oSelf.m_oContainer.offsetHeight;  
    };    
    // -------------------------------------------------------------------        
  }
