PageSourceSearch

https://csonkr.ru/modules/mod_s5_live_search/js/s5_ls_fade.js

js csonkr.ru collected 2026-10-08 10:59:31 UTC 5,589 bytes, 282 lines download raw bytes

1var is_ie_s5_ls/*@cc_on = {
2
3  // quirksmode : (document.compatMode=="BackCompat"),
4
5  version : parseFloat(navigator.appVersion.match(/MSIE (.+?);/)[1])
6
7}@*/;
8
9
10
11function opacity_s5_ls(id_s5_ls, opacStart_s5_ls, opacEnd_s5_ls, millisec_s5_ls) {
12
13    //speed for each frame
14
15    var speed_s5_ls = Math.round(millisec_s5_ls / 100);
16
17    var timer_s5_ls = 0;
18
19    //determine the direction for the blending, if start and end are the same nothing happens
20
21    if(opacStart_s5_ls > opacEnd_s5_ls) {
22
23        for(i = opacStart_s5_ls; i >= opacEnd_s5_ls; i--) {
24
25            setTimeout("changeOpac_s5_ls(" + i + ",'" + id_s5_ls + "')",(timer_s5_ls * speed_s5_ls));
26
27            timer_s5_ls++;
28
29        }
30
31    } else if(opacStart_s5_ls < opacEnd_s5_ls) {
32
33        for(i = opacStart_s5_ls; i <= opacEnd_s5_ls; i++)
34
35            {
36
37            setTimeout("changeOpac_s5_ls(" + i + ",'" + id_s5_ls + "')",(timer_s5_ls * speed_s5_ls));
38
39            timer_s5_ls++;
40
41        }
42
43    }
44
45}
46
47
48
49//change the opacity for different browsers
50
51function changeOpac_s5_ls(opacity_s5_ls, id_s5_ls) {
52
53    var object_s5_ls = document.getElementById(id_s5_ls).style;
54
55    object_s5_ls.opacity = (opacity_s5_ls / 100);
56
57    object_s5_ls.MozOpacity = (opacity_s5_ls / 100);
58
59    object_s5_ls.KhtmlOpacity = (opacity_s5_ls / 100);
60
61    object_s5_ls.filter = "alpha(opacity=" + opacity_s5_ls + ")";
62
63}
64
65
66
67function blendimage_s5_ls(divid_s5_ls, imageid_s5_ls, imagefile_s5_ls, millisec_s5_ls) {
68
69    var speed_s5_ls = Math.round(millisec_s5_ls / 100);
70
71    var timer_s5_ls = 0;
72
73    
74
75    //set the current image as background
76
77    document.getElementById(divid_s5_ls).style.backgroundImage = "url(" + document.getElementById(imageid_s5_ls).src + ")";
78
79    
80
81    //make image transparent
82
83    changeOpac_s5_ls(0, imageid_s5_ls);
84
85    
86
87    //make new image
88
89    document.getElementById(imageid_s5_ls).src = imagefile_s5_ls;
90
91
92
93    //fade in image
94
95    for(i = 0; i <= 100; i++) {
96
97        setTimeout("changeOpac_s5_ls(" + i + ",'" + imageid_s5_ls + "')",(timer_s5_ls * speed_s5_ls));
98
99        timer_s5_ls++;
100
101    }
102
103}
104
105
106
107function currentOpac_s5_ls(id_s5_ls, opacEnd_s5_ls, millisec_s5_ls) {
108
109    //standard opacity is 100
110
111    var currentOpac_s5_ls = 100;
112
113    
114
115    //if the element has an opacity set, get it
116
117    if(document.getElementById(id_s5_ls).style.opacity < 100) {
118
119        currentOpac_s5_ls = document.getElementById(id_s5_ls).style.opacity * 100;
120
121    }
122
123
124
125    //call for the function that changes the opacity
126
127    opacity_s5_ls(id_s5_ls, currentOpac_s5_ls, opacEnd_s5_ls, millisec_s5_ls)
128
129}
130
131
132
133
134
135//Ajax call lib
136
137
138
139jx = {
140
141		http:false, //HTTP Object
142
143		format:'text',
144
145		callback:function(data){},
146
147		error:false,
148
149		//Create a xmlHttpRequest object - this is the constructor. 
150
151		getHTTPObject : function() {
152
153			var http = false;
154
155			//Use IE's ActiveX items to load the file.
156
157			if(typeof ActiveXObject != 'undefined') {
158
159				try {http = new ActiveXObject("Msxml2.XMLHTTP");}
160
161				catch (e) {
162
163					try {http = new ActiveXObject("Microsoft.XMLHTTP");}
164
165					catch (E) {http = false;}
166
167				}
168
169			//If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document.
170
171			} else if (XMLHttpRequest) {
172
173				try {http = new XMLHttpRequest();}
174
175				catch (e) {http = false;}
176
177			}
178
179			return http;
180
181		},
182
183		// This function is called from the user's script. 
184
185		//Arguments - 
186
187		//	url	- The url of the serverside script that is to be called. Append all the arguments to 
188
189		//			this url - eg. 'get_data.php?id=5&car=benz'
190
191		//	callback - Function that must be called once the data is ready.
192
193		//	format - The return type for this function. Could be 'xml','json' or 'text'. If it is json, 
194
195		//			the string will be 'eval'ed before returning it. Default:'text'
196
197		load : function (url,callback,format) {
198
199			this.init(); //The XMLHttpRequest object is recreated at every call - to defeat Cache problem in IE
200
201			if(!this.http||!url) return;
202
203			if (this.http.overrideMimeType) this.http.overrideMimeType('text/xml');
204
205
206
207			this.callback=callback;
208
209			if(!format) var format = "text";//Default return type is 'text'
210
211			this.format = format.toLowerCase();
212
213			var ths = this;//Closure
214
215			
216
217			//Kill the Cache problem in IE.
218
219			var now = "uid=" + new Date().getTime();
220
221			url += (url.indexOf("?")+1) ? "&" : "?";
222
223			url += now;
224
225
226
227			this.http.open("GET", url, true);
228
229
230
231			this.http.onreadystatechange = function () {//Call a function when the state changes.
232
233				if(!ths) return;
234
235				var http = ths.http;
236
237				if (http.readyState == 4) {//Ready State will be 4 when the document is loaded.
238
239					if(http.status == 200) {
240
241						var result = "";
242
243						if(http.responseText) result = http.responseText;
244
245						//If the return is in JSON format, eval the result before returning it.
246
247						if(ths.format.charAt(0) == "j") {
248
249							//\n's in JSON string, when evaluated will create errors in IE
250
251							result = result.replace(/[\n\r]/g,"");
252
253							result = eval('('+result+')'); 
254
255						}
256
257		
258
259						//Give the data to the callback function.
260
261						if(ths.callback) ths.callback(result);
262
263					} else { //An error occured
264
265						if(ths.error) ths.error(http.status);
266
267					}
268
269				}
270
271			}
272
273			this.http.send(null);
274
275		},
276
277		init : function() {this.http = this.getHTTPObject();}
278
279	}
280
281
282

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.