/* utility to manage tri-state objects */
function ObjectSelector() {
	this.reset();
}
ObjectSelector.prototype.reset = function(){
	this.hlObject = null;
	this.curObject = null;
}

ObjectSelector.prototype.over = function(obj) {
	if (obj === this.hlObject || obj === this.curObject)
		return;
	obj.highlight(1);
	hlObject = obj;
}
ObjectSelector.prototype.out = function(obj) {
	if (obj === this.curObject)
		return;
	obj.highlight(0);
	this.hlObject = null;
}
ObjectSelector.prototype.select = function(obj) {
	if (obj === this.curObject)
		return false;
	if (this.curObject)
		this.curObject.highlight(0);
	if (obj)
		obj.highlight(2);
	this.curObject = obj;
	return true;
}

