newsi.TabObject=function(o){
this.arr=o.arr;
this.target=o.target;
this.linkIdBase=o.linkIdBase;
this.contentIdBase=o.contentIdBase;
this.doInit(this.arr);
var i=0;
while(this.arr[i]){
	var ev=new newsi.Event();
	ev.addListener("onclick",this.linkIdBase+i,this,"toggle",false,this.target[i]);
	i++;
	};
};
newsi.TabObject.prototype=new newsi.HTML.Stacker();
newsi.TabObject.prototype.toggle=function(num){
this.loopAndHide({linkId:this.linkIdBase+num[0],str:"contentId",showClass:"displayblock",hideClass:"displaynone"});
this.changeStack({state:"show",linkId:this.linkIdBase+num[0],contentId:this.contentIdBase+num[0],showClass:"displayblock",hideClass:"displaynone"});
};
// setStyleById: given an element id, style property and 
// value, apply the style.
// args:
//  i - element id
//  p - property
//  v - value
//
function setStyleById(i, p, v) {
	var n = document.getElementById(i);
	n.style[p] = v;
}

function changeStyles (id)  { //function for open all close all feature
	//debugger;
	switch(id) {
		case 'openall':
			setStyleById ('closeall', 'display', 'inline');
			setStyleById ('openall', 'display', 'none');
			break;	
		
		case 'closeall':
			setStyleById ('openall', 'display', 'inline');
			setStyleById ('closeall', 'display', 'none');
			break;	
	}
}

