function exTabNavi() {
  this.defaults = {
    id: null,
    active: 1,
    activeclass: 'active',
    showall: null
  };
  for (var n in arguments[0]) {
    this.defaults[n]=arguments[0][n];
  };  
  this.getTabNavi = function(){
    var elem = document.getElementById(this.defaults.id).getElementsByTagName('li');
    return elem;
  }
  this.tabIndex = this.getTabNavi();
  this.links = document.getElementById(this.defaults.id).getElementsByTagName('li');
  this.show = function(n){
    for (var i = 0; i < this.tabIndex.length; i++) {
      if(this.defaults.showall != i){
      var body = document.getElementById(this.defaults.id + '_' + (i+1) +  '_body');
      if(((i)==n) || this.defaults.showall == n){
        body.style.display = 'block';
      }else{
        body.style.display = 'none';
      }
      }
      this.links[i].className = (i==n) ? this.defaults.activeclass : '';
    }
  };
  var self = this;
  for (var i = 0; i < this.tabIndex.length; i++) {
      this.tabIndex[i].tabId = i;
      this.tabIndex[i].onclick = function(){ self.show(this.tabId);};
  }
  this.show(this.defaults.active);
};
