PageSourceSearch

https://beforemarriage.ru/assets/templates/at_skyjump/scripts/at.script.js

js beforemarriage.ru collected 2026-10-08 09:09:37 UTC 4,847 bytes, 196 lines download raw bytes

1/*global window, localStorage, fontSizeTitle, bigger, reset, smaller, biggerTitle, resetTitle, smallerTitle, Cookie */
2var prefsLoaded = false;
3var defaultFontSize = 75;
4var currentFontSize = defaultFontSize;
5
6function supportsLocalStorage() {
7return ('localStorage' in window) && window.localStorage !== null;
8}
9
10function setFontSize(fontSize) {
11document.body.style.fontSize = fontSize + '%';
12}
13
14function changeFontSize(sizeDifference) {
15currentFontSize = parseInt(currentFontSize, 10) + parseInt(sizeDifference * 5, 10);
16if (currentFontSize > 180) {
17currentFontSize = 180;
18} else if (currentFontSize < 60) {
19currentFontSize = 60;
20}
21setFontSize(currentFontSize);
22}
23
24function revertStyles() {
25currentFontSize = defaultFontSize;
26changeFontSize(0);
27}
28
29function writeFontSize(value) {
30if (supportsLocalStorage()) {
31localStorage.fontSize = value;
32} else {
33Cookie.write("fontSize", value, {duration: 180});
34}
35}
36
37function readFontSize() {
38if (supportsLocalStorage()) {
39return localStorage.fontSize;
40} else {
41return Cookie.read("fontSize");
42}
43}
44
45function setUserOptions() {
46if (!prefsLoaded) {
47var size = readFontSize();
48currentFontSize = size ? size : defaultFontSize;
49setFontSize(currentFontSize);
50prefsLoaded = true;
51}
52}
53/////////////////////////////////////////////////////////////////////////////nd biz code font zie
54
55function setActiveStyleSheet(title) {
56createCookie("ColorCSS", title, 365);
57//window.location.reload();
58window.location.reload();
59return;
60}
61
62function createCookie(name,value,days) {
63if (days) {
64var date = new Date();
65date.setTime(date.getTime()+(days*24*60*60*1000));
66var expires = "; expires="+date.toGMTString();
67}
68else expires = "";
69document.cookie = name+"="+value+expires+"; path=/";
70}
71
72function setScreenType(screentype){
73createCookie("ScreenType", screentype, 365);
74//window.location.reload();
75bclass = document.body.className.trim();
76if (bclass.indexOf(' ') > 0){
77bclass = bclass.replace(/^\w+/,screentype);
78}else{
79bclass = screentype + ' ' + bclass;
80}
81
82document.body.className = bclass;
83equalHeightInit();
84createCookie("ScreenType", screentype, 365);
85}
86
87String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
88
89function changeToolHilite(oldtool, newtool) {
90if (oldtool != newtool) {
91if (oldtool) {
92oldtool.src = oldtool.src.replace(/-hilite/,'');
93}
94newtool.src = newtool.src.replace(/.gif$/,'-hilite.gif');
95}
96}
97
98//addEvent - attach a function to an event
99function atAddEvent(obj, evType, fn){
100if (obj.addEventListener){
101obj.addEventListener(evType, fn, false);
102return true;
103} else if (obj.attachEvent){
104var r = obj.attachEvent("on"+evType, fn);
105return r;
106} else {
107return false;
108}
109}
110
111function equalHeight (elems){
112if (!elems) return;
113var maxh = 0;
114for (var i=0; i<elems.length; i++)
115{
116if (elems[i] && elems[i].scrollHeight > maxh) maxh = elems[i].scrollHeight;
117}
118
119for (i=0; i<elems.length; i++){
120if (elems[i]) elems[i].parentNode.style.height = maxh + "px";
121}
122}
123
124function getElem (id) {
125var obj = document.getElementById (id);
126if (!obj) return null;
127var divs = obj.getElementsByTagName ('div');
128if (divs && divs.length >= 1) return divs[divs.length - 1];
129return null;
130}
131
132function getFirstDiv (id) {
133var obj = document.getElementById (id);
134if (!obj) return null;
135var divs = obj.getElementsByTagName ('div');
136if (divs && divs.length >= 1) return divs[0];
137return obj;
138}
139
140function getElementsByClass(searchClass,node,tag) {
141var classElements = new Array();
142var j = 0;
143if ( node == null )
144node = document;
145if ( tag == null )
146tag = '*';
147var els = node.getElementsByTagName(tag);
148var elsLen = els.length;
149var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
150for (var i = 0; i < elsLen; i++) {
151if ( pattern.test(els[i].className) ) {
152classElements[j] = els[i];
153j++;
154}
155}
156//alert(searchClass + j);
157return classElements;
158}
159
160function instr(str, item){
161var arr = str.split(" ");
162for (var i = 0; i < arr.length; i++){
163if (arr[i] == item) return true;
164}
165return false;
166}
167
168function equalHeightInit (){
169var at_spl = document.getElementById('at-bottom');
170if (!at_spl) return;
171var atblocks = getElementsByClass ("moduletable", at_spl, "DIV");
172equalHeight (atblocks);
173}
174
175atAddEvent (window, 'load', equalHeightInit);
176
177function fixIE() {
178var objs = getElementsByClass ("createdate", null, "TD");
179if (objs) {
180for (var i=0; i<objs.length; i++){
181objs[i].innerHTML = "<span>" + objs[i].innerHTML + "</span>";
182}
183}
184}
185
186/*function setActiveStyleSheet1(url,act,style,old){
187url = url + '?act=' + act;
188url = url + '&style=' + style;
189url = url + '&old=' + old;
190var myAjax = new Ajax(url, {method: 'get', onComplete: updateTool}).request();
191}
192
193function updateTool(){
194window.location.reload();
195}
196*/atAddEvent (window, 'load', fixIE);

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.