function Select(select) {
    this._select = select; // Le node select
};

Select.prototype.load = function(entries) {
    for (var i=0;i<this._entries.length;i++) {
	var option = document.createElement('option');
	option.value = entries[i][0];
	option.innerHTML = entries[i][1];
	
	this._select.appendChild(option);
    }
};

Select.prototype.add = function(value, description) {
    for (var i=0;i<this._select.length;i++) if (this._select.options[i].value==value) return;

    var option = document.createElement('option');
    option.value = value;
    option.innerHTML = description;

    this._select.appendChild(option);
};

Select.prototype.valueExists = function(value) {
    for (var i=0;i<this._select.length;i++) if (this._select.options[i].value==value) return true;
    return false;
};

Select.prototype.valueSelected = function() {
    return this._select.value;
};

Select.prototype.remove = function(value) {
    for (var i=0;i<this._select.length;i++) {
	if (this._select.options[i].value==value) {
	    this._select.remove(i);
	    break;
	}
    }
};

Select.prototype.chgDescription = function(value, newDescription) {
    for (var i=0;i<this._select.length;i++) {
	if (this._select.options[i].value==value) {
	    this._select.options[i].innerHTML = newDescription;
	    break;
	}
    }
};



