PageSourceSearch

https://www.infotour.ro/static/js/main.js?v=20260925

js infotour.ro collected 2026-09-25 01:06:30 UTC 25,224 bytes, 849 lines download raw bytes

1/* Inits */
2
3function initAjaxReq(){
4	$('.ajax-form').on('submit', function(e){
5        e.preventDefault();
6        var $this = $(this);
7        $.ajax({
8            url: $this.attr('action'),
9            type: $this.attr('method'),
10            dataType: 'json',
11            data: $this.serialize()
12        }).done(function(res){
13            $this.find('.ajax-success, .ajax-error').slideUp();
14            if(res.status == 'success') {
15                $this.find('.ajax-body').hide();
16                $this.find('.ajax-success').html(res.message).slideDown();
17            }
18            if(res.status == 'error') {
19                $this.find('.ajax-error').html(res.message).slideDown();
20            }
21        });
22    });
23}
24
25function initParalax() {
26    $('.parallax-container').jKit('parallax', {
27        'strength': '0.1',
28        'axis': 'x'
29    });
30}
31
32
33// taburile COMPANII AERIENE
34
35function initResponsiveTabsWithLink() {
36    $('#companii-tabs li a').on('click', function(event) {
37    	if($(this).parent().hasClass('active')){
38    		event.preventDefault();
39    	}
40        var parent = $(this).closest(".nav-tabs.nav-responsive");
41        var href = $(this).attr('href');
42        
43
44        if (parent.hasClass('closed')) {
45            parent.removeClass('closed');
46        } else {
47            parent.addClass('closed');
48        }
49
50    });
51}
52
53
54function initResponsiveTabs() {
55    $('.nav-tabs.nav-responsive li a').on('click', function(event) {
56    	
57        var parent = $(this).closest(".nav-tabs.nav-responsive");
58        var href = $(this).attr('href');
59        var swiper = $(href)[0].swiper;
60
61        if (parent.hasClass('closed')) {
62            parent.removeClass('closed');
63        } else {
64            parent.addClass('closed');
65        }
66
67        setTimeout(function() {
68            if (swiper !== undefined) {
69                swiper.update();
70                swiper.slideTo(0);
71            }
72        }, 1); 
73    });
74}
75
76
77
78
79function initSwipers() {
80    $('.swiper-container.single-slider').each(function(index, el) {
81        initSwiperContainer(index, el, 'swiper-single', 1, 1, 0, {}, false, false);
82    });
83	
84    $('.swiper-container.normal-slider').each(function(index, el) {
85        initSwiperContainer(index, el, 'swiper-normal', 3, 1, 0, {
86            480: {
87                slidesPerView: 1,
88                slidesPerGroup: 1
89            },
90            768: {
91                slidesPerView: 2,
92                slidesPerGroup: 1
93            },
94            992: {
95                slidesPerView: 2,
96                slidesPerGroup: 1
97            },
98            1200: {
99                slidesPerView: 3,
100                slidesPerGroup: 1
101            }
102        }, false, false)
103    });
104    
105    //carousel 5 elemente
106	$('.swiper-container.obj-cat-slider').each(function(index, el) {
107        initSwiperContainer(index, el, 'swiper-obj-cat', 5, 1, 0, {
108            480: {
109                slidesPerView: 2,
110                slidesPerGroup: 1
111            },
112            768: {
113                slidesPerView: 3,
114                slidesPerGroup: 1
115            },
116            992: {
117                slidesPerView: 4,
118                slidesPerGroup: 1
119            },
120            1200: {
121                slidesPerView: 5,
122                slidesPerGroup: 1
123            }
124        }, false, false)
125    });
126	
127	//carousel 6 elemente bilete avion
128	$('.promo-companies-small .swiper-container.plane-tickets-search-results-slider').each(function(index, el) {
129        initSwiperContainer(index, el, 'swiper-plane-search', 6, 1, 0, {
130            480: {
131                slidesPerView: 2,
132                slidesPerGroup: 1
133            },
134            768: {
135                slidesPerView: 3,
136                slidesPerGroup: 1
137            },
138            992: {
139                slidesPerView: 4,
140                slidesPerGroup: 1
141            },
142            1200: {
143                slidesPerView: 6,
144                slidesPerGroup: 1
145            }
146        }, false, false)
147    });
148
149    $('.companies-slider-airports .swiper-container.plane-tickets-search-results-slider').each(function(index, el) {
150        initSwiperContainer(index, el, 'swiper-plane-search', 4, 1, 0, {
151            480: {
152                slidesPerView: 2,
153                slidesPerGroup: 1
154            },
155            768: {
156                slidesPerView: 3,
157                slidesPerGroup: 1
158            },
159            992: {
160                slidesPerView: 4,
161                slidesPerGroup: 1
162            },
163            1200: {
164                slidesPerView: 4,
165                slidesPerGroup: 1
166            }
167        }, false, false)
168    });
169    
170    //obiective turistice tara
171    $('.swiper-container.country-articles').each(function(index, el) {
172        initSwiperContainer(index, el, 'country-articles', 4, 1, 0, {
173            480: {
174                slidesPerView: 1,
175                slidesPerGroup: 1
176            },
177            768: {
178                slidesPerView: 3,
179                slidesPerGroup: 1
180            },
181            992: {
182                slidesPerView: 4,
183                slidesPerGroup: 1
184            },
185            1200: {
186                slidesPerView: 4,
187                slidesPerGroup: 1
188            }
189        }, false, false)
190    });
191	
192	//carousel 7 elemente bilete avion +/- 3 zile
193	$('.swiper-container.plane-tickets-search-3days-results-slider').each(function(index, el) {
194        initSwiperContainer(index, el, 'swiper-three-days-search', 7, 1, 0, {
195            480: {
196                slidesPerView: 1,
197                slidesPerGroup: 1
198            },
199            768: {
200                slidesPerView: 3,
201                slidesPerGroup: 1
202            },
203            992: {
204                slidesPerView: 4,
205                slidesPerGroup: 1
206            },
207            1200: {
208                slidesPerView: 7,
209                slidesPerGroup: 1
210            }
211        }, false, false)
212    });
213	
214	 //carousel 3 elemente
215	$('.swiper-container.map-slider-other-cities').each(function(index, el) {
216        initSwiperContainer(index, el, 'swiper-other-cities', 3, 1, 0, {
217            480: {
218                slidesPerView: 1,
219                slidesPerGroup: 1
220            },
221            768: {
222                slidesPerView: 2,
223                slidesPerGroup: 1
224            },
225            992: {
226                slidesPerView: 3,
227                slidesPerGroup: 1
228            },
229            1200: {
230                slidesPerView: 3,
231                slidesPerGroup: 1
232            }
233        }, false, false)
234    });
235
236    
237    $('.swiper-container.content-slider').each(function(index, el) {
238        initSwiperContainer(index, el, 'swiper-content', 2, 1, 0,{
239            480: {
240                slidesPerView: 1,
241                slidesPerGroup: 1
242            },
243            768: {
244                slidesPerView: 2,
245                slidesPerGroup: 1
246            },
247            992: {
248                slidesPerView: 2,
249                slidesPerGroup: 1
250            },
251            1200: {
252                slidesPerView: 2,
253                slidesPerGroup: 1
254            }
255        }, false, false)
256    });
257
258    $('.swiper-container.search-history-slider').each(function(index, el) {
259	   initSwiperContainer(index, el, '', 3, 1, 10,{
260            600: {
261                slidesPerView: 1,
262                slidesPerGroup: 1
263            },
264            768: {
265                slidesPerView: 2,
266                slidesPerGroup: 1
267            },
268            992: {
269                slidesPerView: 2,
270                slidesPerGroup: 1
271            },
272            1200: {
273                slidesPerView: 2,
274                slidesPerGroup: 1
275            }
276       }, false, false)
277    });
278}
279
280function initSwiperContainer(index, el, class_name, slidesPerView, slidesPerGroup, spaceBetween, breakpoints, preventClicks, preventClicksPropagation) {
281    $(el).addClass(class_name + index);
282
283    $('.' + class_name + index).swiper({
284        speed: 500,
285        slidesPerView: slidesPerView,
286        slidesPerGroup: slidesPerGroup,
287        pagination: $(el).find('.swiper-pagination'),
288        paginationClickable: $(el).find('.swiper-pagination'),
289        nextButton: $(el).parent().find('.swiper-button-next'),
290        prevButton: $(el).parent().find('.swiper-button-prev'),
291        spaceBetween: spaceBetween,
292        breakpoints: breakpoints,
293        preventClicks : preventClicks,
294        preventClicksPropagation: preventClicksPropagation
295    });
296}
297
298
299function initToTop() {
300    $('.top').on('click', function(e) {
301        e.preventDefault();
302        $('html, body').animate({
303            scrollTop: 0
304        });
305    });
306}
307
308
309
310function initNavigationLamp() {
311    if ($('.main-nav nav ul > li.selected').first().length) {
312        var currentleft = $('.selected').position().left + "px";
313        var currentwidth = $('.selected').css('width');
314        $('.lamp').css({
315            "left": currentleft,
316            "width": currentwidth,
317            "background": "#f15a24"
318        });
319    }
320
321    $('.main-nav nav ul > li').hover(function() {
322        $('.main-nav nav ul > li').removeClass('active');
323        $(this).addClass('active');
324        var currentleft = $('.active').position().left + "px";
325        var currentwidth = $('.active').css('width');
326        $('.lamp').css({
327            "left": currentleft,
328            "width": currentwidth,
329            "background": "#f15a24"
330        });
331    }, function() {
332        $('.main-nav nav ul > li').removeClass('active');
333        if ($('.main-nav nav ul > li.selected').first()) {
334            $('.main-nav nav ul .selected').addClass('active');
335            if ($('.main-nav nav ul > li.selected').first().length) {
336
337	            var currentleft = $('.main-nav nav ul .selected').position().left + "px";
338	            var currentwidth = $('.main-nav nav ul .selected').css('width');               
339            }else{
340                var currentwidth = '0';        
341            }
342            $('.lamp').css({
343                "left": currentleft,
344                "width": currentwidth,
345                "background": "#f15a24"
346            });
347        }       
348    });
349
350    // la click sa ramana banda portocalie pe itemul pe care s-a dat click
351    $('.main-nav nav ul > li a').on('click', function(e){
352        $('.main-nav nav ul > li').off('mouseleave');
353        $('.main-nav nav ul > li').removeClass('active');
354        $(this).parent().addClass('active');
355        var currentleft = $('.active').position().left + "px";
356        var currentwidth = $('.active').css('width');
357        $('.lamp').css({
358            "left": currentleft,
359            "width": currentwidth,
360            "background": "#f15a24"
361        });
362    });
363
364}
365function initNavHover404(){
366    $('.main-nav nav ul').children('li').each(function(){
367        $(this).on('hover', function(){
368            console.log($(this));
369            var currentleft = $(this).position().left + "px";
370            var currentwidth = $(this).css('width');
371             $('.lamp').css({
372                "left": currentleft,
373                "width": currentwidth,
374                "background": "#f15a24"
375            });
376        });
377    });
378}
379function initHamburgerAnimation() {
380    (function() {
381        "use strict";
382        var toggles = document.querySelectorAll(".cmn-toggle-switch");
383
384        for (var i = toggles.length - 1; i >= 0; i--) {
385            var toggle = toggles[i];
386            toggleHandler(toggle);
387        };
388
389        function toggleHandler(toggle) {
390            toggle.addEventListener("click", function(e) {
391                e.preventDefault();
392                (this.classList.contains("active") === true) ? this.classList.remove("active"): this.classList.add("active");
393            });
394        }
395    })();
396}
397
398function initScrollMenu() {
399    if ($(window).width() > 960) {
400        $(window).on("scroll", function() {
401            var fromTop = $(window).scrollTop();
402            if (fromTop > 200) {
403                $('body').addClass('down');
404                $('body.down header').find('#logo').prependTo('body.down header .inner-top-header');
405                $('body.down header').find('.search-input .top-search-form').insertBefore('body.down header .inner-top-header .top-header-menu');
406                $('body.down header').find('.program').insertBefore('body.down header .inner-top-header .top-search-form');
407                $('body.down header').css('top', '0px');
408            } else {
409                $('body').removeClass('down');
410                $('body header').find('#logo').prependTo('body header .inner-middle-header .logo-in div');
411                $('body header').find('.top-search-form').appendTo('body header .inner-middle-header .search-input');
412                $('body header').find('.program').appendTo('body header .inner-middle-header');
413                $('body header').css('top', '-100px');
414            };
415        });
416    }
417}
418
419function initMyAccountDropdown() {
420    $(".my-acc-wrapper").hover(function() {
421        $(this).find('.dropdown').addClass('open');
422    }, function() {
423        $(this).find('.dropdown').removeClass('open');
424    })
425}
426
427
428
429function openNav() {
430    document.getElementById("myNav").style.width = "100%";
431    document.body.className += " lockScroll";
432}
433function closeNav() {
434    document.getElementById("myNav").style.width = "0%";
435    document.body.style.overflow="initial";
436    document.body.className -= " lockScroll";
437}
438
439
440
441/* Go! */
442$(document).ready(function() {
443    //resonsive menu
444   // $('.menu-btn ').on('click',function(){
445        //if($(this).next('.menu-overlay').hasClass('hide')){
446        //   $('menu-overlay').removeClass('hide');
447        //}
448      //  $('#responsive-menu').toggleClass('show');
449       // if($('.menu-overlay').hasClass('show')){
450        //    $('.menu-overlay').removeClass('show');
451        //}
452  //  });
453
454     if($(window).width() < 1200){
455        $('#hotels-grid').find('.grid-elem-wrapper').removeClass('width-large').addClass('width-small');
456        console.log('te');
457    } 
458	
459	$("a[rel^='prettyphoto']").prettyPhoto({
460		social_tools:false, 
461		deeplinking: false, 
462		show_title: true,
463		changepicturecallback: function(){ 
464			$('body').addClass('locked');
465		},
466		callback: function(){ 
467			$('body').removeClass('locked');
468		}
469	});
470	$("a[rel^='prettypopup']").prettyPhoto({
471		social_tools:false, 
472		deeplinking: false, 
473		modal: true,
474		changepicturecallback: function(){ 
475			$('body').addClass('locked');
476		},
477		callback: function(){ 
478			$('body').removeClass('locked');
479		}
480	});
481	
482	//init tooltip	
483	$('[data-toggle="tooltip"]').tooltip();
484	
485    /* Major plugins */
486    initParalax();
487    initSwipers();
488
489    /* Major components */
490   	initResponsiveTabsWithLink();
491    initResponsiveTabs();
492
493    /* Major components */
494    initToTop();
495    initAjaxReq();
496    initNavigationLamp();
497    initNavHover404();
498    initHamburgerAnimation();
499    initScrollMenu();
500    initMyAccountDropdown();
501	
502	// grafic bilete avion
503 	$("#bars li .bar").each(function(key, bar){
504        var percentage = $(this).data('percentage');
505        $(this).animate({
506          'height':percentage+'%'
507        }, 1000);
508  	});
509	
510	
511	//$('.bar-chart').cssCharts({type:"bar"});
512
513	//checkbox select hack
514	$('.checkbox-link').on('click',function(){
515		$('.checkbox-link').children('input').not(this).prop('checked', false);
516		$(this).children('input').prop('checked', true);
517	//	if($(this).parent().parent().hasClass('active') ){
518	//		$(this).children('input').prop('checked', true);
519	//	}
520		
521	});
522	
523	//uncheck box if another one is checked
524	$('.single-choice').on('change', function() {
525		$('.single-choice').not(this).prop('checked', false);  
526	});
527	
528	
529	// in content butonul Afla mai multe
530	$('#show-full-text').on('click', function(e) {
531		e.preventDefault();
532		$('.full-text-toggle p').slice(2).show('fade',750);
533		$(this).addClass("hidden");
534	});	
535	$('#show-full-text').parent().parent().find('.full-text-toggle').each(function(){
536    	$items_to_hide = $(this).find('p');
537	    if($items_to_hide.length <= 2){
538	    	$(this).parent().find('.show-full-text').addClass("hidden");
539	    }
540    });
541	
542    // in content butonul Afla mai multe - unde am mai multe butoane(pag hotel) - trebuie incluit id-ul de mai sus
543    $('.show-full-text').on('click', function(e) {
544        e.preventDefault();
545        $(this).parent().parent().find('div.full-text-toggle p').slice(2).show('fade',750);
546        $(this).addClass("hidden");
547	}); 
548    $('.full-text-toggle').each(function(){
549    	$items_to_hide = $(this).find('p');
550	    if($items_to_hide.length <= 2){
551	    	$(this).parent().find('.show-full-text').addClass("hidden");
552	    }
553    });
554   
555    //in sidebar la filtre expand panel
556    $('.show-full-filter').on('click', function(e) {
557        e.preventDefault();
558        $(this).parent('.form-group').children('.checkbox').slice(10).show('fade',750);
559        $(this).addClass("hidden");
560    });
561
562	$('.guide-slider-read-more').click(function(e){
563		e.preventDefault();
564		$('html, body').animate({scrollTop: 600}, 500);
565	});
566	
567	// hamburger animation sidebar menu
568	$(".sidebar-accordion-button").on("click", function(e){
569		e.preventDefault();
570		$(this).toggleClass("cross");
571        if($(this).parent().next().hasClass('menu')){
572            $(this).parent().next().slideToggle("slow");    
573        }else if( $(this).parent().parent().next().hasClass('responsive-wrapper') ){
574             $(this).parent().parent().next('.responsive-wrapper').slideToggle("slow");
575                        
576        }else if( $(this).parent().parent().parent().next().hasClass('responsive-wrapper')){
577            $(this).parent().parent().parent().next('.responsive-wrapper').slideToggle("slow");    
578        }
579        $(this).closest('.list-group-item').toggleClass('bottom-bordered');
580		
581	});
582    
583	// airports city collapse
584	$(".air-big-link").on("click", function(e){
585		e.preventDefault();
586		$(this).children('button').toggleClass("cross");
587		$(this).next('.airport-collapse-container').slideToggle("slow");
588	});
589	
590	
591	
592	$(".footer-accordion-button").on("click", function(e){
593		e.preventDefault();
594		//$(this).toggleClass("cross");
595		$(this).next().slideToggle("slow");
596	});
597	
598	$(".sidebar-toggle .sidebar-accordion-button").on("click", function(){
599	
600	  $(this).next('ul').slideToggle("slow");
601 	});
602 	
603 	
604 	var side_childs = $('#sidebar-sidebar-menu-content').children();
605 	
606 	side_childs.each(function(){
607 		if($(this).hasClass('active')){
608 			$(this).children('ul').toggleClass('in');
609 			$(this).children().children('button').toggleClass('cross');
610 		}
611 	});
612 	
613 	$('.active.sidebar-toggle button').on('click', function(e){
614 		e.preventDefault();
615 		$(this).toggleClass('cross');
616 	});
617 	
618 	
619 	//if($(".sidebar-toggle .sidebar-toggle-link").hasClass('active')){
620 		//$(this).next('ul').addClass('in');
621 		
622 	//}
623	
624	// sterge borderul ultimului copil
625    $('.hotel-tab-content:last-child').children('.hotel-tab-content-inner').css('border-bottom','none'); 
626
627	//responsive tabs pentru lista continente
628	$('.nav-tabs-responsive > li.active').next().addClass('next');
629	$('.nav-tabs-responsive > li.active').prev().addClass('prev');
630	
631	$('.nav-tabs-responsive > li').on('click',function(e){
632		var $target = $(e.target);
633		var $tabs = $target.closest('.nav-tabs-responsive');
634		var $current = $target.closest('li');
635		var $parent = $current.closest('li.dropdown');
636			$current = $parent.length > 0 ? $parent : $current;
637		var $next = $current.next();
638		var $prev = $current.prev();
639		var updateDropdownMenu = function($el, position){
640		  $el
641			.find('.dropdown-menu')
642			.removeClass('pull-xs-left pull-xs-center pull-xs-right')
643			.addClass( 'pull-xs-' + position );
644		};
645
646		$tabs.find('>li').removeClass('next prev');
647		$prev.addClass('prev');
648		$next.addClass('next');
649		
650		updateDropdownMenu( $prev, 'left' );
651		updateDropdownMenu( $current, 'center' );
652		updateDropdownMenu( $next, 'right' );
653	});
654	
655	
656	//circular graphs
657	$(function(){
658		$('.circliful').circliful();
659	});
660	
661	
662	//pagina tara/harta ascund ultimul element din "vezi si alte orase"
663	$('#other_cities_maps').children().last().addClass('hidden-md hidden-sm hidden-xs');
664	//pagina tara/harta ascund ultimile 2 elem din "vezi si alte tari"
665	$('#other_countries_maps').children().slice(-2).addClass("hidden-xs");
666	
667	
668	$('#collapseMap button.close').on('click', function(){
669	    $('.collapse-map').click();
670	});
671	
672	$('#obj-cat-list li').first().addClass('active');
673	
674	
675	$('body').on('focus', '.form-control', function(){
676		$(this).removeClass('error');
677		$(this).next('span.error').hide();
678	});
679	
680	
681    // Show or hide the sticky footer button
682    $(window).scroll(function() {
683        if ($(this).scrollTop() > 350) {
684            $('.go-top').fadeIn(200);
685        } else {
686            $('.go-top').fadeOut(200);
687        }
688    });
689    
690    // country/city map
691    var listItem =$('#panel-map-localisation .nav-responsive').children('li.active');
692    if(listItem.siblings().length == 0){
693        listItem.addClass('no_dropdown_arrow');
694    }
695
696    // Animate the scroll to top
697    $('.go-top').click(function(event) {
698        event.preventDefault();
699        
700        $('html, body').animate({scrollTop: 0}, 800);
701    })
702        
703	if ( (document.referrer.match(/google\.com/gi) || document.referrer.match(/google\.ro/gi)) && document.referrer.match(/cd/gi) ) {
704		var myString = document.referrer;
705		var r        = myString.match(/cd=(.*?)&/);
706		var rank     = parseInt(r[1]);
707		var kw       = myString.match(/q=(.*?)&/);
708		var p        = document.location.pathname;
709        
710		if (kw[1].length > 0) {
711			var keyWord  = decodeURI(kw[1]);
712			ga('send', 'event', 'Rank Tracker', keyWord, p, rank);
713		}
714	}
715
716
717    //open comments button
718    $('.scrie-com').on('click',function(e){
719        e.preventDefault();
720        $(this).parent().next().show("fade", 500);
721        $(this).parent().next().toggleClass('hidden');
722    });
723
724    
725    // initiaza harta din tabul hidden - pagina de hotel
726    var map;
727    var initialize= function (){
728        //...
729    }
730
731    var resize = function () {
732        if (typeof(map) == "undefined") {
733            // initialize the map. You only need this if you may not have initialized your map when resize() is called.
734            initialize();
735        }else{
736            // okay, we've got a map and we need to resize it
737            var center = map.getCenter();
738            google.maps.event.trigger(map, 'resize');
739            map.setCenter(center);
740        }
741    }
742    //$("#hotel-tab-map").show( setTimeout(function(){ resize(); }, 1000));
743    
744    /*** SMART SEARCH ***/
745
746	$.widget("custom.catcomplete", $.ui.autocomplete, {
747		_renderMenu: function(ul, items) {
748			var self = this,
749				currentCategory = "";
750			$.each(items, function(index, item) {
751				if(item.category != currentCategory) {
752					ul.append('<li class="ui-autocomplete-category"><span class="ui-category-title">'+ item.category +'</span></li>');
753					currentCategory = item.category;
754				}
755				self._renderItemData(ul, item);
756			});
757		},
758		_renderItem: function(ul, item) {
759			/*
760			var pattern = new RegExp(this.term.replace(' ','|'), "gi"),
761				newLabel = item.label.replace(pattern, "<span class='ui-autocomplete-term'>$&</span>");
762			*/
763            return $('<li></li>')
764                .data('item.catcomplete', item)
765                .append("<a>"+ item.label + "</a>")
766                .appendTo(ul);
767        }
768	});
769	$(function(){
770		var smartSearchForm = $('#smart-search');
771			smartSearchCache = {};
772		$('#smart-search-field')
773			// don't navigate away from the field on tab when selecting an item
774			.bind("keydown", function(event) {
775				if(event.keyCode === $.ui.keyCode.TAB && $(this).data("autocomplete").menu.active) {
776					event.preventDefault();
777				}
778			})
779			.catcomplete({
780				delay: 0,
781				minLength: 3,
782				source: function(request, response) {
783					var term = request.term;
784					if(term in smartSearchCache) {
785						response(smartSearchCache[term]);
786						return;
787					}
788					$.getJSON($_base + 'ajax/smart_search.php', request, function(data, status, xhr) {
789						smartSearchCache[term] = data.results; //console.log(data.results);
790						response(data.results);
791					});
792				},
793				select: function(event, ui) {
794					window.location = ui.item.url;
795				},
796				search: function(event, ui) {
797					smartSearchForm.find('input[type=submit]').addClass('loading');
798				},
799				response: function(event, ui) {
800					smartSearchForm.find('input[type=submit]').removeClass('loading');
801				}
802			});
803		});
804	
805		$('#smart-search input[type=text]').on('keyup', function(){
806			if($(this).val().length>40)
807				$('#smart-search input[type=submit]').addClass('shadow');
808			else
809				$('#smart-search input[type=submit]').removeClass('shadow');
810		});
811	
812		var searchFields = $('.search-field');
813		searchFields.tooltip({
814			trigger: 'manual',
815			placement: 'bottom',
816			html: true
817		});
818		searchFields.parents('form').on('submit', function(e) {
819			var $this = $(this),
820				searchField = $this.find('.search-field');
821	
822			if(searchField.val().length<3) {
823				searchField
824					.attr('data-original-title', 'Va rugam sa introduceti cel putin 3 caractere!')
825					.tooltip({
826						trigger: 'manual',
827						placement: 'bottom',
828						html: true
829					})
830					.tooltip('show');
831	
832				e.preventDefault();
833			}
834		});
835		searchFields.on('keydown', function(){
836			$(this).tooltip('hide');
837		});
838
839});
840
841
842
843
844
845
846
847
848
849

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.