PageSourceSearch

https://www.nhmamd.org/jmc-assets/global-js/mc-respond-orig-v1.7.js

js nhmamd.org collected 2026-10-02 05:34:30 UTC 6,733 bytes, 177 lines download raw bytes

1jQuery(document).ready(function() {
2	jQuery('table.contentpaneopen > tbody > tr > td').wrapInner('<div class="content-wrapper"></div>');
3	jQuery(".mobile-menu > ul li.parent > a, .mobile-menu > ul li.parent > .separator").append('<div class="expander"></div>');
4	jQuery('div.mobile-menu').find('li.parent').children('a').each(function(){
5	  var linkRepeat = jQuery(this).clone();
6	  linkRepeat.find('div.expander').remove();
7	  linkRepeat.prependTo(jQuery(this).siblings('ul')).wrap('<li></li>');
8	});
9	jQuery('.toggle-menu').click(function(e) {
10		e.preventDefault();
11		jQuery(".mobile-menu > ul").slideToggle('400');
12		jQuery('li').removeClass('expand');
13	});
14	jQuery('.toggle-login').click(function(e) {
15		e.preventDefault();
16		jQuery(".login-container").slideToggle('400');
17		jQuery('li').removeClass('expand');
18	});
19	jQuery('.toggle-search').click(function(e) {
20		e.preventDefault();
21		jQuery('#search-bar').slideToggle('400');
22		jQuery('li').removeClass('expand');
23	});
24	/* Smooth Scroll */
25	jQuery('a#RTT').click(function(e) {
26		e.preventDefault();
27		jQuery('html,body').animate({
28			scrollTop: 0}, 500);
29	});
30	adjustSize();
31	tableWrapper();
32	turnLeft();
33	hideKids();
34});
35jQuery(window).bind('resize orientationchange', function() {
36	contentWidth = jQuery('#component-wrap').outerWidth();
37	adjustSize();
38	tableWrapper();
39	turnLeft();
40});
41var adjustSize = function () {
42	adjustMenu();
43	var newBkgClass = jQuery('#bkg').attr('class');
44	if ((bkgClass != newBkgClass) && (jQuery('#phone-landscape').is(':visible'))) {
45		jQuery('.mobile-menu > ul, .login-container, #search-bar').hide();
46	} else if ((bkgClass != newBkgClass) && (jQuery('#tablet-portrait').is(':visible'))) {
47		jQuery('.mobile-menu > ul, #search-bar').hide();
48	}
49	bkgClass = newBkgClass;
50}
51var adjustMenu = function() {
52	if (jQuery('#phone-landscape').is(':visible')) {
53		jQuery('#bkg').addClass('phone-landscape').removeClass('tablet-portrait tablet-landscape');
54	}
55	if (jQuery('#tablet-portrait').is(':visible')) {
56		jQuery('#bkg').addClass('tablet-portrait').removeClass('tablet-landscape phone-landscape');
57		jQuery(document).off();
58		jQuery('.login-container').show();
59	}
60	if (jQuery('#tablet-landscape').is(':visible')) {
61		jQuery('#bkg').addClass('tablet-landscape').removeClass('tablet-portrait phone-landscape');
62		jQuery('.login-container, #search-bar').show();
63		jQuery('.mobile-menu > ul').hide();
64		jQuery('.mc-touch .mc-dropdown > ul li.parent').click(function(e){
65			e.preventDefault();
66            jQuery(this).unbind(e);
67		});
68		jQuery(document).off();
69	} else {
70		mobileMenu();
71		jQuery('.toggle-menu').click(function(e) {
72			e.preventDefault();
73			jQuery('#search-bar').hide('400');
74			jQuery('.phone-landscape .login-container').hide('400');
75		});
76		jQuery('.toggle-login').click(function(e) {
77			e.preventDefault();
78			jQuery('.mobile-menu > ul, #search-bar').hide('400');
79		});
80		jQuery('.toggle-search').click(function(e) {
81			e.preventDefault();
82			jQuery('.mobile-menu > ul').hide('400');
83			jQuery('.phone-landscape .login-container').hide('400');
84		});
85		clickOutside();
86	}
87};
88var clickOutside = function() {
89	jQuery('.toggle-menu, .toggle-login, .toggle-search, .mobile-menu > ul, #search-bar, .phone-landscape .login-container').click(function(event){
90    	event.stopPropagation();
91	});
92	jQuery(document).click(function() {
93		jQuery('.mobile-menu > ul, #search-bar, .phone-landscape .login-container').hide('400');
94		jQuery('li').removeClass('expand');
95	});
96};
97var mobileMenu = function() {
98	jQuery(".mobile-menu > ul li.parent > a div, .mobile-menu > ul li.parent > .separator div").addClass('expander');
99	jQuery(".mobile-menu > ul li").unbind('mouseenter mouseleave');
100	jQuery(".mobile-menu > ul li.parent > a, .mobile-menu > ul li.parent > .separator").unbind('click').bind('click', function(e) {
101		e.preventDefault();
102		jQuery(this).parent("li").toggleClass("expand", 400);
103        //jQuery(this).unbind(e);
104	});
105};
106/* Scripts for all templates */
107var articlePageClass = function(){
108	var mcClass = jQuery('meta[name="keywords"]').attr('content');
109	if (mcClass.contains("full-width")){
110		jQuery('#bkg').addClass('full-width');
111	}
112	if (mcClass.contains("mc-columns")){
113		jQuery('#bkg').addClass('mc-columns');
114	}
115};
116articlePageClass();
117jQuery('table.contentpaneopen td table').addClass('content-table');
118jQuery('table.content-table table').removeClass('content-table');
119jQuery('table.content-table').wrap('<div><div class="table-wrapper"></div></div>');
120var bkgClass = jQuery('#bkg').attr('class');
121var contentWidth = jQuery('#component-wrap').outerWidth();
122var tableWrapper = function(){
123	jQuery('div.content-wrapper').css({'width':contentWidth}
123);
124	jQuery('div.table-wrapper').css({'width': contentWidth - 2});
125	jQuery('table.content-table').each(function(){
126		var tableWidth = jQuery(this).outerWidth();
127		if ((contentWidth-2) < tableWidth){
128			jQuery(this).parent('div.table-wrapper').parent('div').addClass('scroll-indicator');
129		} else {
130			jQuery(this).parent('div.table-wrapper').parent('div').removeClass('scroll-indicator');
131		}
132	});
133};
134var turnLeft = function(){
135	if (jQuery('#tablet-landscape').is(':visible')) {
136		var siteW = jQuery('#header .site-width').outerWidth();
137		var bkgW = jQuery('#bkg').outerWidth();
138		var hoverSpace = siteW+((bkgW-siteW)/2);
139		jQuery('#primary-menu .resp-menu > li.parent').each(function(){
140			var liPos = jQuery(this).position().left;
141			var menuW = jQuery(this).children('ul').outerWidth();
142			if (liPos > (hoverSpace - menuW)) {
143				jQuery(this).addClass('turn-left').removeClass('third-level');
144			} else if (jQuery(this).find('li.parent').length && liPos > (hoverSpace - (menuW * 2))) {
145				jQuery(this).addClass('third-level').removeClass('turn-left');
146			} else {
147				jQuery(this).removeClass('turn-left third-level');
148			}
149		});
150	} else {
151		jQuery('#primary-menu').find('li.parent').removeClass('turn-left third-level');
152	}
153};
154var hideKids = function(){
155	jQuery('.resp-menu ul').each(function(){
156		if (!jQuery(this).children('li').length) {
157			jQuery(this).addClass('no-kids');
158		}
159	});
160};
161var gridTable = function(){
162	var tableContents = jQuery(this).html()
163	  .replace(/<tbody/gi, "<div class='grid-layout'")
164	  .replace(/<tr/gi, "<div")
165	  .replace(/<\/tr>/gi, "</div>")
166	  .replace(/<td/gi, "<div class='grid-box'")
167	  .replace(/<\/td>/gi, "</div>")
168	  .replace(/<\/tbody/gi, "</div")
169	;
170	return tableContents;
171};
172jQuery('table.grid-table table').each(function(){
173 	jQuery(this).replaceWith(jQuery(this).html());
174});
175jQuery('table.grid-table').each(function(){
176	jQuery(this).replaceWith(gridTable);
177});

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.