

function CollBox (sClientId, fSummary) {
	this.sClientId_ = sClientId;
	this.fSummary_ = fSummary;
}

CollBox.prototype.init = function () {
	var id = this.sClientId_;
	this.r1_ = gid(id);
	this.r1i_ = gid(id + "_r1i");
	this.sp1_ = gid(id + "_sp1");
	this.sp2_ = gid(id + "_sp2");
	this.r2_ = gid(id + "_r2");
	this.hi_ = gid(id + "_hi");
	var oThis = this;
	this.r1i_.onclick = function (evt) {
		if (window.event) window.event.cancelBubble = true;
		else evt.stopPropagation();
		oThis.toggle();
	};
	this.r1_.onclick = function () {
		oThis.toggle();
	};
	this.sp1_.unselectable = "on";
	this.sp2_.unselectable = "on";
	if (this.hi_.value == "1") this.expand();
	else this.collapse();
}

CollBox.prototype.toggle = function () {
	if (this.hi_.value == "1") this.collapse();
	else this.expand();
}

CollBox.prototype.expand = function () {
	this.hi_.value = "1";
	this.r1_.className = "cllbxr1e";
	this.r1_.style.backgroundImage = "url(/jv/ext/images/arrDown.gif)";
	this.r1_.style.borderBottom = "1px solid #ccc";
	this.r2_.style.display = "block";
	this.sp2_.innerHTML = "";
}

CollBox.prototype.collapse = function () {
	this.hi_.value = "0";
	this.r1_.className = "cllbxr1";
	this.r1_.style.backgroundImage = "url(/jv/ext/images/arrRight.gif)";
	this.r1_.style.borderBottom = "1px solid #aaa";
	this.r2_.style.display = "none";
	this.sp2_.innerHTML = this.fSummary_();
}

