var _ToolTip = null; // À̺¥Æ®¸¦ À§ÇÑ Àü¿ªº¯¼ö function ToolTip() { this.pointX = 0; this.pointY = 0; this.toolTip = null; this.toolTipID = null; _ToolTip = this; } ToolTip.prototype.tooltipLoad = function () { this.toolTip.innerHTML = document.getElementById(this.toolTipID).innerHTML; }; ToolTip.prototype.displayToolTip = function () { this.toolTip.style.left = (this.pointX + 12) + 'px'; this.toolTip.style.top = (this.pointY + 5) + 'px'; this.toolTip.style.display = 'block'; }; ToolTip.prototype.moveToolTip = function (evt) { this.setToolTipPosition(evt); this.displayToolTip(); }; ToolTip.prototype.hideToolTip = function () { this.toolTip.style.display = 'none'; }; ToolTip.prototype.hideRequestToolTip = function () { setTimeout(function () { _ToolTip.hideToolTip(); }, 10); }; ToolTip.prototype.setToolTipPosition = function (evt) { this.pointX = evt.pageX ? evt.pageX : document.body.scrollLeft + evt.clientX - document.body.clientLeft; this.pointY = evt.pageY ? evt.pageY : document.body.scrollTop + evt.clientY - document.body.clientTop-1; }; ToolTip.prototype.showToolTip = function (objRef, evt, toolTipID) { if (this.toolTipID == toolTipID) { this.displayToolTip(); return; } this.toolTipID = toolTipID; if (!this.toolTip) { var toolTip = document.createElement('div'); this.toolTip = toolTip; toolTip.style.display = 'none'; toolTip.style.position = 'absolute'; toolTip.style.paddingTop = '3px'; toolTip.style.paddingLeft = '3px'; toolTip.style.paddingRight = '5px'; //toolTip.style.width = 30; toolTip.style.backgroundColor='#FFFFCC'; toolTip.style.border='1px solid #999'; //toolTip.className = 'toolTip'; document.body.appendChild(toolTip); toolTip.onmouseover = toolTip.onmousemove = this.moveToolTipEvent; toolTip.onmouseout = this.hideRequestToolTipEvent; } else { this.hideToolTip(); } this.tooltipLoad(); objRef.onmousemove = this.moveToolTipEvent; objRef.onmouseout = this.hideRequestToolTipEvent; }; ToolTip.prototype.moveToolTipEvent = function () { var evt = (arguments.length != 0) ? arguments[0] : window.event; _ToolTip.moveToolTip(evt); }; ToolTip.prototype.hideRequestToolTipEvent = function () { _ToolTip.hideRequestToolTip(); }; var _T = new ToolTip();