function getElementsByClass(classname,object){ 

     var output = Array(); 
	
     var obj = object.getElementsByTagName('*') 

     for (i=0;i<obj.length;i++){ 
          if (obj[i].className == classname){ 
          	//alert(obj[i].className);
			output.push(obj[i]); 
          } 
     } 
     return output; 

} 

 

function domtabs(postfix,ul){ 
	if (ul){
		this.ulid = ul;
	} else {
		this.ulid = 'domtabs_menu';
	}
	if (postfix)
		this.classN = 'domtabs ' + postfix;
	else 
		this.classN = 'domtabs';
	this.select = 0;
     this.init();      
} 

  

domtabs.prototype.init = function (){ 
	
	
     this.tabs = getElementsByClass(this.classN,document); 

     for(i=1; i<this.tabs.length;i++){ 

          this.tabs[i].style.display = 'none'; 

     } 
	
    this.show(0); 

} 

 

domtabs.prototype.show = function(num){ 
	//alert(this.tabs[this.select]);
     this.tabs[this.select].style.display = 'none'; 
     this.tabs[num].style.display = 'block'; 
     var LIs = this.getLi(); 
     LIs[this.select].className = ''; 
     LIs[num].className = 'selected'; 
     this.select = num; 
} 

 

domtabs.prototype.getLi = function(){ 
    return document.getElementById(this.ulid).getElementsByTagName('li'); 
}