function DropDownArea(id) { this.parentDiv = null; this.dropdownAreaDiv = null; this.top = 0; this.left = 0; this.height = 100; this.id = id; this.width = 100; this.borderColor = "#A7A7A7"; this.zIndex = 0; this.backImage = null; this.position = 'absolute'; function draw(htmlCode) { /* * Se não for internet explorer, remove 2 pixels do width devido ao calculo dos pixels no IE considerarem as * bordar e os outros browser nao consideram. */ if(!document.all) { this.width = this.width - 2; } // Div pai this.dropdownAreaDiv = document.createElement("div"); this.dropdownAreaDiv.style.position = this.position; this.dropdownAreaDiv.style.zIndex = this.zIndex this.dropdownAreaDiv.className = this.menuClass; this.dropdownAreaDiv.id = this.id; this.dropdownAreaDiv.name = this.id; this.dropdownAreaDiv.style.width = this.width; this.dropdownAreaDiv.style.height = this.height; this.dropdownAreaDiv.style.top = this.top; this.dropdownAreaDiv.style.left = this.left; if(this.backImage) { this.dropdownAreaDiv.style.backgroundImage = "url('" + this.backImage + "')"; this.dropdownAreaDiv.style.backgroundRepeat = "repeat-x"; this.dropdownAreaDiv.style.backgroundPosition = "bottom"; this.dropdownAreaDiv.style.backgroundColor = "#FFFFFF"; } this.dropdownAreaDiv.style.borderBottom = "1px solid " + this.borderColor; this.dropdownAreaDiv.style.borderLeft = "1px solid " + this.borderColor; this.dropdownAreaDiv.style.borderRight = "1px solid " + this.borderColor; if(htmlCode) { this.dropdownAreaDiv.innerHTML = htmlCode; } if(this.parentDiv != null) { this.parentDiv.appendChild(this.dropdownAreaDiv); } else { document.body.appendChild(this.dropdownAreaDiv); } } this.draw = draw; function destroy() { if(this.parentDiv != null) { this.parentDiv.removeChild(this.dropdownAreaDiv); } else { document.body.removeChild(this.dropdownAreaDiv); } } this.destroy = destroy; /* * Retorna true se menu está ativo */ function isActive() { return document.getElementById(this.id) ? true:false; } this.isActive = isActive; }