function HTMLLabel(sys, formID, code, posX, posY, width, height, value) {
  this.create(sys, formID, code, posX, posY, width, height, '', value);
  this.wrap = false;
  this.type = 1;
}

HTMLLabel.inherits(HTMLElementBase);

HTMLLabel.prototype.name = 'HTMLLabel';
HTMLLabel.prototype.tabable = false;

HTMLLabel.prototype.setDescription = function(description) {
  this.value = description;
  this.setValue(description);
}

HTMLLabel.prototype.setColor = function(color) {
  this.color= color;
  this.label.style.color = color;
}

HTMLLabel.prototype.setBGColor = function(color) {
  this.bgColor= color;
  this.label.style.backgroundColor = color;
}

HTMLLabel.prototype.setFont = function(f) {
  this.label.style.fontFamily = f;
}

HTMLLabel.prototype.setSize = function(s) {
  this.label.style.fontSize = s;
}

HTMLLabel.prototype.setValue = function(value) {
	value = normalizeRuleParam(value);
	
  this.value = value;
  
  if (this.wrap) {
    this.label.innerHTML = this.value;
  } else {
  	this.label.innerHTML = this.value.replace(/\s/g, '&nbsp;');
  }
  
  if (this.hidden) this.hidden.setValue(value);
}

HTMLLabel.prototype.designComponent = function(doc) {
  this.label = document.createElement("font");
  this.label.className = 'tabBack';
  if (!this.bgColor)
    this.label.style.backgroundColor = doc.style.backgroundColor;
  this.label.style.color = "#000000";
  
  if (this.wrap) {
    this.div.style.overflow = "auto";
    
  	this.label.innerHTML = this.value;
  } else {
  	this.label.innerHTML = this.value.replace(/\s/g, '&nbsp;');
  }

  this.label.onmousedown = function() { return false; };
  this.label.onselectstart = function() { return false; };
  this.label.style.cursor = 'default';

  /* INI DECORATION */
  if (this.font) {
    this.label.style.fontFamily = this.font;
  }

  if (this.size) {
    this.label.style.fontSize = this.size;
  }

  if (this.weight) {
    this.label.style.fontWeight = "bold";
  }

  if (this.italic) {
    this.label.style.fontStyle = "italic";
  }

  if (this.underline) {
    this.label.style.textDecoration = "underline";
  }

  if (this.strikeout) {
    this.label.style.textDecoration = "line-through";
  }

  if (this.color) {
    this.label.style.color = this.color;
  }

  if (this.bgColor) {
    this.div.style.backgroundColor = this.bgColor;
  }
  /* END DECORATION */
  
  if (this.width) {
  	this.div.style.width = this.width;
  }
  
  if (this.height) {
    this.div.style.height = this.height;
  }
  
  if (this.alignment) {
    this.div.style.textAlign = this.alignment;
  }

  this.context.appendChild(this.label);
  
  if ((this.type == 2) || (!isNullable(this.field) && this.field.length > 0)) {
    this.hidden = new HTMLHidden(this.sys, this.formID, this.code, this.value);
    this.hidden.design(doc);
  }

  if (this.onclick) {
    this.div.onclick = this.onclick;
    this.div.onmouseover = (this.div.style.cursor = "pointer");
    this.label.onmouseover = (this.label.style.cursor = "pointer");
  }
}

HTMLLabel.prototype.setHint = function(hint) {
	this.callMethod(HTMLElementBase, "setHint", [hint]);
	
	if (this.label) {
	  this.label.hint = hint;
    this.label.alt = hint;
    this.label.title = hint;
	}
}

HTMLLabel.prototype.focus = function() { return false; }

HTMLLabel.prototype.blur = function() { return false; }

HTMLLabel.prototype.getPermissionDescription = function() {
  if (!isNullable(this.value)) {
    return this.value;
  }
  return this.callMethod(HTMLElementBase, "getPermissionDescription");
}

HTMLLabel.prototype.flush = function() {
  if (this.label) {
    if (this.label.onmousedown) this.label.onmousedown = null;
    if (this.label.onselectstart) this.label.onselectstart = null;
    this.label = null;
  }
  this.hidden = null;
	this.callMethod(HTMLElementBase, "flush");
}