// Called on page load to set heights of dynamic DIV blocks // and optionally adjust screen position for resolutions <= 800 /* Called by GBIWEB pages (outside Portal) -----------------------------------------*/ function setPage() { sidebarHeight(); recenter(); } /* Called by Portal pages (inside Portal) -----------------------------------------*/ function setPortal() { reportBarHeight(); rightBorderHeight(); // extendPage(); } /* Sets sidebar height equal to height of the main content ---------------------------------------------------------*/ function sidebarHeight() { var elem = document.getElementById('content'); xPos = elem.offsetHeight; xPos = xPos < 450 ? 450 : xPos; elem = document.getElementById('sidebarBody'); elem.style.height = (xPos) + 'px'; } /* Repositions screen position for resolutions <= 800x600 ---------------------------------------------------------*/ function recenter() { // WHEN SCREEN RESOLUTION IS 800X600 OR LESS, AUTOMATICALLY SCROLL OVER TO CUT OUT WHITE MARGINS if (document.body.clientWidth <= 800) scrollTo(78,0); } /* Extends width of Header & Footer in Portal if the custom portlet stretches beyond viewable screen ---------------------------------------------------------*/ function extendPage() { var edge= document.getElementById('rightBorderTable'); var curleft = 0; if (edge.offsetParent) { curleft = edge.offsetLeft while (edge = edge.offsetParent) { curleft += edge.offsetLeft } } if (curleft > document.body.clientWidth) { curleft += 16; document.getElementById('header').style.width = curleft; document.getElementById('footer').style.width = curleft; } } /* Sets reportbar height equal to its parent table container ------------------------------------------------------------*/ function reportBarHeight() { var elem = document.getElementById('footer'); var xPos = 0; if (elem.offsetParent) { xPos = elem.offsetTop while (elem = elem.offsetParent) { xPos += elem.offsetTop } } xPos = xPos < 450 ? 450 : xPos; elem = document.getElementById('reportbar'); //subtract 133 - the height of the header elem.style.height = (xPos - 133) + 'px'; } /* Initializes the right border height to the height of its parent container ----------------------------------------*/ function rightBorderHeight() { var elem = document.getElementById('rightBorderTable').parentNode; xPos = elem.offsetHeight; xPos = xPos < 450 ? 450 : xPos; elem = document.getElementById('rightBorderTable'); elem.style.height = (xPos) + 'px'; }