PageSourceSearch

https://www.mesto-kadan.cz/js/nove_okno_obrazku.js?ver=20260924034529

js mesto-kadan.cz collected 2026-09-25 04:07:39 UTC 38,942 bytes, 1,126 lines download raw bytes

1// pozice mysi
2var mouseXJ = 0;
3var mouseYJ = 0;
4
5if (typeof jQuery == 'function') {
6
7    jQuery(document).ready(function () {
8        jQuery(document).mousemove(function (e) {
9            mouseXJ = e.pageX;
10            mouseYJ = e.pageY;
11        });
12    });
13}
14
15// vlozeni souboru javascriptu
16function includeJScript(JScript)
17{
18    window.document.write('<script type="text/javascript" src="' + JScript + '"><\/script>');
19}
20
21// videoprehravac
22function resizePlayer(width, ratio) {
23    var height = width * ratio;
24    document.getElementById("as4u_flvPlayer").style.width = width + "px";
25    document.getElementById("as4u_flvPlayer").style.height = height + "px";
26    return true;
27}
28
29function as4u_showVideoInPage(videofile, width, height, fs, fileType, mediaType, subtitleid) {
30    var langVideo = '';
31    var langVideoTmp = '';
32
33    if (jQuery('#global_lanG').length > 0) {
34        langVideoTmp = jQuery('#global_lanG').val();
35    } else if (jQuery('#lanG').length > 0) {
36        langVideoTmp = jQuery('#lanG').val();
37    } else if (jQuery('#search_actualLang').length > 0) {
38        langVideoTmp = jQuery('#search_actualLang').val();
39    }
40    if (langVideoTmp != '') {
41        langVideo = '-' + langVideoTmp;
42    }
43
44
45    if (mediaType == 'video' && fileType != 'flv') {
46        var aktualWidth = $("#as4u_flvPlayer" + videofile).css("width");
47        var subtitle = '';
48        if(subtitleid != ''){
49          subtitle = '<track src="' + location.protocol + '//' + location.hostname + '/filemanager/files/' + subtitleid + '.vtt" kind="subtitles" srclang="cs" label="Čeština" default>';
50        }
51        var src = location.protocol + "//" + location.hostname + "/filemanager/files/" + videofile + langVideo + "." + fileType;
52        var player = '<video width="500" controls autoplay style="height:' + height + 'px; width:' + aktualWidth + '; position: absolute;">' // controlsList="nodownload"
53                + '<source src="' + src + '" type="' + mediaType + '/' + fileType + '">' + subtitle
54                + 'Your browser doesnt support video'
55                + '</video>';
56        $("#as4u_flvPlayer" + videofile).css("background-color", "black");
57        //$("#as4u_flvPlayer" + videofile).css("height", "50px");
58    } else if ((fileType.indexOf('mp4') !== -1) || (fileType.indexOf('mpeg') !== -1) || (fileType.indexOf('mp3') !== -1)) {
59        var aktualWidth = $("#as4u_flvPlayer" + videofile).css("width");
60        var src = location.protocol + "//" + location.hostname + "/filemanager/files/" + videofile + langVideo + "." + fileType;
61        var player = '<audio id="audiop_'+videofile+'" width="500" controls autoplay style="height:50px; width:' + aktualWidth + ';">' // controlsList="nodownload"
62                + '<source src="' + src + '" type="' + mediaType + '/' + fileType + '">'
63                + 'Your browser doesnt support audio'
64                + '</audio>'
65                + '<div class="ovladani_rychlosti">'
66                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').playbackRate=1;" title="Rychlost přehrávání: normální" class="audiospeed" style="display:none;">1</a>'
67                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').playbackRate=1.25;" title="Rychlost přehrávání: o čtvrtinu rychlejší" class="audiospeed" style="display:none;">1.25</a>'
68                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').playbackRate=1.5;" title="Rychlost přehrávání: o polovinu rychlejší" class="audiospeed" style="display:none;">1,5</a>'
69                + '</div>'
70                + '<div class="ovladani_pozice" style="display:none;">'
71                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').currentTime = document.getElementById(\'audiop_' + videofile + '\').currentTime - 30;" class="audioseek">-30</a>'
72                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').currentTime = document.getElementById(\'audiop_' + videofile + '\').currentTime - 10;" class="audioseek">-10</a>'
73                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').currentTime = document.getElementById(\'audiop_' + videofile + '\').currentTime + 10;" class="audioseek">+10</a>'
74                + ' <a href="javascript:document.getElementById(\'audiop_' + videofile + '\').currentTime = document.getElementById(\'audiop_' + videofile + '\').currentTime + 30;" class="audioseek">+30</a>'
75                + '</div>';
76
77        $("#as4u_flvPlayer" + videofile).css("background-color", "black");
78        $("#as4u_flvPlayer" + videofile).css("height", "50px");
79    } else {
80        var player = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="flash" name="flash" width="100%" height="100%" codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">' +
81                '<param name="movie" value="/redakce/inc/preddefinovane/as4u_flvPlayer.swf" />' +
82                '<param name="quality" value="high" />' +
83                '<param name="bgcolor" value="#000000" />' +
84                '<param name="allowScriptAccess" value="always" />' +
85                '<param name="FlashVars" value="video=' + location.protocol + '//' + location.hostname + '/filemanager/files/' + videofile + langVideo + '.flv&width=' + width + '&format=normal&playOnLoad=true&fullscreen=' + fs + '" />' +
86                '<param name="allowFullScreen" value="true" />' +
87                '<param name="wmode" value="transparent" />' +
88                '<embed src="/redakce/inc/preddefinovane/as4u_flvPlayer.swf" qual
88ity="high" bgcolor="#000000" width="100%" height="100%" id="flash" name="flash" align="middle" wmode="transparent" ' +
89                'play="true"' +
90                'loop="false"' +
91                'quality="high"' +
92                'allowScriptAccess="always"' +
93                'allowFullScreen="true"' +
94                'FlashVars="video=' + location.protocol + '//' + location.hostname + '/filemanager/files/' + videofile + langVideo + '.flv&width=' + width + '&format=normal&playOnLoad=true&fullscreen=' + fs + '"' +
95                'type="application/x-shockwave-flash"' +
96                'pluginspage="https://www.adobe.com/go/getflashplayer">' +
97                '</embed>' +
98                '</object>';
99    }
100
101    $("#as4u_flvPlayer" + videofile).html(player);
102}
103
104
105// calendar
106var calendar_to_element_old = '';
107var fromDateSet;
108var toDateSet;
109//30.3.2011 - pridana moznost predat event kvuli pozici mysi a korektnimu zobrazeni kalendare
110function load_ajax_calendar(to_element, rok, mesic, fromDate, toDate, fromDateElm, event) {
111
112    if (document.getElementById('global_lanG')) {
113        var langCalendar = document.getElementById('global_lanG').value
114    } else {
115        var langCalendar = getQueryString()["lanG"];
116    }
117
118    if (!document.getElementById('bs_common_calendar')) {
119
120        var calendarDiv = document.createElement('div');
121        calendarDiv.setAttribute('id', 'bs_common_calendar');
122        document.body.appendChild(calendarDiv);
123
124        document.getElementById('bs_common_calendar').style.display = 'none';
125        document.getElementById('bs_common_calendar').style.position = 'absolute';
126
127        document.getElementById('bs_common_calendar').style.zIndex = 9999;
128
129        document.getElementById('bs_common_calendar').style.backgroundColor = 'white';
130        document.getElementById('bs_common_calendar').style.border = '5px solid #cccccc';
131
132        document.getElementById('bs_common_calendar').style.padding = '0px';
133    }
134
135
136    if ((mesic == 0) && (mesic != '')) {
137        mesic = document.getElementById('ajax_cal_mesic').value;
138    }
139
140    var fromDateElmDate = '';
141    if (document.getElementById(fromDateElm)) {
142        fromDateElmDate = document.getElementById(fromDateElm).value;
143    }
144
145    myDiv = document.getElementById('bs_common_calendar');
146
147    if ((myDiv.style.display == "none") || (calendar_to_element_old != to_element)) {
148
149        myDiv.innerHTML = "";
150        myDiv.style.display = "";
151        myDiv.innerHTML = '<img src="/images/gallery/loading.gif" />';
152        if (event) {
153            //console.log(event);
154            if (event.pageX && event.pageY) {
155                //console.log('pageX : ' + event.pageX);
156                //console.log('pageY : ' + event.pageY);
157                var topPos = event.pageY + 10;
158                var leftPos = event.pageX;
159
160            } else if (event.clientX && event.clientY) {
161                var topPos = event.clientY + (document.documentElement.scrollTop ?
162                        document.documentElement.scrollTop :
163                        document.body.scrollTop) + 10;
164                //var topPos = event.x + 10;
165                var leftPos = event.clientX + (document.documentElement.scrollLeft ?
166                        document.documentElement.scrollLeft :
167                        document.body.scrollLeft);
168                //console.log('X : ' + leftPos);
169                //console.log('Y : ' + topPos);
170            } else {
171
172                var topPos = mouseYJ + 10;
173                var leftPos = mouseXJ;
174            }
175            //console.log('mouseX : ' + mouseYJ);
176            //console.log('mouseY : ' + mouseYJ);
177
178        } else {
179            var topPos = mouseYJ + 10;
180            var leftPos = mouseXJ;
181
182        }
183
184        myDiv.style.top = topPos + 'px';
185        myDiv.style.left = leftPos + 'px';
186
187        fromDateSet = fromDate;
188        toDateSet = toDate;
189    }
190    calendar_to_element_old = to_element;
191
192    var params = "&lanG=" + langCalendar +
193            "&toBsElement=" + to_element +
194            "&rok=" + rok +
195            "&mesic=" + mesic +
196            "&fromDate=" + fromDateSet +
197            "&toDate=" + toDateSet +
198            "&fromDateElmDate=" + fromDateElmDate;
199
200    $("div#bs_common_calendar").load('/bs/ajax.php?akce=calendar' + params);
201
202
203}
204
205function bs_common_calendar_move() {
206    $(function () {
207        $("#bs_common_calendar").draggable({handle: 'div.calendar_move'});
208    }
209    )
210}
211
212function date2element(elm2, dateFormat) {
213    jQuery('#' + elm2).val(dateFormat);
214    jQuery('#' + elm2).focus();
215    jQuery('#' + elm2).blur();
216    jQuery('#' + elm2).trigger('change');
217    /*
218     var el = document.getElementById(elm2);
219     el.value = dateFormat;
220     el.focus();
221     el.blur();
222     $(el).trigger('change'); // trigger change event in input - Ing. Jindrich Ruzicka
223     */
224    close_common_calendar();
225}
226
227function close_common_calendar() {
228    $("#bs_common_calendar").hide(300);
229}
230
231
232var neww = false;
233function openw(co, okno, jak, nazev) {
234    var verze = parseInt(navigator.appVersion);
235    var wi = 'width=';
236    var hi = 'height=';
237    var res = 'resizable=';
238    var scr = 'scrollbars=';
239
240    if (verze >= 4) {
241
242        sirkao = screen.width;
243        vyskao = screen.height;
244
245        var sirkaz = co.indexOf('x=') + 2;
246        var sirkat = co.substr(sirkaz);
247        var sirkak = sirkat.indexOf('&');
248        if (sirkak > 0) {
249            var sirka = sirkat.substr(0, sirkak);
250        }
251        else {
252            var sirka = sirkat;
253        }
254
255        var vyskaz = co.indexOf('y=') + 2;
256        var vyskat = co.substr(vyskaz);
257        var vyskak = vyskat.indexOf('&');
258
259        if (vyskak > 0) {
260            var vyska = vyskat.substr(0, vyskak);
261        }
262        else {
263            var vyska = vyskat;
264        }
265
266        sirka = sirka * 1;
267        vyska = vyska * 1;
268
269        if ((isNaN(sirka) == true) && (isNaN(vyska) == true)) {
270            var res2cd1 = co.split('_');
271            sirka = res2cd1[1];
272            var res2cd2 = res2cd1[2].split('.');
273            vyska = res2cd2[0];
274        }
275
276//    vyska = (vyska * 1) + 30;
277
278        if (sirka > sirkao) {
279            wih = sirkao;
280            resh = 1;
281            scrh = 1;
282        }
283        else {
284            wih = sirka;
285            resh = 0;
286            scrh = 0;
287        }
288
289        if (vyska > (vyskao - 30)) {
290            hih = vyskao;
291            resh = 1;
292            scrh = 1;
293        }
294        else {
295            hih = vyska;
296            if (scrh == 0) {
297                resh = 0;
298                scrh = 0;
299            }
300        }
301
302        wih = wih * 1;
303        hih = hih * 1;
304
305        if (scrh == 1) {
306            if ((wih + 19) < sirkao) {
307                wih = wih + 19;
308            }
309            if ((hih + 19) < vyskao) {
310                hih = hih + 19;
311            }
312        }
313
314        var odshora = (vyskao - hih) / 2;
315        if (odshora < 0) {
316            odshora = 0;
317        }
318
319        odboku = (sirkao - wih) / 2;
320        if (odboku < 0) {
321            odboku = 0;
322        }
323
324        jak = wi + wih + ', ' + hi + hih + ', ' + res + resh + ', ' + scr + scrh + ', top=' + odshora + ', left=' + odboku;
325    }
326
327    if (neww != false) {
328        if (typeof (neww.document) == "object") {
329            try {
330                neww.window.close();
331            } catch (e) {
332            }
333        }
334    }
335
336    neww = window.open('', okno, jak);
337    neww.document.write("<html>\n<head>\n");
338    neww.document.write("<title>" + nazev + "</title>\n</head>\n");
339    neww.document.write("<body style=\"margin: 0;\">\n");
340    neww.document.write("<div style=\"width: 100%; position: absolute; top: 40%; left: 0px; text-align: center; z-index: 1;\">Please wait ...</div>\n");
341    neww.document.write("<a href=\"javascript:window.close()\" style=\"position: absolute; top: 0px; left: 0px; z-index: 2;\"><img src=\"" + co + "\" border=\"0\" alt=\"" + nazev + "\"></a>\n");
342    neww.document.write("</body>\n");
343    neww.document.write("</html>");
344}
345
346function prihlaseni(url) {
347    var w = 370;
348    var h = 280;
349    var windowfeatures = 'toolbar=no, scrollbars=yes, resizable=yes, menubar=no';
350    var winl = (screen.width - w) / 2;
351    var wint = (screen.height - h) / 2;
352    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl;
353    win = window.open(url, "prihlaseni", winprops + windowfeatures)
354    if (parseInt(navigator.appVersion) >= 4) {
355        win.window.focus();
356    }
357}
358
359function regwindow(url) {
360    var w = 600;
361    var h = 400;
362    var windowfeatures = 'toolbar=0, scrollbars=1, resizable=1, menubar=0';
363    var winl = (screen.width - w) / 2;
364    var wint = (screen.height - h) / 2;
365    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl;
366    win = window.open(url, "registrace", winprops + windowfeatures)
367    if (parseInt(navigator.appVersion) >= 4) {
368        win.window.focus();
369    }
370}
371
372
373function appwindow(url, wu, hu, wname) {
374
375
376    var afterDataLoaded = function () {
377
378    };
379
380
381    url = url + "&iframe=yes";
382    /*
383     if (location.protocol == 'https:') {
384     window.open(url);
385     } else {
386     */
387    if (typeof as4uPopup === 'object') {
388        as4uPopup.nooverlay = false;
389        as4uPopup.show(url, 640, 480, afterDataLoaded, true);
390    } else {
391        $.getScript("/js/as4u_popup.js", function () {
392            as4uPopup.nooverlay = false;
393            as4uPopup.show(url, 640, 480, afterDataLoaded, true);
394        });
395    }
396    //}
397
398    return false;
399
400}
401
402function appopen(url) {
403    if (jQuery('#useraplication_in_iframe').val() == "yes") {
404        window.open(url);
405        if (jQuery('#as4uPopupDataContainerIn', parent.document).size > 0) {
406            parent.as4uPopup.close();
407        }
408        return false;
409    } else if (opener == '[object]') {
410        window.open(url);
411        window.close();
412    }
413    else {
414        parent.location.href = url;
415    }
416}
417
418function datetoform(datum, kam) {
419    window.opener.document.getElementById(kam).value = datum;
420    window.close();
421}
422
423
424function confirmLink(theLink, theMsg) {
425    var is_confirmed = confirm(theMsg);
426    if (is_confirmed) {
427    }
428    return is_confirmed;
429}
430
431// obecna kontrole emailu
432function as4u_kontrola_emailu(adresa) {
433    re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,6}$/;
434    return adresa.search(re) == 0;
435}
436
437
438// komunita
439function komunita_kontrola_reg_formulare() {
440
441
442    if (document.getElementById('uzivatelske_jmeno').value == "") {
443        alert("Musíte si zvolit uživatelské jméno (nickname)!");
444        document.getElementById('uzivatelske_jmeno').focus();
445        return false;
446    } else if (document.getElementById('heslo').value == "") {
447        alert("Musíte si zvolit heslo!");
448        document.getElementById('heslo').focus();
449        return false;
450    } else if (document.getElementById('heslok').value != document.getElementById('heslo').value) {
451        alert("Zadaná hesla jsou rozdílná!");
452        document.getElementById('heslo').focus();
453        return false;
454
455    } else if (!as4u_kontrola_email_reg()) {
456        alert("Zadaný email je neplatný!");
457        document.getElementById('emailreg').focus();
458        return false;
459
460    } else if (komunita_kontrola_reg_formulare_rozsirene() == false) {
461        return false;
462
463    } else if (as4u_registrace_souhlas_podminek() == false) {
464        alert("S podmínkami musíte souhlasit!");
465        document.getElementById('souhlas_podminek').focus();
466        return false;
467
468    } else {
469
470        if (typeof (document.getElementById('antispam')) != 'undefined' && document.getElementById('antispam') != null) {
471            if (document.getElementById('antispam').value == "") {
472                alert("Musíte si zadat antispamový kód!");
473                document.getElementById('antispam').focus();
474                return false;
475            }
476        }
477
478        if ((typeof (document.getElementById('telefonreg')) != 'undefined' && document.getElementById('telefonreg') != null)) {
479            if (document.getElementById('telefonreg').value == "") {
480                alert("Telefoní číslo musí být zadané!");
481                document.getElementById('telefonreg').focus();
482                return false;
483            }
484        }
485
486        if ((typeof (document.getElementById('control_code_from_sms')) != 'undefined' && document.getElementById('control_code_from_sms') != null)) {
487            if (document.getElementById('control_code_from_sms').value == "") {
488                alert("Nezadali jste autorizační kód!");
489                document.getElementById('control_code_from_sms').focus();
490                return false;
491            }
492        }
493
494        return true;
495    }
496}
497
498function as4u_registrace_souhlas_podminek() {
499    if (jQuery('#souhlas_podminek').length > 0) {
500        return jQuery('#souhlas_podminek').is(':checked');
501    } else {
502        return true;
503    }
504}
505
506function as4u_kontrola_email_reg() {
507
508    if (jQuery('#emailreg').length > 0) {
509        if (as4u_kontrola_emailu(jQuery('#emailreg').val())) {
510            return true;
511        } else {
512            return false;
513        }
514    } else {
515        return true;
516    }
517
518}
519
520function komunita_kontrola_reg_formulare_rozsirene() {
521
522    if (jQuery('#jmeno').length > 0) {
523        if (jQuery('#jmeno').val() == '') {
524            alert('Musíte zadaat jméno!');
525            document.getElementById('jmeno').focus();
526            return false;
527        } else if (jQuery('#prijmeni').val() == '') {
528            alert('Musíte zadaat příjmení!');
529            document.getElementById('prijmeni').focus();
530            return false;
531        } else if (jQuery('#obec').val() == '') {
532            alert('Musíte zadaat obec!');
533            document.getElementById('obec').focus();
534            return false;
535        } else if (jQuery('#psc').val() == '') {
536            alert('Musíte zadaat PSČ!');
537            document.getElementById('psc').focus();
538            return false;
539        }
540    } else {
541        return true;
542    }
543}
544
545function komunita_kontrola_pis_reg_formulare() {
546    if (document.getElementById('uzivatelske_jmeno').value == "") {
547        alert("Musíte si zvolit uživatelské jméno (nickname)!");
548        document.getElementById('uzivatelske_jmeno').focus();
549        return false;
550    } else if (document.getElementById('heslo').value == "") {
551        alert("Musíte si zvolit heslo!");
552        document.getElementById('heslo').focus();
553        return false;
554    } else if (document.getElementById('heslok').value != document.getElementById('heslo').value) {
555        alert("Zadaná hesla jsou rozdílná!");
556        document.getElementById('heslo').focus();
557        return false;
558    } else if (document.getElementById('jmeno').value == "") {
559        alert("Musíte zadat jméno!");
560        document.getElementById('jmeno').focus();
561        return false;
562    } else if (document.getElementById('prijmeni').value == "") {
563        alert("Musíte zadat příjmení!");
564        document.getElementById('prijmeni').focus();
565        return false;
566    } else if (document.getElementById('ulice').value == "") {
567        alert("Musíte zadat ulici!");
568        document.getElementById('ulice').focus();
569        return false;
570    } else if (document.getElementById('cislo_popisne').value == "") {
571        alert("Musíte zadat číslo popisné!");
572        document.getElementById('cislo_popisne').focus();
573        return false;
574    } else if (document.getElementById('cislo_popisne').value != parseInt(document.getElementById('cislo_popisne').value)) {
575        alert("Číslo popisné  není platné!");
576        document.getElementById('cislo_popisne').focus();
577        return false;
578    } else if (document.getElementById('orientacni_cislo').value == "") {
579        alert("Musíte zadat orientační číslo!");
580        document.getElementById('orientacni_cislo').focus();
581        return false;
582    } else if (document.getElementById('orientacni_cislo').value != parseInt(document.getElementById('orientacni_cislo').value)) {
583        alert("Orientační číslo není platné!");
584        document.getElementById('orientacni_cislo').focus();
585        return false;
586    } else if (document.getElementById('mesto').value == "") {
587        alert("Musíte zadat město/obec!");
588        document.getElementById('mesto').focus();
589        return false;
590    } else if (document.getElementById('psc').value == "") {
591        alert("Musíte zadat PSČ!");
592        document.getElementById('psc').focus();
593        return false;
594    } else if (document.getElementById('psc').value != parseInt(document.getElementById('psc').value) || document.getElementById('psc').value.length != 5) {
595        alert("PSČ není platné!");
596        document.getElementById('psc').focus();
597        return false;
598    } else if (document.getElementById('telefon').value == "") {
599        alert("Musíte zadat telefon!");
600        document.getElementById('telefon').focus();
601        return false;
602    } else if (document.getElementById('telefon').value != parseInt(document.getElementById('telefon').value)) {
603        alert("telefoní číslo není platné!");
604        document.getElementById('telefon').focus();
605        return false;
606    } else if (!as4u_kontrola_emailu(document.getElementById('emailreg').value)) {
607        alert("Zadaný email je neplatný!");
608        document.getElementById('emailreg').focus();
609        return false;
610    } else if (document.getElementById('souhlas_podminek').checked == false) {
611        alert("S podmínkami musíte souhlasit!");
612        document.getElementById('souhlas_podminek').focus();
613        return false;
614    } else {
615        return true;
616    }
617}
618
619
620function as4ucheckun(as4u_elm_un) {
621
622    if (jQuery('#' + as4u_elm_un).val() != '') {
623
624        jQuery.post(location.protocol + '//' + document.location.host + '/registrace/ajax.php?akce=registrace&lanG=cs',
625                {
626                    subakce: 'overeni_jmena_as4u',
627                    nameType: jQuery('#nameType').val(),
628                    uname: jQuery('#' + as4u_elm_un).val()
629                },
630        function (xml) {
631            jQuery(xml).find('response').each(function () {
632                if (jQuery(this).find('odp').text() != 'OK') {
633                    alert(jQuery(this).find('alert').text());
634                    jQuery('#' + as4u_elm_un).val('');
635                    jQuery('#' + as4u_elm_un).focus();
636
637                }
638            });
639        }, "xml");
640
641    }
642}
643
644
645// ajaxove okno
646function as4uAjaxAlertShow(aaWidth, aaHeight) {
647
648    document.getElementById('ajax_transparent').style.display = '';
649    document.getElementById('ajax_view').style.display = '';
650    as4uAjaxAlertShowSize(aaWidth, aaHeight);
651
652}
653
654
655function as4uAjaxAlertShowSize(aaWidth, aaHeight) {
656    aaWidth = aaWidth * 1;
657    aaHeight = aaHeight * 1;
658
659    aaWidthOriginal = aaWidth;
660    aaHeightOriginal = aaHeight;
661
662    if (document.getElementById('ajax_transparent').style.display != 'none') {
663
664        wSizeH = jQuery(window).height();
665        wSizeW = jQuery(window).width();
666
667        if (!jQuery.browser.msie) {
668            //wSizeW = wSizeW - 20;
669        }
670
671        if (aaHeight > wSizeH) {
672            aaHeight = wSizeH - 40;
673            aaWidth = aaWidth + 20;
674        }
675
676        if (aaWidth > wSizeW) {
677            aaWidth = wSizeW - 20;
678        }
679
680        if (wSizeH == 0) {
681        } else {
682            document.getElementById('ajax_transparent').style.height = wSizeH + 'px';
683            document.getElementById('ajax_transparent').style.width = wSizeW + 'px';
684
685            ajaxSizeObH = (aaHeight * 1) + 20;
686            ajaxSizeObW = (aaWidth * 1);
687
688            document.getElementById('ajax_view').style.height = ajaxSizeObH + 'px';
689            document.getElementById('ajax_view').style.width = ajaxSizeObW + 'px';
690            document.getElementById('ajax_view_close').style.width = ajaxSizeObW + 'px';
691
692            ajaxSizeH = ajaxSizeObH - 20;
693            ajaxSizeW = ajaxSizeObW;
694
695            document.getElementById('ajax_content').style.height = ajaxSizeH + 'px';
696            document.getElementById('ajax_content').style.width = ajaxSizeW + 'px';
697
698            posAjaxH = ((wSizeH - ajaxSizeObH) / 2);
699            posAjaxW = ((wSizeW - ajaxSizeW) / 2);
700
701            if (document.documentElement && document.documentElement.scrollTop) {
702                winScroll = document.documentElement.scrollTop;
703            } else if (document.body) {
704                winScroll = document.body.scrollTop;
705            } else {
706                winScroll = 0;
707            }
708
709            document.getElementById('ajax_transparent').style.top = (winScroll) + 'px';
710
711            document.getElementById('ajax_view').style.top = (winScroll + posAjaxH) + 'px';
712            document.getElementById('ajax_view').style.left = (posAjaxW) + 'px';
713
714            setTimeout('as4uAjaxAlertShowSize(' + aaWidthOriginal + ', ' + aaHeightOriginal + ')', 100);
715
716        }
717
718    }
719}
720
721function closeajax() {
722
723    document.getElementById('ajax_transparent').style.display = 'none';
724    document.getElementById('ajax_view').style.display = 'none';
725    document.getElementById('ajax_content').innerHTML = '';
726
727    after_closeajax();
728
729}
730
731function after_closeajax() {
732}
733;
734
735function setCookie(key, value, days, path) {
736
737    var dateRm = new Date();
738    dateRm.setTime(dateRm.getTime() - 365 * 24 * 60 * 60 * 1000);
739    document.cookie = key + '="";expires=' + dateRm.toGMTString();
740
741    if ((value != '') || (value != undefined)) {
742
743        value = encodeURIComponent(value);
744
745        if (days > 0) {
746            var dateAdd = new Date();
747            dateAdd.setTime(dateAdd.getTime() + days * 24 * 60 * 60 * 1000);
748            value += ';expires=' + dateAdd.toGMTString();
749        }
750
751        value += ';path=' + path;
752
753        document.cookie = key + '=' + value;
754
755    }
756
757}
758
759function readCookie(cookName) {
760    cookieArr = document.cookie.split(";");
761    for (var i = 0; i < cookieArr.length; i++) {
762        cook = cookieArr[i].split("=");
763        if (jQuery.trim(cook[0]) == cookName) {
764            return jQuery.trim(cook[1]);
765            break;
766        }
767    }
768
769}
770
771
772function deleteCookie(name, path, domain) {
773  if( get_cookie( name ) ) {
774    document.cookie = name + "=" +
775      ((path) ? ";path="+path:"")+
776      ((domain)?";domain="+domain:"") +
777      ";expires=Thu, 01 Jan 1970 00:00:01 GMT";
778  }
779}
780
781function getQueryString() {
782    var result = {}, queryString = location.search.substring(1),
783            re = /([^&=]+)=([^&]*)/g, m;
784
785    while (m = re.exec(queryString)) {
786        result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
787    }
788
789    return result;
790}
791
792function limitDelkyTextu(limit, idElm, msg) {
793    var delkaretezce = document.getElementById(idElm).value.length;
794    if (delkaretezce > limit) {
795        alert(msg);
796        document.getElementById(idElm).value = document.getElementById(idElm).value.substring(0, limit);
797    } else {
798        document.getElementById(idElm + '_zbyva').innerHTML = limit - delkaretezce;
799    }
800
801}
802
803function log(data) {
804    try {
805        console.log(data);
806    } catch (e) {
807    }
808}
809
810// rozsireni o preload obrazku
811if (typeof jQuery === 'function') {
812    (function ($) {
813        var imgList = [];
814        $.extend({
815            preload: function (imgArr, option) {
816                var setting = $.extend({
817                    init: function (loaded, total) {
818                    },
819                    loaded: function (img, loaded, total) {
820                    },
821                    loaded_all: function (loaded, total) {
822                    }
823                }, option);
824                var total = imgArr.length;
825                var loaded = 0;
826
827                setting.init(0, total);
828                for (var i in imgArr) {
829                    imgList.push($("<img />")
830                            .attr("src", imgArr[i])
831                            .load(function () {
832                                loaded++;
833                                setting.loaded(this, loaded, total);
834                                if (loaded == total) {
835                                    setting.loaded_all(loaded, total);
836                                }
837                            })
838                            );
839                }
840
841            }
842        });
843    })(jQuery);
844}
845
846// obecne mapy
847function initAs4uMapOnClick(callback) {
848    if (typeof frontentScriptIsOnLoad != 'function') {
849        jQuery.getScript(location.protocol + '//' + document.location.host + '/js/map4u.js').done(function (script, textStatus) {
850            frontentMapScriptIsOnLoad();
851            log('frontend OK ');
852            if (typeof callback == 'function')
853                callback();
854        }).fail(function (jqxhr, settings, exception) {
855            log('frontend error ');
856            log(exception);
857            log(exception.message);
858            if (typeof callback == 'function')
859                callback();
860        });
861    } else {
862        log('Mapy uz jsou jednou nactene');
863        frontentMapScriptIsOnLoad();
864        if (typeof callback == 'function')
865            callback();
866    }
867}
868;
869
870function as4u_jsLang(txt) {
871    if (jQuery('input[rel="' + txt + '"]').length > 0) {
872        return jQuery('input[rel="' + txt + '"]').val();
873    } else {
874        return txt;
875    }
876
877}
878
879
880function as4u_testDateOfBirth(d) {
881    re = /^\d{1,2}\.\d{1,2}\.\d{4}$/;
882    if (d == '' || !d.match(re)) {
883        return false;
884    } else {
885        return true;
886    }
887}
888
889// RS
890function as4u_rs() {
891    if (document.getElementById('redakcni_system')) {
892        document.getElementById('redakcni_system').style.display = 'none';
893    }
894}
895
896if (typeof jQuery === 'function') {
897    jQuery(document).ready(function () {
898        as4u_rs();
899    });
900}
901;
902
903if (typeof String.prototype.trim !== 'function') {
904    String.prototype.trim = function () {
905        return this.replace(/^\s+|\s+$/g, '');
906    }
907}
908
909// schvaleni cookies
910jQuery(document).ready(function () {
911    defaultConsentSettings();
912    if (jQuery('#cookies_info').length > 0) {
913        var podpraCookies = readCookie('ConfirmCookie');
914        if (podpraCookies != 'agree' && podpraCookies != 'agree_all' && podpraCookies != 'rejct'  && podpraCookies != 'defered') {
915            setCookie('ConfirmCookie', 'yes', 100, '/');
916            podpraCookies = readCookie('ConfirmCookie');
917        }
918        if (podpraCookies == 'yes') {
919            jQuery('#cookies_info').css('display', '');
920        }
921    }
922
923
924    var confirmCookiesA = readCookie('ConfirmCookieA');
925    if (confirmCookiesA == 'yes'){
926      $('#cookies_analytics_vyk').prop("checked", true);
927    }
928    $('#cookies_analytics_vyk').change(function() {
929      if($('#cookies_analytics_vyk').prop("checked")) {
930        setCookie('ConfirmCookieA', 'yes', 100, '/');
931      } else {
932        setCookie('ConfirmCookieA', 'no', 100, '/');
933      }
934      updateConsentSettings();
935    });
936
937    var confirmCookiesA = readCookie('ConfirmCookieS');
938    if (confirmCookiesA == 'yes'){
939      $('#cookies_statistics_stat').prop("checked", true);
940    }
941    $('#cookies_statistics_stat').change(function() {
942      if($('#cookies_statistics_stat').prop("checked")) {
943        setCookie('ConfirmCookieS', 'yes', 100, '/');
944      } else {
945        setCookie('ConfirmCookieS', 'no', 100, '/');
946      }
947      updateConsentSettings();
948    });
949    updateConsentSettings();
950    
951});
952function as4uCookiesConfirm(infoset) {
953    setCookie('ConfirmCookie', infoset, 100, '/');
954
955    if(infoset == 'agree_all'){
956
957      jQuery('#cookies_statistics_stat').prop('checked', true);
958      jQuery('#cookies_analytics_vyk').prop('checked', true);
959      setCookie('ConfirmCookieA', 'yes', 100, '/');
960      setCookie('ConfirmCookieS', 'yes', 100, '/');
961    }
962    if(infoset == 'rejct'){
963      jQuery('#cookies_statistics_stat').prop('checked', false);
964      jQuery('#cookies_analytics_vyk').prop('checked', false);
965      setCookie('ConfirmCookieA', 'no', 100, '/');
966      setCookie('ConfirmCookieS', 'no', 100, '/');
967    }
968
969    jQuery('#cookies_info').hide();
970    updateConsentSettings();
971
972}
973function as4uCookieShowStatus(){
974  jQuery('#cookies_info').css('display', '');
975}
976
977
978function updateConsentSettings() {
979
980    var confirmCookiesA = readCookie('ConfirmCookieA');
981    if (confirmCookiesA == 'yes'){
982      var analyticsConsent = "granted";
983    } else {
984      var analyticsConsent = "denied";
985    }
986
987    var confirmCookiesA = readCookie('ConfirmCookieS');
988    if (confirmCookiesA == 'yes'){
989      var advertisingConsent = "granted";
990    } else {
991      var advertisingConsent = "denied";
992    }
993
994    // Aktualizace Google Consent Mode
995    window.dataLayer = window.dataLayer || [];
996    function gtag(){dataLayer.push(arguments);}
997    gtag('consent', 'default', {
998        'functionality_storage': 'granted',
999        'security_storage': 'granted',
1000        'analytics_storage': analyticsConsent,
1001        'ad_storage': advertisingConsent,
1002        'personalization_storage': advertisingConsent,
1003        'ad_user_data': advertisingConsent,
1004        'ad_personalization': advertisingConsent,
1005        'wait_for_update': 500
1006    });
1007
1008    /*
1009    window.dataLayer = window.dataLayer || [];
1010    window.dataLayer.push({
1011      event: 'consentUpdate',
1012      consent: {
1013        'functionality_storage': 'granted',
1014        'security_storage': 'granted',
1015        'analytics_storage': analyticsConsent,
1016        'ad_storage': advertisingConsent,
1017        'ad_user_data': advertisingConsent,
1018        'ad_personalisation': advertisingConsent,
1019        'personalization_storage': 'denied',
1020        'wait_for_update': 500
1021      }
1022    });
1023    */
1024    console.log('consent updatovan');
1025
1026}
1027
1028function defaultConsentSettings() {
1029
1030  window.dataLayer = window.dataLayer || [];
1031  function gtag(){dataLayer.push(arguments);}
1032  gtag('consent', 'default', {
1033      'functionality_storage': 'granted',
1034      'security_storage': 'granted',
1035      'analytics_storage': 'denied',
1036      'ad_storage': 'denied',
1037      'personalization_storage': 'denied',
1038      'ad_user_data': 'denied',
1039      'ad_personalization': 'denied',
1040      'wait_for_update': 500
1041  });
1042
1043
1044
1045  /*
1046  window.dataLayer = window.dataLayer || [];
1047  window.dataLayer.push({
1048    event: 'consentInitialization',
1049    consentDefault:{
1050        'functionality_storage': 'granted',
1051        'security_storage': 'granted',
1052        'analytics_storage': 'denied',
1053        'ad_storage': 'denied',
1054        'personalization_storage': 'denied',
1055        'ad_user_data': 'denied',
1056        'ad_personalization': 'denied',
1057        'wait_for_update': 500
1058    }
1059  });
1060  */
1061  console.log('consent nastaven');
1062}
1063
1064
1065
1066
1067function isNumberKey(evt)
1068{
1069    var charCode = (evt.which) ? evt.which : event.keyCode
1070    var event = window.event || ffEvent; //ffEvent is the function argument
1071    var intKeyCode = event.keyCode || event.which;
1072
1073    //log(intKeyCode);
1074
1075    if ((intKeyCode >= 46 && intKeyCode <= 57) || (intKeyCode >= 95 && intKeyCode <= 105)) {
1076        return true;
1077    } else if ((intKeyCode == 188) || (intKeyCode == 190) || (intKeyCode == 110)) {
1078        return true;
1079    } else if (intKeyCode == 32) {
1080        return false;
1081    } else if (intKeyCode < 39) {
1082        return true;
1083    } else if (intKeyCode == 86 || intKeyCode == 17) {
1084        return true;
1085    } else {
1086        return false;
1087    }
1088}
1089
1090// Nanotrix AI - načtení odpovědi do vyhledávání
1091if (typeof jQuery == 'function') {
1092    jQuery(function ($) {
1093        var $box = $('#nanotrix-ai-box');
1094        if ($box.length === 0) {
1095            return;
1096        }
1097        var query = $box.attr('data-query');
1098        if (!query) {
1099            $box.hide();
1100            return;
1101        }
1102        $.ajax({
1103            url: 'json.php',
1104            data: { akce: 'scearch_ai', query: query },
1105            dataType: 'json',
1106            timeout: 65000,
1107            success: function (resp) {
1108                $('#nanotrix-ai-loading').hide();
1109                if (resp && resp.status === 'ok' && resp.html) {
1110                    $('#nanotrix-ai-result').html(resp.html);
1111                } else {
1112                    $box.hide();
1113                }
1114            },
1115            error: function () {
1116                $box.hide();
1117            }
1118        });
1119    });
1120}
1121
1122function loadContent2element(url, elm, retfunc) {
1123    jQuery('#' + elm).load(url, function () {
1124        retfunc();
1125    });
1126}

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.