Gaia.ButtonControl = function() {}

Gaia.ButtonControl.prototype = {
  
  // Sets text of button
  setText: function(value){
    this.element.value = value;
    return this;
  },

  // Sets text of button
  setPostBackUrl: function(value){
    this.options.url = value;
    return this;
  },
  
  setTarget: function(value) {
    this.options.callbackName = value;
    return this;
  },
  
  setArg: function(value) {
    this.options.arg = value;
    return this;
  },
  
  // Sets a function to call when button is clicked
  setOnClientClick: function(value) {
    if (value)
        this.element.onclick = new Function(value).bindAsEventListener(this.element);
    else {
        this.element.onclick = null;
        this.element.removeAttribute('onclick');
    }   
    return this;
  },
  
  _getElementPostValue: function(){
    return '';
  }
};

Gaia.ButtonControl.loaded = true;
