function HTMLPermissionForm(sys, formID, width, height, formDescription, formHeight) {
  this.sys = sys;
  this.formID = formID;
  this.width = width;
  this.height = height;
  this.formDescription = formDescription;
  this.formHeight = formHeight;
  this.visibleNav = true;
}

HTMLPermissionForm.inherits(HTMLObject);

HTMLPermissionForm.name = "HTMLPermissionForm";

HTMLPermissionForm.prototype.design = function() {
  var divLay = MM_findObj("lay");
  
  // DIV superior para permissão de formulário
  if (this.visibleNav) {
    this.divFormPerm = this.getDiv('WFRFormPerm'+this.formID, this.width, this.height, 10002, true);
  
    this.divFormPerm.style.cursor = "pointer";
    this.divFormPerm.innerHTML = '<table width=100% height=100%><tr><td>&nbsp;</td></tr></table>';
    this.divFormPerm.parent = this;
  
    var divFormHint = this.getDiv('ACCESS_HINT', 300, 20, 10001, false);
    this.divFormPerm.divFormHint = divFormHint;
  
    divLay.appendChild(this.divFormPerm);
    divLay.appendChild(divFormHint);
  
    this.divFormPerm.onmouseover = function() {
      if (this.parent && this.parent.formDescription) {
        var desc = getLocaleMessage("LABEL.FORM")+ ": " + this.parent.formDescription;
  
        this.divFormHint.style.display = "block";
        this.divFormHint.style.top = mY;
        this.divFormHint.style.left = mX + 15;
        this.divFormHint.innerHTML = '<table border=0 cellpadding=2 cellspacing=1 bgcolor=#000000><tr><td bgcolor=#FFFF99>'+unescape(desc)+'</td></tr></table>';
      }
    }
    this.divFormPerm.onmousemove = function() {
      if (this.parent && this.parent.formDescription) {
        this.divFormHint.style.top = mY;
        this.divFormHint.style.left = mX + 15;
      }
    }
    this.divFormPerm.onmouseout = function() {
      this.divFormHint.style.display = "none";
    }
    this.divFormPerm.onclick = function() {
      this.divFormHint.style.display = "none";
      openFormAccess(this.parent.sys, this.parent.formID, document.title);
    }
  }
  
  // Imagem com cadeado para permissão de usuário
  var imageSize = 16;
  this.divDownFormPerm = getDiv('WFRFormPerm'+this.formID, this.width - imageSize - 5, this.formHeight - imageSize - 5, imageSize, imageSize, 10003, true);
  this.divDownFormPerm.parent = this;
  this.divDownFormPerm.onclick = function() {
    openFormAccess(this.parent.sys, this.parent.formID, document.title);
  }
  
  this.img = document.createElement("<img>");
  this.img.setAttribute("border", "0");
  this.img.alt = getLocaleMessage("LABEL.FORM") + ": " + this.formDescription;
  this.img.title = getLocaleMessage("LABEL.FORM") + ": " + this.formDescription;
  this.img.src = skin + "permission.gif";
  this.img.style.cursor = "pointer";
  
  this.divDownFormPerm.appendChild(this.img);
  divLay.appendChild(this.divDownFormPerm);
}

HTMLPermissionForm.prototype.getDiv = function(id, w, h, zindex, display) {
  return getDiv(id, 0, 0, w, h, zindex, display);
}

HTMLPermissionForm.prototype.toString = function() {
  return "[object " + this.name + ": " + this.formDescription + "]";
}
