// JavaScript Document function startPolling(){setInterval("poll()",10)} function poll(){ myHeight = 0; // var for height of browser window if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } var T= 0; // T = distance between of static ISI layer and top of browser window hoo = document.getElementById('static_ISI'); while(hoo){ T+= hoo.offsetTop; hoo= hoo.offsetParent; } if(window.pageXOffset!==undefined){ T-= pageYOffset; } else{ var d= document.documentElement, b=document.body; T-= (d.scrollTop+b.scrollTop); // T = distance between of static ISI layer and top of browser window } //alert ("top of static_ISI = " + T); var difference = (T - myHeight); // distance between static ISI layer and height of browser window // use the below code for debugging, this renders on the hover ISI layer //document.getElementById('hover_ISI').innerHTML = "T = " + T + " myHeight = " + myHeight + " difference = " + difference; if (difference > -220 && difference < -55) {document.getElementById('hover_ISI').style.height=(difference * -1) + 'px';} // changes height of hover ISI layer relative to "difference" (or amount of scroll) else {document.getElementById('hover_ISI').style.height=50 + 'px';}// sets height of hover ISI layer // if the difference between the layers is a certain value, then show/hide layers if (difference <= -220) { document.getElementById('hover_ISI').style.visibility="hidden"; document.getElementById('static_ISI').style.visibility="visible"; }else{ document.getElementById('hover_ISI').style.visibility="visible"; document.getElementById('static_ISI').style.visibility="hidden"; } return true; }