var agt=navigator.userAgent.toLowerCase(); var is_opera = (agt.indexOf("opera") != -1); function ShowTips(obj, field, hide) { if (field == '') { field = obj.id.substr(2); } var helpObj = document.getElementById('mHelpDiv'); if (!helpObj) return; var helpDiv = document.getElementById('mHelpDiv2'); if (!helpDiv) return; if (hide) { helpObj.style.display = 'none'; return; } var hObj = 0; if (document.all) { hObj = document.all[field+"_help"]; } else if (document.getElementById) { hObj = document.getElementById(field+"_help"); } if (!hObj) return; //alert(hObj.offsetWidth); helpObj.style.width = parseInt(hObj.style.width)+"px"; //helpObj.style.height = "100px"; helpDiv.innerHTML = hObj.innerHTML; //Get location of mouseover object, move help object to the left if will display off-screen var divWidth = parseInt(hObj.offsetWidth); var offsetLeft = getOffsetLeft(obj); var screenWidth = (window.innerWidth) ? window.innerWidth - 25 : document.body.clientWidth; if ((offsetLeft + divWidth) > screenWidth) offsetLeft = screenWidth - divWidth; //Get location of mouseover object, move help object on top if will display off-screen var divHeight = parseInt(hObj.offsetHeight); var offsetTop = getOffsetTop(obj) + obj.offsetHeight; var screenHeight = (window.innerHeight) ? window.innerHeight - 25 : document.body.clientHeight; if ((offsetTop + divHeight) > screenHeight + getScrollY()) offsetTop = getOffsetTop(obj) - divHeight - 3; else offsetTop += 10; newY = offsetTop; newX = parseInt(offsetLeft) - 50; if (newX < 0) newX = 0; helpObj.style.top = parseInt(newY) + "px"; helpObj.style.left = parseInt(newX) + "px"; //alert("X: "+newX+", Y: "+newY+", W: "+helpObj.style.width+", H: "+helpObj.style.height); helpObj.style.display = 'block'; } function ShowHelp(obj,field,hide) { if (field == '') { field = obj.id.substr(2); } //Get help object var helpObj; if (document.all){ helpObj = document.all[field+"_help"];} else if (document.getElementById){ helpObj = document.getElementById(field+"_help");} if (helpObj) { //if help object is shown, hide it ; if object hidden, show it if (hide){ helpObj.style.display = "none";} else{ helpObj.style.display = "";} //Get location of mouseover object, move help object to the left if will display off-screen var divWidth = 340; var offsetLeft = getOffsetLeft(obj); var screenWidth = (window.innerWidth) ? window.innerWidth - 25 : document.body.clientWidth; if ((offsetLeft + divWidth) > screenWidth) offsetLeft = screenWidth - divWidth; //Get location of mouseover object, move help object on top if will display off-screen var divHeight = parseInt(helpObj.offsetHeight); var offsetTop = getOffsetTop(obj) + parseInt(obj.offsetHeight); var screenHeight = (window.innerHeight) ? window.innerHeight - 25 : document.body.clientHeight; if ((offsetTop + divHeight) > screenHeight + getScrollY()) offsetTop = getOffsetTop(obj) - divHeight - 3; else offsetTop += 10; newY = offsetTop; newX = parseInt(offsetLeft) - 50; if (newX < 0) newX = 0; helpObj.style.top = parseInt(newY) + "px"; helpObj.style.left = parseInt(newX) + "px"; if (!hide){ qh_hideElement("select",helpObj); qh_hideElement("object",helpObj); qh_hideElement("embed",helpObj); } else{ qh_showElement("select"); qh_showElement("object"); qh_showElement("embed");} } } function getOffsetTop (elm) { var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; while (mOffsetParent) { mOffsetTop += parseInt(mOffsetParent.offsetTop); mOffsetParent = mOffsetParent.offsetParent;} return mOffsetTop; } function getOffsetLeft (elm) { var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; while (mOffsetParent) { mOffsetLeft += parseInt(mOffsetParent.offsetLeft); mOffsetParent = mOffsetParent.offsetParent;} return mOffsetLeft; } function getScrollY() { var scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape scrOfY = parseInt(window.pageYOffset);} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM scrOfY = parseInt(document.body.scrollTop);} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 scrOfY = parseInt(document.documentElement.scrollTop);} return scrOfY; } function qh_hideElement( elmID, overDiv ) { tab = document.getElementsByTagName(elmID); for(i = 0; i < tab.length; i++) { obj = tab[i]; if(!obj || !obj.offsetParent) continue; // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = parseInt(obj.offsetLeft); objTop = parseInt(obj.offsetTop); objParent = obj.offsetParent; while(objParent && objParent.tagName.toUpperCase() != 'BODY') { objLeft += parseInt(objParent.offsetLeft); objTop += parseInt(objParent.offsetTop); objParent = objParent.offsetParent; } objHeight = parseInt(obj.offsetHeight); objWidth = parseInt(obj.offsetWidth); if((parseInt(overDiv.offsetLeft) + parseInt(overDiv.offsetWidth)) <= objLeft); else if((parseInt(overDiv.offsetTop) + parseInt(overDiv.offsetHeight)) <= objTop); else if(parseInt(overDiv.offsetTop) >= (objTop + objHeight)); else if(parseInt(overDiv.offsetLeft) >= (objLeft + objWidth)); else { obj.style.visibility = 'hidden'; } } } function qh_showElement(elmID) { var tab = document.getElementsByTagName(elmID); for(i = 0; i < tab.length; i++) { obj = tab[i]; if(!obj || !obj.offsetParent) continue; obj.style.visibility = ''; } }