PageSourceSearch

https://domashnij-portal.ru/components/com_kide/js/base.js

js domashnij-portal.ru collected 2026-10-04 20:10:29 UTC 21,275 bytes, 651 lines download raw bytes

1/**
2* @Copyright Copyright (C) 2012 - JoniJnm.es
3* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
4**/
5
6var kide = {
7	debug: false,
8	sids: [],
9	mostrar_colores_iniciado: false,
10	sesiones_parado: true,
11	recargar_parado: true,
12	privados_parado: true,
13	privados_encontrado: false,
14	retardo_avisar: false,
15	shift_pressed: false,
16	shift_priv_pressed: false,
17	popup: null,
18	scrolling: false,
19	scrolling_privados: false,
20
21	$: function(id) {
22		return document.getElementById(id);
23	},
24	defined: function(value) {
25		return typeof(value) != "undefined";
26	},
27	css: function(id, param, value) {
28		if (!this.checkID(id)) return;
29		if (this.defined(value)) this.$(id).style[param] = value;
30		else return this.$(id).style[param];
31	},
32	attr: function(id, param, value) {
33		if (!this.checkID(id)) return;
34		if (this.defined(value)) this.$(id)[param] = value;
35		else return this.$(id)[param];
36	},
37	val: function(id, v) {
38		if (!this.checkID(id)) return;
39		if (this.defined(v)) this.$(id).value = v;
40		else return this.$(id).value;
41	},
42	html: function(id, value) {
43		if (!this.checkID(id)) return;
44		if (this.defined(value)) this.$(id).innerHTML = value;
45		else return this.$(id).innerHTML;
46	},
47	show: function(id,s) {
48		if (!this.checkID(id)) return;
49		if (this.defined(s)) s = s ? "" : "none";
50		else s = this.css(id,"display") == "none" ? "" : "none";
51		this.css(id,"display",s);
52	},
53	visible: function(id,s) {
54		if (!this.checkID(id)) return;
55		if (this.defined(s)) s = s ? "" : "hidden";
56		else s = this.css(id,"visibility") == "hidden" ? "" : "hidden";
57		this.css(id,"visibility",s);
58	},
59	foco: function(id) {
60		if (!this.checkID(id)) return;
61		this.$(id).focus();
62	},
63	checkID: function(id) {
64		if (this.$(id)) return true;
65		if (this.debug) {
66			this.error("The element with id '"+id+"' doesn't exists.", 2);
67		}
68	},
69	log: function(msg, f, l) {
70		if (this.debug && console && console.log) {
71			console.log("Kide error: "+msg+" at "+f+":"+l);
72		}
73	},
74	error: function(msg, n, e) {
75		try {
76			var up = 0;
77			if (!this.defined(e)) {
78				up++;
79				var e = new Error();
80			}
81			s = e.stack;
82			if (s.indexOf("@") != -1) {
83				var s = s.split("\n")[n+up].split("@")[1].split(":");
84				var l = s[s.length-1];
85				s[s.length-1] = '';
86				s = s.join(':'); 
87				var f = s.substr(0, s.length-1);
88				this.log(msg, f, l);
89			}
90			else if("at " != -1) {
91				var s = s.split("\n")[n+up].match(/\(([^\)]+)/)[1].split(":");
92				var l = s[s.length-2];
93				s[s.length-1] = '';
94				s[s.length-2] = '';
95				s = s.join(':'); 
96				var f = s.substr(0, s.length-2);
97				this.log(msg, f, l);
98			}
99		}
100		catch(err) {
101		
102		}
103	},
104	nuevoAjax: function() {
105		var xmlhttp=false;
106		if (kide.defined('ActiveXObject')) {
107			try {
108				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
109			} catch (e) {
110				try {
111					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
112				} catch (E) {
113					xmlhttp = false;
114				}
115			}
116		}
117		if (!xmlhttp && kide.defined('XMLHttpRequest'))
118			xmlhttp = new XMLHttpRequest();
119		return xmlhttp;
120	},
121	form: function(param, v) {
122		if (typeof(v) == "undefined") return document.forms.kideForm[param].value;
123		else document.forms.kideForm[param].value = v;
124	},
125	onLoad: function(func, func2) {
126		if (kide.fast_init) {
127			if (this.defined(func2)) (func2)();
128			else (func)();
129		}
130		else if (window.addEventListener) window.addEventListener("load", func, false);
131		else if (window.attachEvent) window.attachEvent("onload", func);
132		else if (this.defined(func2)) (func2)();
133		else (func)();
134	},
135	addHTMLInBody: function(html) {
136		this.onLoad(function() {
137			var div = document.createElement('div');
138			div.setAttribute('class', 'KIDE_div');
139			div.innerHTML = html;
140			kide.insertAfter(div, document.body.lastChild);
141		}, function(){
142			document.write(html);
143		}); 
144	},
145	iniciar: function() {
146		kide.encendido = 2;
147		kide.attr('encendido', 'src', kide.img_encendido[2]);
148		if (kide.recargar_parado) {
149			kide.recargar_parado = false;
150			kide.recargar();
151		}
152		if (kide.sesiones_parado) {
153			kide.sesiones_parado = false;
154			kide.sesiones();
155		}
156		kide.events.lanzar('onIniciar');
157	},
158	open_popup: function() {
159		if (this.popup)
160			this.popup.close();
161		this.popup=window.open(this.popup_url, 'kide', 'toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,width=800,height=600');
162	},
163	text: function(row) {
164		var n = navigator.userAgent.toString();
165		if (n.indexOf("MSIE") != -1)
166			return row.text;
167		return row.textContent;
168	},
169	recargar: function() {
170		if (this.encendido == 2) {
171			this.ajax("reload");
172			setTimeout("kide.recargar()", this.refresh_time);
173		}
174		else
175			this.recargar_parado = true;
176	},
177	getUser: function(sid) {
178		return this.defined(this.sids[sid]) ? this.sids[sid] : null;
179	},
180	getUserById: function(uid) {
181		for(var i in this.sids) {
182			if (this.sids[i].id == uid)
183				return this.sids[i];
184		}
185	},
186	sesiones: function() {
187		if (this.encendido == 2) {
188			this.ajax("sesiones");
189			setTimeout("kide.sesiones()", this.refresh_time_sesion);
190		}
191		else
192			this.sesiones_parado = true;
193	},
194	apagar_encender: function() {
195		if (this.encendido == 0)
196			this.encendido++;
197		else if (this.encendido == 1) 
198			this.iniciar();
199		else 
200			this.encendido = 0;
201			
202		this.save_config("encendido", this.encendido);
203		this.attr('encendido', 'src', this.img_encendido[this.encendido]);
204	},
205	sonido: function() {
206		if (this.sound != -1) {
207			if (this.attr('sound', 'src', this.sound_on)) {
208				this.sound = 0;
209				this.attr('sound', 'src', this.sound_off);
210			}
211			else {
212				this.sound = 1;
213				this.attr('sound', 'src', this.sound_on);
214				this.play_msg_sound();
215			}
216			this.save_config("sound", this.sound);
217		}
218	},
219	save_config: function(param, value) {
220		var ajax = this.nuevoAjax();
221		var config = document.cookie.match(/kide_config=([^;]*)/);
222		config = decodeURIComponent(config[1]);
223		if (config.search(eval('/'+param+'=/')) > -1)
224			config = config.replace(eval('/'+param+'=[^;]*/'), param+'='+value);
225		else
226			config += ';'+param+'='+value;
227		document.cookie = 'kide_config='+encodeURIComponent(config)+'; path=/';
228	},
229	ahora: function() {
230		var ya = new Date();
231		var m = ya.getMonth() + 1;
232		ya = ya.getDate()+"-"+(m < 10 ? "0" : "")+m+" "+ya.getHours()+":"+(ya.getMinutes() < 10 ? "0" : "")+ya.getMinutes()+":"+(ya.getSeconds() < 10 ? "0" : "")+ya.getSeconds();
233		return ya;
234	},
235	in_array: function(e, a) {
236		for (var i=0; i<a.length; i++)
237			if (a[i] == e) return true;
238		return false;
239	},
240	insertAfter: function(newElement,targetElement) {
241		var parent = targetElement.parentNode;
242		if (parent.lastchild == targetElement) 
243			parent.appendChild(newElement);
244		else 
245			parent.insertBefore(newElement, targetElement.nextSibling);
246	},
247	trim: function(a,e) {
248		//http://phpjs.org/functions/trim:566
249		var c,d=0,b=0;a+="";if(!e)c=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";else{e+="";c=e.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,"$1")}d=a.length;for(b=0;b<d;b++)if(c.indexOf(a.charAt(b))===-1){a=a.substring(b);break}d=a.length;for(b=d-1;b>=0;b--)if(c.indexOf(a.charAt(b))===-1){a=a.substring(0,b+1);break}return c.indexOf(a.charAt(0))===-1?a:"";
250	},
251	htmlspecialchars_decode: function(b,a) {
252		//http://phpjs.org/functions/htmlspecialchars_decode:427
253		var f=0,c=0,e=false;if(typeof a==="undefined")a=2;b=b.toString().replace(/&lt;/g,"<").replace(/&gt;/g,">");var d={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(a===0)e=true;if(typeof a!=="number"){a=[].concat(a);for(c=0;c<a.length;c++)if(d[a[c]]===0)e=true;else if(d[a[c]])f=f|d[a[c]];a=f}if(a&d.ENT_HTML_QUOTE_SINGLE)b=b.replace(/&#0*39;/g,"'");if(!e)b=b.replace(/&quot;/g,'"');b=b.replace(/&amp;/g,"&");return b;
254	},
255	check_shift: function(e, up, priv) {
256		var code = this.getCode(e);
257		if (up) {
258			if (code == 16) { //shift
259				if (priv)
260					this.shift_priv_pressed = false;
261				else
262					this.shift_pressed = false;
263			}
264		}
265		else if (code != 13) { //enter
266			if (priv)
267				this.shift_priv_pressed = code == 16;
268			else
269				this.shift_pressed = code == 16;
270		}
271	},
272	getCode: function(e) {
273		return e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
274	},
275	isEnter: function(e) {
276		return this.getCode(e) == 13;
277	},
278	pressedEnter: function(e, priv) {
279		if (this.isEnter(e)) {
280			if ((!priv && this.shift_pressed) || (priv && this.shift_priv_pressed))
281				return true;
282			else if (priv) 
283				this.ajax("privados_insertar");
284			else
285				this.sm();
286			return false;
287		} 
288		else
289			return true;
290	},
291	tiempo: function(t) {
292		t = Number(t);
293		if (t <= 0) {
294			kide.show('KIDE_tiempo_p', false);
295			return;
296		}
297		kide.show('KIDE_tiempo_p', true);
298		t -= this.retardo;
299		var time = new Date();
300		time = time.getTime();
301		t = Math.floor((time/1000) - t);
302		if (t <= 0) t = 1;
303		
304		var out = "";
305		var i;
306		var salir = false;
307		var datos = new Array();
308		datos[0] = new Array();
309		datos[0][0] = Math.floor(t/2592000);
310		datos[0][1] = Math.floor((t - datos[0][0]*2592000)/86400); 
311		datos[0][2] = Math.floor((t - datos[0][0]*2592000 - datos[0][1]*86400)/3600);
312		datos[0][3] = Math.floor((t - datos[0][0]*2592000 - datos[0][1]*86400 - datos[0][2]*3600)/60);
313		datos[0][4] = Math.floor(t - datos[0][0]*62592000 - datos[0][1]*86400 - datos[0][2]*3600 - datos[0][3]*60);
314		datos[1] = [1, 3, 7, 10];
315		
316		for (i=0;i<=4 && !salir;i++) {
317			if (datos[0][i]) {
318				salir = true;
319				out += datos[0][i]+" "+this.msg.lang[datos[0][i]!=1 ? i*2+1 : i*2];
320				if (i < 4 && datos[0][i] <= datos[1][i] && datos[0][i+1]) 
321					out += " "+datos[0][i+1]+" "+this.msg.lang[datos[0][i+1]!=1 ? (i+1)*2+1 : (i+1)*2];
322			}
323		}
324		if (!out) out = '1 '+this.msg.lang[8];
325		kide.html('KIDE_tiempoK', out); 
326	},
327	insertSmile: function(text) {
328		var textarea = document.forms.kideForm.txt;
329		textarea.value += " "+text;
330		textarea.focus(textarea.value.length - 1);
331	},
332	filter_smilies: function(s) {
333		s = " "+s+" ";
334		for (var i = 0; i < this.smilies.length; i++) {
335			s = s.replace(" "+this.smilies[i][0], '<img alt="' + this.smilies[i][0] + '" title="' + this.smilies[i][0] + '" src="' + this.smilies[i][1] + '" class="KIDE_icono" />');
336			s = s.replace(" "+this.smilies[i][0].toLowerCase(), '<img alt="' + this.smilies[i][0] + '" title="' + this.smilies[i][0] + '" src="' + this.smilies[i][1] + '" class=KIDE_icono" />')
337		}
338		return s;
339	},
340	tohtml: function(s) {
341		s = s.replace(/&/g, "&amp;");
342		s = s.replace(/</g, "&lt;");
343		s = s.replace(/>/g, "&gt;");
344		s = s.replace(/'/g, "&#39;");
345		s = s.replace(/"/g, "&quot;");
346		return s;
347	},
348	sm: function() {
349		this.ajax("insertar");
350		if (this.rango == 3) 
351			this.anti_flood_spam();
352		if (this.encendido == 1) 
353			this.iniciar();
354	},
355	anti_flood_spam: function() {
356		var total = this.ban_total+2;
357		if (this.ban[0] != total-1) {
358			this.ban[0]++;
359			var time = new Date();
360			time = time.getTime();
361			this.ban[this.ban[1]] = time;
362			this.ban[1]++;
363		}
364		else {
365			var i;
366			for (i=2;i<total;i++)
367				this.ban[i] = this.ban[i+1];
368			var time = new Date();
369			time = time.getTime();
370			this.ban[total] = time;
371			var aux = this.ban[total] - this.ban[2];
372			if (aux < this.ban_time*1000) {
373				this.val('KIDE_txt', '');
374				this.attr('KIDE_txt', 'disabled', true);
375				this.ajax("baneado");
376			}
377		}
378	},
379	retardo_input: function() {
380		this.retardo_avisar = true;
381		this.ajax("retardo");
382	},
383	mostrar_iconos: function() {
384		if (this.$('KIDE_iconos')) {
385			this.save_config('icons_hidden', this.css('KIDE_iconos', 'display') == 'none' ? 0 : 1);
386			this.show('KIDE_iconos');
387		}
388	},
389	play_msg_sound: function() {
390		if (navigator.userAgent.toString().indexOf("MSIE") != -1)
391			this.html('KIDE_msg_sound', '<object name="msg_sound" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s
391hockwave/cabs/flash/swflash.cab#3,0,0,0" width="0" height="0"><param name="src" value="'+this.sound_src+'"><param name="loop" value="false"></object>');
392		else
393			this.html('KIDE_msg_sound', '<embed name="msg_sound" src="'+this.sound_src+'" width="0" height="0" loop="false" />');
394	},
395	mostrar_opciones: function() {
396		if (!this.mostrar_colores_iniciado) {
397			this.mostrar_colores_iniciado = true;
398			this.show_colors();
399		}
400		this.show('KIDE_opciones');
401	},
402	save_options: function() {
403		this.show('KIDE_opciones', false);
404		if (this.color)
405			this.save_config("color", this.color);
406		this.save_config("ocultar_sesion", this.attr('ocultar_sesion', 'checked')?1:0);
407		if (this.form("KIDE_template") != this.template) {
408			this.save_config("template", this.form("KIDE_template"));
409			location.reload();
410		}
411	},
412	change_name: function(t) {
413		var v = t.value;
414		if (v && v != this.name) {
415			this.name = v;
416			this.save_config("name", v);
417		}
418		else
419			t.value = this.name;
420	},
421	set_color: function(c) {
422		if (this.works) {
423			this.color = c;
424			this.css('KIDE_txt', 'color', "#"+c);
425			this.events.lanzar('onSetColor', c);
426		}
427	},
428	borrar: function(id) {
429		if (id > 0) {
430			this.show("KIDE_id_"+id, false);
431			this.show("KIDE_mensaje", false)
432			this.ajax("borrar", id);
433		}
434		else
435			alert(this.msg.mensaje_borrar);
436	},
437	getDocumentWidth: function() {
438		return window.innerWidth ? window.innerWidth : document.documentElement.clientWidth;
439	},
440	getDocumentHeight: function() {
441		return window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
442	},
443	banear: function(sid, tipo) {
444		var dias = this.form('kide_'+tipo+'_banear_dias');
445		var horas = this.form('kide_'+tipo+'_banear_horas');
446		var minutos = this.form('kide_'+tipo+'_banear_minutos');
447		if (dias>0 || horas>0 || minutos>0)
448			this.ajax("banear", [sid, tipo]);
449	},
450	ajax: function(tipo, tmp) {
451		var ajax = this.nuevoAjax();
452		if (tipo == "reload") { 
453			ajax.onreadystatechange = function() {
454				if (ajax.readyState == 4 && ajax.status == 200) {
455					var xml = ajax.responseXML.documentElement;
456					if (xml.getElementsByTagName('mensaje').length > 0) {
457						var row;
458						kide.n = kide.text(xml.getElementsByTagName('last_id')[0]);
459						kide.last_time = kide.text(xml.getElementsByTagName('last_time')[0]);
460						for (var i=0; i<xml.getElementsByTagName('mensaje').length; i++) {
461							row = xml.getElementsByTagName('mensaje')[i];
462							kide.insertNewContent(row.getAttribute("uid"),row.getAttribute("name"),kide.htmlspecialchars_decode(kide.text(row)),row.getAttribute("url"),row.getAttribute("date"),row.getAttribute("color"),row.getAttribute("rango"),row.getAttribute("id"),row.getAttribute("sesion"),row.getAttribute("sesion")==kide.sesion,row.getAttribute("hora"),row.getAttribute("img"));
463						}
464					}
465					kide.tiempo(kide.last_time);
466					kide.ajustar_scroll();
467					kide.events.lanzar('onAjaxReload', xml);
468				}
469			};
470			if (this.direct) {
471				ajax.open('POST', this.direct_url+'reload.php', true);
472				ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
473				ajax.send("privs="+(kide.privados_encontrado?0:1)+"&id="+this.n+"&token="+this.token+"&order="+this.order+"&gmt="+kide.gmt+"&formato_hora="+encodeURIComponent(kide.formato_hora)+"&formato_fecha="+encodeURIComponent(kide.formato_fecha));
474			}
475			else {
476				ajax.open('POST',  this.ajax_url+"&task=reload", true);
477				ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
478				ajax.send("privs="+(kide.privados_encontrado?0:1)+"&id="+this.n+"&token="+this.token);
479			}
480		}
481		else if (tipo == "insertar") {
482			var txt = this.val('KIDE_txt');
483			kide.val('KIDE_txt', '');
484			if (!kide.trim(txt)) return;
485			this.visible('KIDE_img_ajax', true);
486			ajax.onreadystatechange = function() {
487				if (ajax.readyState == 4 && ajax.status == 200) {
488					var xml = ajax.responseXML.documentElement;
489					if (xml.getAttribute('banned') == 1) {
490						location.reload();
491						return;
492					}
493					if (xml.getElementsByTagName('comment').length) {
494						var texto = kide.text(xml.getElementsByTagName('comment')[0]);
495						kide.insertNewContent(0,'System',texto,'',kide.ahora(),'',0,0,0,false,xml.getAttribute('hora'),''); 
496					}
497					if (xml.getElementsByTagName('txt').length) {
498						var texto = kide.text(xml.getElementsByTagName('txt')[0]);
499						kide.insertNewContent(kide.userid,kide.name,texto.length?texto:txt,kide.url,kide.ahora(),kide.color,kide.rango,xml.getAttribute('id'),kide.sesion,true,xml.getAttribute('hora'),xml.getAttribute('img'));
500						kide.last_time = xml.getAttribute('tiempo');
501						kide.tiempo(kide.last_time);
502						kide.ajustar_scroll();
503					}
504					kide.visible('KIDE_img_ajax', false);
505					if (xml.getElementsByTagName('js').length) {
506						eval(kide.text(xml.getElementsByTagName('js')[0]));
507					}
508					kide.events.lanzar('onAjaxInsertar', xml);
509				}
510			};
511			ajax.open('POST', this.ajax_url+"&task=add", true);
512			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
513			ajax.send("txt="+encodeURIComponent(txt.replace(/~/g, ""))+"&token="+this.token);
514		}
515		else if (tipo == "baneado") {
516			ajax.onreadystatechange = function() {
517				if (ajax.readyState == 4)
518					location.reload();
519			};
520			ajax.open('POST', this.ajax_url+"&task=add", true);
521			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
522			ajax.send("banear=1");
523		}
524		else if (tipo == "borrar") {
525			ajax.open('POST', this.ajax_url+"&task=borrar", true);
526			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
527			ajax.send("id="+tmp);
528		}
529		else if (tipo == "sesiones") {
530			if (kide.show_sessions) {
531				ajax.onreadystatechange = function() {
532					if (ajax.readyState == 4 && ajax.status == 200) {
533						var xml = ajax.responseXML.documentElement;
534						kide.sids = [];
535						kide.html('KIDE_usuarios', '');
536						var alias, name;
537						for (var i=xml.getElementsByTagName('user').length-1; i>=0; i--) {
538							row = xml.getElementsByTagName('user')[i];
539							var sid = row.getAttribute("sesion");
540							kide.sids[sid] = {
541								rango: row.getAttribute("rango"),
542								name: row.getAttribute("name"),
543								_class: row.getAttribute("class"),
544								sesion: row.getAttribute("sesion"),
545								profile: row.getAttribute("profile"),
546								id: row.getAttribute("userid"),
547								img: row.getAttribute("img")
548							};
549							kide.events.lanzar('onAjaxSession', kide.getUser(sid));
550							kide.insert_sesion(kide.getUser(sid));
551						}
552					}
553				};
554			}
555			ajax.open('POST', this.ajax_url+"&task=sesiones&show_sessions="+kide.show_sessions, true);
556			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
557			ajax.send("token="+this.token);
558		}
559		else if (tipo == "retardo") {
560			ajax.onreadystatechange = function() {
561				if (ajax.readyState == 4 && ajax.status == 200) {
562					var out = ajax.responseText.split("|");
563					out = out[0];
564					if (out > 0) {
565						var time = new Date();
566						time = time.getTime();
567						out = out - Math.floor((time/1000));
568						kide.retardo = out;
569						kide.save_config("retardo", kide.retardo);
570						if (kide.retardo_avisar) {
571							alert(kide.msg.retardo_frase.replace("%s", out));
572						}
573					}
574				}
575			};
576			ajax.open('POST', this.ajax_url+"&task=retardo", true);
577			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
578			ajax.send(null);
579		}
580		else if (tipo == "banear") {
581			var dias = this.form('kide_'+tmp[1]+'_banear_dias');
582			var horas = this.form('kide_'+tmp[1]+'_banear_horas');
583			var minutos = this.form('kide_'+tmp[1]+'_banear_minutos');
584			ajax.onreadystatechange = function() {
585				if (ajax.readyState == 4 && ajax.status == 200) {
586					var out = ajax.responseText;
587					alert(out);
588					kide.show('KIDE_'+tmp[1]+'_banear_span', false);
589					kide.form('kide_'+tmp[1]+'_banear_dias', 0);
590					kide.form('kide_'+tmp[1]+'_banear_horas', 0);
591					kide.form('kide_'+tmp[1]+'_banear_minutos', 0);
592				}
593			};
594			ajax.open('POST', this.ajax_url+"&task=banear", true);
595			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
596			ajax.send("sesion="+tmp[0]+"&dias="+dias+"&horas="+horas+"&minutos="+minutos);
597		}
598		else {
599			this.events.lanzar('onAjax_'+tipo, [ajax, tmp]);
600		}
601	}
602};
603
604// eventos
605
606kide.events = {
607	list: [],
608	add: function(name, func) {
609		if (typeof(func) != 'function') return;
610		if (!this.list[name])
611			this.list[name] = [];
612		this.list[name].push(func);
613	},
614	lanzar: function(name, params) {
615		var stop = false;
616		if (this.list[name]) {
617			if (!params) params = [];
618			for (var i=0; i<this.list[name].length;i++)
619				stop = (this.list[name][i])(params) || stop;
620		}
621		return stop;
622	}
623};
624
625// catpcha
626
627kide.captcha = {
628	check: function() {
629		kide.ajax('captcha_check');
630	},
631	onAjax_check: function(data) {
632		var ajax = data[0];
633		ajax.onreadystatechange = function() {
634			if (ajax.readyState == 4 && ajax.status == 200) {
635				var out = ajax.responseText;
636				if (out == 'ok') {
637					kide.show('KIDE_catpcha', false);
638					kide.show('KIDE_form', true);
639				}
640				else {
641					Recaptcha.reload();
642					alert(out);
643				}
644			}
645		};
646		ajax.open('POST', kide.ajax_url+"&task=catpcha_check", true);
647		ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
648		ajax.send('recaptcha_challenge_field='+encodeURIComponent(kide.form('recaptcha_challenge_field'))+'&recaptcha_response_field='+encodeURIComponent(kide.form('recaptcha_response_field')));
649	}
650};
651kide.events.add('onAjax_captcha_check', kide.captcha.onAjax_check);

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.