// JScript File var lastTooltip =null; var tooltipBackColor='#F5F5F5'; showTooltip = function (strTitle,strText,strHelpText,strhelpImage,strmainImage) { if (lastTooltip==null){ var newDiv = document.createElement("div"); newDiv.style.background=tooltipBackColor; newDiv.style.color='#4C4C4C'; newDiv.style.position='absolute'; newDiv.style.width='250px'; newDiv.style.border='#767676 1px solid'; newDiv.style.visibility='hidden'; newDiv.style.textAlign='left'; var title = document.createElement("span"); title.style.padding='6px 0 4px 10px'; newDiv.style.font='bold 12px "Trebuchet MS" , "Arial"'; title.style.styleFloat='left'; title.style.cssFloat='left'; title.style.clear='both'; title.style.width='100%'; var titleText = document.createTextNode(strTitle); title.appendChild(titleText); var mainParagraf = document.createElement("p"); mainParagraf.style.font='normal 12px "Trebuchet MS" , "Arial"'; mainParagraf.style.padding='0 2px 6px 20px'; mainParagraf.style.margin='0'; mainParagraf.style.styleFloat='left'; mainParagraf.style.cssFloat='left'; if (strmainImage) { var mainImg = document.createElement("img"); mainImg.setAttribute("src",strmainImage); mainImg.style.font='bold 12px "Trebuchet MS" , "Arial"'; mainImg.style.marginRight='10px'; mainImg.style.border='#BDBDBD 1px solid'; mainImg.style.styleFloat='left'; mainImg.style.cssFloat='left'; mainParagraf.appendChild(mainImg); } //var mainText = document.createTextNode(strText); mainParagraf.innerHTML = strText; newDiv.appendChild(title); newDiv.appendChild(mainParagraf); if (strHelpText) { var horLine = document.createElement("hr"); horLine.style.width='96%'; horLine.style.clear='both'; var helpDiv = document.createElement("div"); helpDiv.style.styleFloat='left'; helpDiv.style.cssFloat='left'; helpDiv.style.clear='both'; helpDiv.style.paddingLeft='6px'; helpDiv.style.height='24px'; if (strhelpImage) { var helpImg = document.createElement("img"); helpImg.setAttribute("src",strhelpImage); helpImg.style.marginRight='8px'; helpImg.style.verticalAlign='middle'; helpDiv.appendChild(helpImg); } var helpText = document.createTextNode(strHelpText); helpDiv.appendChild(helpText); newDiv.appendChild(horLine); newDiv.appendChild(helpDiv); } lastTooltip=newDiv; if (document.addEventListener) document.addEventListener("mousemove",moveTooltip, true); if (document.attachEvent) document.attachEvent("onmousemove",moveTooltip); var bodyRef = document.getElementsByTagName("body").item(0); bodyRef.appendChild(newDiv); } }; moveTooltip = function (e) { if (lastTooltip){ if (document.all) e = event; if (e.target) sourceEl = e.target; else if (e.srcElement) sourceEl = e.srcElement; var coors=findPos(sourceEl); var positionLeft = e.clientX; var positionTop = coors[1] + sourceEl.clientHeight + 20; var PageHeight = getPageHeight(); var PageTop = getScrollY(); if ((positionTop - PageTop) + lastTooltip.clientHeight > PageHeight) { positionTop = coors[1] - 20 - lastTooltip.clientHeight; } lastTooltip.style.top=positionTop+'px'; lastTooltip.style.left=positionLeft+'px'; lastTooltip.style.visibility='visible'; } } getPageHeight = function () { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return myHeight; } getScrollY = function () { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return scrOfY; } hideTooltip = function () { var bodyRef = document.getElementsByTagName("body").item(0); if (lastTooltip) bodyRef.removeChild(lastTooltip); lastTooltip=null; }; function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; }