var DomHelper = function(element) {
  this.element = element;
};

DomHelper.find = function(id) {
  return new DomHelper(document.getElementById(id));
};

DomHelper.inArray = function(needle, haystack) {
  for (var i = 0; i < haystack.length; i += 1) {
    if (haystack[i] == needle) return true;
  }
  return false;
};

DomHelper.prototype = {
  show: function() {
    this.element.style.display = 'block';
    return this;
  },
  hide: function() {
    this.element.style.display = 'none';
    return this;
  },
  enable: function(enabled) {
    var disabled = enabled === false ? true : false;
    this.element.disabled = disabled;
    return this;
  },
  disable: function() {
    return this.enable(false);
  },
  html : function(content) {
    if (content !== undefined) {
      this.element.innerHTML = content;
      return this;
    }
    else {
      return this.element.innerHTML;
    }
  },
  value : function() {
    // solo para selects
    return this.element.options[this.element.selectedIndex].value;
  }
};
