PageSourceSearch

https://www.hba.org/javascript/custom.js

js hba.org collected 2026-09-25 23:36:26 UTC 19,901 bytes, 443 lines download raw bytes

1function resizeContactIframe() {
2    $(".contactLoader").hide();
3    $("#contactIframe").height($("#contactIframe").contents().find('.contactFrmHolder').height()+20);
4}
5$(window).on("load resize scroll", function(e) {
6    if ($(window).width() < 980) {
7        $(".dropdown .menu-arrow").remove();
8        $(".header .dropdown").append("<span class='menu-arrow'></span>");
9        $(".menu-arrow").unbind('click');
10
11
12        $(".menu-arrow").click(function() {
13            if ($(this).closest('.dropdown').hasClass('open-droupdown')) {
14                $(this).closest(".dropdown").removeClass('open-droupdown');
15                $(this).closest(".dropdown").children(".dropdown-menu").slideUp();
16            } else {
17                $(this).closest(".dropdown").addClass('open-droupdown');
18                $(this).closest(".dropdown").children(".dropdown-menu").slideDown();
19            }
20
21        });
22
23        $(".btn-navbar").unbind('click');
24
25        $(".btn-navbar").click(function() {
26            $("body").toggleClass("overlay");
27            $(".dropdown").removeClass('open-droupdown');
28            $(".dropdown-menu").hide();
29        });
30
31        $(".mainMenuMobBtn").unbind('click');
32
33        $(".mainMenuMobBtn").click(function() {
34            $(this).toggleClass('textUnderline');
35            $(this).parents(".megaMenuSection").toggleClass('closeBox');
36            $(this).parents(".megaMenuSection").children(".mainMenuMob").slideToggle();
37            $(this).parents(".megaMenuSection").children(".mainMenuOnclickBtn").slideToggle();
38            $(this).parents(".megaMenuSection").children(".mainMenuOnclickBtn").toggleClass('openBoxInner');
39        });
40        $(".mainMenuOnclickBtn").unbind('click');
41
42        $(".mainMenuOnclickBtn").click(function() {
43            $(this).parents(".megaMenuSection").children(".mainMenuOnclick").slideToggle();
44        });
45
46    }
47
48    if ($(window).width() > 979) {
49        $(".mainMenuOnclickBtn").unbind('click');
50        $(".mainMenuOnclickBtn").click(function() {
51            $(this).parents(".megaMenuSection").children(".mainMenuOnclick").slideToggle();
52        });
53    }
54});
55
56$(document).ready(function() {
57
58    var menu = "";
59    $(".menuWrapper > ul > li").each(function() {
60        aCustomClass = '';
61        if($('a', this).attr('class') != undefined){
62            aCustomClass = $('a', this).attr('class');
63        }
64        menu = menu + '<li>' + '<a href="' + $('a', this).attr('href') + '" class="'+aCustomClass+'">' + $('a', this).html() + '</a>';
65        if ($('>ul', this).length) {
66            var subMenu = "";
67            $('>ul >li >ul', this).each(function() {
68                subMenu = subMenu + '<div class="mainMenuMob-col"><ul class="mainMenuMob-list">' + $(this).html() + '</ul></div>';
69            });
70            var subHead = "";
71
72            if ($('h2', this).length) {
73                var link = "";
74                if ($("h2 a", this).length) {
75                    link = '<a href="' + $("h2 a", this).attr("href") + '" class="BlueBorderBtn">' + $("h2 a", this).html() + '</a>';
76                    $("h2 a", this).remove();
77                }
78                subHead = '<div class="header-drop-title"><h2>' + $('h2', this).html().replace(/<br>/g, '') + '</h2>' + link + '</div>';
79            }
80
81            subMenu = '<ul><li class="closeBox textUl">' + subHead + '<div class="mainMenuMob">' + subMenu + '</div></li></ul>';
82            menu = menu + subMenu;
83        }
84        menu = menu + '</li>';
85    });
86
87    $('.menuHolder').replaceWith(menu);
88    $('.nav-collapse ul > li:has(ul)').addClass('dropdown');
89    $('.nav-collapse ul > li.dropdown > a').addClass('dropdown-toggle');
90    $('.nav-collapse ul > li.dropdown > ul').addClass('dropdown-menu row-fluid');
91    $('.nav-collapse ul > li.dropdown > ul.dropdown-menu >  li').addClass('megaMenuSection');
92    $('.nav-collapse ul > li.dropdown > ul.dropdown-menu >  li.megaMenuSection > ul').addClass('mainMenu');
93    $('.nav-collapse ul > li.dropdown > ul.dropdown-menu >  li.megaMenuSection > ul.mainMenu > li > ul').addClass('subMenu');
94    $('.nav-collapse ul > li.dropdown > ul.dropdown-menu >  li.megaMenuSection:has(form)').addClass('formDiv clearfix');
95    $('.nav-collapse ul > li.dropdown > ul.dropdown-menu >  li.megaMenuSection.formDiv > div ').addClass('formframe clearfix');
96    $('.mainMenu > li:has(ul)').addClass('subMenuParent');
97
98    $('.hbf-nav-wrap .nav > li:has(ul)').addClass('dropdown');
99    $('.hbf-nav-wrap .nav > li.dropdown > a').addClass('dropdown-toggle');
100    $('.hbf-nav-wrap .nav > li.dropdown > ul').addClass('dropdown-menu row-fluid');
101    $('.hbf-nav-wrap .nav > li.dropdown > ul.dropdown-menu >  li').addClass('megaMenuSection');
102    $('.hbf-nav-wrap .nav > li.dropdown > ul.dropdown-menu >  li.megaMenuSection > ul').addClass('mainMenu');
103    $('.hbf-nav-wrap .nav > li.dropdown > ul.dropdown-menu >  li.megaMenuSection > ul.mainMenu > li > ul').addClass('subMenu');
104    $('.fa').each(function() {
105        if ($.trim($(this).html()) == '&nbsp;') $(this).html('');
106    });
107    $('.fas').each(function() {
108        if ($.trim($(this).html()) == '&nbsp;') $(this).html('');
109    });
110    $('.fa-brands').each(function() {
111        if ($.trim($(this).html()) == '&nbsp;') $(this).html('');
112    });
113    $('.fa-solid').each(function() {
114        if ($.trim($(this).html()) == '&nbsp;') $(this).html('');
115    });
116
117    $('.mainMenuMob-list > li > a').closest('li').addClass('menuLi');
118
119    $(".slideHolder .item img").each(function() {		;
120		$(this).parents('.item').addClass($(this).attr("class"));
121		var style = "";
122		if($.trim($(this).attr("class")).length){
123			var style = "style='opacity: 0.3;'";
124		}
125    
126        $(this).parents('.item').find('.slideImageHolder').replaceWith('<img '+style+' src="' + $(this).attr('src') + '">');
127        $(this).remove();
128    })
129    $(".slideHolder .item li>a").addClass('WhiteBorderBtn');
130
131
132
133    $(".slider .owl-carousel").owlCarousel({
134        items: 1,
135        margin: 0,
136        loop: true,
137        autoplay: true,
138        autoplayTimeout: 7000,
139        autoplayHoverPause: true,
140        animateIn: 'fadeIn',
141        animateOut: 'fadeOut',
142        touchDrag: false,
143        mouseDrag: false
144    });
145
146    $(".friendsSliderBox ul").addClass('owl-carousel owl-theme').owlCarousel({
147        items: 1,
148        margin: 0,
149        loop: true,
150        nav: true,
151        dots: false,
152        autoplay: true,
153        autoplayTimeout: 7000,
154        animateIn: 'fadeIn',
155        animateOut: 'fadeOut',
156        touchDrag: false,
157        mouseDrag: false,
158        responsive: {
159            0: {
160                items: 1,
161                nav: true
162            },
163            767: {
164                items: 4,
165                nav: true
166            },
167            1000: {
168                items: 4,
169                nav: true
170            }
171        }
172    });
173
174    $(".friendsSliderBox.friendsSliderBox-mobile .owl-carousel").owlCarousel({
175        items: 1,
176        margin: 0,
177        loop: true,
178        nav: true,
179        dots: false,
180        autoplay: true,
181        autoplayTimeout: 7000,
182        //autoplayHoverPause:true,
183        animateIn: 'fadeIn',
184        animateOut: 'fadeOut',
185        touchDrag: false,
186        mouseDrag: false
187    });
188
189
190
191    $(document).on('click', '.searchBtnFn  .dropdown-toggle', function(e) {
192        e.preventDefault();
193        $(this).closest('li').addClass('show-search-bar');
194    });
195
196    $(document).on('click', '.searchclose', function(e) {
197        e.preventDefault();
198        $(this).closest('li.show-search-bar').removeClass('show-search-bar');
199    });
200
201    $(document).on('click', '.toggle-form', function(e) {
202        e.preventDefault();
203        $(this).closest('li').toggleClass('show-form');
204    });
205
206    $('#myTab a').click(function(e) {
207        e.preventDefault();
208        $(this).tab('show');
209        $(".friendsSliderBox .owl-carousel").trigger('refresh.owl.carousel');
210    })
211
212    //  $(document).on('click', '.hbf-nav-wrap .dropdown-toggle', function()  {
213    //   $(this).closest('li').toggleClass('open');
214    //  })
215
216    $("a", ".logoWrapper").addClass("navbar-brand");
217    $(".zoneB1Wrapper ul").addClass("social-list")
218    $(".zoneB1Holder").replaceWith($(".zoneB1Wrapper").html());
219
220    $(".logoHolder").replaceWith($(".logoWrapper").html());
221    $(".zoneP1Holder h3").addClass('footer-title');
222
223    var footerLinks = "";
224    $(".zoneQ1Wrapper > ul > li").each(function() {
225        footerLinks = footerLinks + '<div class="footer-links">' + $(this).html() + '</div>';
226    });
227    if ($(".zoneQ1Wrapper > ul > li").length) {
228        $(".zoneQ1Holder").replaceWith(footerLinks);
229    }
230
231    $(".footerLogoHolder").addClass('footlogo');
232
233    var eventWrapper = $('.eventWrapper ul');
234    var fullEventString = '';
235    var fullMobEventString = '';
236    var fullEventHomeString = '';
237    eventWrapper.each(function() {
238        var heading = '';
239        var eventLinkHref = '';
240        var date = '';
241        var category = '';
242        var categoryMob = '';
243        var eventString = '';
244        var eventMobString = '';
245        var eventHomeString = '';
246        if ($('a', $($('li', $(this))[0])).length) {
247            heading = $('a', $($('li', $(this))[0])).html();
248            eventLinkHref = $('a', $($('li', $(this))[0])).attr('href');
249        }
250        if ($($('li', $(this))[1]).length) {
251            date = $($('li', $(this))[1]).html();
252        }
253        if ($($('li', $(this))[2]).length && $($('li', $(this))[2]).html().length) {
254            category = '<li>' + $($('li', $(this))[2]).html() + '</li>';
255            categoryMob = '<span>' + $($('li', $(this))[2]).html() + '</span>';
256        }
257        eventString = '<a class="eventbox-item" href="' + eventLinkHref + '"><div class="eventbox-item-in"><ul><li>' + date + '</li>' + category + '</ul><p>' + heading + '</p></div></a>';
258        fullEventString = fullEventString + eventString;
259        eventMobString = '<li><a href="' + eventLinkHref + '"><div class="sbm-event"><div class="sbm-e-head"> <span>' + date + '</span> ' + categoryMob + '</div><h4>' + heading + '</h4></div></a></li>';
260        fullMobEventString = fullMobEventString + eventMobString;
261        eventHomeString = '<div class="eventbox-item" ><div class="eventbox-item-in"><ul><li>' + date + '</li>' + category + '</ul><p><a href="' + eventLinkHref + '">' + heading + '</a></p></div></div>';
262        fullEventHomeString = fullEventHomeString + eventHomeString;
263
264    });
265    var eventBottomString = "";
266    if ($('.eventWrapper > a').length) {
267        eventBottomString = '<div class="eventbox-item eventbox-item-link"><a href="' + $('.eventWrapper > a').attr('href') + '" class="event-link">' + $('.eventWrapper > a').html() + ' <i class="fa-solid fa-angles-right" aria-hidden="true">&nbsp;</i></a></div>';
268    }
269    var eventTopImageString = "";
270    if ($('.eventWrapper > img').length) {
271        eventTopImageString = '<img src="' + $('.eventWrapper > img').attr("src") + '" alt="" class="fixed-bg">';
272    }
273    var eventTopHeaderString = "";
274    if ($('.eventWrapper > h3').length) {
275        eventTopHeaderString = $('.eventWrapper > h3').html();
276    }
277    fullEventString = '<div class="eventbox-img"><div class="event-head">' + eventTopImageString + '<h4>' + eventTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullEventString + eventBottomString + '</div>';
278    fullMobEventString = '<h3>' + eventTopHeaderString + '</h3><div class="event-list"><ul>' + fullMobEventString + '</ul></div>';
279    fullEventHomeString = '<div class="eventbox-img"><div class="event-head">' + eventTopImageString + '<h4>' + eventTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullEventHomeString + '</div>';
280    if (eventWrapper.length) {
281        $('.eventHolder').replaceWith(fullEventString);
282        $('.eventMobHolder').replaceWith(fullMobEventString);
283        $('.eventHomeHolder').replaceWith(fullEventHomeString);
284    }
285
286    var newsWrapper = $('.newsWrapper ul');
287    var fullNewsString = '';
288    var fullMobNewsString = '';
289    newsWrapper.each(function() {
290        var heading = '';
291        var newsLinkHref = '';
292        var date = '';
293        var category = '';
294        var categoryMob = '';
295        var newsString = '';
296        var newsMobString = '';
297        if ($('a', $($('li', $(this))[0])).length) {
298            heading = $('a', $($('li', $(this))[0])).html();
299            newsLinkHref = $('a', $($('li', $(this))[0])).attr('href');
300        }
301        if ($($('li', $(this))[1]).length) {
302            date = $($('li', $(this))[1]).html();
303        }
304        if ($($('li', $(this))[2]).length && $($('li', $(this))[2]).html().length) {
305            category = '<li>' + $($('li', $(this))[2]).html() + '</li>';
306            categoryMob = '<span>' + $($('li', $(this))[2]).html() + '</span>';
307        }
308
309        newsString = '<a class="eventbox-item" href="' + newsLinkHref + '"><div class="eventbox-item-in"><ul><li>' + date + '</li>' + category + '</ul><p>' + heading + '</p></div></a>';
310        fullNewsString = fullNewsString + newsString;
311        newsMobString = '<li><a href="' + newsLinkHref + '"><div class="sbm-event"><div class="sbm-e-head"> <span>' + date + '</span> ' + categoryMob + '</div><h4>' + heading + '</h4></div></a></li>';
312        fullMobNewsString = fullMobNewsString + newsMobString;
313    });
314    var newsBottomString = "";
315    if ($('.newsWrapper > a').length) {
316        newsBottomString = '<div class="eventbox-item eventbox-item-link"><a href="' + $('.newsWrapper > a').attr('href') + '" class="event-link">' + $('.newsWrapper > a').html() + ' <i class="fa-solid fa-angles-right" aria-hidden="true">&nbsp;</i></a></div>';
317    }
318    var newsTopImageString = "";
319    if ($('.newsWrapper > img').length) {
320        newsTopImageString = '<img src="' + $('.newsWrapper > img').attr("src") + '" alt="" class="fixed-bg">';
321    }
322    var newsTopHeaderString = "";
323    if ($('.newsWrapper > h3').length) {
324        newsTopHeaderString = $('.newsWrapper > h3').html();
325    }
326    fullNewsString = '<div class="eventbox-img"><div class="event-head">' + newsTopImageString + '<h4>' + newsTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullNewsString + newsBottomString + '</div>';
327    fullMobNewsString = '<h3>' + newsTopHeaderString + '</h3><div class="event-list"><ul>' + fullMobNewsString + '</ul></div>';
328    if (newsWrapper.length) {
329        $('.newsHolder').replaceWith(fullNewsString);
330        $('.newsMobHolder').replaceWith(fullMobNewsString);
331    }
332    var quickWrapper = $('.quickWrapper ul > li');
333    var fullQuickString = '';
334    var fullMobQuickString = '';
335    var fullQuickHomeString = '';
336    quickWrapper.each(function() {
337        var heading = '';
338        var quickLinkHref = '';
339        var quickString = '';
340        var quickMobString = '';
341        var quickHomeString = '';
342        if ($('a', $(this)).length) {
343            heading = $('a', $(this)).html();
344            quickLinkHref = $('a', $(this)).attr('href');
345        }
346        quickString = '<a href="' + quickLinkHref + '" class="sidebar-iconbox"><div class="textBox"><h2>' + heading + '</h2></div><span class="arrow"><img src="/images/arrow.png" alt=""></span></a>';
347        fullQuickString = fullQuickString + quickString;
348        quickMobString = '<li><a href="' + quickLinkHref + '">' + heading + '</a></li>';
349        fullMobQuickString = fullMobQuickString + quickMobString;
350        quickHomeString = '<div class="eventbox-item" ><div class="eventbox-item-in"><p><a href="' + quickLinkHref + '">' + heading + '</a></p></div></div>';
351        fullQuickHomeString = fullQuickHomeString + quickHomeString;
352
353    });
354    var quickTopImageString = "";
355    if ($('.quickWrapper > img').length) {
356        quickTopImageString = '<img src="' + $('.quickWrapper > img').attr("src") + '" alt="" class="fixed-bg">';
357    }
358    var quickTopHeaderString = "";
359    if ($('.quickWrapper > h3').length) {
360        quickTopHeaderString = $('.quickWrapper > h3').html();
361    }
362    fullQuickString = '<div class="eventbox-img"><div class="event-head">' + quickTopImageString + '<h4>' + quickTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullQuickString + '</div>';
363    fullMobQuickString = '<h3>' + quickTopHeaderString + '</h3><div class="event-list"><ul>' + fullMobQuickString + '</ul></div>';
364    fullQuickHomeString = '<div class="eventbox-img"><div class="event-head">' + quickTopImageString + '<h4>' + quickTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullQuickHomeString + '</div>';
365
366    if (quickWrapper.length) {
367        $('.quickHolder').replaceWith(fullQuickString);
368        $('.quickMobHolder').replaceWith(fullMobQuickString);
369        $('.quickHomeHolder').replaceWith(fullQuickHomeString);
370    }
371
372
373    var newsInfoWrapper = $('.newsInfoWrapper ul li');
374    var fullNewsInfoHomeString = '';
375    newsInfoWrapper.each(function() {
376        var heading = '';
377        var newsInfoLinkHref = '';
378        var newsInfoHomeString = '';
379        if ($('a', $(this)).length) {
380            heading = $('a', $(this)).html();
381            newsInfoLinkHref = $('a', $(this)).attr('href');
382        }
383        newsInfoHomeString = '<div class="eventbox-item" ><div class="eventbox-item-in"><p><a href="' + newsInfoLinkHref + '">' + heading + '</a></p></div></div>';
384        fullNewsInfoHomeString = fullNewsInfoHomeString + newsInfoHomeString;
385
386    });
387    var newsInfoTopImageString = "";
388    if ($('.newsInfoWrapper > img').length) {
389        newsInfoTopImageString = '<img src="' + $('.newsInfoWrapper > img').attr("src") + '" alt="" class="fixed-bg">';
390    }
391    var newsInfoTopHeaderString = "";
392    if ($('.newsInfoWrapper > h3').length) {
393        newsInfoTopHeaderString = $('.newsInfoWrapper > h3').html();
394    }
395    fullNewsInfoHomeString = '<div class="eventbox-img"><div class="event-head">' + newsInfoTopImageString + '<h4>' + newsInfoTopHeaderString + '</h4></div></div><div class="eventbox-info">' + fullNewsInfoHomeString + '</div>';
396    if (newsInfoWrapper.length) {
397        $('.newsInfoHomeHolder').replaceWith(fullNewsInfoHomeString);
398    }
399
400    var homeQuick = "";
401    $(".homeQuickWrapper > ul > li").each(function() {
402        var heading = '';
403        var homeQuickLinkHref = '';
404        var image = '';
405        if ($($('li', $(this))[0]).length) {
406            image = $($('li', $(this))[0]).html();
407        }
408        if ($('a', $($('li', $(this))[1])).length) {
409            heading = $('a', $($('li', $(this))[1])).html();
410            homeQuickLinkHref = $('a', $($('li', $(this))[1])).attr('href');
411        }
412        homeQuick = homeQuick + '<li><a href="' + homeQuickLinkHref + '"><div class="iconBox">' + image + '</div><div class="textBox"><h2>' + heading + '</h2></div><span class="arrow"><i class="fa-solid fa-angle-right" aria-hidden="true">&nbsp;</i></span></a></li>'
413    });
414
415    if ($(".homeQuickWrapper > ul > li").length) {
416        $('.homeQuickHolder').replaceWith('<ul>' + homeQuick + '</ul>');
417    }
418
419    $(".slideHolder a").addClass("WhiteBorderBtn");
420
421    /*****************/
422    $(".quicklink-mobile .event-list").hide();
423    $(".quicklink-mobile h3").click(function() {
424        $(".quicklink-mobile .event-list").slideToggle();
425        $(this).toggleClass("quicklink-open");
426    });
427
428    $(".event-mobile .event-list").hide();
429    $(".event-mobile h3").click(function() {
430        $(this).closest(".event-mobile").find(".event-list").slideToggle();
431        $(this).toggleClass("event-open");
432    });
433    if ($(".bannerHolder img").length) {
434        $(".bannerImageHolder").replaceWith('<img src="' + $(".bannerHolder img").attr('src') + '" class="fixed-bg">');
435        $(".bannerHolder img").remove();
436    }
437    $(".bannerHolder ul").addClass("nav");
438    $(".member-boxtwo h2").addClass("TitleText");
439    $(".member-boxtwo p").append("<br>");
440    $(".member-boxtwo a").wrap("<span>");
441
442    $('.headerNavWrap').removeClass('hide');
443});

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.