
// requires getObject and showHide metods within the general.js 

ToggleGroup = function(pName){
	this._name = pName; // reference to defining variable name
	this._toggleItems = []; // array of toggle items
};

ToggleGroup.prototype.add = function(toggleID, linkString){
	this._toggleItems[this._toggleItems.length] = toggleID;
	if(linkString.length){
		document.write("<a href=\"javaScript:" + this._name + ".toggle(\'" + toggleID + "\');\">" + linkString + "<\/a>");
	}
};

ToggleGroup.prototype.toggle = function(toggleID){
	showHide(toggleID);
};

ToggleGroup.prototype.show = function(toggleID){
	var toggleItem = getObject(toggleID);
	toggleItem.style.display = "";
};

ToggleGroup.prototype.hide = function(toggleID){
	var toggleItem = getObject(toggleID);
	toggleItem.style.display = "none";
};

ToggleGroup.prototype.hideAll = function(toggleID){
	for(var i=0; i<this._toggleItems.length; i++){
		this.hide(this._toggleItems[i]);
	}
};

ToggleGroup.prototype.showAll = function(toggleID){
	for(var i=0; i<this._toggleItems.length; i++){
		this.show(this._toggleItems[i]);
	}
};