PageSourceSearch

https://www.topvision.cz/js/global.js?v=2.7.2

js topvision.cz collected 2026-10-06 19:59:05 UTC 54,272 bytes, 1,479 lines download raw bytes

1// Global
2
3$(window).load(
4    function() {
5        // Animations
6
7        animations();
8    }
9);
10
11$(document).ready(
12    function() {
13        
14        // Section
15
16        var smallMenuHeight = $(".small-menu-box").height();
17
18        $("section").css("min-height",smallMenuHeight + 40);
19
20        // Placeholder
21
22        $(".placeholder").focus(
23            function() {
24                var defaultValue = this.defaultValue;
25
26                if($(this).val() == defaultValue) {
27                    $(this).val("");
28                }
29            }
30        );
31
32        $(".placeholder").blur(
33            function() {
34                var defaultValue = this.defaultValue;
35
36                if($(this).val() == "") {
37                    $(this).val(defaultValue);
38                }
39            }
40        );
41
42        // Colorbox
43
44        $(".colorbox").colorbox({
45            onComplete: function() {
46                colorboxJs();
47            }
48        });
49        
50        $(".close-info").on("click", function(){
51            $(this).parents(".mobile-filter-info").slideToggle();
52            return false;
53        });
54
55        /*
56        $(".close-bascet").on("click", function(){
57            $(this).parents(".bascet").slideToggle(450, function(){ $(this).parents(".bascet").remove(); });
58            return false;
59        });
60        */        
61
62        // Select
63 
64        $('.select-footer').select2();
65        $('.select-grey').select2({
66            minimumResultsForSearch: Infinity,
67            dropdownCssClass: 'select-grey'            
68        });
69        $('.select-search').select2({
70            dropdownCssClass: 'select-search'
71        });
72       
73        
74        $(".period").on("click" , function(){
75            $(this).parent().find(".period").removeClass("activated");
76            $(this).addClass("activated").find("ins").click();;
77            //return false;
78        });
79
80        $(".box-filter-link").on("click", function(){
81            $(this).toggleClass("activated").next().slideToggle();
82            return false;
83        });
84
85        $(".order-tag").on("click", function(){
86            $(this).toggleClass("activated");
87            return false;
88        });
89
90        $(".filter-button").on("click", function(){
91            $(".mobile-filter-categories").slideDown();
92            return false;
93        });          
94
95        $(".mobile-filter-categories .heading .flr,.mobile-filter-categories .heading .fll").on("click", function(){
96            $(".mobile-filter-categories").slideUp();
97            return false;
98        });        
99        
100        $('.select-grey').on("change", function(e) {
101          //$("#select").select2("val"); //get the value
102          //$("#select").select2("val", "CA"); //set the value
103          // zmena voleb prihlasovani na strance kurzu
104          var kosik_sel = $(this).attr("id").split("_");                               
105          if ($(this).attr("id")=="pocet1") {
106            var sel2 = document.getElementById("pocet2");
107            $(sel2).select2("val", $(this).val());
108            var sel3 = document.getElementById("pocet3");
109            if (sel3 != null) {
110              $(sel3).select2("val", $(this).val());
111            }
112          }
113          else if ($(this).attr("id")=="pocet2") {
114            var sel1 = document.getElementById("pocet1");
115            $(sel1).select2("val", $(this).val());
116            var sel3 = document.getElementById("pocet3");
117            if (sel3 != null) {
118              $(sel3).select2("val", $(this).val());
119            }            
120          }
121          else if ($(this).attr("id")=="pocet3") {
122            var sel1 = document.getElementById("pocet1");
123            $(sel1).select2("val", $(this).val());
124            var sel2 = document.getElementById("pocet2");
125            $(sel2).select2("val", $(this).val());                      
126          }
127          else if ($(this).attr("id")=="termin2") {
128            $('input:radio[name=volba_term]').iCheck('uncheck');
129            $('input:radio[name=volba_term][value='+ $(this).val() +']').iCheck('check');
130            var sel3 = document.getElementById("termin3");
131            if (sel3 != null) {
132              $(sel3).select2("val", $(this).val());
133            }
134            lektori_zalozky($(this).val());            
135          }
136          else if ($(this).attr("id")=="termin3") {
137            $('input:radio[name=volba_term]').iCheck('uncheck');
138            $('input:radio[name=volba_term][value='+ $(this).val() +']').iCheck('check');
139            var sel2 = document.getElementById("termin2");
140            $(sel2).select2("val", $(this).val());
141            lektori_zalozky($(this).val());           
142          } 
143          else if (kosik_sel[0]=="termin-kosik" || kosik_sel[0]=="termin-kosik-mobile") {
144            document.location.replace("/objednavka/kosik/?uprav_kosik="+kosik_sel[1]+"&new_term="+$(this).val()+"#kosik");
145          }                                        
146          else if (kosik_sel[0]=="pocet-kosik" || kosik_sel[0]=="pocet-kosik-mobile") {
147            document.location.replace("/objednavka/kosik/?uprav_kosik="+kosik_sel[1]+"&new_pocet="+$(this).val()+"#kosik");
148          }
149          else if (kosik_sel[0]=="cena-kosik" || kosik_sel[0]=="cena-kosik-mobile") {
150            document.location.replace("/objednavka/kosik/?uprav_kosik="+kosik_sel[1]+"&new_cena="+$(this).val()+"#kosik");
151          }
152          else if (kosik_sel[0]=="participant") {
153            var id_pole = $(this).attr("id").split("_");
154            var id = id_pole[1];            
155            if ($(this).val()!=0) {
156              var data_pole = $(this).val().split(";");
157              document.getElementById("jmeno" + id).value = data_pole[0];
158              document.getElementById("funkce" + id).value = data_pole[1];
159              document.getElementById("email" + id).value = data_pole[2];
160              document.getElementById("telefon" + id).value = data_pole[3];
161              //$(".participant-data").slideUp();  
162            }
163            else {
164              document.getElementById("jmeno" + id).value = "";
165              document.getElementById("funkce" + id).value = "";
166              document.getElementById("email" + id).value = "";
167              document.getElementById("telefon" + id).value = "";            
168              //$(".participant-data").slideDown();
169            }
170          }
171          else if (kosik_sel[0]=="fakt-udaje") {
172            if ($(this).val()!=0) {
173              var data_pole = $(this).val().split(";");
174              if (data_pole[0]!=0) {              
175                document.getElementById("firma").value = data_pole[0];
176                document.getElementById("adresa").value = data_pole[1];
177                document.getElementById("ico").value = data_pole[2];
178                document.getElementById("firma_udaj1").style.display="block";
179                document.getElementById("firma_udaj4").style.display="block";
180                document.getElementById("firma_udaj5").style.display="block";
181                $('input:radio[name=typ_firma]').iCheck('uncheck');
182                $('input:radio[name=typ_firma][value=1]').iCheck('check');                              
183              }
184              else {
185                document.getElementById("firma").value = "";
186                document.getElementById("adresa").value = data_pole[1];
187                document.getElementById("ico").value = "";              
188                document.getElementById("firma_udaj1").style.display="none";
189                document.getElementById("firma_udaj4").style.display="none";
190                document.getElementById("firma_udaj5").style.display="none";
191                $('input:radio[name=typ_firma]').iCheck('uncheck');
192                $('input:radio[name=typ_firma][value=2]').iCheck('check');            
193              }              
194              //$(".fakt-udaje-data").slideUp();  
195            }
196            else {
197              document.getElementById("firma").value = "";
198              document.getElementById("adresa").value = "";
199              document.getElementById("ico").value = "";
200              document.getElementById("firma_udaj1").style.display="block";
201              document.getElementById("firma_udaj4").style.display="block";
202              document.getElementById("firma_udaj5").style.display="block";
203              $('input:radio[name=typ_firma]').iCheck('uncheck');
204              $('input:radio[name=typ_firma][value=1]').iCheck('check');                           
205              //$(".fakt-udaje-data").slideDown();
206            }
207          }
208          else if (kosik_sel[0]=="kontakt-osoba") {
209            if ($(this).val()!=0) {
210              var data_pole = $(this).val().split(";");
211              document.getElementById("jmeno_kontos").value = data_pole[0];
212              document.getElementById("email_kontos").value = data_pole[1];
213              document.getElementById("telefon_kontos").value = data_pole[2];             
214              //$(".kontakt-osoba-data").slideUp();  
215            }
216            else {
217              document.getElementById("jmeno_kontos").value = "";
218              document.getElementById("email_kontos").value = "";
219              document.getElementById("telefon_kontos").value = "";               
220              //$(".kontakt-osoba-data").slideDown();
221            }
222          }
223        });
224        
225        // Checkbox, Radio
226
227        $('input').iCheck();
228
229        $('input').on('ifChecked', function(event){
230            $("label",$(this).parent().parent()).addClass("active");
231        });
232        $('input').on('ifUnchecked', function(event){
233            $("label",$(this).parent().parent()).removeClass("active");
234        });
235
236        $(".select-options-link").click(
237            function() {
238                $(this).toggleClass("active");
239                $(".select-options-box",$(this).parent()).slideToggle();
240                return false;
241            }
242        );
243        
244        // pridani kurzu od digi skills v kosiku
245        $('.add_digidopln').on('ifChecked', function(event){
246            var kosik_sel = $(this).attr("id").split("_");
247            document.location.replace("/objednavka/kosik/?uprav_kosik="+kosik_sel[1]+"&add_digi="+$(this).val()+"#kosik");
248        });                   
249        $('.add_digidopln').on('ifUnchecked', function(event){
250            var kosik_sel = $(this).attr("id").split("_");
251            document.location.replace("/objednavka/kosik/?uprav_kosik="+kosik_sel[1]+"&remove_digi="+$(this).val()+"#kosik");
252        });        
253
254        // Slides
255
256        //if( $(".mobile-options").is(":hidden") ){
257          $('.slider-text.auto').bxSlider({
258              adaptiveHeight: true,
259              mode: 'fade',        
260              auto: true
261          });
262        //}
263        
264        $('.slider-text').bxSlider({
265            adaptiveHeight: true,
266            mode: 'fade'
267        });
268
269        // Search
270
271        $(".search-form-box").hide();
272        $(".search-header-icon").click(
273            function() {
274              if ($(this).attr("id")=="search-icon-fixed-top") {
275                $(this).toggleClass("active");
276                //var search-form-box = document.getElementById("search-box-fixed-top");
277                $(".search-form-box.fixed-top").slideToggle();                               
278                document.getElementById('search-header2').focus();                                
279                return false;              
280              }
281              else {
282                $(this).toggleClass("active");
283                $(".search-form-box").slideToggle();                
284                $(".nav-link").removeClass("active");                
285                $(".nav-submenu").hide();
286                document.getElementById('search-header').focus();                                
287                return false;
288              }  
289            }
290        );
291
292        if( $(".mobile-options").is(":visible") ){
293            if(!$(".list-small-menu").hasClass("static")) {
294              $(".list-small-menu").addClass("static");
295            }
296            if(!$(".list-small-menu2").hasClass("static")) {
297              $(".list-small-menu2").addClass("static");
298            }            
299            //, .has-submenu
300            $(".curs-info").on("click", function(){
301                $(this).next().slideToggle(350);
302                $(this).toggleClass("activated");
303                return false;
304            });
305        }
306
307        // Fixed elements
308
309        fixed();
310
311        // Box more
312
313        $(".link-small-info").click(
314            function() {
315                var more = $(this).attr("data-more");
316                if($(this).hasClass("active")) {
317                    $(this).removeClass("active");
318                    $(".box-detail-more").slideUp();
319                    var akce_detail = document.getElementById("fixed-menu-5");
320                    if (akce_detail != null) {                    
321                      $(".approval-text").removeClass("hidbox");
322                    }  
323                } else {
324                    $(".link-small-info").removeClass("active");
325                    $(this).addClass("active");
326                    $(".box-detail-more").slideUp();
327                    $(".box-detail-more." + more).slideDown();
328                    var akce_detail = document.getElementById("fixed-menu-5");
329                    if (akce_detail != null) {                       
330                      $(".approval-text").addClass("hidbox");
331                    }
332                }
333                return false;
334            }
335        );
336
337        $(".link-button-info").click(
338            function() {
339                var more = $(this).attr("data-more");
340                if($(this).hasClass("active")) {
341                    $(this).removeClass("active");
342                    $(".box-detail-more." + more).slideUp();
343                } else {
344                    $(".link-button-info").removeClass("active");
345                    $(this).addClass("active");
346                    if (more!="darkovy-poukaz") {
347                      $(".box-detail-more").slideUp();
348                    }
349                    $(".box-detail-more." + more).slideDown();
350                }
351                return false;
352            }
353        );
354
355        $(".box-detail-more .close").click(
356            function() {
357                $(this).parent().slideUp();
358                var akce_detail = document.getElementById("fixed-menu-5");
359                if (akce_detail != null) {                    
360                  $(".approval-text").removeClass("hidbox");
361                }                
362                return false;
363            }
364        );
365
366        // Scroll to id
367
368        var fixedMenuHeight = $(".fixed-menu-top").height();
369
370        $("a[rel='m_PageScroll2id']").mPageScroll2id({
371            offset: fixedMenuHeight,
372            forceSingleHighlight: true,
373            highlightClass: "highlighted",
374            keepHighlightUntilNext: true
375        });      
376
377
378
379        updateMenuBar();
380
381        // Approval
382
383        $(".approval-main-box a.close").click(
384            function() {
385                $(this).parent().hide();
386                return false;
387            }
388        );     
389
390        // Navigation
391        
392        $(".nav-link").click(
393            function() {
394
395                $(".search-form-box").hide();
396                $(".search-header-icon").removeClass("active");
397
398                var submenu = $(this).attr("data-submenu");
399
400                if( $(".mobile-options").is(":visible") ){
401                    //mobile menu
402
403                    var containerWidth = $("header .bottom").outerWidth();
404
405                    $(".nav-link").removeClass("active");
406                    $(this).addClass("active");
407                    $(".nav-submenu").hide();
408
409                    if ( $("header").hasClass("fixed-header") ) $("header").css({"min-height": "100%", "overflow": "auto"});
410                    else $("header").css({"min-height":( $(".nav-submenu." + submenu).height() + $("header .bottom .mobile-top").outerHeight() ), "overflow": "auto"});
411
412                    $("header .bottom").css({"height": 1200 });
413                    
414
415                    $(".nav-submenu." + submenu).show();
416
417                    $("header .bottom .mainnav").animate({left:-containerWidth}, 350);
418                    $("header .bottom .login").fadeOut(400);
419                    $("header .bottom .back").fadeIn(400);
420
421                    
422                    $("header .bottom .nav-submenu").animate({"margin-left":-containerWidth}, 350);                                        
423
424                }else{
425                    //desktop menu
426                    if($(this).hasClass("active")) {
427                        $(this).removeClass("active");
428                        $(".nav-submenu").hide();
429                    } else {
430                        $(".nav-link").removeClass("active");
431                        $(this).addClass("active");
432                        $(".nav-submenu").hide();
433                        $(".nav-submenu." + submenu).slideDown();
434                    }
435
436                }
437                return false;
438            }
439        );        
440        
441        /* back button on mobile menu */
442        $("header a.back").on("click", function(){
443
444            $(".nav-link").removeClass("active");
445            
446
447            $("header .bottom .mainnav").animate({left:0}, 350);
448            $("header .bottom .login").fadeIn(400);
449            $("header .bottom .back").fadeOut(400);
450            
451            if ( $("header").hasClass("fixed-header") ) $("header").css({"min-height": "100%", "overflow": "auto"});
452            else $("header").css({"min-height": ( $("header .mainnav").height() + $("header .top").height() ), "overflow": ""});
453                    
454            $("header .bottom .nav-submenu").animate({"margin-left":0}, 350, function(){
455                $(".nav-submenu").hide();
456            });
457            return false;
458        });
459        /* close navigation */
460        $(".close-menu").on("click", function(){
461            $('header .bottom').animate({"top":-$(window).height()}, 350, function(){
462                $('header .bottom').hide();
463            });
464            $(".nav-link").removeClass("active");
465            $(".fixedbg").fadeOut(450);
466            $("header .bottom .login").delay(400).fadeIn(400);
467            $("header .bottom .back").delay(400).fadeOut(400);
468            $("header .bottom .mainnav").delay(400).animate({left:0}, 350);
469            $("header .bottom .nav-submenu").delay(400).hide(0);
470            $("header").css({"min-height": "1px", "overflow": ""});
471            $("body").css({"overflow":"auto"});
472            return false;
473        });
474        /* show mobile menu */
475        $(".show-nav-link").on("click", function(){
476            $('header .bottom').show();
477            $('header  .bottom').animate({"top":0}, 350);
478            $(".nav-link").removeClass("active");
479            $(".fixedbg").fadeIn(250);
480            $("body").css({"overflow":"hidden"});
481
482            $("header").css({"min-height": ( $("header .mainnav").height()  ), "overflow": ""});
483            
484            return false;
485        });                
486
487        $(document).click(function(e) {
488            var target = e.target;
489
490            if (!$(target).is('.nav-submenu') && !$(target).parents().is('.nav-submenu')) {
491                $('.nav-submenu').hide();
492                $(".nav-link").removeClass("active");
493            }
494        });              
495
496        // Faq
497        
498        $(".faq-show-detail").click(
499            function() {
500                /*
501                if($(this).hasClass("active")) {
502                    $(this).removeClass("active");
503                    //$(".faq-box-detail").slideUp();
504                    $(".faq-box-detail",$(this).parent()).slideUp();
505                } else {
506                    //$(".faq-show-detail").removeClass("active");
507                    $(this).addClass("active");
508                    //$(".faq-box-detail").slideUp();
509                    $(".faq-box-detail",$(this).parent()).slideDown();
510                }
511                */                
512                $(this).toggleClass("active");
513                $(".faq-box-detail",$(this).parent()).slideToggle();                                
514                return false;
515            }
516        );
517
518        // Login box kurz
519        
520        $(".login-box-link").click(
521            function() {
522                $("#sign-in-box-kurz").slideToggle();
523                $(document).scrollTop( $("#fixed-menu-1").offset().top );                                  
524                return false;
525            }
526        );
527
528        // Table term
529        
530        $(".more-link").click(
531            function() {
532                $("#table-term-top").slideToggle();                                
533                return false;
534            }
535        );
536
537        // FRP akce form
538        
539        $("#frp-contact-link").click(
540            function() {
541                $("#frp-contact-link").slideToggle();
542                $("#frp-contact-form").slideToggle();                                
543                return false;
544            }
545        );
546
547        // LEKTOR delsi cv
548        
549        $("#lecturer-more-link").click(
550            function() {
551                $("#lecturer-more-link").slideToggle();
552                $("#lecturer-more-cv").slideToggle();                                
553                return false;
554            }
555        );
556        
557        // Blogy
558
559        $(".dalsi-blogy").click(
560            function() {                                
561                var page_num = $(this).attr("id").split("_");                                
562                var page_next = parseInt(page_num[1]) + 1;
563                var page_button = document.getElementById("page-list_"+page_num[1]);
564                if (page_button != null) {
565                  $(page_button).hide();
566                }                 
567                var page_next_list = document.getElementById("page_"+page_next);
568                if (page_next_list != null) {
569                  $(page_next_list).slideToggle();
570                }                                                                                             
571                return false;
572            }
573        );
574        
575        // Blogy E-book
576        
577        $(".save-ebook").click(
578            function() {
579                $(".detail-newsletter.ebook").slideToggle();                                
580                return false;
581            }
582        );                                
583        
584        // Login
585        
586        $(".login-link").click(
587            function() {
588                $("#sign-in-box").slideToggle();                                
589                return false;
590            }
591        );
592
593        $(".logout").click(
594            function() {
595                document.location.replace("/?logout=1");                                 
596                return false;
597            }
598        );                              
599
600        $(".autoreg-link").click(
601            function() {                
602                $(".registration").slideToggle();                                
603                return false;
604            }
605        );
606
607        $("#podminky-link").click(
608            function() {                
609                $("#podminky-soutez").slideToggle();                                
610                return false;
611            }
612        );
613
614        // Contact
615
616        var contactHeight = $(".main-col-top").height();
617
618        //$(".main-col-top .contact").css("height",contactHeight).css("line-height",contactHeight + "px");
619        $(".main-col-top .contact").css("height",contactHeight + "px");
620
621        // Participants
622
623        // $(".other-participants-form").hide();
624        //$(".form-line.other-address").hide();
625        //$(".sign-in-box.checkout").hide();
626
627        $(".iCheck-helper, label").click(
628            function() {
629                if($("#other-address").parent().hasClass("checked")) {
630                    $(".form-line.other-address").slideUp();
631                } else {
632                    $(".form-line.other-address").slideDown();
633                }
634                if($("#want-to-sign-in").parent().hasClass("checked")) {
635                    $(".sign-in-box.checkout").slideDown();
636                } else {
637                    $(".sign-in-box.checkout").slideUp();
638                }
639                if($("#autoreg").parent().hasClass("checked")) {                    
640                    document.getElementById('autoreg2').value=1;
641                } else {                    
642                    document.getElementById('autoreg2').value=0;
643                }
644                if($("#darek").parent().hasClass("checked")) {
645                    $(".gift-info").slideDown();
646                } else {
647                    $(".gift-info").slideUp();
648                }              
649            }
650        );
651        
652        $(".iCheck-helper").click(
653            function() {
654                if(!$(".same-participant",$(this).parent()).parent().hasClass("checked")) {
655                    $(this).closest(".part").each(
656                        function() {
657                            console.log("prd");
658                            $(".other-participants-form",this).slideDown();
659                        }
660                    );
661                } else {
662                    $(this).closest(".part").each(
663                        function() {
664                            $(".other-participants-form",this).slideUp();
665                        }
666                    );
667                }
668            }
669        );
670        
671        $("label").click(
672            function() {
673                if(!$(".same-participant",$(this).parent()).parent().hasClass("checked")) {
674                    $(this).closest(".part").each(
675                        function() {
676                            console.log("prd");
677                            $(".other-participants-form",this).slideDown();
678                        }
679                    );
680                } else {
681                    $(this).closest(".part").each(
682                        function() {
683                            $(".other-participants-form",this).slideUp();
684                        }
685                    );
686                }
687            }
688        );                
689
690        // Submenu
691
692        $(".list-small-menu-link").click(
693            function() {
694              if( $(".mobile-options").is(":hidden") ){
695                if($(this).hasClass("active")) {
696                    $(this).removeClass("active");
697                    $(".submenu",$(this).parent()).slideUp();
698                } else {
699                    $(".list-small-menu-link").removeClass("active");
700                    $(this).addClass("active");
701                    $(".submenu").slideUp();
702                    $(".submenu",$(this).parent()).slideDown();
703                }
704                return false;
705              }  
706            }
707        );
708
709        colorboxJs();
710        
711        // vlastni doplneni - jan parizek
712        // filtry pro akce
713        $("input[type='checkbox']").on("ifChecked", function(event){
714          var field = $(this).attr("name");                  
715          var akce_vypis = document.getElementById("akce_vypis");
716          if (akce_vypis != null) {
717            var filtry = document.getElementById("filtry_akce").value;
718            var filtry_new = "";
719            if (filtry != "") { filtry_new = filtry + ";" + field; }
720            else { filtry_new = field; }
721            document.getElementById("filtry_akce").value = filtry_new;
722            var filtr = field.split("_"); 
723            if (filtr[0]=="oblast" && filtr.length==2) {
724              var podoblasti = document.getElementById("podoblasti_"+filtr[1]);
725              if (podoblasti != null) {
726                podoblasti.style.display="block";
727              }              
728              var seo_categ = document.getElementById("seo_oblast_"+filtr[1]).value;
729              var seo_old = document.getElementById("seo_categ").value;
730              if (seo_old == "") {                
731                document.getElementById("seo_categ").value = seo_categ;
732              } 
733            }
734            filtr_akce();
735          }
736          var kosik_ucast = $(this).attr("id").split("_");
737          /*
738          if (kosik_ucast[0] == "copy-ucast") {
739            document.getElementById("ucast_"+kosik_ucast[1]).style.display="none"; 
740          }
741          if ($(this).attr("id") == "add_kontfirm") {
742            document.getElementById("kontfirm").style.display="block";
743          }                         
744          if ($(this).attr("id") == "add_kontos") {
745            document.getElementById("kontos").style.display="none";
746          }
747          */
748          var pocet_predsevz = document.getElementById("pocet_predsevz");
749          if (pocet_predsevz != null) {
750            var num = +$("#pocet_predsevz").val() + 1;            
751            if (parseInt(num)>9) {
752              alert ("Již máte označeno 10 předsevzetí. Další už nevybírejte a pokračujte dále na svůj koktejl.");            
753            }
754            $("#pocet_predsevz").val(num);        
755          }                                                      
756        }); 
757
758        $("input[type='checkbox']").on("ifUnchecked", function(event){
759          var field = $(this).attr("name");
760          var akce_vypis = document.getElementById("akce_vypis");
761          if (akce_vypis != null) {
762            var filtry_akce = document.getElementById("filtry_akce").value.split(";");
763            var filtr;
764            var filtry_new = [];
765            var i = 0;
766            for (filtr in filtry_akce) {              
767              if (field != filtry_akce[filtr]) {
768                var field2 = field + "_";
769                var check_podoblast = filtry_akce[filtr].search(field2);
770                if (check_podoblast == -1) {
771                  filtry_new[i] = filtry_akce[filtr];
772                  i = i + 1;
773                }
774              }   
775            }
776            document.getElementById("filtry_akce").value = filtry_new.join(";");
777            var filtr = field.split("_"); 
778            if (filtr[0]=="oblast" && filtr.length==2) {
779              var podoblasti = document.getElementById("podoblasti_"+filtr[1]);
780              if (podoblasti != null) {
781                podoblasti.style.display="none";
782              } 
783            }            
784            filtr_akce();
785          }
786          var kosik_ucast = $(this).attr("id").split("_");
787          /*
788          if (kosik_ucast[0] == "copy-ucast") {
789            document.getElementById("ucast_"+kosik_ucast[1]).style.display="block"; 
790          }
791          if ($(this).attr("id") == "add_kontfirm") {
792            document.getElementById("kontfirm").style.display="none";
793          }                         
794          if ($(this).attr("id") == "add_kontos") {
795            document.getElementById("kontos").style.display="block";
796          }
797          */
798          var pocet_predsevz = document.getElementById("pocet_predsevz");
799          if (pocet_predsevz != null) {
800            var num = +$("#pocet_predsevz").val() - 1;
801            if (num<0) num = 0;
802            $("#pocet_predsevz").val(num);        
803          }             
804        });
805                
806        $('input:radio[name=volba_term]').on("ifChecked", function(event){
807          //zmena terminu na strance kurzu
808          var sel2 = document.getElementById("termin2");
809          $(sel2).select2("val", $(this).val());
810          var sel3 = document.getElementById("termin3");
811          if (sel3 != null) {
812            $(sel3).select2("val", $(this).val());  
813          }
814          lektori_zalozky($(this).val());          
815        });
816        
817        $('input:radio[name=volba_term_mobile]').on("ifChecked", function(event){
818          lektori_zalozky($(this).val());
819        });
820        
821        $('input:radio[name=typ_firma]').on("ifChecked", function(event){
822          if ($(this).val()==1) {
823            document.getElementById("firma_udaj1").style.display="block";
824            //document.getElementById("firma_udaj3").style.display="block";
825            document.getElementById("firma_udaj4").style.display="block";
826            document.getElementById("firma_udaj5").style.display="block";
827          }
828          else {
829            document.getElementById("firma_udaj1").style.display="none";
830            //document.getElementById("firma_udaj3").style.display="none";
831            document.getElementById("firma_udaj4").style.display="none";
832            document.getElementById("firma_udaj5").style.display="none";          
833          }
834        });
835        
836        // filtry reference
837        $(".filtr-reference").click(
838          function() {
839            var field = $(this).attr("id");
840            if($(this).hasClass("active")) {
841              $(this).removeClass("active");                                                         
842              var filtry_ref = document.getElementById("filtry_ref").value.split(";");
843              var filtr;
844              var filtry_new = [];
845              var i = 0;
846              for (filtr in filtry_ref) {
847                if (field != filtry_ref[filtr]) {
848                  filtry_new[i] = filtry_ref[filtr];
849                  i = i + 1;
850                }   
851              }
852              document.getElementById("filtry_ref").value = filtry_new.join(";");          
853              filtr_ref();                                                           
854            } else {
855              $(this).addClass("active");
856              var filtry = document.getElementById("filtry_ref").value;
857              var filtry_new = "";
858              if (filtry != "") { filtry_new = filtry + ";" + field; }
859              else { filtry_new = field; }
860              document.getElementById("filtry_ref").value = filtry_new;
861              filtr_ref();                                                         
862            }
863            return false;
864          }
865        );
866        
867        // prekliknuti terminu v tabulce pri kliku na zalozky u lektoru 
868        $(".lektori_zalozka").click(
869          function() {
870            var field = $(this).attr("id").split("_");
871            $('input:radio[name=volba_term]').iCheck('uncheck');
872            $('input:radio[name=volba_term][value='+ field[2] +']').iCheck('check');            
873            $('input:radio[name=volba_term_mobile]').iCheck('uncheck');
874            $('input:radio[name=volba_term_mobile][value='+ field[2] +']').iCheck('check');
875            $(".period").removeClass("activated");
876            var term_mobile = document.getElementById("term_mobile_"+ field[2]); 
877            $(term_mobile).addClass("activated");  
878            return false;
879          }                    
880        );                                                  
881        
882        // souhlas s cookies
883        $("#eu-cookies-button").on("click", function(){
884            var date = new Date();
885            date.setFullYear(date.getFullYear() + 10);
886            document.cookie = 'eu-cookies=1; path=/; expires=' + date.toGMTString();
887            $('.eu-cookies').hide();            
888            //return false;
889        });
890        
891        // kurzy z testu - zobraz dalsi
892        $("#kurzy-test-more").on("click", function(){
893            $(".box-basic-info").removeClass("hidbox");
894            $(this).addClass("hidbox");          
895            //return false;
896        });        
897        
898    }
899);
900
901$(document).mouseup(function (e)
902{
903    var container = $("#sign-in-box");
904    if (!container.is(e.target) // if the target of the click isn't the container...                 
905        && container.has(e.target).length === 0) // ... nor a descendant of the container
906    {
907        container.hide();
908    }
909    var container = $(".naseptavac");
910    if (!container.is(e.target) // if the target of the click isn't the container...                 
911        && container.has(e.target).length === 0) // ... nor a descendant of the container
912    {
913        container.hide();
914    }
915    var container = $(".search-form-box");
916    if (!container.is(e.target) // if the target of the click isn't the container...                 
917        && container.has(e.target).length === 0) // ... nor a descendant of the container
918    {
919        container.hide();
920    }
921});
922
923
924$(window).scroll(function() {    
925
926    var fixedmenu = document.getElementById("fixed-menu-6");
927    if (fixedmenu != null) {    
928      if(isScrolledIntoView($('#fixed-menu-6')))
929      {
930        //alert('visible');        
931        if(!$(".detail-newsletter").hasClass("active")) {
932            $(".detail-newsletter").addClass("active");
933            $(".detail-newsletter").slideDown();
934        }        
935      }
936    } 
937    
938    var headerHeight = $("header").height();
939    var scrollTop = $(this).scrollTop();
940    
941    if( $(".mobile-options").is(":hidden") ){
942
943        if(scrollTop > (headerHeight - 20)) {
944            $(".fixed-menu-top").show();
945        } else {
946            $(".fixed-menu-top").hide();
947        }
948
949        if(scrollTop > 600) {
950            $(".fixed-anchor-top").show();                                  
951        } else {
952            $(".fixed-anchor-top").hide();
953        }
954
955
956    }else{
957
958        if(scrollTop > (headerHeight*2)) {
959            $("header").addClass("fixed-header");
960            $("body").css({"padding-top":headerHeight});
961        }else{
962            $("header").removeClass("fixed-header");
963            $("body").css({"padding-top":0});
964        }
965        
966        if(scrollTop > 600) {
967            $(".fixed-anchor-top-mobile").show();                                  
968        } else {
969            $(".fixed-anchor-top-mobile").hide();
970        }                    
971
972
973        //kosik  detailu kurzu
974        if( $(".to-bascet-mobile").length>0 ){
975            var hide = $("#tobascethide").offset().top;
976            console.log("scrolltop:"+scrollTop+" hide:"+hide);
977
978            if(scrollTop > hide-$(window).height() ){
979                if( (scrollTop > hide) ) $(".to-bascet-mobile").removeClass("hidebascet");
980                else $(".to-bascet-mobile").addClass("hidebascet");
981            }
982            else $(".to-bascet-mobile").removeClass("hidebascet"); 
983        }
984
985    }
986
987    updateMenuBar();  
988       
989});
990
991
992function isScrolledIntoView(elem)
993{
994    var $elem = $(elem);
995    var $window = $(window);
996
997    var docViewTop = $window.scrollTop();
998    var docViewBottom = docViewTop + $window.height();
999
1000    var elemTop = $elem.offset().top;
1001    var elemBottom = elemTop + $elem.height();
1002
1003    //return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
1004    return ((docViewTop < elemTop) && (docViewBottom > elemBottom));
1005}
1006
1007function filtr_akce() {
1008  var filtry_akce = document.getElementById("filtry_akce").value;
1009  // nove filtrovani pro vypis akci
1010  var akce_vypis = document.getElementById("akce_vypis");
1011  if (akce_vypis != null) {
1012    var aktual_url = document.getElementById("aktual_url").value;
1013    var sort = document.getElementById("sort").value;
1014    var search = document.getElementById("search").value;
1015    var get_dovedn = document.getElementById("get_dovedn").value;
1016    var seo_categ = document.getElementById("seo_categ").value;
1017    var categ_url = "";  
1018    var page_vypis = aktual_url.indexOf("vypis-kurzu");
1019    if (seo_categ != null && seo_categ != "vice-oblasti" && page_vypis == -1) {
1020      var seo_aktual = aktual_url.indexOf(seo_categ);
1021      if (seo_aktual == -1) {
1022        categ_url = seo_categ + "/";
1023      }          
1024    } 
1025		document.location.assign(aktual_url+categ_url+"?"+get_dovedn+"sort="+sort+"&filtry="+filtry_akce+"&search="+search+"#vypis-kurzu");  
1026  }  
1027  else if (filtry_akce != "") {   
1028    var f;
1029    var i = 1;
1030    var akce_zadna = 1;
1031    var akce_zadna_box = document.getElementById("akce_zadna");
1032    $(".box-basic-info").addClass("hidbox");
1033    var akce_pocet = document.getElementById("akce_pocet").value;
1034    while (i <= akce_pocet) {
1035      var akce_ok = 1;
1036      var podoblast_ok = 0;
1037      var akce_box = "akce" + i;
1038      //alert(akce_box);
1039      var akce = document.getElementById(akce_box);
1040      var filtr_predch = "nic";
1041      var filtr_predch2 = "nic";
1042      var filtry = filtry_akce.split(";");
1043      filtry.sort();
1044      for (f in filtry) {
1045        //alert(filtry[f]);
1046        //var filtr = "."+filtry_akce[f];
1047        //$(filtr).removeClass("hidbox");
1048        var filtr = filtry[f].split("_");
1049        if (akce_ok == 0 && filtr[0] != filtr_predch) {
1050          break;
1051        }
1052        // oznaceni akci za ok kdyz pro jejich oblast neni v hledani zaskrtnuta podoblast
1053        if (akce_ok == 1 && filtr[0] == filtr_predch && filtr[1] != filtr_predch2) {
1054          podoblast_ok = 1;
1055        }                   
1056        if ((akce_ok == 0 && filtr[0] == filtr_predch) || (akce_ok == 1 && filtr[0] != filtr_predch)) {
1057         if ($(akce).hasClass(filtry[f])) {
1058          akce_ok = 1;
1059         } 
1060         else {
1061          akce_ok = 0;          
1062         }
1063        }    
1064        // kontrola pro podoblasti - filtr_predch2 obsahuje cislo nadrazene oblasti
1065        if (akce_ok == 1 && filtr[0] == filtr_predch && filtr[1] == filtr_predch2 && filtr.length==3 && podoblast_ok == 0) {         
1066         if ($(akce).hasClass(filtry[f])) {
1067          akce_ok = 1;
1068          podoblast_ok = 1;
1069         } 
1070         else {
1071          akce_ok = 0;          
1072         }          
1073        }          
1074        filtr_predch = filtr[0];
1075        filtr_predch2 = filtr[1];        
1076      }
1077      //alert (akce_ok);
1078      if (akce_ok == 1) {
1079        akce_zadna = 0;
1080        $(akce).removeClass("hidbox");
1081      }
1082      i++;            
1083    }
1084    if (!$(akce_zadna_box).hasClass("hidbox")) {
1085      $(akce_zadna_box).addClass("hidbox");
1086    }     
1087    if (akce_zadna > 0) {  
1088      $(akce_zadna_box).removeClass("hidbox");
1089    }
1090    $(".banner-in-list").addClass("hidbox");              
1091  }
1092  else {
1093    $(".box-basic-info").removeClass("hidbox");
1094  }
1095}
1096
1097function filtr_ref() {
1098  var filtry_ref = document.getElementById("filtry_ref").value
1099  if (filtry_ref != "") {   
1100    var f;
1101    var i = 1;
1102    var ref_zadna = 1;
1103    var ref_zadna_box = document.getElementById("ref_zadna");
1104    $(".box.reference").addClass("hidbox");
1105    var ref_pocet = document.getElementById("ref_pocet").value
1106    while (i <= ref_pocet) {
1107      var ref_ok = 1;
1108      var ref_box = "ref" + i;
1109      //alert(akce_box);
1110      var ref = document.getElementById(ref_box);
1111      var filtr_predch = "nic";
1112      var filtry = filtry_ref.split(";");
1113      filtry.sort();
1114      for (f in filtry) {
1115        //alert(filtry[f]);
1116        //var filtr = "."+filtry_akce[f];
1117        //$(filtr).removeClass("hidbox");
1118        var filtr = filtry[f].split("_");
1119        if (ref_ok == 0 && filtr[0] != filtr_predch) {
1120          break;
1121        }                 
1122        if ((ref_ok == 0 && filtr[0] == filtr_predch) || (ref_ok == 1 && filtr[0] != filtr_predch)) {
1123         if ($(ref).hasClass(filtry[f])) {
1124          ref_ok = 1;
1125         } 
1126         else {
1127          ref_ok = 0;          
1128         }
1129        }        
1130        filtr_predch = filtr[0];      
1131      }
1132      //alert (ref_ok);
1133      if (ref_ok == 1) {
1134        ref_zadna = 0;
1135        $(ref).removeClass("hidbox");
1136      }
1137      i++;            
1138    }
1139    if (!$(ref_zadna_box).hasClass("hidbox")) {
1140      $(ref_zadna_box).addClass("hidbox");
1141    }     
1142    if (ref_zadna > 0) {  
1143      $(ref_zadna_box).removeClass("hidbox");
1144    }              
1145  }
1146  else {
1147    $(".box.reference").removeClass("hidbox");
1148  }
1149}
1150
1151function lektori_zalozky(term) {
1152  $(".lektori_zalozka").removeClass("active");
1153  var lektori_zalozka_active = document.getElementById("lektori_zalozka_"+term);
1154  $(lektori_zalozka_active).addClass("active");
1155  $(".lektori_box").addClass("hidbox");
1156  var lektor_box_active = document.getElementById("lektor_box_"+term);
1157  $(lektor_box_active).removeClass("hidbox");
1158  var sel2 = document.getElementById("termin2");
1159  $(sel2).select2("val", term);
1160  $(".detail-small-box-info .price").removeClass("active");
1161  var cena_active = document.getElementById("price_term_"+term);
1162  $(cena_active).addClass("active");         
1163}
1164
1165function porovnavac_posun(smer) {
1166  var aktual_cislo = document.getElementById("aktual_cislo").value;
1167  var max_cislo = document.getElementById("max_cislo").value;
1168  var cislo_skryj = 0;
1169  var cislo_zobraz = 0;
1170  var aktual_new = 0;
1171  if (smer == "right") {
1172    cislo_skryj = parseInt(aktual_cislo) - 2;
1173    cislo_zobraz = parseInt(aktual_cislo) + 1;
1174    aktual_new = parseInt(aktual_cislo) + 1; 
1175  }
1176  else if (smer == "left") {
1177    cislo_skryj = parseInt(aktual_cislo);
1178    cislo_zobraz = parseInt(aktual_cislo) - 3;
1179    aktual_new = parseInt(aktual_cislo) - 1;
1180  }
1181  if ((aktual_new > max_cislo) || (aktual_new < 3 && max_cislo <= 3)) {
1182    aktual_new = max_cislo;
1183  }
1184  else if (aktual_new < 3 && max_cislo > 3) {
1185    aktual_new = 3;   
1186  }
1187  if (aktual_new == 3) {
1188    $(".bx-prev").addClass("hidbox");
1189  }
1190  else {
1191    $(".bx-prev").removeClass("hidbox");
1192  } 
1193  if (aktual_new == max_cislo) {
1194    $(".bx-next").addClass("hidbox");
1195  }
1196  else {
1197    $(".bx-next").removeClass("hidbox");
1198  } 
1199  document.getElementById("aktual_cislo").value = aktual_new;
1200  if (cislo_skryj > 0 && cislo_skryj <= max_cislo && cislo_zobraz > 0 && cislo_zobraz <= max_cislo) {
1201    $(".col"+cislo_skryj).removeClass("active");
1202    $(".col"+cislo_zobraz).addClass("active");
1203  } 
1204}
1205
1206function animations() {
1207
1208    animationDone = false;
1209
1210    $("span.label:in-viewport").addClass("visible");
1211    $("span.day:in-viewport").addClass("visible");
1212    $(".detail-reviews:in-viewport").each(
1213        function() {
1214            if(animationDone = false) {
1215                animationDone = true;
1216                $(".review p strong",this).animateNumber({ number: 165 });
1217            }
1218        }
1219    );
1220    $(".box-numbers:in-viewport").each(
1221        function() {
1222            if(animationDone == false) {
1223                animationDone = true;
1224                $(".part .number span",this).each(
1225                    function() {
1226                        var number = $(this).attr("data-number");
1227                        $(this).animateNumber({ number: number },1500);
1228                    }
1229                );
1230            }
1231        }
1232    );
1233
1234    $(window).scroll(
1235        function () {
1236            $("span.label:in-viewport").addClass("visible");
1237            $("span.day:in-viewport").addClass("visible");
1238            $(".detail-reviews:in-viewport").each(
1239                function() {
1240                    if(animationDone == false) {
1241                        animationDone = true;
1242                        $(".review p strong",this).each(
1243                            function() {
1244                                var number = $(this).attr("data-number");
1245                                $(this).animateNumber({ number: number },1500);
1246                            }
1247                        );
1248                    }
1249                }
1250            );
1251            $(".box-numbers:in-viewport").each(
1252                function() {
1253                    if(animationDone == false) {
1254                        animationDone = true;
1255                        $(".part .number span",this).each(
1256                            function() {
1257                                var number = $(this).attr("data-number");
1258                                $(this).animateNumber({ number: number },1500);
1259                            }
1260                        );
1261                    }
1262                }
1263            );
1264        }
1265    );
1266
1267    $(".bg-order-check span").css("width","0");
1268    $(".bg-order-check span").animate({
1269        width: 26
1270    },500);
1271
1272    $(".select-options-main-box").hide();
1273    if( $(".mobile-options").is(":hidden") ){
1274      $(".select-options-main-box").slideDown(800);
1275    }
1276}
1277
1278function updateMenuBar() {
1279    var maxScroll = $(document).height() - $(window).height();
1280    var amount = 0;
1281    if (maxScroll > 0) {
1282        amount = ($(window).scrollTop() * 100) / maxScroll;
1283    }
1284
1285    $('#menu-bar').width(amount + '%');
1286}
1287
1288function fixed() {
1289    // Fixed element
1290
1291    /*
1292    if($('.detail-small-box-info').length >= 1 && !$('.detail-small-box-info').hasClass("static")) {
1293        $('.detail-small-box-info').scrollToFixed({
1294            marginTop: 75,
1295            zIndex: 9999,
1296            limit: $(".detail-reviews.long").offset().top - 300,
1297            //limit: $(".detail-recommended").offset().top - 350,
1298            //limit: $("footer").offset().top - 600,
1299            removeOffsets: true
1300        });
1301    }
1302    */
1303    
1304    if($('.detail-kosik-box').length >= 1 && !$('.detail-kosik-box').hasClass("static")) {
1305        $('.detail-kosik-box').scrollToFixed({
1306            marginTop: 60,
1307            zIndex: 9999,
1308            limit: $(".detail-reviews.long").offset().top - 300,
1309            //limit: $(".detail-recommended").offset().top - 350,
1310            //limit: $("footer").offset().top - 600,
1311            removeOffsets: true
1312        });
1313    }    
1314
1315    if($('.list-small-menu').length >= 1 && !$('.list-small-menu').hasClass("static")) {
1316        var listHeight = $('.list-small-menu').height();
1317        $('.list-small-menu').scrollToFixed({
1318            marginTop: 25,
1319            zIndex: 9999,
1320            limit: $("footer").offset().top - listHeight,
1321            removeOffsets: true
1322        });
1323    }
1324
1325    if($('.list-small-menu2').length >= 1 && !$('.list-small-menu2').hasClass("static")) {
1326        var listHeight = $('.list-small-menu2').height();
1327        $('.list-small-menu2').scrollToFixed({
1328            marginTop: 25,
1329            zIndex: 9999,
1330            limit: $("footer").offset().top - listHeight,
1331            removeOffsets: true
1332        });
1333    }
1334
1335    if($('.small-contact-box').length >= 1 && !$('.small-contact-box').hasClass("static")) {
1336        var boxHeight = $('.small-contact-box').height();
1337        $('.small-contact-box').scrollToFixed({
1338            marginTop: 0,
1339            zIndex: 9999,            
1340            limit: $("footer").offset().top - boxHeight,
1341            removeOffsets: true
1342        });
1343    }
1344
1345    /*
1346    if($('.small-menu-box').length >= 1 && !$('.small-menu-box').hasClass("static")) {
1347        var menuBoxHeight = $('.small-menu-box').height();
1348        $('.small-menu-box').scrollToFixed({
1349            marginTop: 25,
1350            zIndex: 9999,
1351            limit: $("footer").offset().top - menuBoxHeight - 110,
1352            removeOffsets: true
1353        });
1354    }*/
1355
1356    if($('.second-detail-small-menu').length >= 1 && !$('.second-detail-small-menu').hasClass("static")) {
1357      if( $(".mobile-options").is(":hidden") ){
1358        var secondHeight = $('.second-detail-small-menu').height();
1359        $('.second-detail-small-menu').scrollToFixed({
1360            marginTop: 99,
1361            zIndex: 9999,
1362            limit: $("footer").offset().top - secondHeight - 37,
1363            //limit: $("footer").offset().top - secondHeight,
1364            removeOffsets: true
1365        });
1366      }  
1367    }
1368    
1369    /*if($('.fixed-banner').length >= 1 && !$('.fixed-banner').hasClass("static")) {
1370        var bannerHeight = $('.fixed-banner').height();
1371        $('.fixed-banner').scrollToFixed({
1372            marginTop: 25,
1373            zIndex: 9999,
1374            limit: $("footer").offset().top - bannerHeight - 120,
1375            removeOffsets: true
1376        });
1377    }*/    
1378}
1379
1380function colorboxJs() {
1381
1382    // password
1383    $("p input[type='password']").hide();
1384    $(".password-text").focus(
1385        function() {
1386            $(this).hide();
1387            $("input[type='password']",$(this).parent()).show();
1388            $("input[type='password']",$(this).parent()).focus();
1389        }
1390    );
1391    $("p input[type='password']").blur(
1392        function() {
1393            var value = $(this).val();
1394            if(value == "") {
1395                $(this).hide();
1396                $(".password-text",$(this).parent()).show();
1397            }
1398        }
1399    );
1400
1401}
1402
1403function data_ares(ico_pole) {
1404  
1405  var vyplneno_dobre = false;
1406  //e.preventDefault();
1407
1408  if (ico_pole == "ico_kosik") {
1409    var ico_id = "#ico";
1410    var firma_id = "firma";
1411    //var ulice_id = "adresa";
1412    //var mesto_id = "mesto";
1413    var adresa_id = "adresa";    
1414    var dic_id = "dic"; 
1415  }
1416
1417  vyraz = /^\d{8}$/; //ico
1418  var hodnota_polozky = $(ico_id).val();  
1419  if( hodnota_polozky == "" )
1420    {
1421      alert("Po zjištìní firemních údajù z ARES je nutné vyplnit IÈO!");
1422      vyplneno_dobre = false;
1423    }
1424  else
1425    {
1426      if(!vyraz.test(hodnota_polozky))
1427        {
1428          alert("Špatný formát IÈO - musí mít právì 8 èíslic!");
1429          vyplneno_dobre = false;
1430        }else{ //ok
1431          vyplneno_dobre = true;
1432        }
1433    }
1434
1435  if( vyplneno_dobre == true ){ //pokud je naplnene (a dobre) ICO ve fakturacnich udajich
1436
1437    //ico_ajax = parseInt($(ico_id).val());
1438    ico_ajax = $(ico_id).val();
1439
1440    var url = "/js/ares2.php?ico_ajax_send=" + ico_ajax;
1441
1442    // IE/zbytek svìta
1443    if (window.ActiveXObject) {
1444      httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
1445    } else {
1446      httpRequest = new XMLHttpRequest();
1447    }        
1448    httpRequest.open("GET", url, true);    
1449    httpRequest.onreadystatechange= function () {      
1450      if (httpRequest.readyState == 4) {
1451        if(httpRequest.status == 200) {
1452          var response = httpRequest.responseText;
1453          //alert (response);
1454          var ares_pole = response.split(";");
1455          if (ares_pole[0]) {          
1456            document.getElementById(firma_id).value = ares_pole[1];
1457            if (ico_pole == "ico_cyklus") {
1458              //document.getElementById(adresa_id).value = ares_pole[2] + ", " + ares_pole[3];
1459            }
1460            else {
1461              //document.getElementById(ulice_id).value = ares_pole[2];
1462              //document.getElementById(mesto_id).value = ares_pole[3];
1463              document.getElementById(adresa_id).value = ares_pole[2] + ", " + ares_pole[3];
1464            }            
1465            document.getElementById(dic_id).value = ares_pole[4];            
1466          }
1467          else {
1468            alert (ares_pole[1]);
1469          }          
1470        }
1471        else {
1472          //alert("Chyba pøi naèítání stránky" + httpRequest.status +":"+ httpRequest.statusText);
1473        }
1474      }            
1475    };
1476    httpRequest.send(null);    
1477  }    
1478
1479}

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.