var TabBox = function() {
  
  this.className = "";
  this.tabs = new Array();
  this.id = "";
  
  this.create = function(id) {
    this.id = id;
    eTabs = document.getElementById(id + "_tabs");
    if (!eTabs) { return false; }
    eTabs.style.display = 'block';
    html = '';
    for (tabId in this.tabs) {
      if (isNaN(tabId)) { continue; }
      html += '<a id="' + id + '_tab' + tabId + '" href="javascript:void(0);" onmouseover="javascript:' + this.id + '.show(\'' + tabId + '\');" class="' + this.className + '_inactive">' + this.tabs[tabId] + '</a>';
      eContent = document.getElementById(this.id + "_" + tabId);
      if (eContent) { eContent.className = this.className + "_content_js"; }
    }
    eTabs.innerHTML = html;
    this.show(1);
  }
  
  this.show = function(tid) {
    for (tabId in this.tabs) {
      if (isNaN(tabId)) { continue; }
      eContent = document.getElementById(this.id + "_" + tabId);
      if (eContent) { eContent.style.display = "none"; }
      eTab = document.getElementById(this.id + "_tab" + tabId); 
      if (eTab) { eTab.className = this.className + "_inactive"; }
    }
    eContent = document.getElementById(this.id + "_" + tid);
    if (eContent) { eContent.style.display = "block"; }
    eTab = document.getElementById(this.id + "_tab" + tid); 
    if (eTab) { eTab.className = this.className + "_active"; }
  }
  
}
