﻿if (!SIGI) throw ("SIGI.ComboBox depends on the following scripts. Please make sure these are included.\nSIGI.js");

// === classes ===
SIGI.CheckBox = function() {
    this._initialDisplay = "";
};
SIGI.CheckBox.inherits(SIGI.UI.Control);

SIGI.CheckBox.prototype.get_text = function() {
    return this.get_element()._label.innerHTML;
};
SIGI.CheckBox.prototype.set_text = function(pValue) {
    this.get_element()._label.innerHTML = pValue;
};
SIGI.CheckBox.prototype.get_value = function() {
    return this.get_element().value;
};
SIGI.CheckBox.prototype.set_value = function(pValue) {
    return this.get_element().value = pValue;
};
SIGI.CheckBox.prototype.get_checked = function() {
    return this.get_element().checked;
};
SIGI.CheckBox.prototype.set_checked = function(pValue) {
    this.get_element().checked = pValue;
};
SIGI.CheckBox.prototype.get_enabled = function() {
    return !this.get_element().disabled;
};
SIGI.CheckBox.prototype.set_enabled = function(pValue) {
    SIGI.changeState(this.get_element(), !pValue);
};
SIGI.CheckBox.prototype.get_toolTip = function() {
    return this.get_element().getAttribute("tooltip");
};
SIGI.CheckBox.prototype.set_toolTip = function(pValue) {
    this.get_element().setAttribute("tooltip", pValue);
};
SIGI.CheckBox.prototype.get_statusText = function() {
    return this.get_element().getAttribute("statustext");
};
SIGI.CheckBox.prototype.set_statusText = function(pValue) {
    this.get_element().setAttribute("statustext", pValue);
};
SIGI.CheckBox.prototype.get_visible = function() {
    if (this.get_element().style.display == "none")
        return false;
    else
        return true;
};
SIGI.CheckBox.prototype.set_visible = function(pValue) {
    if (pValue) {
        this.get_element().style.display = this._initialDisplay;
        if (this.get_element()._label) {
            this.get_element()._label.style.display = this._initialDisplay;
        }
    }
    else {
        this.get_element().style.display = "none";
        if (this.get_element()._label) {
            this.get_element()._label.style.display = "none";
        }
    }
};
SIGI.CheckBox.prototype.focus = function() {
    SIGI.setFocus(this.get_element());
};
SIGI.CheckBox.prototype.initialize = function() {
    this._initialDisplay = this.get_element().style.display;
    this.get_element()._label = document.getElementById(this._id + "_Label")
};

