PageSourceSearch

https://maxime-and-co.com/wp-content/plugins/jquery-collapse-o-matic/js/collapse.js?ver=1.6.23

js maxime-and-co.com collected 2026-10-02 10:52:48 UTC 21,298 bytes, 687 lines download raw bytes

1/*!
2 * Collapse-O-Matic JavaSctipt v1.6.23
3 * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4 *
5 * Copyright 2020, Twinpictures
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, blend, trade,
11 * bake, hack, scramble, difiburlate, digest and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26function collapse_init() {
27	//force collapse
28	jQuery('.force_content_collapse').each(function(index) {
29		jQuery(this).css('display', 'none');
30	});
31
32	//inital collapse
33	jQuery('.collapseomatic:not(.colomat-close)').each(function(index) {
34		var thisid = jQuery(this).attr('id');
35		jQuery('#target-'+thisid).css('display', 'none');
36	});
37
38	//inital swaptitle for pre-expanded elements
39	jQuery('.collapseomatic.colomat-close').each(function(index) {
40		var thisid = jQuery(this).attr('id');
41		if(jQuery("#swap-"+thisid).length > 0){
42			swapTitle(this, "#swap-"+thisid );
43		}
44		if(jQuery("#swapexcerpt-"+thisid).length > 0){
45			swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
46		}
47		jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
48			if(jQuery(this).data('swaptitle')){
49				old_swap_title = jQuery(this).data('swaptitle');
50				old_title = jQuery(this).html();
51				jQuery(this).html(old_swap_title);
52				jQuery(this).data('swaptitle', old_title);
53			}
54		});
55	});
56}
57
58function swapTitle(origObj, swapObj){
59	if(jQuery(origObj).prop("tagName") == 'IMG'){
60		var origsrc = jQuery(origObj).prop('src');
61		var swapsrc = jQuery(swapObj).prop('src');
62
63		jQuery(origObj).prop('src',swapsrc);
64		jQuery(swapObj).prop('src',origsrc);
65	}
66	else{
67		var orightml = jQuery(origObj).html();
68		var swaphtml = jQuery(swapObj).html();
69
70		jQuery(origObj).html(swaphtml);
71		jQuery(swapObj).html(orightml);
72
73		//is cufon involved? if so, do that thing
74		if(swaphtml.indexOf("<cufon") != -1){
75			var trigelem = jQuery(this).get(0).tagName;
76			Cufon.replace(trigelem);
77		}
78	}
79}
80
81function toggleState (obj, id, maptastic, trig_id) {
82	//toggletarget class
83	//jQuery('[id^=target][id$='+id+']').toggleClass('colomat-targ-visable');
84
85	if (maptastic && jQuery('[id^=target][id$='+id+']').hasClass('maptastic') ) {
86		jQuery('[id^=target][id$='+id+']').removeClass('maptastic');
87	}
88
89	//reset effect and duration to default
90	com_effect = colomatslideEffect;
91	com_duration = colomatduration;
92
93	//effect override
94	if( obj.attr('data-animation_effect') ){
95		com_effect = obj.attr('data-animation_effect');
96	}
97
98	//duration override
99	if( obj.attr('data-duration') ){
100		com_duration = obj.attr('data-duration');
101	}
102
103	//if durration is a number, make it a number
104	if( isFinite(com_duration) ){
105		com_duration = parseFloat(com_duration);
106	}
107
108	//slideToggle
109	if(com_effect == 'slideToggle'){
110		//jQuery('[id^=target][id$='+id+']').slideToggle(com_duration, function() {
111		jQuery('#target-'+id).slideToggle(com_duration, function() {
112			// Animation complete.
113			if( jQuery(this).hasClass('colomat-inline') && jQuery(this).is(':visible') ){
114				jQuery(this).css('display', 'inline');
115			}
116
117			//deal with any findme links
118			if(trig_id && jQuery('#'+trig_id).is('.find-me.colomat-close')){
119				//offset_top = jQuery('#find-'+trig_id).attr('name');
120				findme = jQuery('#'+trig_id).attr('data-findme');
121				target_offset = jQuery('#'+trig_id).offset();
122
123				if( findme == 'auto' || findme == 'target'){
124					target_offset = jQuery('#target-'+trig_id).offset();
125				}
126				if( findme == 'trigger'){
127					target_offset = jQuery('#'+trig_id).offset();
128				}
129				jQuery('html, body').animate({scrollTop:target_offset.top}, 500);
130			}
131		});
132	}
133	//slideFade
134	else if(com_effect == 'slideFade'){
135		jQuery('#target-'+id).animate({
136			height: "toggle",
137			opacity: "toggle"
138		}, com_duration, function (){
139			//Animation complete
140			if( jQuery(this).hasClass('colomat-inline') && jQuery(this).is(':visible') ){
141				jQuery(this).css('display', 'inline');
142			}
143
144			//deal with any findme links
145			if(trig_id && jQuery('#'+trig_id).is('.find-me.colomat-close')){
146				findme = jQuery('#'+trig_id).attr('data-findme');
147				target_offset = jQuery('#'+trig_id).offset();
148
149				if( findme == 'auto' || findme == 'target'){
150					target_offset = jQuery('#target-'+trig_id).offset();
151				}
152				if( findme == 'trigger'){
153					target_offset = jQuery('#'+trig_id).offset();
154				}
155				jQuery('html, body').animate({scrollTop:target_offset.top}, 500);
156			}
157		});
158	}
159
160	//deal with google maps builder resize
161	if(jQuery('#'+id).hasClass('colomat-close')){
162		jQuery('.google-maps-builder').each(function(index) {
163			map = jQuery(".google-maps-builder")[index];
164			google.maps.event.trigger(map, 'resize');
165		});
166	}
167
168	//callback
169	if ( typeof colomat_callback != 'undefined' ) {
170		colomat_callback();
171	}
172}
173
174function closeOtherGroups(rel){
175	jQuery('.collapseomatic[rel!="' + rel +'"]').each(function(index) {
176		//add close class if open
177		if(jQuery(this).hasClass('colomat-expand-only') && jQuery(this).hasClass('colomat-close')){
178			return;
179		}
180		if(jQuery(this).hasClass('colomat-close') && jQuery(this).attr('rel') !== undefined){
181			jQuery(this).removeClass('colomat-close');
182			var id = jQuery(this).attr('id');
183			//remove parent highlight class
184			jQuery('#parent-'+id).removeClass('colomat-parent-highlight');
185
186			//check if the title needs to be swapped out
187			if(jQuery("#swap-"+id).length > 0){
188				swapTitle(this, "#swap-"+id);
189			}
190
191			//check if the excerpt needs to be swapped out
192			if(jQuery("#swapexcerpt-"+id).length > 0){
193				swapTitle("#exerpt-"+id, "#swapexcerpt-"+id);
194			}
195
196			//external triggers
197			jQuery('[id^=extra][id$='+id+']').each( function( index ){
198				if(jQuery(this).data('swaptitle')){
199					old_swap_title = jQuery(this).data('swaptitle');
200					old_title = jQuery(this).html();
201					jQuery(this).html(old_swap_title);
202					jQuery(this).data('swaptitle', old_title);
203				}
204			});
205
206			toggleState (jQuery(this), id, false, false);
207
208			//check if there are nested children that need to be collapsed
209			var ancestors = jQuery('.collapseomatic', '#target-'+id);
210			ancestors.each(function(index) {
211				jQuery(this).removeClass('colomat-close');
212				var thisid = jQuery(this).attr('id');
213				jQuery('#target-'+thisid).css('display', 'none');
214			})
215		}
216	});
217}
218
219function closeOtherRelMembers(rel, id){
220	jQuery('.collapseomatic[rel="' + rel +'"]').each(function(index) {
221		closeOtherMembers( this, id);
222	});
223}
224
225function closeOtherTogMembers(togname, id){
226	jQuery('.collapseomatic[data-togglegroup="' + togname +'"]').each(function(index) {
227		closeOtherMembers( this, id);
228	});
229}
230
231function closeOtherMembers(obj, id){
232		if(jQuery(obj).hasClass('colomat-expand-only') && jQuery(obj).hasClass('colomat-close')){
233			return;
234		}
235
236		//add close class if open
237		if(jQuery(obj).attr('id') != id && jQuery(obj).hasClass('colomat-close')){
238			//collapse the element
239			jQuery(obj).removeClass('colomat-close');
240			var thisid = jQuery(obj).attr('id');
241			//remove parent highlight class
242			jQuery('#parent-'+thisid).removeClass('colomat-parent-highlight');
243
244			//check if the title needs to be swapped out
245			if(jQuery("#swap-"+thisid).length > 0){
246				swapTitle(obj, "#swap-"+thisid);
247			}
248
249			//check if the excerpt needs to be swapped out
250			if(jQuery("#swapexcerpt-"+thisid).length > 0){
251				swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
252			}
253
254			//external triggers
255			jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
256				if(jQuery(this).data('swaptitle')){
257					old_swap_title = jQuery(this).data('swaptitle');
258					old_title = jQuery(this).html();
259					jQuery(this).html(old_swap_title);
260					jQuery(this).data('swaptitle', old_title);
261				}
262			});
263
264			//check for snap-shut
265			if(!jQuery(obj).hasClass('colomat-close') && jQuery(obj).hasClass('snap-shut')){
266				jQuery('#target-'+thisid).hide();
267			}
268			else{
269				toggleState (jQuery(obj), thisid, false, false);
270			}
271
272			//check if there are nested children that need to be collapsed
273			var ancestors = jQuery('.collapseomatic', '#target-'+id);
274			ancestors.each(function(index) {
275				if(jQuery(this).hasClass('colomat-expand-only') && jQuery(this).hasClass('colomat-close')){
276					return;
277				}
278				//deal with extra tirggers
279				var pre_id = id.split('-');
280				if (pre_id[0].indexOf('extra') != '-1') {
281					//console.log('this is an extra trigger');
282					pre = pre_id.splice(0, 1);
283					id = pre_id.join('-');
284
285					//deal with any scroll to links from the Extra Collapse Trigger
286					if(jQuery(this).hasClass('scroll-to-trigger')){
287						var target_offset = jQuery('#'+id).offset();
288						offset_top = target_offset.top;
289					}
290
291					//deal with any scroll to links from the Title Trigger
292					if(jQuery('#'+id).hasClass('scroll-to-trigger')){
293						offset_top = jQuery('#scrollonclose-'+id).attr('name');
294						if (offset_top == 'auto') {
295							var target_offset = jQuery('#'+id).offset();
296							offset_top = target_offset.top;
297						}
298					}
299
300					//toggle master trigger arrow
301					jQuery('#'+id).toggleClass('colomat-close');
302
303					//toggle any other extra trigger arrows
304					jQuery('[id^=extra][id$='+id+']').toggleClass('colomat-close');
305				}
306
307				if(jQuery(this).attr('id').indexOf('bot-') == '-1'){
308					jQuery(this).removeClass('colomat-close');
309					var thisid = jQuery(this).attr('id');
310					//check if the title needs to be swapped out
311					if(jQuery("#swap-"+thisid).length > 0){
312						swapTitle(this, "#swap-"+thisid);
313					}
314					//check if the excerpt needs to be swapped out
315					if(jQuery("#swapexcerpt-"+thisid).length > 0){
316						swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
317					}
318					//external triggers
319					jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
320						if(jQuery(this).data('swaptitle')){
321							old_swap_title = jQuery(this).data('swaptitle');
322							old_title = jQuery(this).html();
323							jQuery(this).html(old_swap_title);
324							jQuery(this).data('swaptitle', old_title);
325						}
326					});
327					jQuery('#target-'+thisid).css('display', 'none');
328				}
329			})
330		}
331}
332
333function colomat_expandall(loop_items){
334	if (!loop_items){
335		loop_items = jQuery('.collapseomatic:not(.colomat-close)');
336	}
337	loop_items.each(function(index) {
338		jQuery(this).addClass('colomat-close');
339		var thisid = jQuery(this).attr('id');
340		jQuery('#parent-'+thisid).addClass('colomat-parent-highlight');
341
342		if(jQuery("#swap-"+thisid).length > 0){
343			swapTitle(this, "#swap-"+thisid);
344		}
345
346		if(jQuery("#swapexcerpt-"+thisid).length > 0){
347			swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
348		}
349
350		//external triggers
351		jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
352			if(jQuery(this).data('swaptitle')){
353				old_swap_title = jQuery(this).data('swaptitle');
354				old_title = jQuery(this).html();
355				jQuery(this).html(old_swap_title);
356				jQuery(this).data('swaptitle', old_title);
357			}
358		});
359
360		toggleState(jQuery(this), thisid, true, false);
361	});
362}
363
364function colomat_collapseall(loop_items){
365	if (!loop_items){
366		loop_items = jQuery('.collapseomatic.colomat-close');
367	}
368
369	loop_items.each(function(index) {
370		if(jQuery(this).hasClass('colomat-expand-only') && jQuery(this).hasClass('colomat-close')){
371			return;
372		}
373
374		jQuery(this).removeClass('colomat-close');
375		var thisid = jQuery(this).attr('id');
376		jQuery('#parent-'+thisid).removeClass('colomat-parent-highlight');
377
378		if(jQuery("#swap-"+thisid).length > 0){
379			swapTitle(this, "#swap-"+thisid);
380		}
381
382		if(jQuery("#swapexcerpt-"+thisid).length > 0){
383			swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
384		}
385
386		//external triggers
387		jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
388			if(jQuery(this).data('swaptitle')){
389				old_swap_title = jQuery(this).data('swaptitle');
390				old_title = jQuery(this).html();
391				jQuery(this).html(old_swap_title);
392				jQuery(this).data('swaptitle', old_title);
393			}
394		});
395
396		toggleState(jQuery(this), thisid, false, false);
397
398	});
399}
400
401
402jQuery(document).ready(function() {
403	//console.log(colomatduration, colomatslideEffect, colomatpauseInit);
404	com_binding = 'click';
405	if (typeof colomattouchstart !== 'undefined' && colomattouchstart) {
406		com_binding = 'click touchstart';
407	}
408
409	if (typeof colomatpauseInit !== 'undefined' && colomatpauseInit) {
410		init_pause = setTimeout(collapse_init, colomatpauseInit);
411	}
412	else{
413		collapse_init();
414	}
415
416	//jetpack infinite scroll catch-all
417	jQuery( document.body ).on( 'post-load', function () {
418		collapse_init();
419	} );
420
421	//Display the collapse wrapper... use to reverse the show-all on no JavaScript degredation.
422	jQuery('.content_collapse_wrapper').each(function(index) {
423		jQuery(this).css('display', 'inline');
424	});
425
426	//hover
427	jQuery(document).on({
428		mouseenter: function(){
429			//stuff to do on mouseover
430			jQuery(this).addClass('colomat-hover');
431		},
432		mouseleave: function(){
433			//stuff to do on mouseleave
434			jQuery(this).removeClass('colomat-hover');
435		},
436		focusin: function(){
437			//stuff to do on keyboard focus
438			jQuery(this).addClass('colomat-hover');
439		},
440		focusout: function(){
441			//stuff to do on losing keyboard focus
442			jQuery(this).removeClass('colomat-hover');
443		}
444	}, '.collapseomatic'); //pass the element as an argument to .on
445
446	//tabindex enter
447	jQuery(document).on('keypress','.collapseomatic', function(event) {
448		if (event.which == 13) {
449			event.currentTarget.click();
450		};
451	});
452
453	//the main collapse/expand function
454	jQuery(document.body).on(com_binding, '.collapseomatic', function(event) {
455		var offset_top;
456
457		//alert('phones ringin dude');
458		if(jQuery(this).hasClass('colomat-expand-only') && jQuery(this).hasClass('colomat-close')){
459			return;
460		}
461
462		// rel highlander must be one
463		if(jQuery(this).attr('rel') && jQuery(this).attr('rel').toString().indexOf('-highlander') != '-1' && jQuery(this).hasClass('must-be-one') && jQuery(this).hasClass('colomat-close')){
464			return;
465		}
466
467		//toggle group highlander must be one
468		if(jQuery(this).data('togglegroup') && jQuery(this).data('togglegroup').toString().indexOf('-highlander') != '-1' && jQuery(this).hasClass('must-be-one') && jQuery(this).hasClass('colomat-close')){
469			return;
470		}
471
472		var id = jQuery(this).attr('id');
473
474		//deal with any scroll to links
475		if(jQuery(this).hasClass('colomat-close') && jQuery(this).hasClass('scroll-to-trigger')){
476			offset_top = jQuery('#scrollonclose-'+id).attr('name');
477			if (offset_top == 'auto') {
478				var target_offset = jQuery('#'+id).offset();
479				offset_top = target_offset.top;
480			}
481		}
482
483		var id_arr = id.split('-');
484
485		//deal with extra tirggers
486		if (id_arr[0].indexOf('extra') != '-1') {
487			//console.log('this is an extra trigger');
488			pre = id_arr.splice(0, 1);
489			id = id_arr.join('-');
490
491			//deal with any scroll to links from the Extra Collapse Trigger
492			if(jQuery(this).hasClass('scroll-to-trigger')){
493				var target_offset = jQuery('#'+id).offset();
494				offset_top = target_offset.top;
495			}
496
497			//deal with any scroll to links from the Title Trigger
498			if(jQuery('#'+id).hasClass('scroll-to-trigger')){
499				offset_top = jQuery('#scrollonclose-'+id).attr('name');
500				if (offset_top == 'auto') {
501					var target_offset = jQuery('#'+id).offset();
502					offset_top = target_offset.top;
503				}
504			}
505
506			//toggle master trigger arrow
507			jQuery('#'+id).toggleClass('colomat-close');
508
509			//toggle any other extra trigger arrows
510			jQuery('[id^=extra][id$='+id+']').toggleClass('colomat-close');
511		}
512
513		else if(id.indexOf('bot-') != '-1'){
514			id = id.substr(4);
515			jQuery('#'+id).toggleClass('colomat-close');
516
517			//deal with any scroll to links from the Internal Collapse Trigger
518			if(jQuery(this).hasClass('scroll-to-trigger')){
519				var target_offset = jQuery('#'+id).offset();
520				offset_top = target_offset.top;
521			}
522
523			//deal with any scroll to links from the Title Trigger
524			if(jQuery('#'+id).hasClass('scroll-to-trigger')){
525				offset_top = jQuery('#scrollonclose-'+id).attr('name');
526				if (offset_top == 'auto') {
527					var target_offset = jQuery('#'+id).offset();
528					offset_top = target_offset.top;
529				}
530			}
531		}
532		else{
533			jQuery(this).toggleClass('colomat-close');
534			//toggle any extra triggers
535			jQuery('[id^=extra][id$='+id+']').toggleClass('colomat-close');
536		}
537
538		//check if the title needs to be swapped out
539		if(jQuery("#swap-"+id).length > 0){
540			swapTitle(jQuery('#'+id), "#swap-"+id);
541		}
542
543		//check if the excerpt needs to be swapped out
544		if(jQuery("#swapexcerpt-"+id).length > 0){
545			swapTitle("#excerpt-"+id, "#swapexcerpt-"+id);
546		}
547
548		//external triggers
549		jQuery('[id^=extra][id$='+id+']').each( function( index ){
550			if(jQuery(this).data('swaptitle')){
551				old_swap_title = jQuery(this).data('swaptitle');
552				old_title = jQuery(this).html();
553				jQuery(this).html(old_swap_title);
554				jQuery(this).data('swaptitle', old_title);
555			}
556		});
557
558		//add visited class
559		jQuery(this).addClass('colomat-visited');
560
561		//toggle parent highlight class
562		var parentID = 'parent-'+id;
563		jQuery('#' + parentID).toggleClass('colomat-parent-highlight');
564
565		//check for snap-shut
566		if(!jQuery(this).hasClass('colomat-close') && jQuery(this).hasClass('snap-shut')){
567			jQuery('#target-'+id).hide();
568		}
569		else{
570			toggleState (jQuery(this), id, true, id);
571		}
572
573		//deal with grouped items if needed
574		if(jQuery(this).attr('rel') !== undefined){
575			var rel = jQuery(this).attr('rel').toString();
576			if(rel.indexOf('-highlander') != '-1'){
577				closeOtherRelMembers(rel, id);
578			}
579			else{
580				closeOtherGroups(rel);
581			}
582		}
583
584		if(jQuery(this).data('togglegroup') !== undefined){
585			var togname = jQuery(this).data('togglegroup').toString();
586			if(togname.indexOf('-highlander') != '-1'){
587				closeOtherTogMembers(togname, id);
588			}
589		}
590
591		if(offset_top){
592			jQuery('html, body').animate({scrollTop:offset_top}, 500);
593		}
594	});
595
596
597	jQuery(document).on(com_binding, '.expandall', function(event) {
598		if(jQuery(this).attr('rel') !== undefined){
599			var rel = jQuery(this).attr('rel');
600			var loop_items = jQuery('.collapseomatic:not(.colomat-close)[rel="' + rel +'"]');
601		}
602		else if(jQuery(this).attr('data-togglegroup') !== undefined){
603			var toggroup = jQuery(this).attr('data-togglegroup');
604			var loop_items = jQuery('.collapseomatic:not(.colomat-close)[data-togglegroup="' + toggroup +'"]');
605		}
606		else{
607			var loop_items = jQuery('.collapseomatic:not(.colomat-close)');
608		}
609
610		colomat_expandall(loop_items);
611	});
612
613	jQuery(document).on(com_binding, '.collapseall', function(event) {
614		if(jQuery(this).attr('rel') !== undefined){
615			var rel = jQuery(this).attr('rel');
616			var loop_items = jQuery('.collapseomatic.colomat-close[rel="' + rel +'"]');
617		}
618		else if(jQuery(this).attr('data-togglegroup') !== undefined){
619			var toggroup = jQuery(this).attr('data-togglegroup');
620			var loop_items = jQuery('.collapseomatic.colomat-close[data-togglegroup="' + toggroup +'"]');
621		}
622		else {
623			var loop_items = jQuery('.collapseomatic.colomat-close');
624		}
625
626		colomat_collapseall(loop_items);
627	});
628
629	//handle new page loads with anchor
630	var fullurl = document.location.toString();
631	if (fullurl.match('#(?!\!)')) {
632		hashmaster(fullurl);
633	}
634
635	//handle no-link triggers within the same page
636	jQuery(document).on('click', 'a.colomat-nolink', function(event) {
637		event.preventDefault();
638	});
639
640	//manual hashtag changes in url
641	jQuery(window).on('hashchange', function (e) {
642		fullurl = document.location.toString();
643		if (fullurl.match('#(?!\!)')) {
644			hashmaster(fullurl);
645		}
646	});
647
648	//master url hash funciton
649	function hashmaster(fullurl){
650		// the URL contains an anchor but not a hash-bang
651		if (fullurl.match('#(?!\!)')) {
652			// click the navigation item corresponding to the anchor
653			var anchor_arr = fullurl.split(/#(?!\!)/);
654
655			if(anchor_arr.length > 1){
656				junk = anchor_arr.splice(0, 1);
657				anchor = anchor_arr.join('#');
658			}
659			else{
660				anchor = anchor_arr[0];
661			}
662
663			if( jQuery('#' + anchor).length ){
664				//expand any nested parents
665				jQuery('#' + anchor).parents('.collapseomatic_content').each(function(index) {
666					parent_arr = jQuery(this).attr('id').split('-');
667					junk = parent_arr.splice(0, 1);
668					parent = parent_arr.join('-');
669					if(!jQuery('#' + parent).hasClass('colomat-close')){
670						jQuery('#' + parent).click();
671					}
672				})
673				//now expand the target anchor
674				if(!jQuery('#' + anchor).hasClass('colomat-close')){
675					jQuery('#' + anchor).click();
676				}
677			}
678
679			if(typeof colomatoffset !== 'undefined'){
680				var anchor_offset = jQuery('#' + anchor).offset();
681				colomatoffset = colomatoffset + anchor_offset.top;
682				jQuery('html, body').animate({scrollTop:colomatoffset}, 50);
683			}
684
685		}
686	}
687});

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.