PageSourceSearch

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

js rehab.hu collected 2026-09-26 13:58:12 UTC 6,672 bytes, 192 lines download raw bytes

1versionSearchString = "Firefox";
2
3function searchVersion() {
4    var index = navigator.userAgent.indexOf(versionSearchString);
5    if (index == -1) return;
6    return parseFloat(navigator.userAgent.substring(index + this.versionSearchString.length + 1));
7}
8
9function searchBrowser() {
10    var index = navigator.userAgent.indexOf(versionSearchString);
11    if (index == -1) return "NEM FIREFOX";
12    return navigator.userAgent.substring(index, this.versionSearchString.length);
13}
14
15function getCookie(c_name) {
16    if (document.cookie.length > 0) {
17        c_start = document.cookie.indexOf(c_name + "=");
18        if (c_start != -1) {
19            c_start = c_start + c_name.length + 1;
20            c_end = document.cookie.indexOf(";", c_start);
21            if (c_end == -1) c_end = document.cookie.length;
22            return unescape(document.cookie.substring(c_start, c_end));
23        }
24    }
25    return "";
26}
27
28function FF_setCookie(c_name, value, expiredays) {
29    var exdate = new Date();
30    exdate.setDate(exdate.getDate() + expiredays);
31    document.cookie = c_name + "=" + escape(value) +
32((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
33}
34
35function FF_checkCookie() {
36    ffChecked = getCookie('firefoxcheck');
37    if (ffChecked != null && ffChecked != "")
38        return true;
39    else 
40        return false;    
41}
42
43function checkBrowser() {   
44    var index = navigator.userAgent.indexOf(versionSearchString);
45    if (index >= 0) 
46    {
47        if (parseFloat(navigator.userAgent.substring(index + this.versionSearchString.length + 1)) < 3.6)
48             {
49                 if (!FF_checkCookie()) {
50                     drawMessage();
51                                         
52                     //openFF();
53                     FF_setCookie("firefoxcheck", 1, 1);
54                 }
55             } 
56    }
57}
58
59 function openFF() {
60       window.open('http://www.mozilla-europe.org/hu/firefox/', '_blank');
61    }
62
63function drawMessage() {
64    writeCss();
65    
66    destHTML = '<div class="title"><center>Firefox verzió ellenõrzés</center><input class="btnCloseX" type="button" onclick="closeMsgBox();" value="X"/></div>' +
67    '<div id="msg"><a href="http://www.mozilla-europe.org/hu/firefox/" target="_blank"><img src="upload/dokinet/image/firefox.png" align="left" border="0px"/></a>' +
68    'Ön a Firefox böngészõ  egy 3.6 verziónál régebbi változatát használja.</br></br>' +
69    'A felhasználói élmény fokozásának érdekében kérjük töltse le a legújabb verziót.' +   
70  //  '<div><a href="http://www.mozilla-europe.org/hu/firefox/" class="btnClose" target="_blank">Firefox letöltése >></div</button>'+
71    '</div><div id="buttonDiv">' +
72    '<input class="btnClose" type="button" type="button" onclick="closeMsgBox();" value="Bezár"/></button> ' +
73    '<input class="btnOk" type="button" type="button" onclick="openFF();" value="Firefox letöltése >>"/></button>' +
74    '</div>';
75    FF_setBox(destHTML, null, false);    
76}
77
78
79function FF_setBox(content, posButtonId, isFrame) {
80   
81    var box = document.getElementById('msgBox');     
82    box.innerHTML = content;    
83    box.style.display = "block";
84    box.style.visibility = "visible";   
85    box.style.zindex = 1001;
86    box.style.position = "absolute";
87    {
88        FF_reposBoxToCenter();
89    }
90
91}
92
93function isBoxOn() {
94    var box = document.getElementById('msgBox');
95    return !(box.style.display == "none" || box.style.display == "");
96}
97
98function FF_reposBoxToCenter() {
99    var box = document.getElementById('msgBox');
100    var scrollPos = FF_getScrollXY();    
101    box.style.top = (document.body.clientHeight - box.offsetHeight + 2 * scrollPos.Y) / 2 + "px";
102    box.style.left = (document.body.clientWidth - box.offsetWidth + 2 * scrollPos.X) / 2 + "px";   
103    box.focus();
104}
105
106function FF_getScrollXY() {
107    var scrOfX = 0, scrOfY = 0;
108    if (typeof (window.pageYOffset) == 'number') {
109        //Netscape compliant
110        scrOfY = window.pageYOffset;
111        scrOfX = window.pageXOffset;
112    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
113        //DOM compliant
114        scrOfY = document.body.scrollTop;
115        scrOfX = document.body.scrollLeft;
116    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
117        //IE6 standards compliant mode
118        scrOfY = document.documentElement.scrollTop;
119        scrOfX = document.documentElement.scrollLeft;
120    }
121    return { X: scrOfX, Y: scrOfY };
122}
123
124function f_clientWidth() {
125    return f_filterResults(
126		window.innerWidth ? window.innerWidth : 0,
127		document.documentElement ? document.documentElement.clientWidth : 0,
128		document.body ? document.body.clientWidth : 0
129	);
130}
131function f_clientHeight() {
132    return f_filterResults(
133		window.innerHeight ? window.innerHeight : 0,
134		document.documentElement ? document.documentElement.clientHeight : 0,
135		document.body ? document.body.clientHeight : 0
136	);
137}
138function f_filterResults(n_win, n_docel, n_body) {
139    var n_result = n_win ? n_win : 0;
140    if (n_docel && (!n_result || (n_result > n_docel)))
141        n_result = n_docel;
142    return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
143}
144
145function closeMsgBox() {
146    var box = document.getElementById('msgBox');
147    //try { takeBackAddressControl(); } catch (e) { }
148    box.innerHTML = "";
149    box.style.display = "none";
150    overBox = false;
151}
152
153//function getLeft(objId) {
154//    var parObj = document.getElementById(objId);
155//    var pos = 0;
156//    while (parObj) {
157//        pos += parObj.offsetLeft;
158//        parObj = parObj.offsetParent;
159//    }
160//    return pos;
161//}
162
163//function getTop(objId) {
164//    var parObj = document.getElementById(objId);
165//    var pos = 0;
166//    while (parObj) {
167//        pos += parObj.offsetTop;
168//        parObj = parObj.offsetParent;
169//    }
170//    return pos;
171//}
172
173//function fireEvent(element, event) {
174//    if (document.createEventObject) {
175//        // dispatch for IE
176//        var evt = document.createEventObject();
177//        return element.fireEvent('on' + event, evt)
178//    }
179//    else {
180//        // dispatch for firefox + others
181//        var evt = document.createEvent("HTMLEvents");
182//        evt.initEvent(event, true, true); // event type,bubbling,cancelable
183//        return !element.dispatchEvent(evt);
184//    }
185//}
186
187function writeCss()
188{
189    document.writeln('<link type="text/css" href="upload/dokinet/css/browserdetect.css" rel="stylesheet"/>');
190}
191
192checkBrowser();

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.