PageSourceSearch

https://hospitalitychain.com/wp-content/themes/glocal-child/js/custom.js?ver=1791268037

js hospitalitychain.com collected 2026-10-10 01:17:00 UTC 32,622 bytes, 1,086 lines download raw bytes

1jQuery(document).ready( function($) { 
2$('.right-wine-outer').each(function () {
3    var wineCount = $(this).find('.right-wine').length;
4
5    if (wineCount > 1) {
6      $(this).addClass('multiple-wines');
7    } else {
8      $(this).removeClass('multiple-wines');
9    }
10  });	
11
12$('.wine-page .right-wine-outer .right-wine').each(function () {
13    var wineCount = $(this).find('.row').length;
14
15    if (wineCount > 1) {
16      $(this).addClass('multiple-beer');
17    } else {
18      $(this).removeClass('multiple-beer');
19    }
20  });	
21    
22	jQuery(document).on( "click", '.wc-view-map .wc-view-map-btn', function(e){
23
24		e.preventDefault();
25		var t_this = jQuery(this);
26		t_this.parents('.wc-view-map').find('.wc-map-button .wc-spiner').show();
27		t_this.hide();
28		jQuery.ajax({
29			type: 'POST',
30			url : myAjax.ajaxurl,
31			data : {action: "check_google_map"},
32			success: function (response) {
33				if( response ){
34					if( response.type == 'success' ){
35						t_this.parents('.wc-view-map').find('.wc-map-button .wc-spiner').hide();
36						t_this.parents('.map-wrapper.rrr').html(response.map_html);
37						var options_container = jQuery("div#map_options");
38
39						var draggable = options_container.find(".draggable").html();
40						var scrollwheel = options_container.find(".scrollwheel").html();
41						var maptype = options_container.find(".maptype").html();
42						var zoom = options_container.find(".zoom").html();
43						var clusters = options_container.find(".clusters").html();
44						var markers_type = options_container.find(".markers-type").html();
45
46						if (draggable == "true") {
47							draggable = true;
48						} else {
49							draggable = false;
50						}
51
52						if (scrollwheel == "true") {
53							scrollwheel = true;
54						} else {
55							scrollwheel = false;
56						}
57
58						zoom = Number(zoom);
59
60						if (clusters == 'true') {
61							clusters = true;
62						} else {
63							clusters = false;
64						}
65
66						var markers_center  = jQuery("div#markers_center");
67
68						var map_lat = markers_center.find(".latitude").html();
69						var map_lng = markers_center.find(".longitude").html();
70						var map_mrk = markers_center.find(".marker").html();
71						var map_ctr = markers_center.find(".option").html();
72
73						/*** Load Major Map. ***/
74
75						var map_centration_indikator;
76
77						if ( jQuery("body").hasClass('single-company')) {
78							map_centration_indikator = 'center';
79						} else if (map_ctr == "centre_world") {
80							zoom = 3;
81						} else if (map_ctr == "center_all") {
82							map_centration_indikator = 'all';
83						} else {
84							map_centration_indikator = 'center';
85						}
86
87						//console.log(map_lat + "   "+map_lng);
88
89						if (jQuery("div#map").length) {
90
91							reloadmap(draggable, scrollwheel, maptype, zoom);
92
93							jQuery.goMap.ready(function(){
94
95								overlay = $.goMap.overlay;
96
97								if (jQuery("#search-content-result").hasClass("content-result-def")) {
98									ajaxGetMarkers();
99								} else if (jQuery("#search-content-result").hasClass("content-result-adv-def")) {
100									searchGetMarkers();
101								} else {
102									addmarkers(map_centration_indikator,markers_type);
103								}
104
105								if (clusters) {
106									var markers = [];
107
108									for (var i in $.goMap.markers) {
109										var temp = $($.goMap.mapId).data($.goMap.markers[i]);
110										markers.push(temp);
111									}
112
113									var markerclusterer = new MarkerClusterer($.goMap.map, markers);
114								}
115
116							});
117
118							/*** Load Hidden Map. ***/
119
120							if (jQuery("#map-trobber").hasClass('load-hide') || jQuery("body").hasClass('single-company')) {
121								setTimeout(function(){
122									jQuery('#map').animate({ height: '620px' });
123									jQuery('#hide-map-button').text('Hide Map').removeClass('map-collapsed').addClass('map-expanded');
124									ajaxGetMarkers();
125								}, 500);
126
127								/*setTimeout(function(){
128									jQuery('#map').animate({ height: '220px' });
129									jQuery("#hide-map-button").text('Show Map').removeClass('map-expanded').addClass('map-collapsed');
130								}, 500);*/
131
132							}
133
134							/*** Disable Map Button. ***/
135
136							if (draggable == false) {
137								jQuery('#disable-map-button').removeClass('map-enable').addClass('map-disable');
138							}
139
140							jQuery(document).on('click', '#disable-map-button', function(event) {
141								event.preventDefault();
142								if ( jQuery('#disable-map-button').hasClass('map-enable') ) {
143									jQuery('#disable-map-button').removeClass('map-enable').addClass('map-disable');
144									jQuery("#map").removeData();
145									jQuery("#map-trobber").fadeIn(500);
146									setTimeout(function(){
147										loadmap(false, scrollwheel, maptype, zoom); 
148										overlay = $.goMap.overlay;
149										addmarkers(map_centration_indikator,markers_type);
150										if (clusters) {
151											var markers = [];
152
153											for (var i in $.goMap.markers) {
154												var temp = $($.goMap.mapId).data($.goMap.markers[i]);
155												markers.push(temp);
156											}
157
158											var markerclusterer = new MarkerClusterer($.goMap.map, markers);
159										}
160									}, 1000);
161
162								} else {
163									jQuery('#disable-map-button').removeClass('map-disable').addClass('map-enable');
164									jQuery("#map").removeData();
165									jQuery("#map-trobber").fadeIn(500);
166									setTimeout(function(){
167										loadmap(true, scrollwheel, maptype, zoom); 
168										overlay = $.goMap.overlay;
169										addmarkers(map_centration_indikator,markers_type);
170										if (clusters) {
171											var markers = [];
172
173											for (var i in $.goMap.markers) {
174												var temp = $($.goMap.mapId).data($.goMap.markers[i]);
175												markers.push(temp);
176											}
177
178											var markerclusterer = new MarkerClusterer($.goMap.map, markers);
179										}
180
181									}, 1000);
182								}
183							});
184
185							/*** Show/Hide Map. ***/
186
187							jQuery(document).on('click', '#hide-map-button', function(event) {
188								var mapheight = $('#get_map_settings').data('mapheight');
189								if (!mapheight){
190									mapheight = 620;
191								}
192								//console.log(mapheight);
193								event.preventDefault();
194								if ( jQuery(this).hasClass('map-expanded') ) {
195									if ( jQuery('.advanced-search-control-new').hasClass('hide') ) {
196										jQuery('#advanced-search').slideToggle('fast');
197										jQuery('.advanced-search-control-new').removeClass('hide').addClass('show');
198										jQuery('#searchdisable').fadeOut(485);
199									}
200									if ( jQuery('#advanced-search-button').hasClass('expanded') ) {
201										jQuery('#default-search').slideToggle('fast');
202										jQuery('#advanced-search').slideToggle('fast');
203										jQuery('#advanced-search-button').text('Advanced Search');
204										jQuery('#advanced-search-button').removeClass('expanded');
205									}
206									jQuery('#map').animate({ height: '220px' });
207									jQuery(this).text('Show Map').removeClass('map-expanded').addClass('map-collapsed');
208								} else {
209									jQuery('#map').animate({ height: mapheight });
210									jQuery(this).text('Hide Map').removeClass('map-collapsed').addClass('map-expanded');
211									setTimeout(function(){
212										ajaxGetMarkers();
213									}, 500);
214
215								}
216							});
217
218						}
219						//reloadmap();
220					}
221				}
222			}
223		});
224});	
225
226
227function applySidebarScroll() {
228    // Only run on screens 768px and up
229    if (window.innerWidth >= 768) {
230        if ($('.page-template-page-beer .beer-container .wine-countries.row').length > 0) {
231            var rightOuterHeight = $('.right-wine-outer .right-wine.clearfix.multiple-beer').innerHeight();
232
233            if (rightOuterHeight > 0) {
234                $('#sidebar .scroll-pane').css({
235                    'max-height': rightOuterHeight + 'px',
236                    'overflow-y': 'auto'
237                });
238            }
239        }
240    } else {
241        // Optional: Remove styles on smaller screens
242        $('#sidebar .scroll-pane').css({
243            'max-height': '',
244            'overflow-y': ''
245        });
246    }
247}
248
249// Run on page load
250$(document).ready(function () {
251    applySidebarScroll();
252});
253
254// Run on window resize
255$(window).resize(function () {
256    applySidebarScroll();
257});
258
259
260var translateInterval = setInterval(function() {
261
262    if (window.innerWidth <= 767) {
263        var firstOption = jQuery('.goog-te-combo option:first');
264
265        if (firstOption.length) {
266            firstOption.text('Language');
267            clearInterval(translateInterval);
268        }
269    }
270
271}, 500);
272
273
274
275});
276jQuery(function($){
277    $('.month-box-item.jhot').each(function(){
278        if ($(this).find('.company-listing, .company-listing-thumb').length === 0) {
279            $(this).hide();
280        }
281    });
282});
283
284
285
286
287(function () {
288	'use strict';
289
290	var OLD_PATH = '/buy-premium-wines/';
291	var NEW_URL  = 'https://hospitalitychain.com/buy-fine-premium-wine-online/';
292
293	function fixWinesLink(root) {
294		root = root || document;
295
296		// Primary: scope to the known breadcrumb container if present.
297		var containers = root.querySelectorAll('.wines_left.loadmore, .wines_left');
298		var scope = containers.length ? containers : [root];
299
300		scope.forEach(function (container) {
301			var links = container.querySelectorAll('a[href*="' + OLD_PATH + '"]');
302			links.forEach(function (a) {
303				if (a.getAttribute('href').indexOf(OLD_PATH) !== -1) {
304					a.setAttribute('href', NEW_URL);
305				}
306			});
307		});
308
309		// Fallback: in case the container class differs on some templates,
310		// also catch any link site-wide whose text is exactly "Wines >>"
311		// and whose href matches the old path.
312		root.querySelectorAll('a').forEach(function (a) {
313			var text = (a.textContent || '').trim();
314			var href = a.getAttribute('href') || '';
315			if (text.indexOf('Wines') === 0 && href.indexOf(OLD_PATH) !== -1) {
316				a.setAttribute('href', NEW_URL);
317			}
318		});
319	}
320
321	// Run once DOM is ready.
322	if (document.readyState === 'loading') {
323		document.addEventListener('DOMContentLoaded', function () {
324			fixWinesLink(document);
325		});
326	} else {
327		fixWinesLink(document);
328	}
329
330	// Some builders (Slider Revolution, AJAX-loaded archive content) inject
331	// markup after initial load — watch for that and re-apply the fix.
332	var observer = new MutationObserver(function (mutations) {
333		mutations.forEach(function (m) {
334			if (m.addedNodes && m.addedNodes.length) {
335				fixWinesLink(document);
336			}
337		});
338	});
339	observer.observe(document.body || document.documentElement, {
340		childList: true,
341		subtree: true
342	});
343})();
344
345
346
347// jQuery(document).ready(function($){
348
349//     $('.countries-button button').on('click', function(e){
350//         e.preventDefault();
351
352//         $('#sidebar').toggleClass('active');
353//     });
354
355// });
356
357jQuery(document).ready(function ($) {
358
359$('.countries-button button').on('click', function (e) {
360e.preventDefault();
361
362$(this).toggleClass('active');
363$('body #sidebar').slideToggle(500);
364});
365
366});
367
368// jQuery(function($){
369
370//     setInterval(function(){
371//         $('.countries-button button').html('Select Country');
372//     }, 10);
373
374// });
375// (function() {
376//     function hideCountriesButtons() {
377//         var buttons = document.querySelectorAll('.countries-button button');
378//         for (var i = 0; i < buttons.length; i++) {
379//             if (buttons[i].textContent.trim() === 'Countries') {
380//                 buttons[i].style.display = 'none';
381//             }
382//         }
383//     }
384//     // Run as early as possible — don't wait for full page load
385//     if (document.readyState === 'loading') {
386//         document.addEventListener('DOMContentLoaded', hideCountriesButtons);
387//     } else {
388//         hideCountriesButtons();
389//     }
390// })();
391
392
393document.querySelectorAll('.faq-question').forEach(function(item){
394
395    item.addEventListener('click', function(){
396
397        const faq = this.parentElement;
398        const icon = this.querySelector('.faq-icon');
399
400        faq.classList.toggle('active');
401
402        if(faq.classList.contains('active')){
403            icon.textContent = '−';
404        }else{
405            icon.textContent = '+';
406        }
407    });
408
409});
410
411document.addEventListener("DOMContentLoaded", function () {
412    document.querySelectorAll("h2").forEach(function (h2) {
413        h2.querySelectorAll("strong").forEach(function (strong) {
414            strong.replaceWith(...strong.childNodes);
415        });
416    });
417});
418
419//country hover
420jQuery(function ($) {
421
422    var current = window.location.pathname.toLowerCase();
423
424    $('.wine-countries-wrapper li.active').removeClass('active');
425
426    if (current.indexOf('/wines-usa') !== -1) {
427        $('.wine-countries-wrapper li.usa').addClass('active');
428    } else if (current.indexOf('/wines-australian') !== -1) {
429        $('.wine-countries-wrapper li.australia').addClass('active');
430    } else if (current.indexOf('/wines-france') !== -1) {
431        $('.wine-countries-wrapper li.france').addClass('active');
432    } else if (current.indexOf('/wines-italy') !== -1) {
433        $('.wine-countries-wrapper li.italy').addClass('active');
434    } else if (current.indexOf('/wines-spain') !== -1) {
435        $('.wine-countries-wrapper li.spain').addClass('active');
436    } else if (current.indexOf('/wines-canada') !== -1) {
437        $('.wine-countries-wrapper li.canada').addClass('active');
438    } else if (current.indexOf('/wines-chile') !== -1) {
439        $('.wine-countries-wrapper li.chile').addClass('active');
440    } else if (current.indexOf('/wines-germany') !== -1) {
441        $('.wine-countries-wrapper li.germany').addClass('active');
442    } else if (current.indexOf('/wines-newzealand') !== -1) {
443        $('.wine-countries-wrapper li.new-zeland').addClass('active');
444    } else if (current.indexOf('/wines-southafrica') !== -1) {
445        $('.wine-countries-wrapper li.south-africa').addClass('active');
446    } else if (current.indexOf('/wines-argentina') !== -1) {
447        $('.wine-countries-wrapper li.argentina').addClass('active');
448    }
449
450});
451
452
453
454// (function () {
455//     const IMAGE_URL = 'https://hospitalitychain.com/wp-content/uploads/2026/08/5F6966E6-71F4-4513-BF4D-1C3757C8D38B.png';
456
457//     function addWineBanner() {
458//         document.querySelectorAll('#sidebar.image-page-wine').forEach(function (sidebar) {
459
460//             // Prevent duplicate banner
461//             if (sidebar.querySelector('.wine-own-space')) {
462//                 return;
463//             }
464
465//             const leftBottom = sidebar.querySelector('.left-bottom');
466
467//             if (!leftBottom) {
468//                 return;
469//             }
470
471//             const banner = document.createElement('div');
472//             banner.className = 'wine-own-space';
473
474//             const img = document.createElement('img');
475//             img.src = IMAGE_URL;
476//             img.alt = 'Own This Space';
477//             img.title = 'Own This Space';
478
479//             banner.appendChild(img);
480
481//             // Add banner above Beverage Equipment / Global Gourmet Food
482//             leftBottom.parentNode.insertBefore(banner, leftBottom);
483//         });
484//     }
485
486//     // Run immediately
487//     addWineBanner();
488
489//     // Handle dynamically loaded/replaced sidebar
490//     const observer = new MutationObserver(function () {
491//         addWineBanner();
492//     });
493
494//     observer.observe(document.body, {
495//         childList: true,
496//         subtree: true
497//     });
498// })();
499
500(function () {
501    const IMAGE_URL = 'https://hospitalitychain.com/wp-content/uploads/2026/08/0ADF30E6-4CE3-4824-BD93-67E326B362BA.png';
502
503    function addWineBanner() {
504
505        document.querySelectorAll('#sidebar').forEach(function (sidebar) {
506
507            // Make sure this is a wine sidebar
508            const countryList = sidebar.querySelector('.scroll-pane ul');
509            const leftBottom = sidebar.querySelector('.left-bottom');
510
511            if (!countryList || !leftBottom) {
512                return;
513            }
514
515            // Check that this sidebar contains wine country links
516            const isWineSidebar = sidebar.querySelector(
517                'a[href*="wines-"], a[href*="australian-wine"]'
518            );
519
520            if (!isWineSidebar) {
521                return;
522            }
523
524            // Prevent duplicate banner
525            if (sidebar.querySelector('.wine-own-space')) {
526                return;
527            }
528
529            // Create banner
530            const banner = document.createElement('div');
531            banner.className = 'wine-own-space';
532
533            const img = document.createElement('img');
534            img.src = IMAGE_URL;
535            img.alt = 'Own This Space';
536            img.title = 'Own This Space';
537
538            banner.appendChild(img);
539
540            // Insert between country list and left-bottom
541            leftBottom.parentNode.insertBefore(banner, leftBottom);
542        });
543    }
544
545    // Initial check
546    addWineBanner();
547
548    // Detect dynamically loaded/replaced sidebars
549    const observer = new MutationObserver(function () {
550        addWineBanner();
551    });
552
553    observer.observe(document.body, {
554        childList: true,
555        subtree: true
556    });
557})();
558
559//
560// jQuery(function ($) {
561//     var $sidebarContainer = $('.sidebar-container');
562//     var $sidebar = $sidebarContainer.find('.recently-added');
563
564//     if (!$sidebarContainer.length || !$sidebar.length) {
565//         return;
566//     }
567
568//     var GAP = 15;
569//     var lastScrollTop = $(window).scrollTop();
570//     var ticking = false;
571
572//     function setFixedTop(left, width) {
573//         $sidebar.css({ position: 'fixed', top: GAP + 'px', bottom: 'auto', left: left + 'px', width: width + 'px' });
574//     }
575//     function setFixedBottom(left, width) {
576//         $sidebar.css({ position: 'fixed', top: 'auto', bottom: GAP + 'px', left: left + 'px', width: width + 'px' });
577//     }
578//     function setAbsolute(top) {
579//         $sidebar.css({ position: 'absolute', top: top, bottom: 'auto', left: 'auto', width: '' });
580//     }
581//     function resetSidebar() {
582//         $sidebar.css({ position: '', top: '', bottom: '', left: '', width: '' });
583//     }
584
585//     function update() {
586//         var scrollTop       = $(window).scrollTop();
587//         var windowHeight    = $(window).height();
588//         var containerTop    = $sidebarContainer.offset().top;
589//         var containerHeight = $sidebarContainer.outerHeight();
590//         var containerBottom = containerTop + containerHeight;
591//         var containerLeft   = $sidebarContainer.offset().left;
592//         var containerWidth  = $sidebarContainer.outerWidth();
593//         var sidebarHeight   = $sidebar.outerHeight();
594
595//         // Sidebar viewport thi lambu hoy to sticky skip karo
596//         if (sidebarHeight >= windowHeight) {
597//             resetSidebar();
598//             lastScrollTop = scrollTop;
599//             ticking = false;
600//             return;
601//         }
602
603//         if (scrollTop > lastScrollTop) {
604//             // DOWN scroll — bottom taraf jay
605//             var wouldReachBottom = scrollTop + windowHeight - GAP;
606//             if (wouldReachBottom >= containerBottom) {
607//                 setAbsolute((containerHeight - sidebarHeight) + 'px'); // parent bottom par stop
608//             } else {
609//                 setFixedBottom(containerLeft, containerWidth); // viewport bottom par sticky
610//             }
611//         } else if (scrollTop < lastScrollTop) {
612//             // UP scroll — top taraf jay
613//             var wouldReachTop = scrollTop + GAP;
614//             if (wouldReachTop <= containerTop) {
615//                 setAbsolute('0px'); // parent top par stop
616//             } else {
617//                 setFixedTop(containerLeft, containerWidth); // viewport top par sticky
618//             }
619//         }
620
621//         lastScrollTop = scrollTop;
622//         ticking = false;
623//     }
624
625//     $(window).on('scroll', function () {
626//         if (!ticking) {
627//             window.requestAnimationFrame(update);
628//             ticking = true;
629//         }
630//     });
631
632//     $(window).on('resize load', update);
633// });
634
635// /**
636// * Smooth sticky sidebar — hospitalitychain listing pages
637// *
638// * ENABLED when viewport width is greater than 767px (tablet/desktop)
639// * DISABLED when viewport width is 767px or below (mobile) — all styles cleared
640// *
641// * Requires: .sidebar-container, .recently-added, sibling .container-16
642// * .sidebar-container keeps a 30px spacer at top and bottom
643// */
644// (function ($) {
645// 'use strict';
646
647// function initStickySidebar() {
648// // Only listing pages with infinite-scroll company cards (e.g. /water/?company_category=water).
649// // Skip category/overview pages without load-more (e.g. /beverage-non-alcoholic/).
650// if (!$('#glocal-load-more-sentinel').length) {
651// return;
652// }
653
654// var $sidebarContainer = $('.sidebar-container').filter(function () {
655// return $(this).find('.recently-added').length && $(this).prevAll('.container-16').length;
656// }).first();
657// var $sidebar = $sidebarContainer.find('.recently-added').first();
658// var $main = $sidebarContainer.prevAll('.container-16').first();
659
660// if (!$sidebarContainer.length || !$sidebar.length) {
661// return;
662// }
663
664// // Avoid double-init if script is printed twice
665// if ($sidebar.data('stickySidebarInit')) {
666// return;
667// }
668// $sidebar.data('stickySidebarInit', true);
669
670// var MIN_WIDTH = 768; // run only when width >= 768; off on mobile ≤767
671// var GAP = 30; // 30px spacer — top & bottom of sidebar-container + viewport edges
672// var lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
673// var ticking = false;
674// var mode = 'static'; // static | sticky | absolute | disabled
675// var lockedTop = 0;
676// var lastMinHeight = 0;
677// var lastSpacerHeight = 0;
678// var containerWasStatic = $sidebarContainer.css('position') === 'static';
679
680// function isEnabledBreakpoint() {
681// return window.innerWidth >= MIN_WIDTH;
682// }
683
684// function ensureContainerPositioned() {
685// if ($sidebarContainer.css('position') === 'static') {
686// $sidebarContainer.css('position', 'relative');
687// }
688// }
689
690// // Permanent 30px top/bottom spacer inside .sidebar-container
691// function applyContainerSpacers(on) {
692// if (on) {
693// $sidebarContainer.css({
694// paddingTop: GAP + 'px',
695// paddingBottom: GAP + 'px',
696// boxSizing: 'border-box'
697// });
698// } else {
699// $sidebarContainer.css({
700// paddingTop: '',
701// paddingBottom: '',
702// boxSizing: ''
703// });
704// }
705// }
706
707// var $spacer = $('<div class="sticky-sidebar-spacer" aria-hidden="true"/>');
708// $spacer.css({
709// width: '100%',
710// height: 0,
711// margin: 0,
712// padding: 0,
713// border: 0,
714// visibility: 'hidden',
715// pointerEvents: 'none'
716// });
717// $sidebar.before($spacer);
718
719// function syncContainerHeight() {
720// if (!$main.length) return;
721// // Match listings column height; 30px top+bottom padding sits inside this box
722// var mainH = Math.round($main.outerHeight());
723// if (mainH !== lastMinHeight) {
724// lastMinHeight = mainH;
725// $sidebarContainer.css('min-height', mainH + 'px');
726// }
727// }
728
729// function syncSpacer(height) {
730// height = Math.round(height);
731// if (height !== lastSpacerHeight) {
732// lastSpacerHeight = height;
733// $spacer.css('height', height + 'px');
734// }
735// }
736
737// function clearSidebarInline() {
738// $sidebar.css({
739// position: '',
740// top: '',
741// bottom: '',
742// left: '',
743// right: '',
744// width: '',
745// zIndex: '',
746// float: ''
747// });
748// }
749
750// function applyNativeSticky() {
751// if (mode !== 'sticky') {
752// clearSidebarInline();
753// $sidebar.css({
754// position: 'sticky',
755// top: GAP + 'px', // 30px from viewport top
756// bottom: GAP + 'px', // keep 30px from bottom when container ends
757// float: 'none',
758// width: '100%',
759// zIndex: 10
760// });
761// mode = 'sticky';
762// }
763// syncSpacer(0);
764// }
765
766// function applyAbsolute(top) {
767// // Stay 30px from container top and 30px from container bottom
768// var maxTop = Math.max(
769// GAP,
770// $sidebarContainer.outerHeight() - $sidebar.outerHeight() - GAP
771// );
772// top = Math.max(GAP, Math.min(top, maxTop));
773// lockedTop = top;
774
775// $sidebar.css({
776// position: 'absolute',
777// top: top + 'px',
778// bottom: 'auto',
779// left: 0,
780// right: 0,
781// width: 'auto',
782// float: 'none',
783// zIndex: 10
784// });
785// mode = 'absolute';
786// syncSpacer($sidebar.outerHeight());
787// }
788
789// function resetAll() {
790// clearSidebarInline();
791// syncSpacer(0);
792// mode = 'static';
793// lockedTop = 0;
794// }
795
796// function disableSticky() {
797// clearSidebarInline();
798// syncSpacer(0);
799// applyContainerSpacers(false);
800// if (lastMinHeight !== 0) {
801// $sidebarContainer.css('min-height', '');
802// lastMinHeight = 0;
803// }
804// if (containerWasStatic) {
805// $sidebarContainer.css('position', '');
806// }
807// mode = 'disabled';
808// lockedTop = 0;
809// }
810
811// function update() {
812// // Mobile ≤767: do not apply sticky
813// if (!isEnabledBreakpoint()) {
814// if (mode !== 'disabled') {
815// disableSticky();
816// }
817// lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
818// ticking = false;
819// return;
820// }
821
822// if (mode === 'disabled') {
823// mode = 'static';
824// }
825
826// ensureContainerPositioned();
827// applyContainerSpacers(true);
828// syncContainerHeight();
829
830// var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
831// var windowHeight = window.innerHeight;
832// var containerTop = $sidebarContainer.offset().top;
833// var containerHeight = $sidebarContainer.outerHeight();
834// var sidebarHeight = $sidebar.outerHeight();
835
836// if (containerHeight <= sidebarHeight + (GAP * 2) + 2) {
837// resetAll();
838// lastScrollTop = scrollTop;
839// ticking = false;
840// return;
841// }
842
843// var fitsInViewport = sidebarHeight + GAP * 2 <= windowHeight;
844
845// if (fitsInViewport) {
846// applyNativeSticky();
847// lastScrollTop = scrollTop;
848// ticking = false;
849// return;
850// }
851
852// if (mode === 'sticky' || mode === 'static') {
853// var currentTop = $sidebar.offset().top - containerTop;
854// applyAbsolute(currentTop);
855// }
856
857// var scrollingDown = scrollTop > lastScrollTop;
858// var scrollingUp = scrollTop < lastScrollTop;
859
860// // Align with 30px from viewport top / bottom
861// var topAligned = scrollTop + GAP - containerTop;
862// var bottomAligned = scrollTop + windowHeight - GAP - sidebarHeight - containerTop;
863// var maxTop = Math.max(GAP, containerHeight - sidebarHeight - GAP);
864// var nextTop = lockedTop;
865
866// if (scrollingDown) {
867// if (bottomAligned > lockedTop) nextTop = bottomAligned;
868// } else if (scrollingUp) {
869// if (topAligned < lockedTop) nextTop = topAligned;
870// } else {
871// nextTop = lockedTop;
872// }
873
874// nextTop = Math.max(GAP, Math.min(nextTop, maxTop));
875
876// if (mode !== 'absolute' || Math.abs(nextTop - lockedTop) > 0.5) {
877// applyAbsolute(nextTop);
878// }
879
880// lastScrollTop = scrollTop;
881// ticking = false;
882// }
883
884// function requestUpdate() {
885// if (!ticking) {
886// ticking = true;
887// window.requestAnimationFrame(update);
888// }
889// }
890
891// $(window).on('scroll.stickySidebar', requestUpdate);
892// $(window).on('resize.stickySidebar', function () {
893// if (mode === 'sticky') mode = 'static';
894// lastMinHeight = 0;
895// ticking = false;
896// update();
897// });
898// $(window).on('load.stickySidebar', requestUpdate);
899
900// if ($main.length && typeof MutationObserver !== 'undefined') {
901// new MutationObserver(function () {
902// if (!isEnabledBreakpoint()) return;
903// lastMinHeight = 0;
904// requestUpdate();
905// }).observe($main.get(0), { childList: true, subtree: true });
906// }
907
908// $sidebar.find('img').on('load', function () {
909// if (!isEnabledBreakpoint()) return;
910// lastSpacerHeight = -1;
911// requestUpdate();
912// });
913
914// update();
915// }
916
917// // Run when DOM is ready (jQuery must already be on the page)
918// $(initStickySidebar);
919// })(jQuery);
920
921
922
923/**
924 * Universal mobile nav toggle
925 * Works across worldfreightdirect.com, globalwastecontrol.com and
926 * leisurechain.com header templates with ZERO template-specific code
927 * or inline onclick handlers.
928 *
929 * How it decides which button does what:
930 * Any .navbar-toggle button that sits INSIDE #mobileNavbar is treated as
931 * the CLOSE button; one OUTSIDE it (in the header bar) is the OPEN button.
932 * This holds true across all three templates regardless of id/class naming,
933 * so the same markup pattern (see the updated header HTML files) just works.
934 *
935 * Include this once, site-wide, right before </body>.
936 */
937(function () {
938  'use strict';
939
940  function ready(fn) {
941    if (document.readyState !== 'loading') fn();
942    else document.addEventListener('DOMContentLoaded', fn);
943  }
944
945  ready(function () {
946    var drawer = document.getElementById('mobileNavbar');
947    if (!drawer) return; // no mobile header on this page
948
949    var backdrop = document.getElementById('hc-drawer-backdrop');
950    var OPEN_CLASS = 'show';
951
952    var toggleBtns = document.querySelectorAll('.hc-mobile-navbar .navbar-toggle');
953    var openBtns = [];
954    var closeBtns = [];
955
956    toggleBtns.forEach(function (btn) {
957      (drawer.contains(btn) ? closeBtns : openBtns).push(btn);
958    });
959
960    function setExpanded(expanded) {
961      openBtns.concat(closeBtns).forEach(function (btn) {
962        btn.setAttribute('aria-expanded', expanded ? 'true' : 'false');
963      });
964    }
965
966    function openDrawer() {
967      drawer.classList.add(OPEN_CLASS);
968      document.body.classList.add('hc-drawer-open');
969      if (backdrop) backdrop.classList.add(OPEN_CLASS);
970      setExpanded(true);
971    }
972
973    function closeDrawer() {
974      drawer.classList.remove(OPEN_CLASS);
975      document.body.classList.remove('hc-drawer-open');
976      if (backdrop) backdrop.classList.remove(OPEN_CLASS);
977      setExpanded(false);
978    }
979
980    openBtns.forEach(function (btn) {
981      btn.addEventListener('click', function (e) {
982        e.preventDefault();
983        openDrawer();
984      });
985    });
986
987    closeBtns.forEach(function (btn) {
988      btn.addEventListener('click', function (e) {
989        e.preventDefault();
990        closeDrawer();
991      });
992    });
993
994    if (backdrop) {
995      backdrop.addEventListener('click', closeDrawer);
996    }
997
998    document.addEventListener('keydown', function (e) {
999      if (e.key === 'Escape' && drawer.classList.contains(OPEN_CLASS)) {
1000        closeDrawer();
1001      }
1002    });
1003
1004    // Optional external hook, e.g. window.hcToggleMobileNav()
1005    window.hcToggleMobileNav = function () {
1006      if (drawer.classList.contains(OPEN_CLASS)) closeDrawer();
1007      else openDrawer();
1008    };
1009  });
1010})();
1011
1012document.addEventListener('DOMContentLoaded', function () {
1013
1014    document.querySelectorAll('a.bread-link22').forEach(function (link) {
1015
1016        if (link.href === 'https://hospitalitychain.com/meat-lovers-recipes/') {
1017            link.href = 'https://hospitalitychain.com/company_category/meat-lovers-recipes/?cat=meat-lovers-recipes';
1018        }
1019
1020    });
1021
1022});
1023
1024
1025// (function () {
1026//   if (!document.body.classList.contains('hc-recipe-company')) return;
1027
1028//   var root = document.querySelector('.company-tabs-single-company .block-content')
1029//           || document.querySelector('.profile-description .block-content');
1030//   var sidebar = document.querySelector('.contact-details.company-page-block');
1031//   if (!root || !sidebar) return;
1032
1033//   var skip = /^(ingredients|method|about this recipe|chef|from)$/i;
1034//   var heads = Array.prototype.filter.call(root.querySelectorAll('h2, h3'), function (h) {
1035//     var t = (h.textContent || '').replace(/\s+/g, ' ').trim();
1036//     return t && !skip.test(t);
1037//   });
1038//   if (!heads.length) return;
1039
1040//   function slug(s) {
1041//     return s.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
1042//   }
1043
1044//   var nav = document.createElement('nav');
1045//   nav.className = 'hc-recipe-toc';
1046//   nav.setAttribute('aria-label', 'Contents');
1047//   nav.innerHTML = '<span class="hc-recipe-toc-label">Contents</span>';
1048
1049//   heads.forEach(function (h, i) {
1050//     var title = (h.textContent || '').replace(/\s+/g, ' ').trim();
1051//     if (!h.id) h.id = slug(title) || ('recipe-section-' + (i + 1));
1052//     var a = document.createElement('a');
1053//     a.href = '#' + h.id;
1054//     a.textContent = title;
1055//     nav.appendChild(a);
1056//   });
1057
1058//   sidebar.parentNode.insertBefore(nav, sidebar);
1059
1060//   var links = nav.querySelectorAll('a');
1061//   function setActive(id) {
1062//     Array.prototype.forEach.call(links, function (a) {
1063//       a.classList.toggle('is-active', a.getAttribute('href') === '#' + id);
1064//     });
1065//   }
1066//   if (links[0]) links[0].classList.add('is-active');
1067
1068//   if ('IntersectionObserver' in window) {
1069//     var io = new IntersectionObserver(function (entries) {
1070//       entries.forEach(function (en) {
1071//         if (en.isIntersecting) setActive(en.target.id);
1072//       });
1073//     }, { rootMargin: '-20% 0px -60% 0px', threshold: 0 });
1074//     heads.forEach(function (h) { io.observe(h); });
1075//   }
1076
1077//   nav.addEventListener('click', function (e) {
1078//     var a = e.target.closest('a');
1079//     if (!a) return;
1080//     var el = document.getElementById(a.hash.slice(1));
1081//     if (!el) return;
1082//     e.preventDefault();
1083//     el.scrollIntoView({ behavior: 'smooth', block: 'start' });
1084//     setActive(el.id);
1085//   });
1086// })();

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.