/**
	Manages multiple button states as well as hiding and
	showing divs based on which button is clicked.
	@extends	BtnStateManager
*/
function SectionDisplayer() {
	this.bodyIdPrefix = "";
	this.bodyIdSuffix = "";
	this.setIdSuffix("Head");
	this.setBodyIdSuffix("Body");
}
SectionDisplayer.prototype = new BtnStateManager();

/**
	Set the name of the prefix which should be concatenated in front of the 'id' string1 before 
	accessing the elemnt using document.getElementById(). The id becomes: prefix + id
	@param	str		(String) Prefix name.
*/
SectionDisplayer.prototype.setBodyIdPrefix = function(str){ this.bodyIdPrefix = str; }
/**
	Set the name of the suffix which should be concatenated with the 'id' string before 
	accessing the elemnt using document.getElementById(). The id becomes: id + suffix
	@param	str		(String) Suffix name.
*/
SectionDisplayer.prototype.setBodyIdSuffix = function(str){ this.bodyIdSuffix = str; }
/** 
	Changes the element to the 'on' state and hides or displays the related body section.
	@param	id		(String) An id of an element on the page
*/	
SectionDisplayer.prototype.itemOn = function(id) {
	if (!document.getElementById(this.idPrefix + id + this.idSuffix)) return;
	if (id != this.activeId){
		if (this.activeId != null) {
			this.setState(this.idPrefix + this.activeId + this.idSuffix, "off");
			document.getElementById(this.bodyIdPrefix + this.activeId + this.bodyIdSuffix).style.display = "none";
		}
		this.setState(this.idPrefix + id + this.idSuffix, "on");
		document.getElementById(this.bodyIdPrefix + id + this.bodyIdSuffix).style.display = "block";
		this.activeId = id;
	}
}


