PageSourceSearch

https://www.blmed.net/scripts/global.js?v=1789052194

js blmed.net collected 2026-10-07 07:47:36 UTC 6,259 bytes, 190 lines download raw bytes

1$(document).ready(function() {
2    "use strict";
3
4	// Animation Handler
5	$('.animate').each(function () {
6        // Grab the data-animation value to add class, grab offset and height to set the scroll position.
7        var $this = $(this),
8            anim = $this.data('animation'),
9            delay = $this.data('delay'),
10            duration = $this.data('duration'),
11            offset = $(this).offset().top - ($(window).height() / 1.05);
12
13        // If data-delay is added
14        if (delay) {
15            $this.css('animation-delay', delay);
16        }
17
18        // If data-duration is added
19        if (duration) {
20            $this.css('animation-duration', duration);
21        }
22
23        // Add the animation class when scroll position is met
24        $(window).on('scroll load', function () {
25            if ($(window).scrollTop() >= offset) {
26                $this.addClass(anim);
27                $this.addClass('animated');
28            }
29
30			// Remove the classes to allow for z-indexing after animations run.
31			// Removes animate because above script adds it back and we can't always target the animation name.
32			if($this.hasClass('animated')) {
33				var timeout = 1000;
34
35				setTimeout(function() {
36					$this.removeClass('animate');
37				}, timeout);
38			}
39        });
40    });
41
42    // Back to Top
43    $(window).scroll(function() {
44        if ($(this).scrollTop() > 400) {
45            $('.back-to-top').addClass('visible');
46        } else {
47            $('.back-to-top').removeClass('visible');
48        }
49    });
50
51    $('.back-to-top').on('click', function(e) {
52        e.preventDefault();
53        $('html, body').animate({ scrollTop: 0 }, 500);
54    });
55
56    // IE Fix for jumpy fixed backgrounds
57    if(navigator.userAgent.match(/Trident\/7\./)) { // if IE
58        $('body').on("mousewheel", function () {
59            // remove default behavior
60            event.preventDefault();
61
62            //scroll without smoothing
63            var wheelDelta = event.wheelDelta;
64            var currentScrollPosition = window.pageYOffset;
65            window.scrollTo(0, currentScrollPosition - wheelDelta);
66        });
67    }
68
69    // Notification message close
70    $("div.message.relative").on('click', function(){
71        $(this).slideUp();
72    });
73
74    $("[data-trigger-dynamic-input]:not(input[type=radio])").on("change", triggerDynamicInput);
75    $("[data-trigger-dynamic-input]:is(input[type=radio])").closest('fieldset').on("change", triggerDynamicInput);
76});
77
78function triggerDynamicInput(evt) {
79    let dynInputControl     = evt.target;
80    let dynInputControlType = $(dynInputControl).is('select') ? 'select' : $(dynInputControl).attr('type');
81
82    let dynInputControlID = $(dynInputControl).attr('id');
83    let dynInputWrapperID = dynInputControlType == 'select' ? $('#' + dynInputControlID + ' :selected').data('dynamicInputWrapper') : $('#' + dynInputControlID).data('dynamicInputWrapper');
84
85    if(dynInputControlType != 'radio') {
86        hideAndClearDynamicInput(dynInputControlID, dynInputWrapperID, dynInputControlType)
87    } else {
88        let fieldset       = evt.currentTarget;
89        let radioGroupName = $(dynInputControl).attr('name');
90
91        $(fieldset).find('[name="' + radioGroupName + '"]').each(function(){
92            let dynInputControlID = $(this).attr('id');
93            hideAndClearDynamicInput(dynInputControlID, dynInputWrapperID, dynInputControlType);
94        });
95    }
96
97    if(dynInputControlType != 'checkbox' || (dynInputControlType == 'checkbox' && $('#' + dynInputControlID).is(':checked') == true)){
98        $('#' + dynInputWrapperID).slideDown();
99    }
100}
101
102function hideAndClearDynamicInput(dynInputControlID, dynInputWrapperID, dynInputControlType) {
103    if(dynInputControlType == 'checkbox' && $('#' + dynInputControlID).is(':checked') == false){
104        $('[data-dynamic-input-control="' + dynInputControlID + '"]').hide();
105    } else {
106        $('[data-dynamic-input-control="' + dynInputControlID + '"]:not(#' + dynInputWrapperID + ')').hide();
107    }
108    $('[data-dynamic-input-control="' + dynInputControlID + '"]').find('[data-is-dynamic-input]').val('');
109}
110
111function getFormToken(){
112    var newToken = '';
113
114    $.ajax({
115        method: 'GET',
116        async: false,
117        url: '/ajax/getToken.php',
118        success: function( data ) {
119            var res = JSON.parse(data);
120            newToken = res.token;
121        }
122    });
123
124    return { 
125        inputId: 'token90353409183455210938412',
126        token:   newToken
127    };
128}
129
130// Class to fade in on load - Can be used to hide html exploding before the jquery can get to it
131$(window).on('load', function() {
132    $('.show-on-load').css('opacity','1');
133});
134
135
136// Measure the scrollbar width
137// Create the measurement node
138var scrollDiv = document.createElement("div");
139scrollDiv.className = "js-scrollbar-measure";
140document.body.appendChild(scrollDiv);
141
142// Get the scrollbar width
143var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
144
145// Delete the DIV
146document.body.removeChild(scrollDiv);
147
148// Add data-scrollbarwidth to elements that may use it
149// elements that use .js-break-out
150var breakOutElements = document.querySelectorAll('.js-break-out');
151for (var i=0; i < breakOutElements.length; i++) {
152    breakOutElements[i].setAttribute('data-scrollbarwidth', scrollbarWidth);
153}
154
155
156// Password Input Toggle
157$(".js-toggle-password").on('click', function() {
158    $(this).toggleClass("fa-eye fa-eye-slash");
159    var input = $($(this).attr("toggle"));
160
161    if (input.attr("type") == "password") {
162        input.attr("type", "text");
163    } else {
164        input.attr("type", "password");
165    }
166});
167
168
169function createCookie(name,value,days) {
170    if (days) {
171        var date = new Date();
172        date.setTime(date.getTime()+(days*24*60*60*1000));
173        var expires = "; expires="+date.toGMTString();
174    }
175    else expires = "";
176    document.cookie = name+"="+value+expires+"; path=/";
177}
178
179function readCookie(name) {
180    var nameEQ = name + "=";
181    var ca = document.cookie.split(';');
182    for(var i=0;i < ca.length;i++) {
183        var c = ca[i];
184        while (c.charAt(0)==' ') c = c.substring(1,c.length);
185        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
186    }
187    return null;
188}
189
190var cookie = readCookie("style");

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.