PageSourceSearch

https://www.filmquestfest.com/wp-content/themes/eventerra/js/custom.js?ver=1.2.8

js filmquestfest.com collected 2026-10-02 06:17:25 UTC 24,950 bytes, 876 lines download raw bytes

1"use strict";
2
3jQuery(function($){
4
5	if(!!('ontouchstart' in window))
6		jQuery('html').addClass('touch');
7	else
8		jQuery('html').addClass('no-touch');
9		
10	/***********************************/
11	
12	$(window).bind('resize load', function(){
13		var timer=$(this).data('resize_delay_timer');
14		if(timer)	{
15			clearTimeout(timer);
16			timer=false;
17		}
18		
19		timer=setTimeout(function(){
20			$(window).trigger('resize_delay');
21		}, 200);
22		$(this).data('resize_delay_timer', timer);
23	});
24
25	/***********************************/
26		
27	function responsiveListener_init(){
28		var $win=$(window);
29		if($('#eventerra-responsive-mobile-css').length) {
30			var lastWindowSize=$win.width();
31			$win.data('mobile-view',(lastWindowSize<768));
32			
33			$win.resize(function(){
34				var w=$(this).width();
35				if(
36					(w>=768 && lastWindowSize < 768) ||
37					(w<=767 && lastWindowSize > 767)
38				){
39					$win.data('mobile-view',(w<768));
40				}
41				lastWindowSize=w;
42			});
43		} else {
44			$win.data('mobile-view', false);
45		}
46	}
47		
48	/***********************************/	
49	
50	responsiveListener_init();
51	
52	countdown_init();
53	
54	fix_placeholders();
55		
56	menu_init();
57	
58	sliced_gallery_init();
59	
60	masonry_gallery_init();
61	
62	responsive_embed_init();
63	
64	gallery_init(); // important to init after all isotope initializations
65	
66	video_bg_container_init();
67	
68	commentform_fast_validation_init();
69	
70	back_to_top_init();
71	
72	/***********************************/
73	
74	function countdown_init() {
75		
76		if($('#header-countdown').length) {
77			var $obj=$('#header-countdown');
78			var hideseconds=( $obj.data('hideseconds') ? true : false );
79				
80			var label_days=$obj.data('days');
81			var label_hrs=$obj.data('hrs');
82			var label_min=$obj.data('min');
83			var label_sec=$obj.data('sec');
84			
85			var txt=$obj.text().replace( /^\s+/g, '').replace( /\s+$/g, '');
86			var tmp=txt.split(' ');
87			if(tmp.length == 2) {
88				var tmp_d=tmp[0].split('-');
89				var tmp_h=tmp[1].split(':');
90				if(tmp_d.length == 3 && tmp_h.length == 3) {
91					var monthNames = ["zero", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
91November", "December"];
92					tmp_d[1]=parseInt(tmp_d[1]);
93					if(isNaN(tmp_d[1])) {
94						$obj.remove();
95						return;
96					}
97					var timeGMT=$obj.data('gmt');
98					if(typeof(timeGMT) == 'undefined' || timeGMT == '0') {
99						timeGMT='';
100					}
101					var finaldate = new Date(monthNames[tmp_d[1]] + ' ' + tmp_d[2] + ', ' + tmp_d[0] + ' ' + tmp_h[0] + ':' + tmp_h[1] + ':' + tmp_h[2] + ' GMT'+timeGMT);
102					$obj.html('').show();
103					var $days=$('<div class="box-value" />');
104					var $hrs=$('<div class="box-value" />');
105					var $min=$('<div class="box-value" />');
106					if(!hideseconds) {
107						var $sec=$('<div class="box-value" />');
108					}
109					var $days_box=$('<div class="countdown-box box-days" />').append('<div class="box-bg" />').append($days).append('<div class="box-label">'+label_days+'</div>').appendTo($obj);
110					var $hrs_box=$('<div class="countdown-box box-hrs" />').append($hrs).append('<div class="box-label">'+label_hrs+'</div>').appendTo($obj);
111					var $min_box=$('<div class="countdown-box box-min" />').append($min).append('<div class="box-label">'+label_min+'</div>').appendTo($obj);
112					if(!hideseconds) {
113						var $sec_box=$('<div class="countdown-box box-sec" />').append($sec).append('<div class="box-label">'+label_sec+'</div>').appendTo($obj);
114					}
115
116					var now=new Date();
117					if(finaldate > now) {
118					
119						$obj.countdown(finaldate);
120	
121						if(!jQuery('html').hasClass('touch') || !jQuery(window).data('mobile-view')) {
122							
123							var last_offset={
124								totalDays: 0,
125								hours: 0,
126								minutes: 0,
127								seconds: 0
128							}
129							var transformY=83; // %
130							
131							$obj.on('update.countdown', function(event) {
132								$days.text(event.offset.totalDays);
133								$hrs.text(event.offset.hours);
134								$min.text(event.offset.minutes);
135								if(!hideseconds) {
136									$sec.text(event.offset.seconds);
137								}
138		
139								if(last_offset.hours != event.offset.hours) {
140									$hrs_box.find('.box-bg').remove();
141									var k_hrs=(59-event.offset.minutes)/59;
142									$('<div class="box-bg" />').css({
143										opacity: k_hrs,
144										transform: 'translateY('+(k_hrs*transformY)+'%)',
145										animationDuration: (3600-k_hrs*3600)+'s'
146									}).prependTo($hrs_box);
147								}						
148								if(last_offset.minutes != event.offset.minutes) {
149									$min_box.find('.box-bg').remove();
150									var k_min=(59-event.offset.seconds)/59;
151									$('<div class="box-bg" />').css({
152										opacity: k_min,
153										transform: 'translateY('+(k_min*transformY)+'%)',
154										animationDuration: (60-k_min*60)+'s'
155									}).prependTo($min_box);
156								}
157								if(!hideseconds && last_offset.seconds != event.offset.seconds) {
158									$sec_box.find('.box-bg').remove();
159									$('<div class="box-bg" />').prependTo($sec_box);
160								}
161								
162								last_offset=event.offset;
163	   					});
164	   				
165	   				} else {
166	   					// mobile view, no animation
167	   					
168	   					$('<div class="box-bg mobile-bg" />').prependTo($min_box);
169	   					$('<div class="box-bg mobile-bg" />').prependTo($hrs_box);
170							if(!hideseconds) {
171								$('<div class="box-bg mobile-bg" />').prependTo($sec_box);
172							}
173
174							$obj.on('update.countdown', function(event) {
175								$days.text(event.offset.totalDays);
176								$hrs.text(event.offset.hours);
177								$min.text(event.offset.minutes);
178								if(!hideseconds) {
179									$sec.text(event.offset.seconds);
180								}
181	   					});
182	   					
183	   				}
184	   				
185	   			} else {
186   					$('<div class="box-bg mobile-bg" />').prependTo($min_box);
187   					$('<div class="box-bg mobile-bg" />').prependTo($hrs_box);
188						if(!hideseconds) {
189							$('<div class="box-bg mobile-bg" />').prependTo($sec_box);
190						}
191						$days.text(0);
192						$hrs.text(0);
193						$min.text(0);
194						if(!hideseconds) {
195							$sec.text(0);
196						}
197   				}
198
199				} else {
200					$obj.remove();
201				}
202			}	else {
203				$obj.remove();
204			}
205		}
206	}
207	
208	/***********************************/
209	
210	function fix_placeholders() {
211		
212		var input = document.createElement("input");
213	  if(('placeholder' in input)==false) { 
214			jQuery('[placeholder]').focus(function() {
215				var i = jQuery(this);
216				if(i.val() == i.attr('placeholder')) {
217					i.val('').removeClass('placeholder');
218					if(i.hasClass('password')) {
219						i.removeClass('password');
220						this.type='password';
221					}			
222				}
223			}).blur(function() {
224				var i = jQuery(this);	
225				if(i.val() == '' || i.val() == i.attr('placeholder')) {
226					if(this.type=='password') {
227						i.addClass('password');
228						this.type='text';
229					}
230					i.addClass('placeholder').val(i.attr('placeholder'));
231				}
232			}).blur().parents('form').submit(function() {
233				jQuery(this).find('[placeholder]').each(function() {
234					var i = jQuery(this);
235					i.addClass('placeholder-submitting');
236					if(i.val() == i.attr('placeholder'))
237						i.val('');
238				})
239			});
240		}
241	}
242	
243	/***********************************/
244	
245	function menu_init() {
246
247		// Primary Menu
248		
249		$('ul.primary-menu a[href="#"]').removeAttr('href');
250		
251		$('ul.primary-menu-fallback.show-dropdown-symbol li').each(function(){
252			if($(this).children('.sub-menu').length)
253				$(this).addClass('menu-item-has-children');
254		});
255		
256		$('.primary-menu li.megamenu-enable .sub-menu .sub-menu').addClass('megamenu-sub');
257		
258		$('.primary-menu > li.menu-item-has-children').mouseenter(function(){
259			var $obj=$(this).children('.sub-menu');
260			var timer=setTimeout(function(){
261				$obj.css('overflow','visible');
262			}, 200);
263			$obj.data('timer',timer);
264		}).mouseleave(function(){
265			var $obj=$(this).children('.sub-menu');
266			if($obj.data('timer'))
267				clearTimeout($obj.data('timer'));
268			$obj.css('overflow','hidden');
269		});
270
271		var args={
272			popUpSelector: '.sub-menu:not(.megamenu-sub)',
273			autoArrows: false,
274			delay: 150,
275			animation: {opacity: 'show', height: 'show'},
276			animationOut: {},
277			speed: 0,
278			speedOut: 0,
279			disableHI: true,
280			onBeforeHide: function(){
281				jQuery(this).parent().removeClass('omHover');
282			},
283			onShow: function(){
284				jQuery(this).parent().addClass('omHover');
285			}
286		};
287	
288		$('ul.primary-menu').superfish(args);
289		
290		// Secondary Menu
291		
292		var $sec_menu_w=$('.header-extra-dropdown-menu-wrapper');
293		var $sec_button_w=$('.header-extra-dropdown-button-wrapper');
294		$('.header-extra-dropdown-button').click(function(){
295			if($sec_button_w.hasClass('active')) {
296				$sec_menu_w.hide();
297				$sec_button_w.removeClass('active');
298			} else {
299				$sec_menu_w.show(0, function(){
300					$sec_button_w.addClass('active');
301				});
302			}
303		});
304		$sec_button_w.mouseleave(function(){
305			$sec_menu_w.hide();
306			$sec_button_w.removeClass('active');
307		});
308		
309		// Mobile menu		
310		
311		$('ul.primary-mobile-menu a[href="#"]').removeAttr('href');
312
313		$('ul.primary-mobile-menu ul').each(function(){
314			var $li = $(this).parent();
315			var $a = $li.children('a');
316			var $sub = $(this);
317			$a.on('click', function(e){
318				if($li.hasClass('sub-active')) {
319					if(!$a.attr('href')) {
320						e.preventDefault();
321						$li.removeClass('sub-active');
322						$sub.stop(true).slideUp(200, function(){
323							$('li.sub-active', this).removeClass('sub-active').children('ul').hide();
324						});
325					}
326				} else {
327					e.preventDefault();
328					$li.addClass('sub-active');
329					$sub.stop(true).slideDown(200);
330				}
331			});
332		});
333		
334		$('.header-menu-mobile-control').click(function(){
335			$(this).toggleClass('active');
336			$('.primary-mobile-menu-container').slideToggle(200);
337		});
338		
339		// Fit menu
340		
341		$(window).on('load', function(){
342			$(window).on('resize_delay', function(){
343				var $buttons=$('.header-buttons');
344				var gap=($buttons.length ? $buttons.width() : 0);
345				var w=$('.header-menu').width();
346				var $menu=$('.header-menu-primary');
347				if(!$menu.is(':visible')) {
348					var mw=$menu.width();
349				} else {
350					var position=$menu.css('position');
351					$menu.css({ visiblity: 'hidden', position:'absolute'});
352					var mw=$menu.width();
353					$menu.css({ visiblity: 'visible', position:position});
354				}
355				if((mw + gap) > w) {
356					$('.header-menu').addClass('header-menu-trim');
357				} else {
358					$('.header-menu').removeClass('header-menu-trim');
359				}
360			});
361		});
362
363        var offset_adminbar = 0;
364        var $adminbar = $('#wpadminbar');
365        if ($adminbar.length) {
366            if ($adminbar.css('position') == 'fixed') {
367                offset_adminbar = $adminbar.height();
368            }
369        }
370        var offset_menu=0;
371
372        // sticky menu
373		if($('body').hasClass('om-sticky-menu')) {
374            var $holder = $('.header-menu-wrapper-stuck');
375            var $wrapper = $('.header-menu-wrapper');
376            offset_menu = $holder.height();
377            $holder.waypoint({
378                handler: function (direction) {
379                    if (direction == 'down') {
380                        var height = $wrapper.height();
381                        $holder.css('height', height + 'px');
382                        $wrapper.addClass('stuck');
383                    } else {
384                        $wrapper.removeClass('stuck');
385                        $holder.css('height', 'auto');
386                    }
387                },
388                offset: offset_adminbar
389            });
390        }
391
392        // one page navigation
393        if(jQuery().onePageNavOm) {
394            $('ul.primary-menu').onePageNavOm({
395                currentClass: 'current-menu-item',
396                changeHash: false,
397                scrollSpeed: 700,
398				easing: 'easeInOutCirc',
399                scrollThreshold: 0.5,
400                filter: '[href*="#"]',
401                offset: offset_adminbar + offset_menu
402            });
403
404            $('ul.primary-mobile-menu').onePageNavOm({
405                currentClass: 'current-menu-item',
406                changeHash: false,
407                scrollSpeed: 500,
408                easing: 'easeInOutCirc',
409                scrollThreshold: 0.5,
410                filter: '[href*="#"]',
411                offset: offset_adminbar + offset_menu,
412                begin: function(){
413                    $('.header-menu-mobile-control').click();
414                }
415            });
416        }
417
418        // scroll position on load with stiky menu fix
419        if(document.location.hash != '') {
420            var hash=document.location.hash;
421            var $obj=$(hash);
422            if($obj.length) {
423                var gap=offset_adminbar + offset_menu;
424                if(gap) {
425                    $(window).load(function(){
426                        setTimeout(function(){
427                            $('html, body').scrollTop($obj.offset().top - ga
427p);
428                        },50);
429                    });
430                }
431            }
432        }
433    }
434	
435	/*************************************/
436	
437	function gallery_init() {
438		if(jQuery().omSlider) {
439			jQuery('.custom-gallery').each(function(){
440				var $items=jQuery(this).find('.items');
441				var num=$items.find('.item').length;
442				if(num > 1) {
443					
444					var active=0;
445					var hash=document.location.hash.replace('#','');
446					if(hash != '') {
447						var $active=$items.find('.item[rel='+hash+']');
448						if($active.length)
449							active=$active.index();
450					}
451					jQuery(this).append('<div class="controls"><div class="control-prev"><a href="#" class="prev"></a></div><div class="control-next"><a href="#" class="next"></a></div><div class="control-progress"><div class="progress"></div></div></div>');
452					var $controls=jQuery(this).find('.controls');
453					$controls.find('.total').html(num);
454					var args={
455						speed: 400,
456						next: $controls.find('.next'),
457						prev: $controls.find('.prev'),
458						active: active,
459						before: function(currSlide, nextSlide, currSlideNum, nextSlideNum){
460							$controls.find('.progress').css('width',Math.round(nextSlideNum/(num-1)*100)+'%');
461						}
462					};
463					
464					$('.prev, .next', $controls).mousedown(function(){
465						$(this).addClass('mousedown');
466					}).mouseup(function(){
467						$(this).removeClass('mousedown');
468					});
469						
470					/*
471					var $blog=jQuery(this).parents('.blogroll.layout-grid');
472					if($blog.length && jQuery().isotopeOm ) {
473						var $iso=$blog.find('section');
474						args.after=function(){
475							$iso.isotopeOm('layout');
476						};
477					}
478					*/
479					$items.omSlider(args);
480	
481				}
482			});
483		}
484	}
485	
486	
487	/*************************************/
488	
489	function sliced_gallery_init() {
490		
491		jQuery(window).bind('resize load', function(){
492			sliced_gallery_resize();
493		});
494		sliced_gallery_resize();
495		
496	}
497	
498	function sliced_gallery_resize(){
499		
500		$('.gallery-sliced').each(function(){
501			var $cont=$(this);
502			var w=$cont.width();
503			
504			//var mar=Math.floor(w*0.01);
505			var mar=0;
506
507			//2
508			var $box=$cont.find('.gallery-sliced-box-2');
509			if($box.length) {
510				var h1=Math.floor(w*0.6666*0.66579634464751958224543080939948);
511				$box.find('.img-1, .img-2').css('height',h1+'px');
512			}
513			
514			//3
515			var $box=$cont.find('.gallery-sliced-box-3');
516			if($box.length) {
517				$box.find('.img-2').css('margin-bottom',mar+'px');
518				var h2=Math.floor(w*0.3333*0.65274151436031331592689295039164);
519				var h1 = h2*2+mar;
520				$box.find('.img-1').css('height',h1+'px');
521				$box.find('.img-2, .img-3').css('height',h2+'px');
522			}
523						
524			//4
525			var $box=$cont.find('.gallery-sliced-box-4');
526			if($box.length) {
527				$box.find('.img-2, .img-3').css('margin-bottom',mar+'px');
528				var h2=Math.floor(w*0.3333*0.56396866840731070496083550913838);
529				var h1 = h2*3+mar*2;
530				$box.find('.img-1').css('height',h1+'px');
531				$box.find('.img-2, .img-3, .img-4').css('height',h2+'px');
532			}
533			
534			//5
535			var $box=$cont.find('.gallery-sliced-box-5');
536			if($box.length) {
537				var h1 = Math.floor(w*0.3333*0.6649076517150);
538				var h2 = Math.floor(w*0.5*0.66550522648083);
539				$box.find('.img-1, .img-2, .img-3').css('height',h1+'px');
540				$box.find('.img-4, .img-5').css('height',h2+'px');
541			}
542		});
543		
544	}
545	
546	/******************************/
547	
548	function masonry_gallery_init() {
549
550		if(jQuery().isotopeOm) {
551			$('.gallery-masonry').each(function() {
552				
553				var $container=$(this).find('.items');
554				
555		    var args={ 
556			    itemSelector: '.item',
557			    layoutMode: 'masonry'
558			  };
559			  
560				$container.isotopeOm(args);
561				
562				$container.find('img').load(function(){
563					$container.isotopeOm('layout');
564				});
565
566	    });
567		}
568	}
569	
570	/********************************/
571	
572	function responsive_embed_init() {
573		$('.responsive-embed').each(function(){
574			var $obj=$(this).children(':first');
575			if($obj.length) {
576				var w=parseInt($obj.attr('width'));
577				var h=parseInt($obj.attr('height'));
578				if(!isNaN(w) && !isNaN(h) && w > 0 && h > 0) {
579					var r=h/w;
580					$(this).css('padding-bottom',(r*100)+'%');
581				}
582			}
583		});
584	}
585	
586	/*********************************/
587	
588	function video_bg_container_init() {
589		
590		function video_bg_container_fit($obj) {
591
592			var $tmp;
593			if($obj)
594				$tmp=$obj;
595			else
596				$tmp=$('.om-video-bg-container');
597			$tmp.each(function(){
598				
599				var $video=$(this).find('video');
600				if($video.length) {
601					var w = $(this).width();
602					var h = $(this).height();
603
604					var r = w/h;
605					var vr = $video.data('wh-ratio');
606	
607					if (r < vr) {
608						$video
609							.width(h*vr)
610							.height(h);
611						$video
612							.css('top',0)
613							.css('left',-(h*vr-w)/2)
614							.css('height',h);
615	
616					} else {
617						$video
618							.width(w)
619							.height(w/vr);
620						$video
621							.css('top',-(w/vr-h)/2)
622							.css('left',0)
623							.css('height',w/vr);
624					}
625				}
626				
627			});
628			
629		}
630		
631		
632		$('.om-video-bg-container').each(function(){
633			
634			var $container=$(this);
635			var $video=$container.find('video');
636			if($video.length) {
637				
638				$video.get(0).volume=0;
639				
640				$video.data('wh-ratio', 16/9 );
641
642				$video.on('loadedmetadata', function(data) {
643
644					var videoWidth =0;
645					var videoHeight=0;
646					
647					if(this.videoWidth)
648						videoWidth=this.videoWidth;
649					if(this.videoHeight)
650						videoHeight=this.videoHeight;
651
652					if(videoWidth && videoHeight) {
653						var ratio = videoWidth / videoHeight;
654						$video.data('wh-ratio', ratio);
655					}
656					
657					video_bg_container_fit($container);
658					
659				});
660
661			}
662			
663		});
664		
665		$(window).on('resize_delay', function(){
666			video_bg_container_fit();
667		});
668				
669	}
670	
671	/*******************************/
672	
673	function commentform_fast_validation_init() {
674		
675		$('#commentform').submit(function(){
676			var stop=false;
677			$(this).find('input.required, textarea.required').each(function(){
678				if($(this).val() == '') {
679					$(this).addClass('error').on('keyup.validation', function(){
680						$(this).removeClass('error').off('keyup.validation');
681					});
682					stop=true;
683				}
684			});
685			if(stop)
686				return false;
687		});
688		
689	}
690
691	/****************************************/
692	
693	function back_to_top_init() {
694		
695		var $button=$('.om-back-to-top');
696		$button.click(function(){
697			$('html, body').animate({scrollTop:0}, 500);
698			return false;
699		});
700		
701		
702		var button_visible=false;
703		var button_timer;
704 		if($button.length) {
705 			var fn=function(){
706				var st=jQuery(window).scrollTop();
707				if(st > 300 && !button_visible) {
708					$button.addClass('active');
709					button_visible=true;
710				} else if(st < 300 && button_visible) {
711					$button.removeClass('active');
712					button_visible=false;
713				}
714 			}
715			$(window).scroll(fn);
716			fn();
717		}
718		
719	}
720	
721});
722
723/***********************************/
724
725function lightbox_init(args_)
726{
727	var args={
728		deeplinking: false,
729		overlay_gallery: false,
730		opacity: 1,
731		theme: 'om_theme',
732		horizontal_padding: 0,
733		default_width: 1168,
734		default_height: 657,
735		markup: '<div class="pp_pic_holder">'+
736						'<div class="pp_content_container">'+
737							'<div class="pp_content">'+
738								'<div class="pp_loaderIcon"></div>'+
739								'<div class="pp_details">'+
740									'<div class="pp_nav">'+
741										'<a href="#" class="pp_arrow_previous">Previous</a>'+
742										'<p class="currentTextHolder">0/0</p>'+
743										'<a href="#" class="pp_arrow_next">Next</a>'+
744									'</div>'+
745									'<div class="pp_social">{pp_social}</div>'+
746									'<a href="#" class="pp_expand" title="Expand the image">Expand</a>'+
747									'<a class="pp_close" href="#">Close</a>'+
748								'</div>'+
749								'<div class="pp_fade">'+
750									'<div class="pp_hoverContainer">'+
751										'<a class="pp_next" href="#">next</a>'+
752										'<a class="pp_previous" href="#">previous</a>'+
753									'</div>'+
754									'<div id="pp_full_res"></div>'+
755								'</div>'+
756							'</div>'+
757						'</div>'+
758						'<div class="ppt">&nbsp;</div>'+
759					'</div>'+
760					'<div class="pp_overlay"></div>'
761	};
762	if(args_)
763		jQuery.extend(args, args_);
764	
765	//prettyPhoto
766	if(jQuery().prettyPhoto) {
767		jQuery('.om_video_popup_links a[href]').addClass('pp_worked_up').prettyPhoto(args);
768		jQuery('a[rel^="prettyPhoto"]').addClass('pp_worked_up').prettyPhoto(args);
769		jQuery('a[data-rel^="prettyPhoto"]').addClass('pp_worked_up').prettyPhoto(jQuery.extend(args, {hook: 'data-rel'}));
770		var $tmp=jQuery('a').filter(function(){ return /\.(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr('href')); }).not('.pp_worked_up');
771		$tmp.each(function(){
772			if(typeof(jQuery(this).attr('title')) == 'undefined')
773				jQuery(this).attr('title',''); 
774		});
775		$tmp.prettyPhoto(args); 
776	}
777}
778
779/***********************************/
780
781function om_local_scroll_init() {
782
783    var offset_menu=0;
784    // sticky menu
785    if(jQuery('body').hasClass('om-sticky-menu')) {
786        offset_menu = jQuery('.header-menu-wrapper-stuck').height();
787    }
788	
789	jQuery('.wpb_text_column a, a.vc_btn3, .vc_om-click-icon-box a, .vc_om-click-icon-box2 a, .vc_om-teaser a, .vc_om-teaser2 a, .vc_call_to_action a, .vc_om-click-box').filter('[href*="#"]').click(function(e){
790		var URI = location.href.replace(/#.*/, ''); // local url without hash
791		if(this.href && this.hash && this.href.replace(this.hash,'') === URI) {
792			var id=this.hash.slice(1);
793			var $target=jQuery('#'+id);
794			if(!$target.length) {
795				$target=jQuery('a[name="'+id+'"]');
796			}
797				
798			if($target.length) {
799				e.preventDefault();
800				
801				var offset=$target.offset().top - offset_menu;
802				var wh=jQuery(window).height();
803				var dh=jQuery(document).height();
804				if(offset > dh-wh)
805					offset=dh-wh;
806				if(offset < 0)
807					offset=0;
808				jQuery('html, body').animate({scrollTop:offset}, 700, 'easeInOutCirc');
809			}
810		}
811		
812	});
813	
814}
815
816/***********************************/
817
818function sidebar_slide_init() {
819	jQuery(".content-column-sidebar aside").omStickSidebar({
820		container: '.content-columns-wrapper',
821		topGapEl: '#wpadminbar',
822		minWidth: 768
823	});
824}
825
826/********************************/
827
828function page_out_init() {
829
830	if(navigator.userAgent.toLowerCase().indexOf('safari') != -1 && navigator.userAgent.toLowerCase().indexOf('chrome') == -1) {
831		return false;
832	}
833	
834	var timer;
835	
836	jQuery(window).on('pageshow',function(event){
837		if(event.originalEvent.persisted){
838			if(timer) {
839				clearTimeout(timer);
840			}
841			jQuery('.om-closing').remove();
842			jQuery('.om-loading-circle').remove();
843		}
844	});
845	
846	jQuery(window).click(function(e){
847		if(e.target && e.target.tagName == 'A' && e.target.href.toLowerCase().indexOf('mailto:') == 0) {
848			jQuery(window).data('om-last-click',false);
849		} else {
850			var date=new Date();
851			jQuery(window).data('om-last-click',{x: e.clientX, y: e.clientY, time: date.getTime()});
852		}
853	});
854
855	jQuery(window).on('beforeunload', function(e) {
856		var data=jQuery(window).data('om-last-click');
857		if(data) {
858			if(e.srcElement && e.srcElement.activeElement && e.srcElement.activeElement.tagName == 'A' && e.srcElement.activeElement.href.toLowerCase().indexOf('mailto:') == 0) {
859				return;
860			}
861			
862			var date=new Date();
863			if( data.time + 100 > date.getTime() ) {
864				timer=setTimeout(function(){
865					var $closing=jQuery('<div class="om-closing"></div>');
866					jQuery('body').append($closing);
867					$closing.fadeTo(400, .8);
868					timer=setTimeout(function(){
869						jQuery('<div class="om-loading-circle"></div>').appendTo('body').css('z-index','100001').fadeIn(200);
870					},200);
871				},300);
872			}
873		}
874	});
875
876}

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.