PageSourceSearch

https://rehab.hu/jscript/modaldbox.js

js rehab.hu collected 2026-09-26 13:58:13 UTC 3,914 bytes, 38 lines download raw bytes

1// Modal Dialog Box
2// copyright 8th July 2006 by Stephen Chapman
3// http://javascript.about.com/
4// permission to use this Javascript on your web page is granted
5// provided that all of the code in this script (including these
6// comments) is used without any alteration
7
8function pageWidth() { return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null; } function pageHeight() { return window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null; } function posLeft() { return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0; } function posTop() { return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0; } function $k(x) { return document.getElementById(x); }
9function scrollFix() {
10try{
11var obol = $k('ol');
12obol.style.top = posTop() + 'px'; obol.style.left = posLeft() + 'px';
13} catch (err) {} }
14function sizeFix() { try { var obol = $k('ol'); obol.style.height = pageHeight() + 'px'; obol.style.width = pageWidth() + 'px'; } catch (err) { } } function kp(e) { ky = e ? e.which : event.keyCode; if (ky == 88 || ky == 120) hm(); return false }
15
16var hideIframe = true;
17function inf(h)
18{
19    tag = document.getElementsByTagName('select');
20    for (i = tag.length - 1; i >= 0; i--) tag[i].style.visibility = h;
21
22    if (hideIframe)
23    {
24        tag = document.getElementsByTagName('iframe');
25        for (i = tag.length - 1; i >= 0; i--) tag[i].style.visibility = h;
26    }
27
28    tag = document.getElementsByTagName('object');
29    for (i = tag.length - 1; i >= 0; i--) tag[i].style.visibility = h;
30}
31
32function sm(obl, wd, ht) { var h = 'hidden'; var b = 'block'; var p = 'px'; var obol = $k('ol'); var obbxd = $k('mbd'); obbxd.innerHTML = $k(obl).innerHTML; obol.style.height = pageHeight() + p; obol.style.width = pageWidth() + p; obol.style.top = posTop() + p; obol.style.left = posLeft() + p; obol.style.display = b; var tp = posTop() + ((pageHeight() - ht) / 2) - 12; var lt = posLeft() + ((pageWidth() - wd) / 2) - 12; var obbx = $k('mbox'); obbx.style.top = (tp < 0 ? 0 : tp) + p; obbx.style.left = (lt < 0 ? 0 : lt) + p; obbx.style.width = wd + p; obbx.style.height = ht + p; inf(h); obbx.style.display = b; return false; } function hm() { var v = 'visible'; var n = 'none'; $k('ol').style.display = n; $k('mbox').style.display = n; inf(v); document.onkeypress = '' } function initmb() {
33    var ab = 'absolute'; var n = 'none'; var obody = document.getElementsByTagName('body')[0]; var frag = document.createDocumentFragment(); 
34var obol = $k('ol');
35    if (obol != null) return;
36    obol = document.createElement('div'); obol.setAttribute('id', 'ol'); obol.style.display = n; obol.style.position = ab; obol.style.top = 0; obol.style.left = 0; obol.style.zIndex = 1001; obol.style.width = '100%'; frag.appendChild(obol); var obbx = document.createElement('div'); obbx.setAttribute('id', 'mbox'); obbx.style.display = n; obbx.style.position = ab; obbx.style.zIndex = 1002; var obl = document.createElement('span'); obbx.appendChild(obl); var obbxd = document.createElement('div'); obbxd.setAttribute('id', 'mbd'); obl.appendChild(obbxd); frag.insertBefore(obbx, obol.nextSibling); obody.insertBefore(frag, obody.firstChild);
37window.onscroll = scrollFix; window.onresize = sizeFix;}
38//window.onload = initmb;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.