/*
	JSUI_TSelectOption
*/
function JSUI_TSelectOption (value, text) {
	this.$owner = null;
	this.$index = -1;
	this.$selected = false;
	this.$value = value;
	this.$text = text;
	this.$HTMLElement = null;

/* void */ this.select = function () {
	this.$selected = true;
}

/* void */ this.deselect = function () {
	this.$selected = false;
}


/* void */ this.addCssClass = function (/* string */ className) {
	var classes = this.$HTMLElement.className.split(" ");
	if (!classes.contains(className)) classes.push(className);
	this.$HTMLElement.className = classes.join(" ");
}

/* void */ this.removeCssClass = function (/* string */ className) {
	var classes = this.$HTMLElement.className.split(" ");
	if (classes.contains(className)) classes.pop(className);
	this.$HTMLElement.className = classes.join(" ");
}

/* HTMLElement */ this.render = function () {
	this.$HTMLElement = document.createElement(JSUI_TSelectManager.OPTION);
	this.$HTMLElement.className = "TSelectOption";
	this.$HTMLElement.innerHTML = this.$text;
	
	var _this = this;
	this.$HTMLElement.onmouseover = function () {
		JSUI_TSelectManager.setHover(_this);
	}
	this.$HTMLElement.onmouseout = function () {
		JSUI_TSelectManager.removeHover(_this);
	}
	this.$HTMLElement.onclick = function () {
		JSUI_TSelectManager.updateTSelect(_this);
	}

	return this.$HTMLElement;
}

}