  function BlockManager() {
    this.blocks = new Array();
    
    this.addBlocks = BlockManager_addBlocks;
    this.switchTo = BlockManager_switchTo;
    this.currentBlock = null;
    this.loadHTMLToBlock = BlockManager_loadHTMLToBlock;
    this.connectWithTabs = false;
    this.tab_postfix = '_tab';
    this.tabActiveClass = '';
    this.tabNormalClass = '';
  }
  
  function BlockManager_addBlocks() {
    for (i=0; i<arguments.length; i++) {
      this.blocks.push(arguments[i]);
    }
  }
  
  function BlockManager_switchTo(blockid) {
    
    for (i=0; i < this.blocks.length; i++) {
      if (this.blocks[i] == blockid) break;
    }
    if (i == this.blocks.length) return;
    
    if (this.currentBlock) {
      this.currentBlock.style.display='none';
      
      if (this.connectWithTabs) {
        tab = document.getElementById(this.currentBlock.id + this.tab_postfix);
        if (tab) {
          tab.className = this.tabNormalClass;          
        }
      }
    }
    
    block = document.getElementById(blockid);
    if (block) {
      block.style.display = 'block';
      this.currentBlock = block;

      if (this.connectWithTabs) {
        
        tab = document.getElementById(blockid + this.tab_postfix);
        
        if (tab) {
          
          tab.className = this.tabActiveClass;          
        }
      }
      
    }
  }

  function BlockManager_loadHTMLToBlock(blockid,url) {
    
  }
