function HTMLComboBox(sys, formID, code, posX, posY, width, height, description, value, showValue) {
  this.create(sys, formID, code, posX, posY, width, height, description, value);
  this.type = 1;
  this.openSubForm = false;
  this.style = 0;
  this.showValue = showValue;
  this.tabable = true;
  //Só quem expande é a lista dinâmica
  this.expand = false;
  this.initialType = 3;
  this.defaultXMLText = "";
  this.defaultText = "";
}

HTMLComboBox.inherits(HTMLLookup);

HTMLComboBox.prototype.name = 'HTMLComboBox';
HTMLComboBox.prototype.tagName = 'lookup';

HTMLComboBox.prototype.lookupInit = function() {
  //Não faz nada
}

HTMLComboBox.prototype.lookupEndInit = function() {
  this.setValue(this.value);
}

/*
HTMLComboBox.prototype.lookupDoSearch = function() {
 //
}
*/

HTMLComboBox.prototype.getXMLData = function(url, type, query) {
  //não modifcar a string do encoding [  encoding=\"ISO-8859-1\"] por causa do ant -->
  xml  = "<?xml version=\"1.0\"  encoding=\"ISO-8859-1\"?>";
  xml += "<root>";
  xml += ("<data value=\"\">" + this.defaultXMLText + "</data>");
  type = parseInt(type);
        
  for (var i = 0; i < this.values.length; i++) {
    var key = this.keys[i];
    var value = this.values[i];
    if (type && query) {
      query = query.toUpperCase();
      switch (type) {
        case 1: //igual
          if(query!=value.toUpperCase()) continue;
          break;
           
        case 2: //contendo
          if (value.toUpperCase().indexOf(query) == -1) continue;
          break;
           
        case 3: //começando
          if(value.toUpperCase().indexOf(query) != 0) continue;
          break;

        case 4: //terminando
          var startIndice = value.toUpperCase().lastIndexOf(query);
          var substring = value.substr(startIndice);
          substring = substring.toUpperCase();
          if (substring!=query) continue;
          break;
      }
    }
    xml += "<data value=\""+key+"\">"+replaceAll(replaceAll(value, '>', '&gt;'),'<', '&lt;')+"</data>";
  }
  xml += "<navigation>";
  xml += "<first enabled=\"false\"></first>";
  xml += "<previous enabled=\"false\"></previous>";
  xml += "<next enabled=\"false\"></next>";
  xml += "<last enabled=\"false\"></last>";
  xml += "</navigation>";
  xml += "</root>";

  var xmlobject = loadXML(xml);
  return xmlobject;
}

HTMLComboBox.prototype.add = function(key, value) {
  this.values = this.values.concat([value]);
  this.keys = this.keys.concat([key]);
}

HTMLComboBox.prototype.removeByIndex = function(idx) {
  this.keys.splice(idx, 1);
  this.values.splice(idx, 1);
}

HTMLComboBox.prototype.removeByKey = function(key) {
  var idx = arrayIndexOf(this.keys, key);
  if (idx != -1) {
    this.keys.splice(idx, 1);
    this.values.splice(idx, 1);
  } else
    interactionError(getLocaleMessage("ERROR.INEXISTENT_ELEMENT_KEY"), key);
}

HTMLComboBox.prototype.clean = function() {
  this.keys = new Array();
  this.values = new Array();
}

HTMLComboBox.prototype.length = function() {
  return this.keys.length;
}

HTMLComboBox.prototype.setValue = function(value, checkDependences) {
  value = normalizeRuleParam(value);
  var temp = this.getValue();

  var idx = arrayIndexOf(this.keys, value, this.typeName);
  if (idx != -1) {
    this.setShowValue(this.values[idx]);
    value = this.keys[idx];
  } else {
  	value = '';
    this.setShowValue(this.defaultText);
  }
  
  this.value = value;
  this.hidden.setValue(value);

  if (trim(this.value) != trim(temp)) {
    this.changeAction(window.event, null, !checkDependences);
  }
}