PageSourceSearch

https://heritageireland.ie/assets/themes/heritage_2023/js2/hi.js?ver=2024

js heritageireland.ie collected 2026-10-02 02:29:47 UTC 46,275 bytes, 1,456 lines download raw bytes

1$.extend({
2    replaceTag: function (currentElem, newTagObj, keepProps) {
3        var $currentElem = $(currentElem);
4        var i, $newTag = $(newTagObj).clone();
5        if (keepProps) {//{{{
6            newTag = $newTag[0];
7            newTag.className = currentElem.className;
8            $.extend(newTag.classList, currentElem.classList);
9            $.extend(newTag.attributes, currentElem.attributes);
10        }//}}}
11        $currentElem.wrapAll($newTag);
12        $currentElem.contents().unwrap();
13        return this;  
14    }
15});
16
17$.fn.extend({
18    replaceTag: function (newTagObj, keepProps) {
19        return this.each(function() {
20            jQuery.replaceTag(this, newTagObj, keepProps);
21        });ima
22    }
23});
24
25
26function shuffle(a) {
27    for (let i = a.length - 1; i > 0; i--) {
28        const j = Math.floor(Math.random() * (i + 1));
29        [a[i], a[j]] = [a[j], a[i]];
30    }
31    return a;
32}
33
34
35//////// HERE /////////
36/*  $( function() {
37    var availableTags = [
38"Carrowmore Megalithic Cemetery",
39"Doe Castle",
40"Donegal Castle",
41"Glebe House and Gallery",
42"Glenveagh National Park",
43"Newmills Corn and Flax Mills",
44"Parke's Castle",
45"Seán Mac Diarmada Cottage",
46"Sligo Abbey",
47"Athenry Castle",
48"Aughnanure Castle",
49"Ballycroy National Park",
50"Boyle Abbey",
51"Connemara National Park",
52"Coole Park",
53"Céide Fields",
54"Dun Aonghasa",
55"Ionad Cultúrtha an Phiarsaigh, Conamara",
56"Portumna Castle and Gardens",
57"Rathcroghan",
58"Shannon Region",
59"Adare Castle",
60"Ardfert Cathedral",
61"Burren National Park",
62"Desmond Castle Newcastlewest",
63"Dromore Wood",
64"Ennis Friary",
65"Listowel Castle",
66"Nenagh Castle",
67"Scattery Island Centre",
68"Barryscourt Castle",
69"Charles Fort",
70"Derrynane House",
71"Desmond Castle Kinsale",
72"Doneraile Estate",
73"Fota Arboretum and Gardens",
74"Gallarus Oratory",
75"Ilnacullin - Garinish Island",
76"Ionad an Bhlascaoid Mhóir - The Blasket Centre",
77"Killarney National Park",
78"Muckross House and Gardens",
79"Muckross Traditional Farms",
80"Ross Castle",
81"Skellig Michael",
82"Altamont Gardens",
83"Ballyhack Castle",
84"Cahir Castle",
85"Dungarvan Castle",
86"Dunmore Cave",
87"Famine Warhouse 1848",
88"Ferns Castle",
89"Holy Cross Abbey",
90"Jerpoint Abbey",
91"Kells Priory",
92"Kilkenny Castle",
93"Ormond Castle",
94"Reginald's Tower",
95"Rock of Cashel",
96"St Marys Church Gowran Co Kilkenny",
97"Swiss Cottage",
98"The John F Kennedy Arboretum",
99"The Main Guard",
100"The Wexford Wildfowl Reserve",
101"Tintern Abbey",
102"Battle of the Boyne",
103"Brú na Bóinne Visitor Centre",
104"Castletown House and Parklands",
105"Clonmacnoise",
106"Corlea Trackway Visitor Centre",
107"Dwyer McAllister Cottage",
108"Emo Court",
109"Fore Abbey",
110"Glendalough Visitor Centre",
111"Heywood Gardens",
112"Hill of Tara",
113"Kilmacurragh",
114"Loughcrew",
115"Maynooth Castle",
116"Old Mellifont Abbey",
117"Roscrea Heritage Centre - Roscrea Castle and Damer",
118"Trim Castle",
119"Wicklow Mountains National Park",
120"Aras an Uachtarain",
121"Arbour Hill Cemetery",
122"Casino Marino",
123"Dublin Castle",
124"Farmleigh House and Estate",
125"Garden of Remembrance",
126"Government Buildings",
127"Grangegorman Military Cemetery",
128"Kilmainham Gaol",
129"National Botanic Gardens",
130"Pearse Museum - St Endas Park",
131"Phoenix Park",
132"Phoenix Park - Peoples Flower Gardens",
133"Phoenix Park Visitor Centre - Ashtown Castle",
134"Rathfarnham Castle",
135"Royal Hospital Kilmainham",
136"St Audoens Church",
137"St Stephens Green",
138"The Iveagh Gardens",
139"War Memorial Gardens"
140];
141
142
143      
144      
145      
146    $( "#s" ).autocomplete({
147      source: availableTags
148    });
149  } );*/
150
151
152////////// TO HERE  ///////////
153
154
155
156
157/*var search_suggestions = ["breathtaking castles","lorem ipsum","another suggestion","bertie bowl"];
158 
159  $( function() {
160      var sugg;
161      shuffle(search_suggestions);
162
163 
164      //var sugg = search_suggestions[Math.floor(Math.random()*search_suggestions.length)];
165      
166      for(var i = 0; i < search_suggestions.length; i++) {
167      //search_suggestions.each(function(){
168          sugg= search_suggestions[i];
169          
170          setTimeout(function(){
171              $( "#s" ).attr('placeholder',sugg);
172          },1000);
173      //});
174      }
175      
176      
177  });*/
178
179function randDelay(min, max) {
180	return Math.floor(Math.random() * (max-min+1)+min);
181}
182function printLetter(string, el,count) {
183	// split string into character seperated array
184
185 
186	var arr = string.split(''), phCount =count,
187		input = el,
188		// store full placeholder
189		origString = string,
190		// get current placeholder value
191		curPlace = $(input).attr("placeholder"),
192		// append next letter to current placeholder
193		placeholder = curPlace + arr[phCount];
194		
195	setTimeout(function(){
196		// print placeholder text
197		$(input).attr("placeholder", placeholder);
198		// increase loop count
199		phCount++;
200		// run loop until placeholder is fully printed
201		if (phCount < arr.length) {
202			printLetter(origString, input, phCount);
203		}
204	// use random speed to simulate
205	// 'human' typing
206	}, randDelay(50, 90));
207        
208 
209}  
210function placeholder(searchBar,ph,phCount) {
211	$(searchBar).attr("placeholder", "");
212	printLetter(ph, searchBar,phCount);
213}
214 
215//var search_suggestions = ["Newgrange","Lorem Ipsum","Killkenny Castle","Random Suggestion","Bertie Bowl","Slattery's Caravan","New Graphic Office"];
216
217
218var search_suggestions = ["Magnificent castles",
219"Award-winning visitor centres",
220"Iconic gardens"];
221
222/*var search_suggestions1 = [
223"Carrowmore Megalithic Cemetery",
224"Doe Castle",
225"Donegal Castle",
226"Glebe House and Gallery",
227"Glenveagh National Park",
228"Newmills Corn and Flax Mills",
229"Parke's Castle",
230"Seán Mac Diarmada Cottage",
231"Sligo Abbey",
232"Athenry Castle",
233"Aughnanure Castle",
234"Ballycroy National Park",
235"Boyle Abbey",
236"Connemara National Park",
237"Coole Park",
238"Céide Fields",
239"Dun Aonghasa",
240"Ionad Cultúrtha an Phiarsaigh, Conamara",
241"Portumna Castle and Gardens",
242"Rathcroghan",
243"Shannon Region",
244"Adare Castle",
245"Ardfert Cathedral",
246"Burren National Park",
247"Desmond Castle Newcastlewest",
248"Dromore Wood",
249"Ennis Friary",
250"Listowel Castle",
251"Nenagh Castle",
252"Scattery Island Centre",
253"Barryscourt Castle",
254"Charles Fort",
255"Derrynane House",
256"Desmond Castle Kinsale",
257"Doneraile Estate",
258"Fota Arboretum and Gardens",
259"Gallarus Oratory",
260"Ilnacullin - Garinish Island",
261"Ionad an Bhlascaoid Mhóir - The Blasket Centre",
262"Killarney National Park",
263"Muckross House and Gardens",
264"Muckross Traditional Farms",
265"Ross Castle",
266"Skellig Michael",
267"Altamont Gardens",
268"Ballyhack Castle",
269"Cahir Castle",
270"Dungarvan Castle",
271"Dunmore Cave",
272"Famine Warhouse 1848",
273"Ferns Castle",
274"Holy Cross Abbey",
275"Jerpoint Abbey",
276"Kells Priory",
277"Kilkenny Castle",
278"Ormond Castle",
279"Reginald's Tower",
280"Rock of Cashel",
281"St Marys Church Gowran Co Kilkenny",
282"Swiss Cottage",
283"The John F Kennedy Arboretum",
284"The Main Guard",
285"The Wexford Wildfowl Reserve",
286"Tintern Abbey",
287"Battle of the Boyne",
288"Brú na Bóinne Visitor Centre",
289"Castletown House and Parklands",
290"Clonmacnoise",
291"Corlea Trackway Visitor Centre",
292"Dwyer McAllister Cottage",
293"Emo Court",
294"Fore Abbey",
295"Glendalough Visitor Centre",
296"Heywood Gardens",
297"Hill of Tara",
298"Kilmacurragh",
299"Loughcrew",
300"Maynooth Castle",
301"Old Mellifont Abbey",
302"Roscrea Heritage Centre - Roscrea Castle and Damer",
303"Trim Castle",
304"Wicklow Mountains National Park",
305"Aras an Uachtarain",
306"Arbour Hill Cemetery",
307"Casino Marino",
308"Dublin Castle",
309"Farmleigh House and Estate",
310"Garden of Remembrance",
311"Government Buildings",
312"Grangegorman Military Cemetery",
313"Kilmainham Gaol",
314"National Botanic Gardens",
315"Pearse Museum - St Endas Park",
316"Phoenix Park",
317"Phoenix Park - Peoples Flower Gardens",
318"Phoenix Park Visitor Centre - Ashtown Castle",
319"Rathfarnham Castle",
320"Royal Hospital Kilmainham",
321"St Audoens Church",
322"St Stephens Green",
323"The Iveagh Gardens",
324"War Memorial Gardens"
325];
326*/
327shuffle(search_suggestions);
328function recurse(counter) {
329    var arrLength = search_suggestions.length;
330    var index = counter%arrLength;
331
332    var sugg = search_suggestions[index];
333
334    var ph = sugg,
335	searchBar = $('body.page-template-template-visit #s'),
336	// placeholder loop counter
337	phCount = 0;
338 
339    //$('#s').delay('1200').attr('placeholder',sugg);
340 
341    placeholder(searchBar,ph,phCount);
342    
343    setTimeout(function() {
344       recurse(counter + 1);
345    }, 5000);
346
347}
348
349var search_suggestions2 = ["Search for a place to visit"];
350
351function recurseHome(counter) {
352    var arrLength = search_suggestions2.length;
353    var index = counter%arrLength;
354
355    var sugg = search_suggestions2[index];
356
357    var ph = sugg,
358	searchBar = $('body.home #s'),
359	// placeholder loop counter
360	phCount = 0;
361 
362    //$('#s').delay('1200').attr('placeholder',sugg);
363 
364    placeholder(searchBar,ph,phCount);
365    
366    setTimeout(function() {
367       recurseHome(counter + 1);
368    }, 1115000);
369
370}
371
372
373
374
375$(document).ready(function() {
376/*    recurse(0);
377    
378    $('body.home #s').attr('placeholder','');
379    setTimeout(function(){
380        recurseHome(1);
381    },3000);*/
382    
383});
384
385
386
387
388
389
390
391    $.fn.isInViewport = function() {
392    var elementTop = $(this).offset().top;
393    var elementBottom = elementTop + $(this).outerHeight();
394
395    var viewportTop = $(window).scrollTop();
396    var viewportBottom = viewportTop + $(window).height();
397
398    //return elementBottom > viewportTop && elementTop < viewportBottom;
399    return elementTop < (viewportBottom - 100);
400    //return elementTop > viewportTop && elementBottom < viewportBottom;
401}; 
402
403$.fn.bottomInViewport = function() {
404    var elementTop = $(this).offset().top;
405    var elementBottom = elementTop + $(this).outerHeight();
406
407    var viewportTop = $(window).scrollTop();
408    var viewportBottom = viewportTop + $(window).height();
409
410    return elementBottom > viewportTop && elementBottom < (viewportBottom - ($(window).height()/4));
411};
412
413function isInViewport(node) {
414    var rect = node.getBoundingClientRect()
415    return (
416        (rect.height > 0 || rect.width > 0) &&
417        rect.bottom >= 0 &&
418        rect.right >= 0 &&
419        rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&
420        rect.left <= (window.innerWidth || document.documentElement.clientWidth)
421    )
422}
423
424function getQueryVariable(variable) {
425    var query = window.location.search.substring(1);
426    var vars = query.split("&");
427    for (var i = 0; i < vars.length; i++) {
428        var pair = vars[i].split("=");
429        if (pair[0] == variable) {
430            return pair[1];
431        }
432    }
433    return (false);
434}
435 
436
437
438function backtotop() {
439    $('#footer').prepend('<div id="backtotopholder" class="backtotopholder"><div id="backtotop" class="backtotop"><i></i></div></div>');
440
441
442    $(".backtotop i").css({
443        cursor: "pointer"
444    }).click(function() {
445        $("html, body").animate({
446            scrollTop: 0
447        }, 300);
448        return false;
449    });
450}
451
452
453function sectionmenu() {
454    if ($('#sectionmenu').length > 0) {
455        
456        $('#sectionmenu').addClass('closed');
457        
458        $('#sectionmenu').children('h3').css({cursor: "pointer"}).click(function () {
459
460        if($('#sectionmenu').hasClass('closed')){
461            $('#sectionmenu').removeClass('closed');
462            
463        } else {
464            $('#sectionmenu').addClass('closed');
465            
466        }
467        
468        });
469    }
470}
471function revealtext() {
472    if ($('div.revealer').length > 0) {
473        
474        $('div.revealer>h2').addClass('closed'); 
475        
476        $('div.revealer>h2').css({cursor: "pointer"}).click(function () {
477
478        if($(this).hasClass('closed')){ 
479            $(this).removeClass('closed');
480            
481        } else {
482            $(this).addClass('closed');
483            
484        }
485        
486        });
487    }
488}
489
490function accordion() {
491    if ($('dl.accordion').length > 0) {
492        
493        $('dl.accordion dt').addClass('closed');
494        
495        $('dl.accordion dt').css({cursor: "pointer"}).click(function () {
496
497        if($(this).hasClass('closed')){
498            $(this).removeClass('closed');
499            
500        } else {
501            $(this).addClass('closed');
502            
503        }
504        
505        });
506    }
507}
508
509function faqs() {
510    if (($("dl.faqs").length > 0)) {
511
512        $("dl.faqs dt").each(function () {
513
514            var thebutton = $(this).children('button').eq(0),
515                thediv = $(this).next('dd').eq(0);
516            thediv.hide();
517            thebutton.click(function (e) {
518                if (thebutton.hasClass('open')) {
519
520                    thebutton.removeClass('open');
521                    thebutton.attr('aria-expanded', false);
522                    thediv.slideUp(300,"swing");
523                } else {
524
525                    $(".faqs button.open ").attr('aria-expanded', false);
526                    $(".faqs button.open").parent().next('dd').slideUp(300,"swing");
527                    $(".faqs button.open").removeClass('open');
528
529                    thebutton.addClass('open');
530                    thebutton.attr('aria-expanded', true);
531                    thediv.slideDown(300,"swing");
532
533                }
534
535            });
536
537
538
539        });
540
541
542/*        $(".accordions div button").on({
543            mouseenter: function () {
544                $(this).closest('div').addClass('hover');
545            },
546            mouseleave: function () {
547                $(this).closest('div').removeClass('hover');
548            }
549        });*/
550
551    }
552
553}
554
555
556function anchornav() {
557    if ($('#anchornav').length > 0) {
558        
559        $('#anchornav').addClass('closed');
560        
561        $('#anchornav').children('h3').css({cursor: "pointer"}).click(function () {
562
563        if($('#anchornav').hasClass('closed')){
564            $('#anchornav').removeClass('closed');
565            
566        } else {
567            $('#anchornav').addClass('closed');
568            
569        }
570        
571        });
572        
573        
574        $(".times1 a,#anchornav li a").css({cursor: "pointer"}).click(function(){
575				var destination = $(this).attr('href'), distance = $(destination).offset().top,newdistance = Math.round(distance-72);
576				//$(this).text(newdistance);-$('#masthead').height())
577				$("html, body").animate({ scrollTop: newdistance }, 300); 
578				return false;
579	
580		});
581        
582        
583        
584    }
585}
586 
587
588
589function anchorlinks() {
590    if (($("h2.anchor").length > 0)){
591
592        var onthispage;
593
594        if ($('html').attr('lang') == 'ga') {
595            onthispage = 'Ar an leathanach seo:';
596        } else {
597            onthispage = 'On this page:';
598        }
599
600        var wheretoput;
601
602
603        if (($(".vacancyheader").length > 0)) {
604            wheretoput = $('.vacancyheader').eq(0);
605            wheretoput.before('<dl id="anchors"><dt>' + onthispage + '</dt></dl>');
606        } else {
607            wheretoput = $('#pageheader');
608            wheretoput.prepend('<dl id="anchors"><dt>' + onthispage + '</dt></dl>');
609        }
610
611
612
613
614
615
616        var anchorlist = $("#anchors");
617
618        var headingid, headingtext;
619
620        $(".anchor").each(function () {
621            headingid = $(this).attr('id');
622
623            if ($(this).data('anchortext')) {
624                headingtext = $(this).data('anchortext');
625            } else {
626                headingtext = $(this).text();
627            }
628            anchorlist.append('<dd><a href="#' + headingid + '">' + headingtext + '</a></dd>');
629        });
630
631
632
633               $("#anchors a").css({cursor: "pointer"}).click(function(){
634
635                   destination = $(this).attr('href');
636                   distance = $(destination).offset().top - $('#masthead').height() - 12;
637
638                   newdistance = Math.round(distance);
639                   $("html, body").animate({ scrollTop: newdistance }, 300);
640                   return false;
641
642               });
643
644
645    }
646
647
648
649    if($("h3.anchor").length > 0){
650
651        var destination,distance,newdistance,difference,y,pagetop,anchorsafterthis,anch
651orstart;
652        var anchorsclass;
653        if (($(".anchor").length > 10)){ anchorsclass='twocol'; } else { anchorsclass = 'normal'; }
654        anchorsclass = 'normal';
655
656        //$('.hassubnav').eq(0).prepend('<div class="wrapper grid anchorholder"><ul id="anchorlinks" class="anchorlinks bodytext  '+anchorsclass+'"></ul></div>');
657
658        if ($('html')[0].lang =='ga'){
659            $('#first_text').eq(0).prepend('<div id="anchorlinks" class="anchorlinks"><h3 aria-hidden="true"><span>Ar an leathanach seo:</h3><ul> </ul></div>');
660        } else {
661            $('#first_text').eq(0).prepend('<div id="anchorlinks" class="anchorlinks"><h3 aria-hidden="true"><span>On this page:</h3><ul> </ul></div>');
662        }
663        var anchorlinklist = $("#anchorlinks>ul").eq(0);
664
665        var headingid,headingtext;
666
667        $("h3.anchor").each(function(){
668
669            //$(this).append('<b class="backtotop"></b>');
670
671            headingid=$(this).attr('id');
672            headingtext=$(this).text();
673
674            if( !isNaN( headingtext.charAt(0)) ) {
675                var headingarray = headingtext.split('.');
676                headingtext = '<span>'+headingarray[0]+'.</span> <span>'+headingarray[1]+'.</span>';
677            }
678
679
680            anchorlinklist.append('<li><a href="#'+headingid+'">'+headingtext+'</a></li>');
681            //anchorlinklist_fixed.append('<li><a href="#'+headingid+'">'+headingtext+'</a></li>');
682        });
683
684
685        $(".anchorlinks ul li a").css({cursor: "pointer"}).click(function(){
686            destination = $(this).attr('href');
687            distance = $(destination).offset().top;
688
689            //newdistance = Math.round(distance-$('#masthead').height())-40;
690            newdistance = Math.round(distance-120);
691
692            $("html, body").animate({ scrollTop: newdistance }, 300);
693            return false;
694
695        });
696
697
698
699    }
700
701    if($(".anchorsection").length > 0 && $('#sectionmenu').length > 0 ){
702
703        var destination,distance,newdistance,difference,y,pagetop,anchorsafterthis,anchorstart;
704        var anchorsclass;
705
706
707        var anchorlinklist = $('#sectionmenu>ul').eq(0);
708
709        var headingid,headingtext;
710
711        $(".anchorsection").each(function(){
712
713            //$(this).append('<b class="backtotop"></b>');
714
715            headingid=$(this).attr('id');
716            headingtext=$(this).attr('data-anchortext');
717
718            if( !isNaN( headingtext.charAt(0)) ) {
719                var headingarray = headingtext.split('.');
720                headingtext = '<span>'+headingarray[0]+'.</span> <span>'+headingarray[1]+'.</span>';
721            }
722
723
724            anchorlinklist.append('<li><a href="#'+headingid+'">'+headingtext+'</a></li>');
725            //anchorlinklist_fixed.append('<li><a href="#'+headingid+'">'+headingtext+'</a></li>');
726        });
727
728
729        $("#sectionmenu ul li a").css({cursor: "pointer"}).click(function(e){
730            e.preventDefault();
731            destination = $(this).attr('href');
732            distance = $(destination).offset().top;
733
734            //newdistance = Math.round(distance-$('#masthead').height())-40;
735            newdistance = Math.round(distance-120);
736
737            $("html, body").animate({ scrollTop: newdistance }, 300);
738            return false;
739
740        });
741
742
743
744    }
745
746    if($(".anch").length > 0 ){
747
748        $(".anch a").css({cursor: "pointer"}).click(function(e){
749            e.preventDefault();
750            destination = $(this).attr('href');
751            distance = $(destination).offset().top;
752
753            //newdistance = Math.round(distance-$('#masthead').height())-40;
754            newdistance = Math.round(distance-84);
755
756            $("html, body").animate({ scrollTop: newdistance }, 300);
757            return false;
758
759        });
760
761
762
763    }
764
765}
766
767function anch() {
768
769    if (($("a.anch").length > 0)){
770
771        var destination,distance,newdistance;
772 
773 
774
775
776        $("a.anch").css({cursor: "pointer"}).click(function(){
777            destination = $(this).attr('href');
778            distance = $(destination).offset().top;
779
780            //newdistance = Math.round(distance-$('#masthead').height())-40;
781            newdistance = Math.round(distance-120);
782
783            $("html, body").animate({ scrollTop: newdistance }, 300);
784            return false;
785
786        });
787
788
789
790    }
791
792}
793
794function readmore() {
795
796    $(".readmore").each(function() {
797
798        $(this).before('<p class="cta expand more"><span>Read More</span></p>');
799        $(this).append('<p class="cta contract more"><span>Read Less</span></p>');
800        $(this).hide();
801
802
803        $(".expand").css({
804            cursor: "pointer"
805        }).click(function() {
806            $(this).next($('.readmore')).slideDown("fast");
807            $(this).slideUp("fast");
808        });
809        $(".contract").css({
810            cursor: "pointer"
811        }).click(function() {
812            $(this).parent().slideUp("fast");
813            $(this).parent().prev($('.expand')).slideDown("fast");
814        });
815
816    });
817}
818
819function hi_cookie() {
820    if (Cookies.get('hi_accept_cookies')) {} else {
821        
822        
823        
824        if($('#cookieconsent').attr('data-lang')=='ga'){
825            
826            $('#cookieconsent').append('<div> <h2>Fógra maidir le cuacha</h2> <p>Úsáidtear cuacha ar an suíomh gréasáin seo. Is féidir go bhfuil roinnt cuacha i bhfeidhm cheana. Le haghaidh tuilleadh faisnéise, léigh ár Ráiteas Príobháideachais. Tríd an suíomh gréasáin seo a úsáid, glacann tú leis an tslí a úsáidimid cuacha. </p><p><button id="dismiss">Glacaim loe</button></p> </div>');
827        } else {
828            $('#cookieconsent').append('<div><h2>A notice about cookies</h2> <p>This website uses cookies. Some cookies may have been set already. To find out more about our use of cookies you can visit our Privacy policy. By browsing this website, you agree to our use of cookies.</p><p><button id="dismiss">I agree</button></p></div>');
829            
830        }
831        
832        $('#cookieconsent').addClass('shown');
833
834        $('#dismiss').click(function() {
835            $('#cookieconsent').fadeOut("300").remove();
836            Cookies.set('hi_accept_cookies', '0', {
837                expires: 365,
838                //domain: '.heritageireland.ie'
839            });
840        });
841    }
842}
843
844
845
846function countdowntimers() {
847 
848$('#countdown .countdown').pietimer('pause').remove();
849
850$('#countdown').html('<p class="countdown"></p>'); 
851
852    var seconds = 16;	
853	 
854	var cd = $('#countdown').find('.countdown').eq(0);
855	 
856	//var next = $(this).children('.bx-wrapper').children('.bx-controls').children('.bx-controls-direction').children('.bx-next');
857	
858	//var next = $('#alerts').find('.slick-next');
859	var next = $('#nextalert');
860	
861	cd.pietimer({
862    seconds: seconds,
863    color: 'rgba(48, 49, 44, 1)',
864    height: 90,
865	width: 90,
866    //color: 'rgba(93, 95, 86, 1)',
867	is_reversed: false
868	},	function(){
869		next.trigger('click');
870		cd.pietimer().remove();
871	});
872	
873	 cd.pietimer('start'); 
874	 
875	 
876	 cd.click(function(){
877		if($(this).hasClass('paused')){
878			$(this).removeClass('paused');
879			cd.pietimer('start');
880		} else {
881			$(this).addClass('paused');
882			cd.pietimer('pause');
883		}
884	 
885	});
886
887	 
888
889}
890
891function alerts() {
892
893if ($('#alerts').length > 0) {    
894                $('#alerts').after('<div id="alertsinfo"><div id="countdown"></div> <p><span id="prevalert"></span> <span id="currentalert">1</span>/'+$('#alerts .alert').length+' <span id="nextalert"></span></div>');
895                $('#alerts').on('init', function(event, slick, currentSlide, nextSlide) {
896                     countdowntimers();
897            
898                });
899                $('#alerts').on('afterChange', function(event, slick, currentSlide, nextSlide) {
900                     countdowntimers();
901                    $('#currentalert').text(currentSlide+1);
902                    
903                });
904                $('#alerts').slick({ //lazyLoad: 'ondemand',
905                dots: false,
906                //arrows: false,
907                prevArrow:$('#prevalert'),  
908                nextArrow:$('#nextalert'),  
909                    
910                    
911/*                prevArrow: '<div class="arrowholder prevarrowholder"><button class="slick-prev slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d=M38.4,0.7l-37,40l37,40"/></g></svg></button></div>',
912             
913                nextArrow: '<div class="arrowholder nextarrowholder"><button class="slick-next slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M0.7,80.7l37-40l-37-40"/></g></svg></button></div>',*/
914                infinite: true, speed: 300,  
915                adaptiveHeight: true,
916
917                draggable: false,
918                responsive: [{
919                    breakpoint: 480,
920                    settings: {
921                        touchMove: true, touchThreshold:10
922                    }
923                }]
924            });
925
926 
927 }
928
929}
930
931
932
933
934
935
936
937
938
939function edu_videos() {
940
941if ($('.video_thumbs').length > 0) {    
942    
943    $('.video_thumbs').each(function(){ 
944    
945        var thiscontainer = $(this);
946        
947        $(this).find('a').click(function(evt) {
948         
949            evt.preventDefault();
950            var iframe = $(this).attr('data-iframe');
951            if ($('#videoshow').length > 0) {
952                   $('#videoshow').remove();
953            } else {
954                
955            }
956            thiscontainer.before('<div id="videoshow" class="bodytext vidcontainer"><div class="vid"><iframe src="'+iframe+'" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></div>');
957            
958                var distance = $('#videoshow').offset().top;
959                var newdistance;
960            
961            if (window.matchMedia('(max-width: 899px)').matches) {
962            newdistance = Math.round(distance-20);
963            } else { 
964                newdistance = Math.round(distance-100);
965            }
966                $("html, body").animate({ scrollTop: newdistance }, 300);
967        });
968        
969        
970    });
971    
972 
973 }
974
975}
976
977
978
979$(document).ready(function() {
980    
981/*      $('#cookieconsent').addClass('shown');
982
983
984      $('button#dismiss').click(function () {
985          if ($('input#consent').is(':checked')) {
986              $.cookie("cookieconsent", 1, { expires: 365, path: '/' });
987
988              location.reload();
989
990          } else {
991              $.cookie("cookieconsent", 0, { expires: 365, path: '/' });
992              location.reload();
993          }
994
995      });
996
997
998
999
1000
1001
1002if(strpos($user_agent, "Macintosh") !== FALSE){
1003
1004    $os = "Macintosh";
1005    $scrollbar='15px';
1006
1007} else if(strpos($user_agent, "Windows") !== FALSE){
1008    if(strpos($user_agent, "Edge") !== FALSE){
1009        $os = "Windows";
1010    $scrollbar='19px';
1011    } else {
1012    $os = "Windows";
1013    $scrollbar='17px';
1014    }
1015} else if(strpos($user_agent, "Mobile") !== FALSE){
1016    $os = "Mobile"; // ??
1017    $scrollbar='0px';
1018
1019
1020
1021
1022       */
1023
1024    var userAgent = window.navigator.userAgent,
1025        platform = window.navigator.platform,
1026        macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],
1027        windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
1028        iosPlatforms = ['iPhone', 'iPad', 'iPod'],
1029        os=null;
1030    newscrollbarwidth= '17px';
1031    if (iosPlatforms.indexOf(platform) !== -1) {
1032        newscrollbarwidth = '0px';
1033    } else if (/Android/.test(userAgent)) {
1034        newscrollbarwidth = '0px';
1035    } else if (macosPlatforms.indexOf(platform) !== -1) {
1036        newscrollbarwidth = '15px';
1037    } else if (windowsPlatforms.indexOf(platform) !== -1) {
1038        newscrollbarwidth = '17px';
1039
1040
1041    } else if (!os && /Linux/.test(platform)) {
1042        newscrollbarwidth = '19px';
1043    }
1044
1045
1046    document.documentElement.style.setProperty('--scrollbar', newscrollbarwidth);
1047
1048    alerts();
1049    //hi_cookie();
1050    
1051    sectionmenu(); anch();
1052    anchornav(); anchorlinks();
1053    accordion(); faqs(); revealtext();
1054 backtotop();
1055    readmore();
1056    
1057    edu_videos();
1058    if (window.matchMedia('(min-width: 900px)  and (pointer:fine)').matches) {
1059        $("ul.squares li a").hover(function() {
1060            $(this).parent().siblings().addClass("unhovered");
1061        }, function() {
1062            $(this).parent().siblings().removeClass("unhovered");
1063        });
1064    }
1065
1066    
1067    if ($('#locationsearch').length > 0) {
1068        
1069        $('#locationsearch #q').focus(function(){
1070            
1071            if (window.matchMedia('(max-width: 599px) and (pointer:coarse)').matches) {
1072                var distance,newdistance;
1073
1074                distance = $('#locationsearch').offset().top;
1075                newdistance = Math.round(distance-20);
1076
1077                $("html, body").animate({ scrollTop: newdistance }, 300);
1078
1079
1080
1081            }
1082            
1083            
1084        });
1085    
1086    }
1087         
1088    
1089    
1090    
1091    $('.bodytext').find('iframe').wrap('<div class="vid"></div>');
1092    
1093    $('section.section').each(function(){
1094        var thissection = $(this),
1095            thisheader = thissection.children('header').eq(0); 
1096        
1097        thisheader.children('p.cta:last-child').clone().appendTo(thissection);     
1098 
1099        
1100    });
1101    
1102   // mainmenu();
1103    
1104  //$('#masthead').find('#logo').eq(0).clone().attr('id','mobilelogo').attr('aria-hidden','true').prependTo($('#maincontent'));
1105    
1106    
1107  $('.boxslides').each(function(){
1108      
1109      var thisslider = $(this);
1110      
1111      thisslider.children('li').replaceTag('<div class="boxslide">', false);
1112      thisslider.replaceTag('<div class="boxslides">', false);
1113  });
1114    
1115    
1116  $('div.boxslides').each(function(){
1117        
1118      var thisslider = $(this);
1119      
1120      
1121    if (thisslider.parents('.section').length) {
1122    
1123        thisslider.slick({
1124          dots: true, arrows: false, 
1125          focusOnSelect: false, 
1126          speed: 300, /*centerMode: false,centerMode: true, centerPadding:'40%',*/
1127            
1128        /*slidesToShow: 2,
1129        */ variableWidth: true,/**/    slidesToScroll: 1,
1130            /*centerMode: true,*/ infinite: true, touchThreshold:10, // slidesToShow: 2.66, 
1131                //prevArrow: '<div class="arrowholder prevarrowholder"><p><button class="slick-prev slick-arrow">Next</button></p></div>',
1132                //nextArrow: '<div class="arrowholder nextarrowholder"><p><button class="slick-next slick-arrow">Previous</button></p></div>',
1133           /*responsive: [
1134                {
1135                  breakpoint: 899,
1136                  settings: { variableWidth: false,
1137                    slidesToShow: 1.666, dots: true, slidesToScroll: 1, infinite: true, centerMode: true, centerPadding:'0',
1138                  }
1139                },
1140                {
1141                  breakpoint: 599,
1142                  settings: {variableWidth: false,
1143                    slidesToShow: 1, dots: true, slidesToScroll: 1, infinite: true, centerMode: true, centerPadding:'0', touchThreshold:10
1144                  }
1145                },
1146
1147              ]    */
1148        });
1149
1150       // thisslider.slick('slickSetOption', 'slidesToScroll', 2, true);
1151
1152    } else {
1153        
1154        thisslider.slick({
1155          dots: true, arrows: false, 
1156          focusOnSelect: false, 
1157          speed: 300, /*centerMode: false,centerMode: true, centerPadding:'40%',*/
1158         slidesToScroll: 1,variableWidth: true,
1159            infinite: true, centerMode: true, touchThreshold:10
1160                //prevArrow: '<div class="arrowholder prevarrowholder"><p><button class="slick-prev slick-arrow">Next</button></p></div>',
1161                //nextArrow: '<div class="arrowholder nextarrowholder"><p><button class="slick-next slick-arrow">Previous</button></p></div>',
1162 
1163    });
1164  
1165    }
1166
1167  });
1168 
1169    setTimeout(function(){ $("body").removeClass("preload"); }, 500);
1170    
1171  $('.slidesnews').each(function(){
1172      var thisslider = $(this);
1173      
1174      thisslider.children('li').replaceTag('<div class="slide">', false);
1175      thisslider.replaceTag('<div class="slidesnews">', false);
1176  });
1177     
1178 $('div.slidesnews').slick({ 
1179     dots: false, arrows: false, 
1180     focusOnSelect: false, 
1181     speed: 300, /*centerMode: false,centerMode: true, centerPadding:'40%',*/
1182     slidesToScroll: 1,
1183     slidesToShow: 3, infinite: false, centerMode: false, centerPadding:'0',
1184			//prevArrow: '<div class="arrowholder prevarrowholder"><p><button class="slick-prev slick-arrow">Next</button></p></div>',
1185			//nextArrow: '<div class="arrowholder nextarrowholder"><p><button class="slick-next slick-arrow">Previous</button></p></div>',
1186       responsive: [
1187        {
1188          breakpoint: 899,
1189          settings: {
1190            slidesToShow: 1.666, dots: true, slidesToScroll: 1, infinite: true, centerMode: true, centerPadding:'0',
1191          }
1192        },
1193        {
1194          breakpoint: 599,
1195          settings: {
1196            slidesToShow: 1, dots: true, slidesToScroll: 1, infinite: true, centerMode: true, centerPadding:'0', touchThreshold:10
1197          }
1198        },
1199
1200      ]    
1201});
1202
1203    if ($('.imagery').length > 0) {
1204
1205        $('.imagery').each(function(){
1206             
1207        if($(this).children('div').children('div').length > 1) {
1208            
1209            
1210            $(this).children('div').eq(0).on('init', function( slick ) {
1211                //$('#banner figure figcaption').hide();
1212                 $(this).closest('.imagery').addClass('init');
1213                $(window).trigger('resize');
1214            })
1215            
1216            
1217            $(this).children('div').eq(0).slick({ //lazyLoad: 'ondemand',
1218                dots: false,
1219                arrows: true,
1220                prevArrow: '<div class="arrowholder prevarrowholder"><button aria-label="Next slide" class="slick-prev slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d=M38.4,0.7l-37,40l37,40"/></g></svg></button></div>',
1221             
1222                nextArrow: '<div class="arrowholder nextarrowholder"><button aria-label="Previous slide" class="slick-next slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M0.7,80.7l37-40l-37-40"/></g></svg></button></div>',
1223                infinite: true, speed: 600,
1224                adaptiveHeight: true,
1225
1226                draggable: false,
1227                responsive: [{
1228                    breakpoint: 480,
1229                    settings: {
1230                        touchMove: true, touchThreshold:10
1231                    }
1232                }]
1233            }).on('beforeChange', function(event, slick, currentSlide, nextSlide) {
1234                //$('#banner figure figcaption').fadeOut(300);
1235            }).on('afterChange', function(event, slick, currentSlide, nextSlide) {
1236                //$('#banner figure[data-slick-index="' + currentSlide + '"] figcaption').fadeIn(400);
1237            });
1238            
1239
1240        }
1241        }); 
1242    }
1243    
1244    if ($('#banner figure').length > 1 || $('.banner figure').length > 1) {
1245
1246        if($('header.placeheader').length > 0) {
1247            $('header.placeheader').prepend('<div id="bannerdots"></div>');
1248        } else if($('.visitbox').length > 0) {
1249            $('.visitbox').eq(0).append('<div id="bannerdots"></div>');
1250        } else if($('#locationsearch').length > 0) {
1251            $('#locationsearch').prepend('<div id="bannerdots"></div>');
1252        }
1253
1254        $('#banner, .banner').slick({
1255                dots: true,
1256                appendDots: '#bannerdots',
1257                arrows: true,
1258                prevArrow: '<div class="arrowholder prevarrowholder"><button aria-label="Next slide" class="slick-prev slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M38.4,0.7l-37,40l37,40"/></g></svg></button></div>',
1259             
1260                nextArrow: '<div class="arrowholder nextarrowholder"><button aria-label="Previous slide" class="slick-next slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M0.7,80.7l37-40l-37-40"/></g></svg></button></div>',
1261                infinite: true, speed: 600,
1262                adaptiveHeight: true,
1263
1264                draggable: false,
1265                responsive: [{
1266                    breakpoint: 480,
1267                    settings: {
1268                        touchMove: true, touchThreshold:10
1269                    }
1270                }]
1271            }).on('init', function(event, slick, currentSlide, nextSlide) {
1272                //$('#banner figure figcaption').hide();
1273            }).on('beforeChange', function(event, slick, currentSlide, nextSlide) {
1274                //$('#banner figure figcaption').fadeOut(300);
1275            }).on('afterChange', function(event, slick, currentSlide, nextSlide) {
1276                //$('#banner figure[data-slick-index="' + currentSlide + '"] figcaption').fadeIn(400);
1277            });
1278
1279
1280        }
1281 
1282    if ($('#introslides>div').length > 0){
1283
1284
1285
1286        if ($('#sectionmenu').length > 0) {
1287            $('#introslides').clone().attr('id', 'topimage').insertBefore($('#sectionmenu'));
1288        } else {
1289            $('#introslides').clone().attr('id', 'topimage').insertAfter($('#breadcrumbs'));
1290        }
1291            $('.introslides').slick({
1292              dots: true, arrows: true, 
1293                
1294                prevArrow: '<div class="arrowholder prevarrowholder"><button aria-label="Next slide" class="slick-prev slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d=M38.4,0.7l-37,40l37,40"/></g></svg></button></div>',
1295             
1296                nextArrow: '<div class="arrowholder nextarrowholder"><button aria-label="Previous slide" class="slick-next slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M0.7,80.7l37-40l-37-40"/></g></svg></button></div>',
1297                
1298                appendDots: '<div class="dotsholder"></div>',
1299                
1300              focusOnSelect: false, 
1301              speed: 300
1302            }).on('init', function(event, slick, currentSlide, nextSlide) {
1303                //$('#banner figure figcaption').hide();
1304            }).on('beforeChange', function(event, slick, currentSlide, nextSlide) {
1305                //$('#banner figure figcaption').fadeOut(300);
1306            }).on('afterChange', function(event, slick, currentSlide, nextSlide) {
1307                //$('#banner figure[data-slick-index="' + currentSlide + '"] figcaption').fadeIn(400);
1308                //alert(currentSlide);
1309                
1310                
1311            });
1312
1313    }
1314
1315    if ($('.campaignslidesX').length > 0){
1316        $('.campaignslides').each(function(){
1317          
1318            if ($(this).children('.callout').length > 1){ 
1319                
1320                $(this).slick({
1321                    dots: true,
1322                    arrows: true,
1323                    prevArrow: '<div class="arrowholder prevarrowholder"><button aria-label="Next slide" class="slick-prev slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d=M38.4,0.7l-37,40l37,40"/></g></svg></button></div>',
1324
1325                    nextArrow: '<div class="arrowholder nextarrowholder"><button aria-label="Previous slide"class="slick-next slick-arrow"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 39.1 81.4" style="enable-background:new 0 0 39.1 81.4;" xml:space="preserve"><g><path fill="none" stroke="white" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="10" shape-rendering="geometricPrecision" vector-effect="non-scaling-stroke" d="M0.7,80.7l37-40l-37-40"/></g></svg></button></div>',
1326                    infinite: true, speed: 600,
1327                    adaptiveHeight: true
1328                });
1329                
1330            }
1331            
1332        });
1333    }
1334  
1335    
1336});
1337
1338var lastScrollTop = 0;
1339
1340 
1341$(window).on('load resize', function() {
1342    
1343 
1344});
1345
1346
1347$(window).on('load resize scroll', function() {
1348    
1349    if (window.matchMedia('(max-width: 599px)').matches) {
1350        $('#gallery ul.hi_gallery li a').click(function(){
1351           
1352            return false;
1353            
1354        });
1355    }
1356    
1357    
1358    if (window.matchMedia('(min-width: 900px)').matches) {
1359 
1360    }
1361    
1362    if ($('.featurelist').length > 0) {
1363        
1364        $('.featurelist li').each(function(){
1365		if ($(this).isInViewport()) {
1366			if($(this).hasClass('isvisible')){	} else {
1367				$(this).addClass('isvisible');
1368			}
1369		}
1370	});
1371    }
1372    
1373 
1374    
1375    $("body").removeClass("preload");
1376    var st = $(window).scrollTop(),
1377        toscroll = 1;
1378
1379 
1380
1381    var hero = $('.hero').eq(0);
1382
1383    if (st >= toscroll) {
1384        if ($('body').hasClass('scrolled')) {} else {
1385            $('body').removeClass('unscrolled');
1386            $('body').addClass('scrolled');
1387        }
1388    } else {
1389
1390        if (st >= lastScrollTop) {
1391
1392
1393        } else {
1394            $('body').addClass('unscrolled');
1395        }
1396
1397        $('body').removeClass('scrolled');
1398    }
1399
1400
1401    if ($('#backtotop').length > 0) {
1402        var thistop = Math.round($('#backtotopholder').offset().top),
1403            thisbottom = Math.round(thistop + $('#backtotopholder').height()),
1404            winbottom = st + $(window).height();
1405
1406        if ($('#masthead').isInViewport() && $('#backtotopholder').isInViewport()) {
1407
1408            $('#backtotop').addClass('notneeded');
1409
1410        } else {
1411
1412            $('#backtotop').removeClass('notneeded');
1413        }
1414        if (winbottom > thisbottom) {
1415            if ($('#backtotop').hasClass('fixed')) {
1416                //$('body').removeClass('scrolled1');
1417                $('#backtotop').removeClass('fixed');
1418            }
1419
1420        } else if (winbottom > thisbottom) {
1421            if ($('#backtotop').hasClass('fixed')) {
1422                //$('body').removeClass('scrolled1');
1423                $('#backtotop').removeClass('fixed');
1424            }
1425
1426        } else if (st > $(window).height()) {
1427            if ($('#backtotop').hasClass('fixed')) {
1428
1429            } else {
1430                $('body').addClass('scrolled1');
1431                $('#backtotop').addClass('fixed');
1432
1433            }
1434
1435        } else if (st < $(window).height()) {
1436            if ($('#backtotop').hasClass('fixed')) {
1437                $('body').removeClass('scrolled1');
1438                $('#backtotop').removeClass('fixed');
1439            }
1440
1441
1442        }
1443
1444
1445
1446    }
1447
1448
1449
1450    lastScrollTop = st;
1451 
1452
1453
1454});
1455
1456 

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.