/** * Get the size of the page loaded in the current window */ function getPageSize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if (xScroll < windowWidth) { pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function setOpacity(obj, opacity) { opacity = (opacity == 100) ? 99.999 : opacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLopacity = opacity/100; // Older Mozilla and Firefox obj.style.Mozopacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } function showOverlay() { } function showPopupBox(boxName, htmlString) { // Show popup layer. var pageSize = getPageSize(); var oDiv = document.getElementById(boxName); oDiv.innerHTML = htmlString; oDiv.style.left = ((pageSize[0] / 2) - (oDiv.offsetWidth / 2)) + 'px'; oDiv.style.top = ((pageSize[1] / 4) - (oDiv.offsetHeight / 4)) + 'px'; oDiv.style.visibility = 'visible'; oDiv.style.display = 'block'; } function hidePopupBox(boxName) { // Hide popup layer. var oDiv = document.getElementById(boxName); oDiv.style.visibility = 'hidden'; oDiv.innerHTML = ''; // Hide the overlay div (the gray opacity layer). oDiv = document.getElementById('overlaybox'); oDiv.style.visibility = 'hidden'; }