function scrollintoview(oElement,blockid,offset) { // Aktuelles Element // Eindeutige Id vom Top Element des Scrollbereichs // Offset - wieviel vor dem Rand (oben und unten) gescrollt werden soll var objheight; var top = findPos(oElement,"DIV",blockid); var obj = document.getElementById(blockid); var offsettop=obj.scrollTop; if (obj.currentStyle) { objheight = parseInt(obj.currentStyle.height); } else { objheight = parseInt(window.getComputedStyle(obj,null).height); } objheight-=offset; // puffer nach unten if (objheight > 0) { if (top[0]-offsettop > objheight) { // oElement.scrollIntoView(true); offsettop = (top[0] - (offset+10)); if (offsettop < 0) {offsettop = 0;} } else if(top[0]-offsettop < offset && offsettop) { // oElement.scrollIntoView(true); do { offsettop -= (offset+20); } while (top[0]-offsettop < 60 && offsettop); } if (offsettop != obj.scrollTop) { obj.scrollTop = offsettop; } } } function scrolltop(oElement,blockid,offset) { // Aktuelles Element // Eindeutige Id vom Top Element des Scrollbereichs // Offset - wieviel vor dem Rand (oben und unten) gescrollt werden soll var top = findPos(oElement,"",blockid); var obj = document.getElementById(blockid); obj.scrollTop = top[0]-offset; } function findPos(obj,stoptagname,stopid) { var curleft=0; var curtop=0 if (obj.offsetParent) { do { if(stopid) { if(obj.id==stopid) { break; } } else if (stoptagname) { if(obj.nodeName==stoptagname) { break; } } curleft += obj.offsetLeft; curtop += obj.offsetTop } while (obj = obj.offsetParent); } return [curtop,curleft]; } function Documentscrolltop(id) { var xx = document.getElementById(id); if (xx) { xx.scrollTop=0; } } function JSTOCScrollSelectedToVisible() { var oElement = $j(".NavTextSelected").parent().get(0); if(typeof(oElement) == "object") { scrollintoview(oElement,global_jstoc_container,50) ; } } function GetWindowSize() { 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 [ myWidth,myHeight]; }