PageSourceSearch

https://www.lrman.ru/func.js

js lrman.ru collected 2026-10-07 19:56:58 UTC 7,807 bytes, 252 lines download raw bytes

1function autochng(idName, opas) {
2   document.getElementById(idName).style.opacity = opas;
3}
4
5
6function sfield(type,field,img) {
7   if (type==1) {document.getElementById(field).style.background = '#FFFFFF';}
8   if (type==2) {
9	if (document.getElementById(field).value!='') {document.getElementById(field).style.background = '#FFFFFF';}
10	else {document.getElementById(field).style.background = '#FFFFFF url(/img/'+img+'.png) no-repeat left top';}
11   }
12}
13
14
15function fontchng (type) {
16
17   var curr = document.getElementById('ctext').style.fontSize;
18   curr = curr.replace(/px/g,'');
19   if (curr=='') {curr = 15;}
20   if (type=='dec') {curr--;}
21   if (type=='inc') {curr++;}
22   if ((curr>22)||(curr<8)) {return;}
23   document.getElementById('ctext').style.fontSize = curr+'px';
24}
25
26
27function trim (str,charlist) {
28   charlist = !charlist ? ' \\t\\s\xA0' : charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
29   var re = new RegExp('^[' + charlist + ']+|[' + charlist + ']+$', 'g');
30   return str.replace(re, '');
31}
32
33
34function boldText(s){return '<b>'+s+'</b>';}
35function italicText(s){return '<i>'+s+'</i>';}
36function undText(s){return '<u>'+s+'</u>';}
37function quoteText(s){return '<blockquote>'+s+'</blockquote>';}
38
39
40function showDiv(divid) {document.getElementById(divid).style.visibility = "visible";}
41function hideDiv(divid) {document.getElementById(divid).style.visibility = "hidden";}
42function showDiv2(divid) {document.getElementById(divid).style.display = "table";}
43function hideDiv2(divid) {document.getElementById(divid).style.display = "none";}
44
45
46function sfield(type,field,img) {
47   if (type==1) {document.getElementById(field).style.background = '#FFFFFF';}
48   if (type==2) {
49	if (document.getElementById(field).value!='') {document.getElementById(field).style.background = '#FFFFFF';}
50	else {document.getElementById(field).style.background = '#FFFFFF url(/img/'+img+'.gif) no-repeat left top';}
51   }
52}
53
54
55function replaceSelectedText(obj,cbFunc) {
56 obj = document.getElementById(obj);
57 obj.focus();
58 
59 if (document.selection) 
60 {
61   var s = document.selection.createRange(); 
62   if (s.text)
63   {
64     eval("s.text="+cbFunc+"(s.text);");
65	 s.select();
66	 return true;
67   }
68 }
69 else if (typeof(obj.selectionStart)=="number")
70 {
71   if (obj.selectionStart!=obj.selectionEnd)
72   {
73     var start = obj.selectionStart;
74     var end = obj.selectionEnd;
75
76     eval("var rs = "+cbFunc+"(obj.value.substr(start,end-start));");
77     obj.value = obj.value.substr(0,start)+rs+obj.value.substr(end);
78     obj.setSelectionRange(end,end);
79   }
80   return true;
81 }
82
83 return false;
84}
85
86
87function strip_tags (input, allowed) {
88    allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
89    var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
90        commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
91    return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
92        return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
93    });
94}
95
96
97function PositionSaver(target) {
98    if (document.selection && document.selection.createRange) {//IE 4.0 (win32) & Opera 8.0
99        cursor = document.selection.createRange().duplicate();
100        return;
101    }
102    if (typeof(target.selectionStart) != "undefined") {//FireFox & Mozilla
103        cursorStart = target.selectionStart;
104        cursorEnd = target.selectionEnd;
105        cursorScroll = target.scrollTop;
106        return;
107    }
108}
109
110
111InsertTag_tags = new Array();
112function InsertTag(id, open, close, type) {
113    open = trim(open);
114    var pattern = /\n/g;
115    open = open.replace(pattern, '');
116    var pattern = /<blockquote>[\s\S]*blockquote>/g;
117    open = open.replace(pattern, '');
118    open = strip_tags(open, '<i><u><b>');
119    if (type==1) {open = '<blockquote> '+open+' </blockquote>\n';}
120    if (type==2) {open = open+', ';}
121    var target = document.getElementById(id);
122    if (!window.opera) target.focus();
123    if (typeof(cursor) != "undefined") {
124        //alert("IE & Opera");
125        if (cursor.text.length) {
126            cursor.text = open + cursor.text + close;
127            cursor.moveToElementText(target);
128            cursor.collapse(false);
129        } else {
130            cursor.text = open + close;
131            cursor.moveEnd("character", -close.length);
132        }
133        cursor.select();
134        return;
135    }
136    if (typeof(cursorStart) != "undefined") {//Gecko
137        var start = target.value.substring(0, cursorStart),
138            selected = target.value.substring(cursorStart, cursorEnd),
139            end = target.value.substr(cursorEnd);
140        target.value = start + open + selected + close + end;
141        target.selectionStart = target.selectionEnd = selected.length ? target.value.length : start.length + open.length;
142        target.scrollTop = cursorScroll;
143        return;
144    }
145    if (InsertTag_tags[open + close]) {
146        target.value += close;
147        InsertTag_tags[open + close] = false;
148    } else {
149        target.value += open;
150        InsertTag_tags[open + close] = true;
151    }
152}
153
154
155
156function togwarn() {
157
158    var curr = document.getElementById('warning').style.lineHeight;
159    curr = curr.replace(/px/g,'');
160    if ((curr=='')||(curr=='16')) {
161	$('blockquote.warn').css('display', 'none');
162	$('blockquote.caut').css('display', 'none');
163	$('a#warning').css('background-position', '-253px -30px');
164	$('a#warning').css('line-height', '17px');
165	return;
166    }
167    if (curr=='17') {
168	$('blockquote.warn').css('display', 'inline-block');
169	$('blockquote.caut').css('display', 'inline-block');
170	$('a#warning').css('background-position', '-253px 0px');
171	$('a#warning').css('line-height', '16px');
172	return;
173    }    
174
175//alert(curr);
176
177}
178
179
180function bgchange (field) {
181   if (document.getElementById(field).className=='bg') {document.getElementById(field).className = 'bg2';}
182   else {document.getElementById(field).className = 'bg';}
183}
184
185
186$('.scrollTop').click(function(){
187    $("html, body").animate({ scrollTop: 0 }, 700);
188    return false;
189});
190
191
192
193$(document).ready(function() {
194  var $window = $(window),
195  $navigation = $("#showbox");
196
197  $window.scroll(function() {
198
199    if (!$navigation.hasClass("fixed") && ($window.scrollTop() > $navigation.offset().top)) {
200        $navigation.addClass("fixed").data("top", $navigation.offset().top);
201    }
202    else if ($navigation.hasClass("fixed") && ($window.scrollTop() < $navigation.data("top"))) {
203        $navigation.removeClass("fixed");
204    }
205
206  }); 
207});
208
209
210
211function anekdot() {
212   makeRequest('https://www.lrman.ru/inc/anekdot.php','anek');
213}
214
215
216
217function makeRequest(url,divid) {
218   var http_request = false;
219   if (window.XMLHttpRequest) {
220   http_request = new XMLHttpRequest();
221   if (http_request.overrideMimeType) {http_request.overrideMimeType('text/xml');}
222   } else if (window.ActiveXObject) {
223	try {http_request = new ActiveXObject("Msxml2.XMLHTTP");}
224	catch (e) {
225	   try {
226		 http_request = new ActiveXObject("Microsoft.XMLHTTP");
227	   } catch (e) {}
228	}
229   }
230   http_request.onreadystatechange = function() {
231   if (http_request.readyState == 4) {
232   if (http_request.status == 200) {
233	document.getElementById(divid).innerHTML = http_request.responseText;
234   }
235   }
236
237   };
238	http_request.open('GET', url, true);
239	http_request.send(null);
240}
241
242
243function mobsite(id) {
244    document.cookie = "mobsite"+"="+id+"; max-age=7000000; path=/; domain=lrman.ru";
245    location.reload();
246}
247
248
249function setcookie() {
250    document.cookie = "is_cookie"+"="+1+"; max-age=6000000; path=/; domain=lrman.ru";
251    document.querySelector(".block9").classList.add("hidden");
252}

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.