PageSourceSearch

https://kow-berlin.com/site/templates/scripts/main.js?v=311074804

js kow-berlin.com collected 2026-10-02 05:48:23 UTC 40,185 bytes, 1,551 lines download raw bytes

1function ua(e){
2	var t = e.toLowerCase(), n = function(e) {
3		return t.indexOf(e)>-1
4	}, r = "gecko", i = "webkit", s = "safari", o = "opera", u = "mobile", a = document.documentElement, f = [!/opera|webtv/i.test(t) && /msie\s(\d)/.test(t) ? "ie ie" + RegExp.$1: n("firefox/2") ? r + " ff2": n("firefox/3.5") ? r + " ff3 ff3_5": n("firefox/3.6") ? r + " ff3 ff3_6": n("firefox/3") ? r + " ff3": n("gecko/") ? r: n("opera") ? o + (/version\/(\d+)/.test(t) ? " " + o + RegExp.$1 : /opera(\s|\/)(\d+)/.test(t) ? " " + o + RegExp.$2 : ""): n("konqueror") ? "konqueror": n("blackberry") ? u + " blackberry": n("android") ? u + " android": n("chrome") ? i + " chrome": n("iron") ? i + " iron": n("applewebkit/") ? i + " " + s + (/version\/(\d+)/.test(t) ? " " + s + RegExp.$1 : ""): n("mozilla/") ? r: "", n("j2me") ? u + " j2me": n("iphone") ? u + " iphone": n("ipod") ? u + " ipod": n("ipad") ? u + " ipad": n("mac") ? "mac": n("darwin") ? "mac": n("webtv") ? "webtv": n("win") ? "win" + (n("windows nt 6.0") ? " vista" : ""): n("freebsd") ? "freebsd": n("x11") || n("linux") ? "linux": "", "js"];
5	c = f.join(" ");
6	a.className += " " + c;
7	return c
8}
9
10var basePath = "",
11    dur = 250,
12		head,
13		dest,
14		sl,
15		tg,
16		ml,
17		ui,
18		n,
19		fItm,
20		attr,
21		node,
22		split,
23		slash,
24		fItems,
25		gridStackData,
26		newHeight,
27		offHeader,
28		filtered,
29		rejoined,
30		location,
31		vidClass,
32		subClass,
33		subNav,
34		headElem,
35		didScroll,
36		offTop,
37		$itemElems,
38		$container,
39		resizeTimeout,
40		biggestHeight,
41		lastScrollTop = 0,
42		delta = 25,
43		element,
44		grid,
45		$grid,
46		$items,
47		gHeight,
48		gWidth,
49		gTop,
50		gLeft,
51		gName,
52		gType,
53		gParam,
54		navbarHeight = $('header').outerHeight();
55
56ua(navigator.userAgent);
57
58function sHeader(){
59		didScroll = true
60}
61
62setInterval(function() {
63
64    if (didScroll) {
65        hasScrolled();
66        didScroll = false;
67    }
68
69}, dur)
70
71function hasScrolled() {
72    var st = $(this).scrollTop();
73
74    if(Math.abs(lastScrollTop - st) <= delta)
75        return;
76
77    if (st > lastScrollTop && st > navbarHeight*2){
78			if($("header nav:nth-of-type(2) ul:nth-child(2) li:not(:empty)").length ||
79			 $('[root="exhibitions"] header').length ||
80			 $('[root="exhibitions-madrid"] header').length ||
81			 $('[root="events"] header').length) {
82	        $('header').addClass('nav-up')
83				} $('.podcast').addClass('collapse')
84    } else {
85        if(st + $(window).height() < $(document).height()) {
86					if($("header nav:nth-of-type(2) ul:nth-child(2) li:not(:empty)").length ||
87					 $('[root="exhibitions"] header').length ||
88					 $('[root="exhibitions-madrid"] header').length ||
89					 $('[root="events"] header').length) {
90	            $('header').removeClass('nav-up')
91						} $('.podcast').removeClass('collapse')
92        }
93    }
94
95    lastScrollTop = st;
96}
97
98$.fn.extend({
99    toggleText: function (a, b){
100        var that = this;
101            if (that.text() != a && that.text() != b){
102                that.text(a);
103            }
104            else
105            if (that.text() == a){
106                that.text(b);
107            }
108            else
109            if (that.text() == b){
110                that.text(a);
111            }
112        return this;
113    }
114})
115
116function thrttl() {
117	if($(".artist").length) {
118		$(".artist").position().top + $(".artist").height() < $(document).scrollTop() ?
119		$("body").addClass("end-artist") : $("body").removeClass("end-artist");
120		navbarHeight*2 < $(document).scrollTop() ?
121		$(".artist > h1").addClass("hide") : $(".artist > h1").removeClass("hide");
122	}
123	if($('.inner .hero').length) {
124		$(".hero").position().top + $(".hero").height() - $('header').outerHeight() < $(document).scrollTop() ?
125		$('header').addClass('on-trail') : $('header').removeClass('on-trail')
126	}
127	if($('[deep]').length) {
128		$("[deep]").position().top + $("[deep]").height() < $(document).scrollTop() ?
129		$('header').addClass('trail-end') : $('header').removeClass('trail-end')
130	}
131	if($('[root="exhibitions"] [sub]').length || $('[root="exhibitions-madrid"] [sub]').length || $('[root="events"] [sub]').length) {
132		$("[sub]").position().top + $("[sub]").height() < $(document).scrollTop() ?
133		$('header').addClass('trail-end') : $('header').removeClass('trail-end')
134	}
135	if($(".landing").length) {
136		$(".landing").first().position().top + $(".landing").first().height() < $(document).scrollTop() ?
137		$("body").addClass("end-artist") : $("body").removeClass("end-artist");
138	}
139	if($(".exhibition").length) {
140		$(window).width() < 641 ? (offHeader = $('header').outerHeight()) : (offHeader = $('header').outerHeight()*5),
141		$(".exhibition").first().position().top + $(".exhibition").first().height() - offHeader  < $(document).scrollTop() ?
142		$("body").addClass("end-artist") : $("body").removeClass("end-artist");
143	}
144	if($('.call-header').length) {
145		$('.exhibition >
145 [ndx-cal-target], [ndx-cal-target]').each(function () {
146        var currCal = $(this),
147            currTarget = currCal.attr('ndx-cal-target');
148        if (currTarget.length) {
149					if (currCal.offset().top <= $(document).scrollTop() && currCal.offset().top + currCal.outerHeight() > $(document).scrollTop()) {
150							$('[ndx-cal-ref]').show();
151              $('.current-cal-view h3').text(currTarget);
152							$('[ndx-cal-ref="'+currTarget+'"]').hide();
153          }
154        }
155     })
156	}
157	if($(".artist").length) {
158
159		var scrollPos = $(document).scrollTop() + ($('header').height()*2);
160    $('.inner nav:nth-child(2) a').each(function () {
161        var currLink = $(this);
162        var refElement = $('.artist [ndx-sub="'+currLink.attr("ndx-ref")+'"]');
163        if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
164            $('.inner nav:nth-child(2) a').removeClass("active");
165            currLink.addClass("active");
166        }
167        else {
168            currLink.removeClass("active");
169        }
170    });
171	}
172}
173
174function moveCal() {
175	$('[ndx-cal-target]:not([ndx-cal-target="Upcoming"])').find('.is-upcoming').insertAfter('[ndx-cal-target="Upcoming"] > h3');
176	$('[ndx-cal-target]:not([ndx-cal-target="Current"])').find('.is-current').insertAfter('[ndx-cal-target="Current"] > h3');
177	if(!$('[ndx-cal-target="Current"] .inner').length){
178		$('[ndx-cal-target="Current"], [ndx-cal-ref="Current"]').remove();
179	}
180	if(!$('[ndx-cal-target="Upcoming"] .inner').length){
181		$('[ndx-cal-target="Upcoming"], [ndx-cal-ref="Upcoming"]').remove();
182	}
183}
184
185function initPlayer(v){
186  const players = Array.from(document.querySelectorAll('.'+v)).map(player => new Plyr(player))
187}
188
189function hvList() {
190
191	$(document).on({
192    mouseenter: function() {
193    	$('header, .podcast').hide()
194    },
195    mouseleave: function() {
196    	$('header, .podcast').show()
197    }
198	}, '.artist-list li')
199
200}
201
202function lngSw(){
203	$('.lang-switch').first().css('display','inline-block')
204}
205
206function tgB(){
207	$('a[href^="http"]').not('a[href*=kow-berlin]').attr('target','_blank');
208	$('p a').not('a[href^="http"], a[href^="mailto"]').attr('ndx-ref','');
209	console.log('done');
210}
211
212function offTags(location,sub){
213	$('.tag-list a').each(function(){
214		tg = $(this).data('tag');
215		split = sub.split("_");
216		if(split.indexOf(tg) > -1) {
217			sl = "off";
218			filtered = split.filter(function(v){ return v!==tg});
219			!filtered.length ? (
220				slash = ""
221			) : (
222				slash = "/"
223			),
224			rejoined = '/idx'+slash+filtered.join("_");
225		} else {
226			sl = "";
227			rejoined = location + '_' + $(this).data('tag');
228		}
229		$(this).attr('href', rejoined).parent().attr('class', sl)
230	})
231}
232
233function filterOff(){
234	$('.fair-list > ul li.active').length == 0 && (
235		$('.fair-list > ul li').show()
236	)
237}
238
239function clearAll(){
240	$('.filter > ul li.active').length > 0 ? (
241		$('.filter label span:nth-child(2)').show()
242	) : (
243		$('.filter label span:nth-child(2)').hide()
244	)
245}
246
247function tagInput(){
248	if($('input[data-multiple]').length){
249	new Awesomplete('input[data-multiple]', {
250		filter: function(text, input) {
251			return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]);
252		},
253		replace: function(text) {
254			var before = this.input.value.match(/^.+,\s*|/)[0];
255			this.input.value = before + text + ", ";
256		}
257	})}
258}
259
260$(document).ready(function(){
261
262	init();
263
264  $(function(){FastClick.attach(document.body)});
265
266	var _t = _.throttle(thrttl, 50);
267	var _h = _.throttle(sHeader, 50);
268	$(window).on('load scroll',_t);
269	$(window).on('load scroll',_h);
270
271
272	var searchOverlay = $("#searchOverlay");
273	var searchInput = $("#searchOverlay input");
274	var delayTimer;
275
276	function doSearch(text) {
277			clearTimeout(delayTimer);
278			delayTimer = setTimeout(function() {
279					searchInput.val().length > 2 && (
280						$.ajax({
281				     type: "POST",
282				     url: '/search/',
283				     data: "q="+searchInput.val(),
284				     success: function(data) {
285							 $('.search-res').html(data)
286						 }})
287					)
288			}, 500);
289	}
290
291	searchOverlay.hide();
292
293	var searchStatus = false;
294
295	window.onkeydown = function (e) {
296	  if(!($(".on-type input").is(":focus"))){
297	  if (!e) e = window.event;
298	  if (!e.metaKey) {
299	    if(e.keyCode >= 65 && e.keyCode <= 90 || e.keyCode >= 48 && e.keyCode <= 57) {
300	        if (!searchStatus) {
301							$('body').addClass('noscroll');
302	            searchOverlay.show();
303	            searchOverlay.find('input').focus();
304	            searchStatus = true;
305	        }
306	    }
307	  }}
308	}
309
310	$(document).keyup(function(e) {
311	      if (e.keyCode == 27 && searchStatus) {
312					$('body').removeClass('noscroll');
313	        searchOverlay.hide();
314	        searchStatus = false;
315			 } else {
316				  doSearch();
317			 }
318	});
319
320	// searchInput.keyup(function() {
321	//     if (searchStatus) {
322	//        if (!this.value) {
323	// 				$('body').removeClass('noscroll');
324	//         searchOverlay.hide();
325	//         searchStatus = false;
326	//         }
327	//     }
328	// });
329
330	$(document).on('click', '.search-res a', function(){
331		$('#searchOverlay').hide();
332		$('body').removeClass('noscroll');
333		searchStatus = false;
334	});
335
336	$("#kow_podcast").kow_cast({
337			jsfolder:"",
338			titleinbarwidthmode:"fixed",
339			timeformatlive:"%CURRENT% / LIVE",
340			volumeimagewidth:24,
341			barbackgroundimage:"",
342			showtime:true,
343			titleinbarwidth:100,
344			showprogress:true,
345			random:false,
346			titleformat:"%TITLE%",
347			height:600,
348			loadingformat:"Loading...",
349			prevnextimage:"",
350			showinfo:false,
351			imageheight:100,
352			loopimage:"",
353			loopimagewidth:24,
354			showstop:false,
355			prevnextimageheight:24,
356			infoformat:"",
357			stopotherplayers:true,
358			showloading:false,
359			forcefirefoxflash:false,
360			showvolumebar:true,
361			imagefullwidth:false,
362			width:"420",
363			showtitleinbar:true,
364			showloop:true,
365			volumeimage:"",
366			playpauseimagewidth:24,
367			loopimageheight:24,
368			tracklistitem:10,
369			tracklistitemformat:"%TITLE%<i p-i='%TITLE%' style='display:none'></i>",
370			prevnextimagewidth:24,
371			tracklistarrowimage:"",
372			playpauseimageheight:24,
373			showbackgroundimage:false,
374			imagewidth:100,
375			stopimage:"",
376			playpauseimage:"",
377			showprevnext:true,
378			backgroundimage:"",
379			autoplay:false,
380			volumebarpadding:8,
381			progressheight:6,
382			showtracklistbackgroundimage:false,
383			titleinbarscroll:true,
384			showtitle:false,
385			defaultvolume:-1,
386			tracklistarrowimageheight:16,
387			heightmode:"auto",
388			titleinbarformat:"%TITLE%",
389			showtracklist:true,
390			stopimageheight:24,
391			volumeimageheight:24,
392			stopimagewidth:24,
393			volumebarheight:80,
394			noncontinous:false,
395			tracklistbackgroundimage:"",
396			showbarbackgroundimage:false,
397			showimage:false,
398			tracklistarrowimagewidth:48,
399			timeformat:"%CURRENT% / %DURATION%",
400			showvolume:true,
401			fullwidth:true,
402			loop:0,
403			preloadaudio:true
404	});
405
406	$('.kow_cast-tracklist').removeAttr('style');
407
408	$(document).on({
409    mouseenter: function() {
410			$(this).addClass('show-podcast');
411    	$('.kow_cast-tracklist').slideDown(dur/2)
412    },
413    mouseleave: function() {
414			$('.podcast').removeClass('show-podcast');
415    	$('.kow_cast-tracklist').slideUp(dur/2)
416    }
417	}, '.podcast');
418
419	$(document).on('click', '[page="kow-tv"] .plyr', function(){
420		$(this).hasClass('plyr--stopped') ? (
421			$('body').addClass('is-playing'),
422			$('.kow_cast-pause').trigger('click')
423		) : (
424			$('body').removeClass('is-playing')
425		)
426	})
427
428	$(document).on('click', '[podcast-item]', function(){
429		$('[p-i="'+$(this).attr('podcast-item')+'"]').trigger('click')
430	})
431
432	$(document).on('click', '.filter label span:first-child', function(){
433		$('.filter').addClass('tg');
434		$(this).hide();
435		$('.filter label span:nth-child(3)').show();
436		clearAll()
437	})
438
439	$(document).on('click', '.filter label span:nth-child(3)', function(){
440		$('.filter').removeClass('tg');
441		$(this).hide();
442		$('.filter label span:first-child').show();
443		$('.filter label span:nth-child(2)').hide();
444	})
445
446	$(document).on('click', '.filter label span:nth-child(2)', function(){
447		$('.fair-list ul li').removeClass('active');
448		$('.fair-list > ul li').show()
449		$(this).hide()
450	})
451
452	$(document).on('click', '.filter li', function(){
453		fItm = $(this).attr('artist-slug');
454		$(this).addClass('active');
455		$('.fair-list > ul li:not(.active)').hide();
456		$('.fair-list > ul li').each(function(){
457			$(this).find('[artist-slug="'+fItm+'"]').closest('li').addClass('active').show()
458		}); clearAll()
459	})
460
461	$(document).on('click', '.filter li.active', function(){
462		fItm = $(this).attr('artist-slug');
463		$(this).removeClass('active');
464		$('.fair-list > ul li').each(function(){
465			$(this).find('[artist-slug="'+fItm+'"]').closest('li').removeClass('active').hide()
466		});
467		filterOff(); clearAll()
468	})
469
470
471
472	/*** mobile ***/
473
474
475	$(document).on("click",".mobile-nav-call",function(){$("body").attr("show-nav","true"==$("body").attr("show-nav")?"false":"true")})
476
477
478	/******* OLD ********/
479
480
481  404 == $("base").attr("ndx--page") && (window.location.href = "/");
482
483        // if(scrollPos > $('.hero > figure').outerHeight()){
484        //   navElem.addClass('trans')
485        // } else {
486        //   navElem.removeClass('trans')
487        // }
488
489
490      // $('[ndx-push-sub]').each(function () {
491      //     var currLink = $(this),
492      //         currSub = currLink.attr('ndx-ref'),
493      //         refElement = $('[ndx-sub="'+currSub+'"]');
494      //     if (refElement.length) {
495      //       var offElement = refElement.position().top - (navElem.outerHeight() * 1.5);
496      //       if (offElement <= scrollPos && offElement + refElement.height() > scrollPos) {
497      //           $('base').attr('ndx--sub', currSub);
498      //       }
499      //     }
500      // });
501
502			/*** Cal Header ***/
503
504			// _.delay(function(){
505			// 	focusHero();
506			// }, dur)
507
508})
509
510$(document).on('click', '.hero .focus-hero label', function(){
511	$('html, body').animate({'scrollTop': $('.focus-l').offset().top}, dur);
512})
513
514$(document).on('click', '.add-tags', function(){
515	$(this).addClass('cancel').text('Cancel');
516	$('.awesomplete').addClass('on-type');
517	_.delay(function(){$('#tags').focus();},dur);
518})
519
520$(document).on('click', '.cancel', function(){
521	$(this).removeClass('cancel').text('Add Tags');
522	$('.awesomplete').removeClass('on-type');
523})
524
525$(document).keyup(function(e) {
526	$('.on-type').length && (
527		$('#tags').val().length ? (
528			$('.add-tags').attr('class','add-tags submit-tags').text('Submit')
529		) : (
530			$('.add-tags').attr('class','cancel add-tags').text('Cancel')
531		)
532	),
533	e.keyCode == 27 && (
534		$('.slider .inner div').length && (
535			$('.close').trigger('click')
536		)
537	)
538})
539
540$(document).on('click', '.submit-tags', function(){
541
542	var tags = $('#tags').val();
543
544	 $(this).attr('class','add-tags').text('Add Tags');
545
546	 tags = $.trim(tags.replace(/\s+/g,' ').replace(/, /g , ',').replace(/ ,/g , ',')),
547			n = "page="+$('#tags').data('page')+"&tags="+tags;
548
549			console.log(n);
550
551	 $.ajax({
552
553    type: "POST",
554    url: '/user-tags/',
555    data: n,
556    success: function(data) {
557
558			var res_tags = $($.parseHTML(data)).filter("#tl").html(),
559					 res_res = $($.parseHTML(data)).filter("#tr").html();
560
561			$('.tags-arr').html(res_tags);
562			$('.awesomplete').removeClass('on-type').find('input').val('');
563			if(res_res.length){
564			$('.message-res').addClass('appear').html(res_res);
565			$('#message')[0].play();
566			_.delay(function(){
567				$('.message-res').removeClass('appear');
568			}, dur*50)
569				$(document).on('click', '.message-res', function(){
570					$(this).removeClass('appear')
571				})
572			}
573
574		}
575
576	})
577
578})
579
580$(document).on('click', '.allow-kiosk figure img', function(){
581
582  var kiosk = '.slider .inner',
583
584      slide = $(this).parent().attr('slide'),
585
586      slides = $.Deferred();
587
588  $(kiosk).empty().removeClass('slick-initialized slick-slider');
589
590		var get_img = $(".allow-kiosk figure img");
591
592
593	$(get_img).each(function(){
594
595		$('<div><div class="img-single lazyload" data-sizes="auto" data-view="'+ $(this).data('view') +'" data-zoom="'+ $(this).data('kiosk-large') +'" data-bgset="'+ $(this).data('kiosk-small') +' 640w, '+ $(this).data('kiosk-large') +' 1024w"></div><figcaption>'+$(this).closest('figure').find('figcaption').text()+'</figcaption></div>').appendTo(kiosk);
596
597		slides.resolve();
598
599	});
600
601  slides.done(function(){
602
603    $(kiosk).slick({
604			dots: false,
605			infinite: true,
606      speed: dur*1.5,
607      prevArrow: '<button type="button" class="slick-prev"></button>',
608      nextArrow: '<button type="button" class="slick-next"></button>',
609			slidesToShow: 1,
610      centerMode: true,
611      variableWidth: true,
612			focusOnSelect: true,
613			centerPadding: '0px',
614			initialSlide: parseInt(slide),
615			draggable: false,
616			responsive: [
617		    {
618		      breakpoint: 768,
619		      settings: {
620		        draggable: true
621		      }
622		    }
623		  ]
624		}).parent().addClass('appear').find('.slick-list').attr('tabindex', 0).focus();
625
626    $('body').addClass('noscroll')
627
628  })
629
630})
631
632$(document).on('click', '.img-single', function(){
633
634	$('body').append('<div class="zoom '+ $(this).data('view') +'"><img src="'+ $(this).data('zoom') +'" /></div>');
635
636	$('.zoom img').mousemove(function(e){
637			magnifier(e);
638	})
639
640	function magnifier(e) {
641    var img = $('.zoom img');
642				img_height = img.height(),
643				img_width = img.width(),
644    		zoom_height = $(window).height(),
645    		zoom_width = $(window).width(),
646				factor_h = (img_height - zoom_height) / zoom_height,
647				factor_w = (img_width - zoom_width) / zoom_width;
648    var yheight = parseInt(e.clientY),
649    		xwidth = parseInt(e.clientX);
650    img.css({
651				transform: 'translateY(0)',
652				top: '-'+(yheight * factor_h) + 'px',
653				left: '-'+(xwidth * factor_w) + 'px'
654			})
655	}
656
657})
658
659$(document).on('click', '.zoom', function(){
660  $(this).remove(),
661	$('.slider .slick-list').attr('tabindex', 0).focus()
662})
663
664$(document).on('click', '.t-edit', function(){
665  	$(this).toggleText('Reset','Zoom Out'),
666	$('.logged-in').toggleClass('edit-mode')
667})
668
669$(document).on('click', '.opt-out-analytics .btn', function(){
670  $(this).parent().hide()
671})
672
673$(document).on('click', '.lang-switch span', function(){
674  $('html').attr('lang',$(this).attr('class'))
675})
676
677$(document).on('click', '[ndx-cal-ref]', function(){
678  $('html, body').stop().animate({scrollTop: $('[ndx-cal-target="'+$(this).attr('ndx-cal-ref')+'"]').offset().top + 5}, dur)
679})
680
681$(document).on('click', '[city]', function(){
682  $('body').attr('city',$(this).attr('city'))
683})
684
685$(document).on('click', '.close', function(){
686  $('body').removeClass('noscroll').find('.slider').removeClass('appear');
687	_.delay(function(){
688		$('.slider .inner').html('')
689	}, dur)
690})
691
692$(document).on('click', 'header nav:nth-of-type(2) ul:nth-child(2) li', function(){
693	$('html, body').stop().animate({'scrollTop': 0}, dur);
694})
695
696$(document).on('click', '[ndx-ref]', function(object) {
697
698  var elem = $(this),
699      addr = elem.attr("href"),
700      strg = [],
701      path = addr.split('/');
702
703  if (window.location.pathname != addr) {
704
705      fnpath(path, strg, addr);
706
707      if (addr.match(/^/)) {
708          history.pushState('', addr, addr);
709      }
710
711  }
712
713  object.preventDefault();
714
715});
716
717
718function getContent(location, page, sub, section, rail, slug) {
719
720	$('body').attr({'root':page,'show-nav':'false'}),
721
722	'complete' === document.readyState && (
723
724    0 == $('main > .inner [page="'+page+'"]').length ? (
725
726      $('body').addClass('wait'),
727
728      $.get('/'+page+'/ajax', function(cntnt) {
729
730        $('main  > .inner').html(cntnt)
731
732        $('html, body').stop().animate({scrollTop:0}, dur).removeClass('wait')
733
734      })
735
736    ) : (
737
738			 void 0 == sub && (
739				 $('[sub],[deep]').remove(),
740				 $('html, body').stop().animate({scrollTop:0}, dur)
741			 )
742
743		),
744
745
746		(void 0 != sub && "focus" != page) && (
747
748			0 == $('main > .inner [sub="'+sub+'"]').length ? (
749
750				$('body').addClass('wait'),
751
752				$.get('/'+page+'/'+sub+'/ajax', function(resp) {
753
754					$('[sub],[deep]').remove(),
755
756					pTimer = setInterval(function() {
757
758						if(0 < $('[page="'+page+'"]').length) {
759
760							switch (page) {
761								case 'idx':
762									$('main > .inner .res-inner').html(resp)
763								break;
764								case 'artists':
765									$('main > .inner .artist-list').before(resp)
766								break;
767								case 'exhibitions':
768									$('main > .inner [page="exhibitions"]').before(resp)
769								case 'exhibitions-madrid':
770									$('main > .inner [page="exhibitions-madrid"]').before(resp)
771								break;
772								case 'events':
773									$('main > .inner [page="events"]').before(resp)
774								break;
775								case 'fairs':
776									$('[fairs-res="'+sub+'"]').html(resp)
777								case 'texts':
778									$('[fairs-res="'+sub+'"]').html(resp)
779								break;
780							}
781
782							(page != "fairs" && page != "texts") && (
783								$('html, body').stop().animate({scrollTop:0}, 0).removeClass('wait')
784							),
785
786							clearInterval(pTimer)
787
788						}
789
790					}, dur)
791
792				})
793
794			) : (
795
796				 void 0 == section && (
797					 $('[deep]').remove()
798				 )
799
800		)),
801
802		void 0 != section ? (
803
804			(0 == $('main > .inner [deep="'+section+'"]').length
805
806				&& "biography" != section
807				&& "dossiers" != section
808				&& "texts-interviews" != section
809				&& "exhibitions-at-kow" != section
810				&& "fairs-events" != section
811				&& "books" != section
812				&& "works" != section
813				&& "reviews" != section
814
815			) && (
816
817				$('body').addClass('wait'),
818
819				$.get('/'+page+'/'+sub+'/'+section+'/ajax', function(wrks) {
820
821					suTimer = setInterval(function() {
822
823						1 == $('[sub="'+sub+'"]').length && (
824
825							$('header').removeClass('on-trail trail-end'),
826
827							$('main > .inner').prepend(wrks),
828
829							$('[deep]:nth-child(2)').remove(),
830
831							$('html, body').stop().animate({scrollTop:0}, 0).removeClass('wait'),
832
833							clearInterval(suTimer)
834
835						)
836
837					}, dur)
838
839				})
840
841			)
842
843		) : (
844
845			$('header').removeClass('on-trail trail-end')
846
847		)
848
849  )
850
851	switch (page) {
852
853		case 'artists':
854
855			$('body').removeClass('end-artist'),
856
857			void 0 != sub ? (
858
859				attr = $('body').attr('has-sub'),
860
861				void 0 == attr && (
862					$('body').attr('has-sub','')
863				),
864
865				dTimer = setInterval(function() {
866
867				1 == $('[sub="'+sub+'"]').length && (
868
869					$('body').removeClass('end-artist'),
870
871					$('body').attr('has-sub') != sub && (
872
873						$('ul.push-right, ul.push-left').html(''),
874
875						$('header .inner nav:nth-child(2) ul:nth-child(2) li:nth-child(1)').html($('[sub="'+sub+'"] > h1').text()),
876						$('body').attr('has-sub', sub),
877
878						$('ul.push-left').append('<li><a href="/'+page+'/'+sub+'/works" ndx-ref="works" class="push-left">Works</a></li>'),
879
880						$('.lrg a').each(function(){
881							$('ul.'+$(this).attr('class')).append('<li>'+$(this)[0].outerHTML+'</li>')
882						}),
883
884						$('figcaption strong').ellipsis({
885						  lines: 2,
886						  ellipClass: 'ellip',
887						  responsive: true
888						})
889
890					),
891
892					clearInterval(dTimer)
893
894				)
895
896			}, dur)
897
898		) : (
899			hvList(),
900			$('body').removeAttr('has-sub'),
901			$('header').removeClass('nav-up'),
902			$('header .inner nav:nth-child(2) ul li').html('')
903		)
904
905			void 0 != section ? (
906
907				sTimer = setInterval(function() {
908
909				1 == $('[deep="'+section+'"]').length && (
910
911					$('.plyr--playing [data-plyr="play"]').trigger('click'),
912					$('[ndx-sub] > .inner,[ndx-deep]').slideUp(dur/1.5),
913					$('.vid-container').each(function(){
914						vidClass = $(this).find('div').attr('class'),
915						void 0 != vidClass && (
916							_.delay(function(){initPlayer(vidClass)}, 1000)
917						)
918					}),
919
920					tgB(),
921					lngSw(),
922
923					!$('.awesomplete').length && (
924					tagInput()),
925					$('body').attr('has-deep',''),
926					$('header .inner nav:nth-child(2) ul:nth-child(2) li:nth-child(2)').html($('.title h1').text()),
927
928					clearInterval(sTimer)
929
930				)
931
932			}, dur),
933
934			"works" == section && (
935				$('html, body').animate({scrollTop: $('[ndx-sub="'+section+'"]').offset().top - ($('header').outerHeight()*1.1)}, dur)
936			),
937			$('[ndx-sub="'+section+'"] > .inner').is(':hidden') && (
938				$('.plyr--playing [data-plyr="play"]').trigger('click'),
939				$('[ndx-sub] > .inner,[ndx-deep]').slideUp(dur/1.5),
940				$('[ndx-sub="'+section+'"] > .inner').slideDown(dur/1.5, function(){
941					$('html, body').animate({scrollTop: $(this).parent().offset().top - ($('header').outerHeight()*1.1)}, dur)
942				})
943
944			),
945
946			void 0 != rail && (
947
948				$('.plyr--playing [data-plyr="play"]').trigger('click'),
949				$('[ndx-deep="'+rail+'"]').slideDown(dur/1.5, function(){
950					$('html, body').animate({scrollTop: $(this).parent().parent().prev().offset().top - ($('header').outerHeight()*1.1)}, dur),
951					$("[ndx-deep]:not([ndx-deep='"+rail+"'])").slideUp(dur)
952					$('.vid-container').each(function(){
953						vidClass = $(this).find('div').attr('class'),
954						void 0 != vidClass && (
955							_.delay(function(){initPlayer(vidClass)}, 1000)
956						)
957					})
958				})
959			)
960
961
962		) : (
963			$('body').removeAttr('has-deep')
964		)
965
966		break;
967
968		case 'exhibitions':
969		case 'events':
970
971			void 0 != sub ? (
972
973				attr = $('body').attr('has-sub'),
974
975				void 0 == attr && (
976					$('body').attr('has-sub','')
977				),
978
979				eTimer = setInterval(function() {
980
981				1 == $('[sub="'+sub+'"]').length && (
982
983					$('body').attr('has-sub') != sub && (
984
985						$('ul.push-right, ul.push-left').html(''),
986
987						$('header .inner nav:nth-child(2) ul:nth-child(2) li:nth-child(1)').html('&nbsp;'),
988						$('body').attr('has-sub', sub),
989
990						$('[sub] h3').each(function(){
991							$('ul.'+$(this).attr('class')).append('<li>'+$(this).html()+'</li>')
992						}),
993
994						$('.vid-container').each(function(){
995							vidClass = $(this).find('div').attr('class'),
996							void 0 != vidClass && (
997								_.delay(function(){initPlayer(vidClass)}, 1000)
998							)
999						}),
1000
1001						tgB(),
1002						lngSw(),
1003						moveCal(),
1004
1005						!$('.awesomplete').length && (
1006						tagInput()),
1007						$('header .inner nav:nth-child(2) ul:nth-child(2) li:nth-child(2)').html($('.title h1').html())
1008
1009					),
1010
1011					clearInterval(eTimer)
1012
1013				)
1014
1015			}, dur)
1016
1017		) : (
1018			pTimer = setInterval(function() {
1019				1 == $('[page="'+page+'"]').length && (
1020					moveCal(),
1021					$('.call-header h3').text($('.call-header').next().attr('ndx-cal-target')),
1022					$('[ndx-cal-target="Current"] h3, [ndx-cal-target="Upcoming"] > h3').addClass('ic'),
1023					clearInterval(pTimer)
1024				)
1025			}, dur),
1026			$('body').removeAttr('has-sub has-deep'),
1027			$('header').removeClass('nav-up'),
1028			$('header .inner nav:nth-child(2) ul li').html('')
1029		),
1030
1031			void 0 != section && (
1032			$('[ndx-sub="'+section+'"] > .inner').is(':hidden') && (
1033				$('[ndx-sub] > .inner').slideUp(dur/1.5),
1034				$('[ndx-sub="'+section+'"] > .inner').slideDown(dur/1.5, function(){
1035					$('html, body').stop().animate({scrollTop: $(this).parent().offset().top - ($('header').outerHeight()*1.1)}, dur)
1036				})
1037			))
1038
1039		break;
1040
1041		case 'idx':
1042		case 'kow':
1043		case 'focus':
1044		case 'kow-tv':
1045		case 'fairs':
1046		case 'texts':
1047		case 'counseling':
1048		case 'about':
1049		case 'news':
1050		case 'contact':
1051		case 'imprint':
1052
1053				$('body').removeClass('end-artist'),
1054
1055				dTimer = setInterval(function() {
1056
1057				0 < $('[page="'+page+'"]').length && (
1058
1059					$('header .inner nav:nth-child(2) ul li').html(''),
1060					$('body').removeAttr('has-sub has-deep'),
1061					$('header').removeClass(),
1062
1063					void 0 != sub ? (
1064						offTags(location,sub)
1065					) : (
1066						$('li').removeClass('off'),
1067						$('.res-inner').html('')
1068					),
1069
1070					void 0 != sub && (
1071						("fairs" == page || "texts" == page) && (
1072								fTimer = setInterval(function() {
1073									1 == $('[page] [sub="'+sub+'"]').length && (
1074									$('html, body').stop().animate({scrollTop:$('[fairs-res="'+sub+'"]').prev().offset().top - ($('header').outerHeight()*1.5)}, dur).removeClass('wait'),
1075									clearInterval(fTimer)
1076								)
1077							}, dur)
1078						)
1079					),
1080
1081					"news" == page && (
1082
1083						$('.fair-list > ul [artist-slug]').each(function(){
1084							$('.filter [artist-slug="'+$(this).attr('artist-slug')+'"]').show()
1085						})
1086
1087					),
1088
1089					"kow" == page && (
1090						$('.is-hero').slick({
1091							dots: false,
1092							infinite: true,
1093							arrows: false,
1094							slidesToShow: 1,
1095							centerMode: true,
1096							variableWidth: true,
1097							autoplay: true,
1098							autoplaySpeed: 5000,
1099							pauseOnHover: false,
1100							pauseOnFocus: false,
1101							draggable: false,
1102							centerPadding: '0px'
1103						}).find('.slick-list').attr('tabindex', 0).focus(),
1104							 Marquee3k(),
1105
1106							 $(function () {
1107							    var options = {
1108							        cellHeight: 100,
1109							        verticalMargin: 0
1110							    }
1111							    $('.grid-stack').gridstack(options),
1112									$('[page="kow"]').length && (
1113									 grid = $('.grid-stack').data( 'gridstack' ),
1114									 grid.cellHeight( grid.cellWidth() * .875 )
1115									)
1116							 }),
1117
1118							 $(window).width() > 641 && (
1119							 $(window).on('resize', function() {
1120								 $('[page="kow"]').length && (
1121							    grid = $('.grid-stack').data( 'gridstack' ),
1122							    grid.cellHeight( grid.cellWidth() * .875 )
1123								 )
1124							 })),
1125
1126							 'complete' === document.readyState && (
1127								 tgB()
1128							 ),
1129							 _.delay(function(){
1130							 $('figure').each(function(){
1131								 vidClass = $(this).find('.vid-container > div').attr('class'), console.log(vidClass),
1132								 void 0 != vidClass && (
1133									 initPlayer(vidClass)
1134								 )
1135							 })}, 1000),
1136
1137							 $('.grid-stack').on('resizestop dragstop', function(event, ui) {
1138
1139								  grid = [];
1140
1141									$('.grid-stack-item.ui-draggable').each(function () {
1142
1143							 		  node = $(this).data('_gridstack_node');
1144											grid.push({
1145												 gLeft: node.x,
1146												 gTop: node.y,
1147												 gWidth: node.width,
1148												 gHeight: node.height,
1149												 gType: $(this).data('item-id')
1150											})
1151
1152									}),
1153
1154										$.ajax({
1155
1156											 type: "POST",
1157											 url: '/landing-grid/',
1158											 data: {'pos': JSON.stringify(grid)}
1159
1160										})
1161
1162								})
1163
1164					),
1165
1166					"kow-tv" == page && (_.delay(function(){
1167						$('.vid-container').each(function(){
1168							vidClass = $(this).find('div').attr('class'),
1169							void 0 != vidClass && (
1170								initPlayer(vidClass)
1171							)
1172						})}, 1000)
1173					),
1174
1175					("focus" == page && void 0 != sub) ? (
1176						fItem = $('[focus="'+sub+'"]').find('.f-i').removeClass('lazyloaded').addClass('lazyload'),
1177						vidLength = $('[focus="'+sub+'"] .vid-outer').length,
1178						vidClass = 'vid_'+Math.floor((Math.random() * 99999999) + 1),
1179						_.delay(function(){$('.focus-d').html(fItem.clone()).prepend(0 != vidLength && ($('[focus="'+sub+'"] .vid-outer')[0].outerHTML)).append($('[focus="'+sub+'"] figcaption')[0].outerHTML).find('.f-i').wrap('<div class="f-d sl" />').parent().wrapAll('<div class="fd-outer" />')},10),
1180						void 0 != vidLength && (
1181							_.delay(function(){$('.focus-d .vid-container > div').attr('class',vidClass)}, 100),
1182							_.delay(function(){initPlayer(vidClass)}, 500)
1183						),
1184						$('body').attr('has-sub',sub),
1185						$('html, body').stop().animate({scrollTop:0}, dur),
1186						fItem.length > 1 && (
1187							_.delay(function(){
1188							$('.fd-outer').slick({
1189								dots: true,
1190								infinite: true,
1191								slidesToShow: 1,
1192								centerMode: true,
1193								variableWidth: true,
1194								prevArrow: '<button type="button" class="slick-prev"></button>',
1195								nextArrow: '<button type="button" class="slick-next"></button>',
1196								autoplay: true,
1197								autoplaySpeed: 5000,
1198								pauseOnHover: false,
1199								pauseOnFocus: false,
1200								draggable: false,
1201								centerPadding: '0px'
1202							}).find('.slick-list').attr('tabindex', 0).focus()},100)
1203						)
1204					) : (
1205						$('body').removeAttr('has-sub'),
1206						$('.focus-d').html('')
1207					),
1208
1209					("focus" == page && void 0 == sub && $(window).width() > 641 && $('.focus-hero > .slick-initialized').length == 0) && (
1210						$('.focus-hero > .inner').slick({
1211							dots: false,
1212							infinite: true,
1213							slidesToShow: 1,
1214							centerMode: true,
1215							variableWidth: true,
1216							prevArrow: '<button type="button" class="slick-prev"></button>',
1217							nextArrow: '<button type="button" class="slick-next"></button>',
1218							autoplay: true,
1219							autoplaySpeed: 8000,
1220							pauseOnHover: true,
1221							pauseOnFocus: false,
1222							draggable: false,
1223							centerPadding: '0px'
1224						}).find('.slick-list').attr('tabindex', 0).focus()
1225					),
1226
1227					clearInterval(dTimer)
1228
1229				)
1230
1231			}, dur)
1232
1233		break;
1234		default:
1235
1236	}
1237
1238	// $('body').attr('page', page);
1239 //
1240	// if(void 0 != sub){
1241	// 	$('body').attr('sub', sub);
1242	// } else {
1243	// 	$('body').attr('sub', '');
1244	// }
1245 //
1246	// if(void 0 != section){
1247	// 	$('body').attr('section', section);
1248	// } else {
1249	// 	$('body').attr('section', '');
1250	// }
1251 //
1252	// if(page == "focus" && void 0 != sub) {
1253 //
1254	// 	$('.focus-d').html('');
1255	// 	$('[focus="'+sub+'"] figure').clone().appendTo('.focus-d')
1256	// 	$('html, body').animate({'scrollTop': 0}, dur);
1257 //
1258	// } else if(page == "fairs" && void 0 != sub) {
1259 //
1260	// 	$('.fair-view').slideUp(dur/3);
1261	// 	$('[ndx-sub="'+sub+'"]').slideDown(dur).find('img').each(function(){
1262	// 		$(this).attr('srcset', $(this).data('srcset'));
1263	// 	});
1264	// 	_.delay(function(){
1265	// 		$('html, body').animate({'scrollTop': $('li a[data-tag="'+sub+'"]').offset().top - 55}, dur);
1266	// 	}, dur)
1267	// 	$('li a[data-tag]').removeClass('active');
1268	// 	$('li a[data-tag="'+sub+'"]').addClass('active');
1269 //
1270	// } else {
1271 //
1272	// $('.focus-d').html('');
1273 //
1274 //  if(void 0 != rail){
1275 //    $('base').attr({
1276 //      'ndx--rail': rail,
1277 //      'ndx--deep': slug
1278 //    });
1279 //
1280	// 	$('[ndx-sub] h2 a').removeClass('active');
1281	// 	$('[ndx-deep] .book-inner').slideUp(dur*.75);
1282 //
1283	// 	switch (section) {
1284	// 		case "texts-interviews":
1285 //
1286	// 			if("complete"===document.readyState){
1287 //
1288	// 				$('base').attr('ndx--main','');
1289	// 				$('[ndx-sub] h2 a').removeClass('active');
1290	// 				(rail == "i") && $('body').addClass('wait');
1291	// 				$.get(location, function(res) {
1292 //
1293	// 						$('[ndx-deep] .res-inner').slideUp(dur*.75);
1294	// 					_.delay(function(){
1295	// 						$('[ndx-sub="texts-interviews"] [ndx-deep]').html('');
1296	// 						$('[ndx-sub="texts-interviews"] [ndx-deep="'+slug+'"]').html(res).closest('ul').find('h2 a').addClass('active');
1297	// 						$('body').removeClass('wait');
1298	// 					}, dur * 3)
1299 //
1300	// 				})
1301	// 			} else {
1302 //
1303	// 				$('.res-inner').appendTo('[ndx-deep="'+slug+'"]').closest('ul').find('h2 a').addClass('active');
1304 //
1305	// 			}
1306 //
1307	// 		break;
1308	// 		case "books":
1309 //
1310	// 		$('[ndx-sub] h2 a').removeClass('active');
1311	// 		$('body').addClass('wait');
1312	// 		_.delay(function(){
1313	// 			$('[ndx-sub="books"] [ndx-deep="'+rail+'"] .book-inner').show().closest('ul').find('h2 a').addClass('active');
1314	// 			$('body').removeClass('wait');
1315	// 		}, dur * 3)
1316 //
1317	// 	}
1318 //
1319 //  } else if($('base').attr('ndx--main') == "true") {
1320 //
1321	// 		if("complete"===document.readyState){
1322 //
1323	// 			$('body').addClass('wait');
1324 //
1325	// 			$.get(location, function(c) {
1326 //
1327	// 				switch (sub) {
1328	// 					case 'tags':
1329 //
1330	// 						// if($('base').attr('ndx--current') == "") {
1331	// 							$('.res-inner').html(c);
1332	// 						// } else {
1333	// 						// 	$('main').html(c);
1334	// 						// }
1335 //
1336	// 						if(section.length){
1337	// 							$('base').attr({
1338	// 								'ndx--sub': 'tags'
1339	// 							});
1340	// 						} else {
1341	// 							$('base').attr({
1342	// 								'ndx--sub': ''
1343	// 							});
1344	// 						}
1345	// 						break;
1346	// 					default: $('main').html(c);
1347 //
1348	// 				}
1349 //
1350	// 				$('base').attr({
1351	// 		      'ndx--main': 'true'
1352	// 		    });
1353 //
1354	// 				$('body').removeClass('wait');
1355 //
1356	// 				$('html, body').animate({'scrollTop': 0}, dur);
1357 //
1358	// 				moveCal();
1359	// 				tagInput();
1360	// 				_.delay(function(){
1361	// 					focusHero();
1362	// 				}, dur)
1363 //
1364	// 				var currFocus = $('[ndx-sub="'+section+'"]'); $('[ndx-sub]').not(currFocus).not('[ndx-sub="works"]').find('.inner').slideUp(dur);
1365	// 				if(currFocus.length){
1366	// 				_.delay(function(){
1367	// 						$('html, body').animate({'scrollTop': currFocus.offset().top - ($('main > nav:nth-child(3)').outerHeight() * 1.25)}, dur);
1368	// 						if(currFocus.not(':visible')){currFocus.find('.inner').slideDown(dur)}
1369	// 				}, dur*1.5);}
1370 //
1371	// 			})
1372 //
1373	// 		}
1374 //
1375 //  } else {
1376 //
1377	// 		$('[ndx-sub="texts-interviews"] [ndx-deep]').html('');
1378	// 		$('[ndx-deep] .book-inner').slideUp(dur*.75);
1379	// 		$('[ndx-sub] h2 a').removeClass('active');
1380	// 		$('base').attr({
1381	//       'ndx--main': ''
1382	//     });
1383 //
1384	// }
1385 //
1386	// if(void 0 != section && $('[ndx-sub="'+section+'"]').length) {
1387 //
1388 //    var currFocus = $('[ndx-sub="'+section+'"]'); $('.elem').not(currFocus).find('.inner').not('.tags').slideUp(dur);
1389 //    _.delay(function(){
1390 //        $('html, body').animate({'scrollTop': currFocus.offset().top - ($('main > nav:nth-child(3)').outerHeight() * 1.25)}, dur);
1391	// 	    if(currFocus.not(':visible')){currFocus.find('.inner').not('.tags').slideDown(dur)}
1392	// 	}, dur*1.5);
1393 //
1394 //  }
1395 //
1396	// if(void 0 != sub) {
1397 //
1398	// 	switch (!null) {
1399	// 		case sub == "current":
1400	// 		case sub == "upcoming":
1401	// 		case sub == sub.match(/^\d+$/):
1402 //
1403	// 			_.delay(function(){
1404	// 				$('html, body').animate({'scrollTop': $('[ndx-cal-target="'+sub.substr(0,1).toUpperCase()+sub.substr(1)+'"]').offset().top - ($('.call-header').outerHeight() * .8)}, dur);
1405	// 			}, dur);
1406 //
1407	// 			break;
1408 //
1409	// 		}
1410 //
1411	// 		switch (sub) {
1412	// 			case 'tags':
1413 //
1414	// 				$('.tag-list a').each(function(){
1415	// 					if(section.indexOf($(this).data('tag')) > -1) {
1416	// 						sl = "off";
1417	// 						dest = location.replace($(this).data('tag'), '').replace(/_/g, '_').replace(/\/_/g, '/').replace(/_$/g,'');
1418	// 					} else {
1419	// 						sl = "";
1420	// 						dest = location + '_' + $(this).data('tag');
1421	// 						dest = dest.replace(/\/_/g, '/');
1422	// 					}
1423	// 					$(this).attr('href', dest).parent().attr('class', sl)
1424	// 				})
1425 //
1426 //
1427	// 				if(section.length){
1428	// 					$('base').attr({
1429	// 						'ndx--sub': 'tags'
1430	// 					});
1431	// 				} else {
1432	// 					$('base').attr({
1433	// 						'ndx--sub': ''
1434	// 					});
1435	// 				}
1436 //
1437	// 				break;
1438 //
1439	// 		}
1440 //
1441	//  }
1442 //
1443 // }
1444
1445}
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476function init(){
1477
1478    var strg = [],
1479        location = window.location.pathname;
1480    if (location.length > 1) {
1481        var path = location.split('/');
1482        if (path != basePath) {
1483            fnpath(path, strg, location)
1484        }
1485    }
1486}
1487
1488function fnpath(path, strg, location){
1489
1490    for (var i = 1; i < path.length; i++) {
1491         var pathParams = path[i];
1492         strg.push(i + "=" + pathParams);
1493    }
1494
1495    var page = path[1],
1496				sub = path[2],
1497        section = path[3],
1498        rail = path[4],
1499        slug = path[5];
1500
1501    getContent(location, page, sub, section, rail, slug);
1502}
1503
1504function uncrypt_mail(s) {
1505    var n = 0;
1506    var r = "";
1507    for(var i = 0; i < s.length; i++)
1508    {
1509        n = s.charCodeAt(i);
1510        if(n >= 8364)
1511        {
1512           n = 128;
1513        }
1514        r += String.fromCharCode(n - 1);
1515    }
1516    return r;
1517}
1518
1519function do_uncrypt_mail(s) {
1520    location.href=uncrypt_mail(s);
1521}
1522
1523window.addEventListener('load', function() {
1524
1525    setTimeout(function() {
1526
1527        window.addEventListener('popstate', function() { init() })
1528
1529    }, 1);
1530
1531});
1532
1533$(window).load(function(){
1534	tgB();
1535	lngSw();
1536	if(navigator.doNotTrack == 1) {
1537    $('.opt-out-analytics').hide()
1538	}
1539	$('.opt-out-analytics').css('opacity', 1);
1540	_.delay(function(){
1541	if($(window).width() > 641 && !$('.cc-banner').hasClass('cc-invisible')){
1542	$('.search-alrt').addClass('appear');
1543	$('#message')[0].play();
1544	_.delay(function(){
1545		$('.search-alrt').removeClass('appear');
1546	}, dur*50)
1547		$(document).on('click', '.search-alrt', function(){
1548			$(this).removeClass('appear')
1549		})
1550	}}, 1000)
1551})

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.