PageSourceSearch

https://authgateway.bma.org.uk/bmaassets/scripts/script3.js?v=ZpJ5ZfJZrmfu9w9YjnRzWV96LGgm5Xuak2HACaPhfKE

js bma.org.uk collected 2026-09-24 08:25:55 UTC 42,464 bytes, 1,127 lines download raw bytes

1jQuery(function (a) {
2    /*var e = {
3        renderTemplate: null,
4        template: '{{~ it :i}}<li><div class="avatar"><img src="{{=i.UserAvatarUrl}}" alt="{{=i.UserName}} Avatar" /><span class="name">{{=i.UserName}}</span></div><div class="copy"><p>{{=i.BodyHtml}}</p><div class="date-time">{{=i.CreatedDateDate }}<br />{{=i.CreatedDateTime }}</div></div></li>{{~}}',
5        renderData: function(s, t) {
6            var u = this.renderTemplate(t);
7            a("ul", s).append(u)
8        },
9        disableLoadButton: function(s) {
10            a(".load-more", s).hide()
11        },
12        enable: function(s) {
13            a(s).show()
14        },
15        enableLoadButton: function(s) {
16            a(".load-more", s).show()
17        },
18        init: function() {
19            this.initTemplates();
20            this.initComments()
21        },
22        initTemplates: function() {
23            this.renderTemplate = doT.template(this.template)
24        },
25        initComments: function() {
26            a("[data-comments]").each(function(t, s) {
27                var v = a(s);
28                var u = v.data();
29                u.page = 0;
30                u.loadedCount = 0;
31                u.totalCount = 0;
32                e.loadNextPage(v, u).done(function() {
33                    if (u.loadedCount < u.totalcount) {
34                        e.initLoadButton(v)
35                    } else {
36                        e.disableLoadButton(v)
37                    }
38                    e.initPosting(v);
39                    e.enable(v)
40                }).fail(function() {})
41            })
42        },
43        initLoadButton: function(t) {
44            var s = t.data();
45            a(".load-more a", t).on("touch click", function(u) {
46                u.preventDefault();
47                e.disableLoadButton(t);
48                e.loadNextPage(t, s).done(function() {
49                    if (s.loadedCount < s.totalcount) {
50                        e.enableLoadButton(t)
51                    }
52                })
53            })
54        },
55        initPosting: function(t) {
56            var s = t.data();
57            a("input[type=submit]", t).on("touch click", function(x) {
58                x.preventDefault();
59                var w = a("textarea", t).val();
60                var u = a(".result", t);
61                var v = a(this);
62                v.addClass("loading");
63                v.prop("disabled", true);
64                a.ajax({
65                    url: s.postUrl,
66                    data: {
67                        Body: w
68                    },
69                    type: "POST",
70                    dataType: "json"
71                }).done(function(y) {
72                    if (y.Success) {
73                        u.text(s.postSuccess)
74                    } else {
75                        if (y.Error) {
76                            u.text(y.Error)
77                        } else {
78                            u.text(s.postError)
79                        }
80                    }
81                }).fail(function(y, z) {
82                    u.text(s.postError)
83                }).always(function(y) {
84                    v.removeClass("loading");
85                    v.prop("disabled", false)
86                })
87            })
88        },
89        loadNextPage: function(t, s) {
90            return a.ajax({
91                url: s.getUrl,
92                data: {
93                    page: s.page
94                },
95                type: "GET",
96                dataType: "json"
97            }).done(function(u) {
98                if (u.Success) {
99                    s.page++;
100                    a.each(u.Comments, function() {
101                        var v = new Date(this.CreatedDate);
102                        this.CreatedDateDate = v.format("dd mmmm yyyy");
103                        this.CreatedDateTime = v.format("H:sstt")
104                    });
105                    e.renderData(t, u.Comments);
106                    s.loadedCount += u.Comments.length;
107                    s.totalcount = u.TotalCount
108                } else {}
109            }).fail(function(u, v) {
110                console.log("Could not load comments.")
111            })
112        }
113    };*/
114    var q = {
115        elms: {
116            globalMenu: a(".global-menu"),
117            masterNav: a(".master-nav ul li a"),
118            controlStudyMenu: a("#control-study-menu"),
119            studyMenu: a("#study-menu"),
120            controlSearchMenu: a("#control-search-menu"),
121            searchMenu: a("#search-menu"),
122            closeMobileMenu: a("#close-mobile-menu"),
123            openMobileMenu: a("#open-mobile-menu"),
124            mobileMenu: a("#mobile-menu"),
125            pageOverlays: a(".page-overlay"),
126            body: a("body"),
127            header: a("header"),
128            openSubmenu: a(".trigger-subnav"),
129            menuExpanded: a(".menu-expanded"),
130            menuExpandedDefault: a(".expanded"),
131            subMenuItem: a(".menu-expanded li a"),
132            subMenuStatus: a(".menu-expanded li a span"),
133            screenOverlay: a(".screen-overlay")
134        },
135        openStudyMenu: function (s) {
136            s.preventDefault();
137            q.elms.studyMenu.fadeIn(600);
138            q.elms.pageOverlays.fadeIn(600);
139            q.elms.body.addClass("overflow-hide");
140            q.elms.controlStudyMenu.addClass("active")
141        },
142        closeStudyMenu: function (s) {
143            s.preventDefault();
144            q.elms.studyMenu.fadeOut(600);
145            q.elms.pageOverlays.fadeOut(600);
146            q.elms.body.removeClass("overflow-hide");
147            q.elms.controlStudyMenu.removeClass("active")
148        },
149        openSearchMenu: function (s) {
150            s.preventDefault();
151            q.elms.searchMenu.fadeIn(600);
152            q.elms.pageOverlays.fadeIn(600);
153            q.elms.body.addClass("overflow-hide");
154            q.elms.controlSearchMenu.addClass("active")
155        },
156        closeSearchMenu: function (s) {
157            s.preventDefault();
158            q.elms.searchMenu.fadeOut(600);
159            q.elms.pageOverlays.fadeOut(600);
160            q.elms.body.removeClass("overflow-hide");
161            q.elms.controlSearchMenu.removeClass("active")
162        },
163        openMobileMenu: function (s) {
164            s.preventDefault();
165            q.elms.closeMobileMenu.fadeIn(200);
166            q.elms.mobileMenu.fadeIn(600);
167            q.elms.pageOverlays.fadeIn(600);
168            q.elms.body.addClass("overflow-hide")
169        },
170        closeMobileMenu: function (s) {
171            s.preventDefault();
172            q.elms.closeMobileMenu.fadeOut(200);
173            q.elms.mobileMenu.fadeOut(600);
174            q.elms.pageOverlays.fadeOut(600);
175            q.elms.body.removeClass("overflow-hide")
176        },
177        closeAllMenu: function (s) {
178            s.preventDefault();
179            q.elms.globalMenu.fadeOut(600);
180            q.elms.pageOverlays.fadeOut(600);
181            q.elms.body.removeClass("overflow-hide");
182            q.elms.masterNav.removeClass("active")
183        },
184        eventListeners: function () {
185            q.elms.controlStudyMenu.on("click touch", function (s) {
186                if (q.elms.controlSearchMenu.hasClass("active")) {
187                    q.closeSearchMenu(s)
188                }
189                if (q.elms.controlStudyMenu.hasClass("active")) {
190                    q.closeStudyMenu(s)
191                } else {
192                    q.openStudyMenu(s)
193                }
194            });
195            q.elms.controlSearchMenu.on("click touch", function (s) {
196                if (q.elms.controlStudyMenu.hasClass("active")) {
197                    q.closeStudyMenu(s)
198                }
199                if (q.elms.controlSearchMenu.hasClass("active")) {
200                    q.closeSearchMenu(s)
201                } else {
202                    q.openSearchMenu(s)
203                }
204            });
205            q.elms.openMobileMenu.on("click touch", function (s) {
206                q.openMobileMenu(s)
207            });
208            q.elms.closeMobileMenu.on("click touch", function (s) {
209                q.closeMobileMenu(s)
210            });
211            q.elms.pageOverlays.on("click touch", function (s) {
212                q.closeAllMenu(s)
213            });
214            q.elms.openSubmenu.on("click touch", function (t) {
215                t.preventDefault();
216                var s = a(this);
217                s.parent().next(".menu-expanded").first().slideToggle(600);
218                s.children("span").toggleClass("active")
219            });
220            q.elms.subMenuItem.on("click touch", function (s) {
221                return false(s)
222            })
223        },
224        init: function () {
225            q.eventListeners()
226        }
227    };
228    /*var f = {
229        renderTemplate: null,
230        template: '{{~ it :i}}<li><a href="{{=i.Url}}" class="page-link"><h3>{{=i.Title}}</h3><p>{{=i.Text}}</p></a></li>{{~}}',
231        renderData: function(t, s) {
232            var u = this.renderTemplate(s);
233            a("ul", t).append(u);
234            a(".page-listing ul li .page-link").matchHeight()
235        },
236        disable: function(s) {
237            a(".load-more", s).hide()
238        },
239        init: function() {
240            this.initTemplates();
241            this.initEvents()
242        },
243        initTemplates: function() {
244            this.renderTemplate = doT.template(this.template)
245        },
246        initEvents: function() {
247            a("[data-expanding]").each(function(t, s) {
248                var u = a(s);
249                u.data("page", 1);
250                var v = u.data("url");
251                a(".load-more a", u).on("touch click", function(w) {
252                    w.preventDefault();
253                    a.ajax({
254                        url: v,
255                        type: "GET",
256                        data: {
257                            page: u.data("page"),
258                            contextItemId: u.data("context-item")
259                        },
260                        dataType: "json",
261                        success: function(y) {
262                            var x = u.data("page");
263                            u.data("page", x + 1);
264                            f.renderData(u, y);
265                            if (y.length < u.data("page-size")) {
266                                f.disable(u)
267                            }
268                        },
269                        error: function() {
270                            console.log("Could not load content.")
271                        }
272                    })
273                })
274            })
275        }
276    };
277    */
278    var g = {
279        elms: {
280            filterItemLi: a(".filter-nav > li"),
281            filterItem: a(".filter-nav > li > a"),
282            closeFilter: a(".options-cta .close"),
283            optionItem: a(".options-group li a"),
284            applyOptions: a(".options-cta .apply"),
285            groupIDAnchor: a(".group-select >li >a"),
286            geocodeOptions: a(".options-cta .geocode"),
287        },
288        toggleActiveMenu: function (s) {
289            a(".options-wrapper[ data-filterid=" + s + "]").each(function () {
290                a(".options-wrapper").removeClass("active");
291                g.elms.filterItemLi.removeClass("active");
292                a(this).addClass("active")
293            })
294        },
295        toggleActiveGroup: function (s) {
296            a(".group[ data-group=" + s + "]").each(function () {
297                a(".group").removeClass("active");
298                a(this).addClass("active")
299            })
300        },
301        eventListeners: function () {
302            g.elms.filterItem.on("click touch", function (s) {
303                s.preventDefault();
304                var t = a(this).attr("data-filterid");
305                if (a(this).parent().hasClass("active")) {
306                    a(".options-wrapper[ data-filterid=" + t + "]").removeClass("active");
307                    a(this).parent().removeClass("active")
308                } else {
309                    g.toggleActiveMenu(t);
310                    a(this).parent().addClass("active")
311                }
312            });
313            g.elms.closeFilter.on("click touch", function (s) {
314                s.preventDefault();
315                a(this).closest(".options-wrapper").removeClass("active");
316                g.elms.filterItemLi.removeClass("active")
317            });
318            g.elms.optionItem.on("click touch", function (s) {
319                s.preventDefault();
320                var t = a(this).closest(".options-group");
321                if (a(this).hasClass("disabled")) { } else {
322                    if (a(this).hasClass("active")) {
323                        a(this).removeClass("active")
324                    } else {
325                        a(this).closest(".options-group").find("li a").removeClass("active");
326                        a(this).addClass("active")
327                    }
328                }
329            });
330            g.elms.applyOptions.on("click touch", function (s) {
331                s.preventDefault();
332                a(this).each(function () {
333                    var t = a(this).closest(".options-group").find(".options-nav").find("li a.active");
334                    if (t.length === 0) {
335                        t = a(this).closest(".group-wrapper").find(".group-select").find("li.active a")
336                    }
337                    if (t.length > 0) {
338                        var u = t.data();
339                        if (u.apply == "geocode") {
340                            g.redirectToLocation(t.attr("href"), u.type)
341                        } else {
342                            if (u.type && u.value) {
343                                a.cookie(u.type, u.value, {
344                                    raw: 1
345                                })
346                            }
347                            window.location = t.attr("href")
348                        }
349                    }
350                })
351            });
352            g.elms.groupIDAnchor.on("click touch", function (s) {
353                s.preventDefault();
354                var t = a(this).parent().data("group");
355                if (a(this).parent().hasClass("active")) { } else {
356                    a(".group-select >li").removeClass("active");
357                    g.toggleActiveGroup(t);
358                    a(this).parent().addClass("active")
359                }
360            });
361            g.elms.geocodeOptions.on("click touch", function (s) {
362                s.preventDefault();
363                g.redirectToLocation(a(this).attr("href"), a(this).data("type"))
364            })
365        },
366        redirectToLocation: function (s, t) {
367            d.reverseGeocodeCurrentLocation(function (u) {
368                var v = new Url(s);
369                v.query.region = u.region;
370                if (t) {
371                    a.cookie(t, u.region, {
372                        raw: 1
373                    })
374                }
375                window.location = v
376            })
377        },
378        removeUnsupported: function () {
379            if (!("geolocation" in navigator)) {
380                g.elms.geocodeOptions.hide()
381            }
382        },
383        init: function () {
384            g.eventListeners();
385            g.removeUnsupported()
386        }
387    };
388    var h = {
389        init: function () {
390            a(document).on("scroll", function () {
391                if (window.windowWidth > window.tablet) {
392                    if (a(document).scrollTop() > 57) {
393                        a('header:not("article header")').addClass("shrink")
394                    } else {
395                        a("header").removeClass("shrink")
396                    }
397                }
398            })
399        }
400    };
401    var i = {
402        init: function () {
403            if (a(".results li.locked").length > 0) {
404                a(".results li.locked >a").each(function () {
405                    var t = a(this).width();
406                    var s = a(this).height();
407                    var u = a(this).next(".tip");
408                    if (window.windowWidth >= window.tablet) {
409                        if (s < 25) {
410                            u.css("left", t - 27).css("top", s + 7)
411                        } else {
412                            u.css("left", "0").css("top", s + 7)
413                        }
414                    } else {
415                        u.css("left", "0").css("top", s + 7)
416                    }
417                    a(this).on("click touch", function (v) {
418                        v.preventDefault();
419                        a(".tip").removeClass("active");
420                        u.toggleClass("active");
421                        if (u.hasClass("active")) {
422                            u.attr("aria-hidden", "false")
423                        } else {
424                            u.attr("aria-hidden", "true")
425                        }
426                    })
427                })
428            }
429        }
430    };
431    var j = {
432        elms: {
433            promoBox: a(".promo")
434        },
435        matchHeightFunction: function () {
436            a(".promo").matchHeight()
437        },
438        eventListeners: function () {
439            if (a(".promo").length > 0) {
440                j.matchHeightFunction()
441            }
442        },
443        init: function () {
444            j.eventListeners();
445            if (a(".filter-wrapper").length > 0) {
446                var s = a(".group-select").height();
447                a(".group").css("min-height", s)
448            }
449        }
450    };
451    var k = {
452        getCurrentTimestamp: function () {
453            return Math.floor(new Date().getTime() / 1000)
454        },
455        init: function () {
456            var s = a(".news-message"),
457                t = s.find(".close"),
458                u = false,
459                v = s.data("timestamp"),
460                w = a.cookie("bma-news");
461            if (!w || (v && v > w)) {
462                setTimeout(function () {
463                    s.slideDown(300);
464                    u = true;
465                    setTimeout(function () {
466                        t.click()
467                    }, 10000)
468                }, 1000)
469            }
470            t.on("click", function (x) {
471                a.cookie("bma-news", k.getCurrentTimestamp(), {
472                    expires: 1,
473                    path: "/"
474                });
475                x.preventDefault();
476                s.slideUp(300);
477                u = false
478            })
479        }
480    };
481    /*var m = {
482        elms: {
483            siteSearch: a("#siteSearch"),
484            txtSearch: a("#txtSearchValue"),
485            btnSubmitSearch: a("#btnSubmitSearch"),
486            suggestions: a("#searchSuggestions"),
487        },
488        renderTemplate: null,
489        template: '{{~ it.suggestions :i}}<li><a href="{{=i.url}}" >{{=i.content}}</a></li>{{~}}',
490        init: function() {
491            this.initTemplates();
492            m.elms.txtSearch.on("keyup", a.debounce(250, function(s) {
493                if (s.keyCode == 13) {
494                    m.redirectToResults()
495                } else {
496                    var t = a(this).val();
497                    if (t && t.length > 3) {
498                        m.populateSuggestions(t)
499                    } else {
500                        m.clearSuggestions()
501                    }
502                }
503            }));
504            m.elms.btnSubmitSearch.on("touch click", function(s) {
505                s.preventDefault();
506                m.redirectToResults()
507            })
508        },
509        clear: function() {
510            m.elms.txtSearch.val("");
511            m.clearSuggestions()
512        },
513        focus: function() {
514            m.elms.txtSearch.focus()
515        },
516        initTemplates: function() {
517            this.renderTemplate = doT.template(this.template)
518        },
519        clearSuggestions: function() {
520            m.elms.suggestions.hide();
521            m.elms.suggestions.empty()
522        },
523        populateSuggestions: function(t) {
524            var s = m.elms.suggestions.data();
525            a.ajax({
526                url: s.searchUrl,
527                type: "GET",
528                data: {
529                    q: t
530                },
531                success: function(u) {
532                    m.elms.suggestions.html(m.renderTemplate(u));
533                    m.elms.suggestions.show()
534                },
535                error: function() {
536                    console.log("Could not populate search content.")
537                }
538            })
539        },
540        redirectToResults: function() {
541            var s = m.elms.btnSubmitSearch.data().resultsUrl;
542            var t = new Url(s);
543            t.query.q = m.elms.txtSearch.val();
544            window.location = t
545        }
546    };*/
547    var n = {
548        init: function () {
549            if (a(".cookie-message").length > 0) {
550                var s = a(".cookie-message"),
551                    t = s.find(".close"),
552                    u = false;
553                if (!a.cookie("bma-cookie")) {
554                    setTimeout(function () {
555                        s.slideDown(300);
556                        u = true;
557                        if (window.windowWidth > window.tablet) {
558                            a("header").addClass("cookie-on");
559                            a(".main").addClass("cookie-on")
560                        }
561                    }, 1000)
562                }
563                t.on("click", function (v) {
564                    a.cookie("bma-cookie", "1", {
565                        expires: 1,
566                        path: "/"
567                    });
568                    v.preventDefault();
569                    s.slideUp(300);
570                    if (window.windowWidth > window.tablet) {
571                        a("header").removeClass("cookie-on");
572                        a(".main").removeClass("cookie-on")
573                    }
574                    u = false
575                })
576            }
577        }
578    };
579    var o = {
580        init: function () {
581            a(".slider ul").slick({
582                infinite: true,
583                slidesToShow: 3,
584                slidesToScroll: 3,
585                arrows: true,
586                dots: true,
587                dotsClass: "custom_paging",
588                customPaging: function (t, s) {
589                    return (s + 1) + " / " + Math.ceil(t.slideCount / 3)
590                },
591                responsive: [{
592                    breakpoint: 640,
593                    settings: {
594                        centerMode: true,
595                        centerPadding: "20px",
596                        slidesToShow: 1,
597                        slidesToScroll: 1,
598                        dots: false,
599                        dotsClass: "custom_paging",
600                        customPaging: function (t, s) {
601                            return (s + 1) + " / " + (t.slideCount)
602                        },
603                    }
604                }]
605            });
606            a(".slider ol").slick({
607                infinite: false,
608                dots: false,
609                slidesToShow: 3,
610                slidesToScroll: 3,
611                arrows: true,
612                responsive: [{
613                    breakpoint: 640,
614                    settings: {
615                        slidesToShow: 1,
616                        slidesToScroll: 1
617                    }
618                }]
619            })
620        }
621    };
622    var p = {
623        init: function () {
624            if (a(".btn.survey").length > 0) {
625                var s = a(".btn.survey");
626                if (!a.cookie("survey-cookie")) {
627                    setTimeout(function () {
628                        s.show()
629                    }, 1000)
630                }
631                a(".btn.survey").on("click touch", function (t) {
632                    console.log("test");
633                    a.cookie("survey-cookie", "1", {
634                        path: "/"
635                    });
636                    s.hide()
637                })
638            }
639        }
640    };
641    var r = {
642        init: function () {
643            if (a(".twitter-wide").length > 0) {
644                a.ajax({
645                    url: "//twemoji.maxcdn.com/2/twemoji.min.js",
646                    cache: true,
647                    dataType: "script",
648                }).done(function () {
649                    if (typeof twemoji !== "undefined") {
650                        a(".twitter-wide").each(function () {
651                            twemoji.parse(a(this)[0])
652                        })
653                    }
654                })
655            }
656        }
657    };
658    /*var l = {
659        elms: {
660            btnSubmit: a("#btnNewsLtrSub"),
661            firstName: a("#newsLtrFirstname"),
662            surname: a("#newsLtrSurname"),
663            gmc: a("#newsLtrGmc"),
664            bop: a("#newsLtrBop"),
665            email: a("#newsLtrEmail"),
666            agreeTerms: a("#newsLtrTerms"),
667            successMessage: a("#newsLtrSuccess"),
668            errorMessage: a("#newsLtrError")
669        },
670        renderTemplate: null,
671        template: "<ul>{{~ it :i}}<li>{{=i}}</li>{{~}}</ul>",
672        showSuccess: function(t) {
673            var s = this.renderTemplate(t);
674            l.elms.errorMessage.empty();
675            l.elms.successMessage.html(s)
676        },
677        showError: function(s) {
678            var t = this.renderTemplate(s);
679            l.elms.successMessage.empty();
680            l.elms.errorMessage.html(t)
681        },
682        clear: function() {
683            l.elms.firstName.val("");
684            l.elms.surname.val("");
685            l.elms.gmc.val("");
686            l.elms.bop.val("");
687            l.elms.email.val("");
688            l.elms.agreeTerms.prop("checked", false);
689            l.elms.successMessage.empty();
690            l.elms.errorMessage.empty();
691            l.elms.btnSubmit.show()
692        },
693        focus: function() {
694            l.elms.firstName.focus()
695        },
696        disableLoadButton: function() {
697            l.elms.btnSubmit.addClass("loading");
698            l.elms.btnSubmit.prop("disabled", true)
699        },
700        enableLoadButton: function() {
701            l.elms.btnSubmit.removeClass("loading");
702            l.elms.btnSubmit.prop("disabled", false)
703        },
704        init: function() {
705            this.initTemplates();
706            this.initSubmit()
707        },
708        initTemplates: function() {
709            this.renderTemplate = doT.template(this.template)
710        },
711        initSubmit: function() {
712            l.elms.email.on("keyup", function(s) {
713                if (s.keyCode == 13) {
714                    l.elms.btnSubmit.get(0).click()
715                }
716            });
717            l.elms.btnSubmit.on("touch click", function(s) {
718                s.preventDefault();
719                l.submit()
720            })
721        },
722        submit: function() {
723            var s = l.elms.btnSubmit.data();
724            var t = s.defaultError;
725            var u = s.defaultSuccess;
726            l.disableLoadButton();
727            a.ajax({
728                url: s.newsletterUrl,
729                type: "POST",
730                data: {
731                    firstName: l.elms.firstName.val(),
732                    surname: l.elms.surname.val(),
733                    gmc: l.elms.gmc.val(),
734                    branchOfPractice: l.elms.bop.val(),
735                    emailAddress: l.elms.email.val(),
736                    agreeTerms: l.elms.agreeTerms.prop("checked"),
737                },
738                dataType: "json"
739            }).done(function(v) {
740                l.enableLoadButton();
741                if (v.Success) {
742                    l.showSuccess([u]);
743                    l.elms.btnSubmit.hide()
744                } else {
745                    l.showError(v.Error)
746                }
747            }).fail(function() {
748                l.showError([t]);
749                l.enableLoadButton()
750            })
751        }
752    };*/
753    var d = {
754        init: function () {
755            if (a(".bmalocation").length > 0) {
756                d.loadMapApi()
757            }
758        },
759        loadMapApi: function () {
760            var s = document.createElement("script");
761            s.type = "text/javascript";
762            s.async = true;
763            s.src = "//maps.google.com/maps/api/js?sensor=false&callback=googleApiCallback";
764            document.body.appendChild(s)
765        },
766        loadMapApiForGeocode: function () {
767            var s = document.createElement("script");
768            s.type = "text/javascript";
769            s.async = true;
770            s.src = "//maps.google.com/maps/api/js?sensor=false&callback=googleGeocodeCallback";
771            document.body.appendChild(s)
772        },
773        initAfterMapLoad: function () {
774            var s = "assets/img/icons/icon-pin.png";
775            a(".bmalocation").each(function () {
776                var t = a(this).data();
777                var w = new google.maps.LatLng(t.lat, t.lon);
778                var v = a(this)[0];
779
780                function u() {
781                    var y = {
782                        center: w,
783                        mapTypeId: google.maps.MapTypeId.ROADMAP,
784                        zoom: t.zoom || 16,
785                        scrollwheel: t.scale
786                    };
787                    var x = new google.maps.Map(v, y);
788                    var z = new google.maps.Marker({
789                        icon: s,
790                        position: w
791                    });
792                    z.setMap(x)
793                }
794                google.maps.event.addDomListener(window, "load", u)
795            })
796        },
797        reverseGeocodeCurrentLocation: function (s) {
798            if ("geolocation" in navigator) {
799                navigator.geolocation.getCurrentPosition(function (t) {
800                    if (typeof google === "undefined" || typeof google.maps === "undefined") {
801                        window.googleGeocodeCallback = function () {
802                            d.reverseGeocode(t, s)
803                        };
804                        d.loadMapApiForGeocode()
805                    } else {
806                        d.reverseGeocode(t, s)
807                    }
808                }, function () { })
809            } else { }
810        },
811        reverseGeocode: function (v, s) {
812            var t = new google.maps.Geocoder;
813            var u = {
814                lat: v.coords.latitude,
815                lng: v.coords.longitude
816            };
817            t.geocode({
818                location: u
819            }, function (y, z) {
820                if (z === google.maps.GeocoderStatus.OK) {
821                    var w = [];
822                    a.each(y, function (A, B) {
823                        a.each(B.address_components, function (D, C) {
824                            if (a.inArray("administrative_area_level_1", C.types) > -1) {
825                                w.push(C)
826                            }
827                        })
828                    });
829                    if (w.length > 0) {
830                        var x = a.extend(u, {
831                            region: d.regionTranslate(w[0].short_name.toLowerCase())
832                        });
833                        s(x)
834                    } else {
835                        s(u)
836                    }
837                }
838            })
839        },
840        translatableRegions: {
841            england: "EN",
842            "northern ireland": "NI",
843            wales: "WA",
844            scotland: "SC",
845        },
846        regionTranslate: function (s) {
847            if (typeof d.translatableRegions[s] != "undefined") {
848                return d.translatableRegions[s]
849            }
850            return "INT"
851        }
852    };
853    window.googleApiCallback = d.initAfterMapLoad;
854    var b = {
855        init: function () {
856            a(".accordion ul li h3").on("click", function () {
857                a(this).toggleClass("active");
858                a(this).next().slideToggle("400")
859            })
860        }
861    };
862    var c = {
863        elms: {
864            btnSignIn: a("#btnSignin"),
865            errorMessage: a("#signinError"),
866            username: a("#signinUsername"),
867            password: a("#signinPassword")
868        },
869        clear: function () {
870            c.elms.username.val("");
871            c.elms.password.val("");
872            c.elms.errorMessage.text("")
873        },
874        focus: function () {
875            c.elms.username.focus()
876        },
877        disableLoadButton: function () {
878            c.elms.btnSignIn.addClass("loading");
879            c.elms.btnSignIn.prop("disabled", true)
880        },
881        enableLoadButton: function () {
882            c.elms.btnSignIn.removeClass("loading");
883            c.elms.btnSignIn.prop("disabled", false)
884        },
885        init: function () {
886            this.initSignin()
887        },
888        initSignin: function () {
889            c.elms.password.on("keyup", function (s) {
890                if (s.keyCode == 13) {
891                    c.elms.btnSignIn.get(0).click()
892                }
893            });
894            c.elms.btnSignIn.on("touch click", function (s) {
895                s.preventDefault();
896                c.submitSignin()
897            })
898        },
899        submitSignin: function () {
900            var s = c.elms.btnSignIn.data();
901            c.disableLoadButton();
902            a.ajax({
903                url: s.authUrl,
904                type: "POST",
905                data: {
906                    username: c.elms.username.val(),
907                    password: c.elms.password.val(),
908                    returnUrl: window.location.href
909                },
910                dataType: "json"
911            }).done(function (t) {
912                if (t.Success) {
913                    window.location = t.RedirectUrl
914                } else {
915                    c.elms.errorMessage.text(t.Error);
916                    c.enableLoadButton()
917                }
918            }).fail(function () {
919                c.elms.errorMessage.text(s.defaultError);
920                c.enableLoadButton()
921            })
922        },
923        submitSignout: function (t) {
924            var s = a(t).data();
925            a.ajax({
926                url: s.authUrl,
927                type: "POST",
928                dataType: "json"
929            }).done(function (u) {
930                if (u.Success) {
931                    window.location = u.RedirectUrl
932                }
933            })
934        }
935    };
936    (function (s) {
937        s(function () {
938            window.windowWidth = window.innerWidth;
939            window.windowHeight = window.innerHeight;
940            window.isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");
941            window.isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");
942            window.isiPod = navigator.userAgent.toLowerCase().indexOf("ipod");
943            window.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") > -1);
944            window.tablet = 768;
945            window.tabletWide = 800;
946            window.desktop = 1024;
947            n.init();
948            p.init();
949            j.init();
950            o.init();
951            g.init();
952            h.init();
953            b.init();
954            k.init();
955            d.init();
956            i.init();
957            //f.init();
958            //e.init();
959            c.init();
960            r.init();
961            //m.init();
962            //l.init();
963            s(".mbl-brgr").on("click", function (x) {
964                x.preventDefault();
965                if (s(".mbl-login.signedin").hasClass("active")) {
966                    s(".mbl-login.signedin").removeClass("active")
967                }
968                s(this).toggleClass("active");
969                s(".primary-wrapper").toggleClass("active")
970            });
971            s(".mbl-login.signedin a").on("click touch", function (x) {
972                x.preventDefault();
973                s(this).parents(".signedin").toggleClass("active");
974                if (s(".mbl-brgr").hasClass("active")) {
975                    s(".mbl-brgr").removeClass("active");
976                    s(".primary-wrapper").toggleClass("active")
977                }
978                if (s(".mbl-login.signedin .account-menu").length > 0) { } else {
979                    s(".account-menu").clone().appendTo(s(".mbl-login.signedin"))
980                }
981            });
982            if (s(".page-listing ").length > 0) {
983                s(".page-listing ul li .page-link").matchHeight()
984            }
985            s(".brgr a").click(function (x) {
986                x.preventDefault();
987                s("header").removeClass("shrink")
988            });
989            if (s(".util li.search a").length > 0) {
990                s(".util li.search a").on("click", function (x) {
991                    x.preventDefault();
992                    m.clear();
993                    Custombox.open({
994                        target: "#siteSearch",
995                        effect: "blur",
996                        position: ["center", "one-third"],
997                        complete: function () {
998                            m.focus()
999                        }
1000                    })
1001                })
1002            }
1003            if (s("a[data-signin-link]").length > 0) {
1004                s("a[data-signin-link]").on("click", function (x) {
1005                    c.clear();
1006                    Custombox.open({
1007                        target: "#siteLogin",
1008                        effect: "blur",
1009                        complete: function () {
1010                            c.focus()
1011                        }
1012                    });
1013                    x.preventDefault()
1014                })
1015            }
1016            if (s("a[data-signout-link]").length > 0) {
1017                s("a[data-signout-link]").on("click", function (x) {
1018                    c.submitSignout(s(this));
1019                    x.preventDefault()
1020                })
1021            }
1022            if (s("a[data-newsltr-link], .js-newsltr-link").length > 0) {
1023                s("a[data-newsltr-link], .js-newsltr-link").on("click", function (x) {
1024                    x.preventDefault();
1025                    l.clear();
1026                    Custombox.open({
1027                        target: "#newsLtrSub",
1028                        effect: "blur",
1029                        complete: function () { }
1030                    })
1031                })
1032            }
1033            var w = s("#siteLogin");
1034            if (w.length > 1 && w.data("auto-show") == 1) {
1035                Custombox.open({
1036                    target: "#siteLogin",
1037                    effect: "blur"
1038                })
1039            }
1040            if (s(".mbl-filters").length > 0) {
1041                s(".mbl-filters").on("click", function (x) {
1042                    s(this).text(function (y, z) {
1043                        return z === "Show filters" ? "Hide filters" : "Show filters"
1044                    });
1045                    s(".filter-nav").slideToggle("400");
1046                    if (s(".options-wrapper").hasClass("active")) {
1047                        s(".options-wrapper, .filter-nav li, .options-nav li, .options-group .group").removeClass("active")
1048                    }
1049                })
1050            }
1051            s(document).on("click", ".js-videoPoster", function (z) {
1052                z.preventDefault();
1053                var x = s(this);
1054                var y = x.closest(".js-videoWrapper");
1055                t(y)
1056            });
1057            s(".js-videoWrapper.js-videoNoPoster").each(function () {
1058                t(s(this))
1059            });
1060            if (s(".counter").length > 0) {
1061                s(".counter").counterUp({
1062                    delay: 10,
1063                    time: 1000
1064                })
1065            }
1066            if (s(".article-news").length > 0) {
1067                var v = s("iframe[src^='//player.vimeo.com'], iframe[src^='https://www.youtube.com']").not('figure iframe[src^="//player.vimeo.com"], figure iframe[src^="https://www.youtube.com"]');
1068                s(v).each(function () {
1069                    s(this).addClass("videoIframe").wrap("<div class='videoWrapper videoWrapper169'></div>")
1070                })
1071            }
1072            s(document).trigger("bma.pagecomplete")
1073        });
1074
1075        function t(w) {
1076            var v = w.find(".js-videoIframe");
1077            var x = v.data("src");
1078            w.addClass("videoWrapperActive");
1079            v.attr("src", x)
1080        }
1081
1082        function u(w) {
1083            if (!w) {
1084                var w = s(".js-videoWrapper");
1085                var v = s(".js-videoIframe")
1086            } else {
1087                var v = w.find(".js-videoIframe")
1088            }
1089            w.removeClass("videoWrapperActive");
1090            v.attr("src", "")
1091        }
1092    })(jQuery);
1093    (function (s, u) {
1094        var t = function (x, y, w) {
1095            var z;
1096            return function v() {
1097                var C = this,
1098                    A = arguments;
1099
1100                function B() {
1101                    if (!w) {
1102                        x.apply(C, A)
1103                    }
1104                    z = null
1105                }
1106                if (z) {
1107                    clearTimeout(z)
1108                } else {
1109                    if (w) {
1110                        x.apply(C, A)
1111                    }
1112                }
1113                z = setTimeout(B, y || 500)
1114            }
1115        };
1116        jQuery.fn[u] = function (v) {
1117            return v ? this.bind("resize", t(v)) : this.trigger(u)
1118        }
1119    })(jQuery, "smartresize");
1120    a(window).smartresize(function () {
1121        window.newWindowWidth = window.innerWidth;
1122        window.newWindowHeight = window.innerHeight;
1123        var s = newWindowWidth * 0.66;
1124        window.windowWidth = window.innerWidth;
1125        window.windowHeight = window.innerHeight
1126    })
1127});

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.