var uniDivHash = {}; function uniDiv(p_id, p_container) { this.elDiv; this.elDivId = p_id; this.container = p_container; this.createDiv(); this.defaultClassName = "uniDivDefault_css"; this.hiddenListener = null; this.hidden(); this.x = null; this.y = null; if (p_id != "") uniDivHash[p_id] = this; } uniDiv.prototype.createDiv = function() { this.elDiv = document.createElement("DIV"); this.container.appendChild(this.elDiv); } uniDiv.prototype.setStyle = function(p_className) { if (p_className == null || p_className == "") { this.elDiv.className = this.defaultClassName; } else { this.elDiv.className = p_className; } } uniDiv.prototype.setContent = function(p_content) { this.elDiv.innerHTML = p_content; } uniDiv.prototype.visible = function() { this.elDiv.style.visibility = "visible"; } uniDiv.prototype.prompt = function() { var mydiv = this.elDiv; if (this.x != null && this.y != null) { mydiv.style.left = this.x; mydiv.style.top = this.y; } else { var x = document.body.clientWidth/2; var y = document.body.clientHeight/2; x += document.body.scrollLeft; y += document.body.scrollTop; var divx = mydiv.clientWidth; var divy = mydiv.clientHeight; x = x - divx/2; y = y - divy/2; //x = (x-150); mydiv.style.left = x+"px"; mydiv.style.top = y+"px"; } mydiv.style.visibility = "visible"; } uniDiv.prototype.hidden = function() { this.elDiv.style.visibility="hidden"; if (this.hiddenListener != null) this.hiddenListener(); } uniDiv.prototype.getDivElement = function() { return(this.elDiv); } uniDiv.prototype.isVisible = function() { return(this.elDiv.style.visibility == "visible"); } uniDiv.prototype.setWidthAndHeight = function(p_width, p_height) { this.elDiv.style.width = p_width; this.elDiv.style.height = p_height; } uniDiv.prototype.display = function(p_content, p_fClose) { if (p_fClose != null && !p_fClose) document.getElementById("closeUniDivRow_id").style.display = "none"; else document.getElementById("closeUniDivRow_id").style.display = ""; if (document.getElementById(this.elDivId+"_content") != null) document.getElementById(this.elDivId+"_content").innerHTML = p_content; else this.elDiv.innerHTML = p_content; this.prompt(); } uniDiv.prototype.setHiddenListener = function(p_listener) { this.hiddenListener = p_listener; } uniDiv.prototype.resetPosition = function(p_x, p_y) { this.elDiv.style.left = p_x; this.elDiv.style.top = p_y; } function getUniDivById(p_id, p_container) { var obj = uniDivHash[p_id]; if (obj == null) { if (p_container == null) p_container = document.body; obj = new uniDiv(p_id, p_container); obj.setStyle(); html = "
| Close |