PageSourceSearch

https://www.stiftung-liebenau.de/typo3temp/assets/compressed/merge…b59a6502fb12b3ba88893700a93fe.js?1787778355

js stiftung-liebenau.de collected 2026-09-24 22:32:05 UTC 164,143 bytes, 4,263 lines download raw bytes

1
2/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
3 * Licensed under the MIT License (LICENSE.txt).
4 *
5 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
6 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
7 * Thanks to: Seamus Leahy for adding deltaX and deltaY
8 *
9 * Version: 3.0.6
10 * 
11 * Requires: 1.2.2+
12 */
13(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=
14d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
15/*!
16 * fancyBox - jQuery Plugin
17 * version: 2.1.5 (Fri, 14 Jun 2013)
18 * @requires jQuery v1.6 or later
19 *
20 * Examples at http://fancyapps.com/fancybox/
21 * License: www.fancyapps.com/fancybox/#license
22 *
23 * Copyright 2012 Janis Skarnelis - [email protected]
24 *
25 */
26
27(function (window, document, $, undefined) {
28	"use strict";
29
30	var H = $("html"),
31		W = $(window),
32		D = $(document),
33		F = $.fancybox = function () {
34			F.open.apply( this, arguments );
35		},
36		IE =  navigator.userAgent.match(/msie/i),
37		didUpdate	= null,
38		isTouch		= document.createTouch !== undefined,
39
40		isQuery	= function(obj) {
41			return obj && obj.hasOwnProperty && obj instanceof $;
42		},
43		isString = function(str) {
44			return str && $.type(str) === "string";
45		},
46		isPercentage = function(str) {
47			return isString(str) && str.indexOf('%') > 0;
48		},
49		isScrollable = function(el) {
50			return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
51		},
52		getScalar = function(orig, dim) {
53			var value = parseInt(orig, 10) || 0;
54
55			if (dim && isPercentage(orig)) {
56				value = F.getViewport()[ dim ] / 100 * value;
57			}
58
59			return Math.ceil(value);
60		},
61		getValue = function(value, dim) {
62			return getScalar(value, dim) + 'px';
63		};
64
65	$.extend(F, {
66		// The current version of fancyBox
67		version: '2.1.5',
68
69		defaults: {
70			padding : 15,
71			margin  : 20,
72
73			width     : 800,
74			height    : 600,
75			minWidth  : 100,
76			minHeight : 100,
77			maxWidth  : 9999,
78			maxHeight : 9999,
79			pixelRatio: 1, // Set to 2 for retina display support
80
81			autoSize   : true,
82			autoHeight : false,
83			autoWidth  : false,
84
85			autoResize  : true,
86			autoCenter  : !isTouch,
87			fitToView   : true,
88			aspectRatio : false,
89			topRatio    : 0.5,
90			leftRatio   : 0.5,
91
92			scrolling : 'auto', // 'auto', 'yes' or 'no'
93			wrapCSS   : '',
94
95			arrows     : true,
96			closeBtn   : true,
97			closeClick : false,
98			nextClick  : false,
99			mouseWheel : true,
100			autoPlay   : false,
101			playSpeed  : 3000,
102			preload    : 3,
103			modal      : false,
104			loop       : true,
105
106			ajax  : {
107				dataType : 'html',
108				headers  : { 'X-fancyBox': true }
109			},
110			iframe : {
111				scrolling : 'auto',
112				preload   : true
113			},
114			swf : {
115				wmode: 'transparent',
116				allowfullscreen   : 'true',
117				allowscriptaccess : 'always'
118			},
119
120			keys  : {
121				next : {
122					13 : 'left', // enter
123					34 : 'up',   // page down
124					39 : 'left', // right arrow
125					40 : 'up'    // down arrow
126				},
127				prev : {
128					8  : 'right',  // backspace
129					33 : 'down',   // page up
130					37 : 'right',  // left arrow
131					38 : 'down'    // up arrow
132				},
133				close  : [27], // escape key
134				play   : [32], // space - start/stop slideshow
135				toggle : [70]  // letter "f" - toggle fullscreen
136			},
137
138			direction : {
139				next : 'left',
140				prev : 'right'
141			},
142
143			scrollOutside  : true,
144
145			// Override some properties
146			index   : 0,
147			type    : null,
148			href    : null,
149			content : null,
150			title   : null,
151
152			// HTML templates
153			tpl: {
154				wrap     : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
155				image    : '<img class="fancybox-image" src="{href}" alt="" />',
156				iframe   : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
157				error    : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
158				closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
159				next     : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
160				prev     : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
161			},
162
163			// Properties for each animation type
164			// Opening fancyBox
165			openEffect  : 'fade', // 'elastic', 'fade' or 'none'
166			openSpeed   : 250,
167			openEasing  : 'swing',
168			openOpacity : true,
169			openMethod  : 'zoomIn',
170
171			// Closing fancyBox
172			closeEffect  : 'fade', // 'elastic', 'fade' or 'none'
173			closeSpeed   : 250,
174			closeEasing  : 'swing',
175			closeOpacity : true,
176			closeMethod  : 'zoomOut',
177
178			// Changing next gallery item
179			nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
180			nextSpeed  : 250,
181			nextEasing : 'swing',
182			nextMethod : 'changeIn',
183
184			// Changing previous gallery item
185			prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
186			prevSpeed  : 250,
187			prevEasing : 'swing',
188			prevMethod : 'changeOut',
189
190			// Enable default helpers
191			helpers : {
192				overlay : true,
193				title   : true
194			},
195
196			// Callbacks
197			onCancel     : $.noop, // If canceling
198			beforeLoad   : $.noop, // Before loading
199			afterLoad    : $.noop, // After loading
200			beforeShow   : $.noop, // Before changing in current item
201			afterShow    : $.noop, // After opening
202			beforeChange : $.noop, // Before changing gallery item
203			beforeClose  : $.noop, // Before closing
204			afterClose   : $.noop  // After closing
205		},
206
207		//Current state
208		group    : {}, // Selected group
209		opts     : {}, // Group options
210		previous : null,  // Previous element
211		coming   : null,  // Element being loaded
212		current  : null,  // Currently loaded element
213		isActive : false, // Is activated
214		isOpen   : false, // Is currently open
215		isOpened : false, // Have been fully opened at least once
216
217		wrap  : null,
218		skin  : null,
219		outer : null,
220		inner : null,
221
222		player : {
223			timer    : null,
224			isActive : false
225		},
226
227		// Loaders
vendor: 12,016 bytes, lines 228-775
228		ajaxLoad   : null,
229		imgPreload : null,
230
231		// Some collections
232		transitions : {},
233		helpers     : {},
234
235		/*
236		 *	Static methods
237		 */
238
239		open: function (group, opts) {
240			if (!group) {
241				return;
242			}
243
244			if (!$.isPlainObject(opts)) {
245				opts = {};
246			}
247
248			// Close if already active
249			if (false === F.close(true)) {
250				return;
251			}
252
253			// Normalize group
254			if (!$.isArray(group)) {
255				group = isQuery(group) ? $(group).get() : [group];
256			}
257
258			// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
259			$.each(group, function(i, element) {
260				var obj = {},
261					href,
262					title,
263					content,
264					type,
265					rez,
266					hrefParts,
267					selector;
268
269				if ($.type(element) === "object") {
270					// Check if is DOM element
271					if (element.nodeType) {
272						element = $(element);
273					}
274
275					if (isQuery(element)) {
276						obj = {
277							href    : element.data('fancybox-href') || element.attr('href'),
278							title   : element.data('fancybox-title') || element.attr('title'),
279							isDom   : true,
280							element : element
281						};
282
283						if ($.metadata) {
284							$.extend(true, obj, element.metadata());
285						}
286
287					} else {
288						obj = element;
289					}
290				}
291
292				href  = opts.href  || obj.href || (isString(element) ? element : null);
293				title = opts.title !== undefined ? opts.title : obj.title || '';
294
295				content = opts.content || obj.content;
296				type    = content ? 'html' : (opts.type  || obj.type);
297
298				if (!type && obj.isDom) {
299					type = element.data('fancybox-type');
300
301					if (!type) {
302						rez  = element.prop('class').match(/fancybox\.(\w+)/);
303						type = rez ? rez[1] : null;
304					}
305				}
306
307				if (isString(href)) {
308					// Try to guess the content type
309					if (!type) {
310						if (F.isImage(href)) {
311							type = 'image';
312
313						} else if (F.isSWF(href)) {
314							type = 'swf';
315
316						} else if (href.charAt(0) === '#') {
317							type = 'inline';
318
319						} else if (isString(element)) {
320							type    = 'html';
321							content = element;
322						}
323					}
324
325					// Split url into two pieces with source url and content selector, e.g,
326					// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
327					if (type === 'ajax') {
328						hrefParts = href.split(/\s+/, 2);
329						href      = hrefParts.shift();
330						selector  = hrefParts.shift();
331					}
332				}
333
334				if (!content) {
335					if (type === 'inline') {
336						if (href) {
337							content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
338
339						} else if (obj.isDom) {
340							content = element;
341						}
342
343					} else if (type === 'html') {
344						content = href;
345
346					} else if (!type && !href && obj.isDom) {
347						type    = 'inline';
348						content = element;
349					}
350				}
351
352				$.extend(obj, {
353					href     : href,
354					type     : type,
355					content  : content,
356					title    : title,
357					selector : selector
358				});
359
360				group[ i ] = obj;
361			});
362
363			// Extend the defaults
364			F.opts = $.extend(true, {}, F.defaults, opts);
365
366			// All options are merged recursive except keys
367			if (opts.keys !== undefined) {
368				F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
369			}
370
371			F.group = group;
372
373			return F._start(F.opts.index);
374		},
375
376		// Cancel image loading or abort ajax request
377		cancel: function () {
378			var coming = F.coming;
379
380			if (!coming || false === F.trigger('onCancel')) {
381				return;
382			}
383
384			F.hideLoading();
385
386			if (F.ajaxLoad) {
387				F.ajaxLoad.abort();
388			}
389
390			F.ajaxLoad = null;
391
392			if (F.imgPreload) {
393				F.imgPreload.onload = F.imgPreload.onerror = null;
394			}
395
396			if (coming.wrap) {
397				coming.wrap.stop(true, true).trigger('onReset').remove();
398			}
399
400			F.coming = null;
401
402			// If the first item has been canceled, then clear everything
403			if (!F.current) {
404				F._afterZoomOut( coming );
405			}
406		},
407
408		// Start closing animation if is open; remove immediately if opening/closing
409		close: function (event) {
410			F.cancel();
411
412			if (false === F.trigger('beforeClose')) {
413				return;
414			}
415
416			F.unbindEvents();
417
418			if (!F.isActive) {
419				return;
420			}
421
422			if (!F.isOpen || event === true) {
423				$('.fancybox-wrap').stop(true).trigger('onReset').remove();
424
425				F._afterZoomOut();
426
427			} else {
428				F.isOpen = F.isOpened = false;
429				F.isClosing = true;
430
431				$('.fancybox-item, .fancybox-nav').remove();
432
433				F.wrap.stop(true, true).removeClass('fancybox-opened');
434
435				F.transitions[ F.current.closeMethod ]();
436			}
437		},
438
439		// Manage slideshow:
440		//   $.fancybox.play(); - toggle slideshow
441		//   $.fancybox.play( true ); - start
442		//   $.fancybox.play( false ); - stop
443		play: function ( action ) {
444			var clear = function () {
445					clearTimeout(F.player.timer);
446				},
447				set = function () {
448					clear();
449
450					if (F.current && F.player.isActive) {
451						F.player.timer = setTimeout(F.next, F.current.playSpeed);
452					}
453				},
454				stop = function () {
455					clear();
456
457					D.unbind('.player');
458
459					F.player.isActive = false;
460
461					F.trigger('onPlayEnd');
462				},
463				start = function () {
464					if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
465						F.player.isActive = true;
466
467						D.bind({
468							'onCancel.player beforeClose.player' : stop,
469							'onUpdate.player'   : set,
470							'beforeLoad.player' : clear
471						});
472
473						set();
474
475						F.trigger('onPlayStart');
476					}
477				};
478
479			if (action === true || (!F.player.isActive && action !== false)) {
480				start();
481			} else {
482				stop();
483			}
484		},
485
486		// Navigate to next gallery item
487		next: function ( direction ) {
488			var current = F.current;
489
490			if (current) {
491				if (!isString(direction)) {
492					direction = current.direction.next;
493				}
494
495				F.jumpto(current.index + 1, direction, 'next');
496			}
497		},
498
499		// Navigate to previous gallery item
500		prev: function ( direction ) {
501			var current = F.current;
502
503			if (current) {
504				if (!isString(direction)) {
505					direction = current.direction.prev;
506				}
507
508				F.jumpto(current.index - 1, direction, 'prev');
509			}
510		},
511
512		// Navigate to gallery item by index
513		jumpto: function ( index, direction, router ) {
514			var current = F.current;
515
516			if (!current) {
517				return;
518			}
519
520			index = getScalar(index);
521
522			F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
523			F.router    = router || 'jumpto';
524
525			if (current.loop) {
526				if (index < 0) {
527					index = current.group.length + (index % current.group.length);
528				}
529
530				index = index % current.group.length;
531			}
532
533			if (current.group[ index ] !== undefined) {
534				F.cancel();
535
536				F._start(index);
537			}
538		},
539
540		// Center inside viewport and toggle position type to fixed or absolute if needed
541		reposition: function (e, onlyAbsolute) {
542			var current = F.current,
543				wrap    = current ? current.wrap : null,
544				pos;
545
546			if (wrap) {
547				pos = F._getPosition(onlyAbsolute);
548
549				if (e && e.type === 'scroll') {
550					delete pos.position;
551
552					wrap.stop(true, true).animate(pos, 200);
553
554				} else {
555					wrap.css(pos);
556
557					current.pos = $.extend({}, current.dim, pos);
558				}
559			}
560		},
561
562		update: function (e) {
563			var type = (e && e.type),
564				anyway = !type || type === 'orientationchange';
565
566			if (anyway) {
567				clearTimeout(didUpdate);
568
569				didUpdate = null;
570			}
571
572			if (!F.isOpen || didUpdate) {
573				return;
574			}
575
576			didUpdate = setTimeout(function() {
577				var current = F.current;
578
579				if (!current || F.isClosing) {
580					return;
581				}
582
583				F.wrap.removeClass('fancybox-tmp');
584
585				if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
586					F._setDimension();
587				}
588
589				if (!(type === 'scroll' && current.canShrink)) {
590					F.reposition(e);
591				}
592
593				F.trigger('onUpdate');
594
595				didUpdate = null;
596
597			}, (anyway && !isTouch ? 0 : 300));
598		},
599
600		// Shrink content to fit inside viewport or restore if resized
601		toggle: function ( action ) {
602			if (F.isOpen) {
603				F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
604
605				// Help browser to restore document dimensions
606				if (isTouch) {
607					F.wrap.removeAttr('style').addClass('fancybox-tmp');
608
609					F.trigger('onUpdate');
610				}
611
612				F.update();
613			}
614		},
615
616		hideLoading: function () {
617			D.unbind('.loading');
618
619			$('#fancybox-loading').remove();
620		},
621
622		showLoading: function () {
623			var el, viewport;
624
625			F.hideLoading();
626
627			el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
628
629			// If user will press the escape-button, the request will be canceled
630			D.bind('keydown.loading', function(e) {
631				if ((e.which || e.keyCode) === 27) {
632					e.preventDefault();
633
634					F.cancel();
635				}
636			});
637
638			if (!F.defaults.fixed) {
639				viewport = F.getViewport();
640
641				el.css({
642					position : 'absolute',
643					top  : (viewport.h * 0.5) + viewport.y,
644					left : (viewport.w * 0.5) + viewport.x
645				});
646			}
647		},
648
649		getViewport: function () {
650			var locked = (F.current && F.current.locked) || false,
651				rez    = {
652					x: W.scrollLeft(),
653					y: W.scrollTop()
654				};
655
656			if (locked) {
657				rez.w = locked[0].clientWidth;
658				rez.h = locked[0].clientHeight;
659
660			} else {
661				// See http://bugs.jquery.com/ticket/6724
662				rez.w = isTouch && window.innerWidth  ? window.innerWidth  : W.width();
663				rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
664			}
665
666			return rez;
667		},
668
669		// Unbind the keyboard / clicking actions
670		unbindEvents: function () {
671			if (F.wrap && isQuery(F.wrap)) {
672				F.wrap.unbind('.fb');
673			}
674
675			D.unbind('.fb');
676			W.unbind('.fb');
677		},
678
679		bindEvents: function () {
680			var current = F.current,
681				keys;
682
683			if (!current) {
684				return;
685			}
686
687			// Changing document height on iOS devices triggers a 'resize' event,
688			// that can change document height... repeating infinitely
689			W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
690
691			keys = current.keys;
692
693			if (keys) {
694				D.bind('keydown.fb', function (e) {
695					var code   = e.which || e.keyCode,
696						target = e.target || e.srcElement;
697
698					// Skip esc key if loading, because showLoading will cancel preloading
699					if (code === 27 && F.coming) {
700						return false;
701					}
702
703					// Ignore key combinations and key events within form elements
704					if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
705						$.each(keys, function(i, val) {
706							if (current.group.length > 1 && val[ code ] !== undefined) {
707								F[ i ]( val[ code ] );
708
709								e.preventDefault();
710								return false;
711							}
712
713							if ($.inArray(code, val) > -1) {
714								F[ i ] ();
715
716								e.preventDefault();
717								return false;
718							}
719						});
720					}
721				});
722			}
723
724			if ($.fn.mousewheel && current.mouseWheel) {
725				F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
726					var target = e.target || null,
727						parent = $(target),
728						canScroll = false;
729
730					while (parent.length) {
731						if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
732							break;
733						}
734
735						canScroll = isScrollable( parent[0] );
736						parent    = $(parent).parent();
737					}
738
739					if (delta !== 0 && !canScroll) {
740						if (F.group.length > 1 && !current.canShrink) {
741							if (deltaY > 0 || deltaX > 0) {
742								F.prev( deltaY > 0 ? 'down' : 'left' );
743
744							} else if (deltaY < 0 || deltaX < 0) {
745								F.next( deltaY < 0 ? 'up' : 'right' );
746							}
747
748							e.preventDefault();
749						}
750					}
751				});
752			}
753		},
754
755		trigger: function (event, o) {
756			var ret, obj = o || F.coming || F.current;
757
758			if (!obj) {
759				return;
760			}
761
762			if ($.isFunction( obj[event] )) {
763				ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
764			}
765
766			if (ret === false) {
767				return false;
768			}
769
770			if (obj.helpers) {
771				$.each(obj.helpers, function (helper, opts) {
772					if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
773						F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
774					}
775				});
vendor: 8,050 bytes, lines 775-1134
775
776			}
777
778			D.trigger(event);
779		},
780
781		isImage: function (str) {
782			return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
783		},
784
785		isSWF: function (str) {
786			return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
787		},
788
789		_start: function (index) {
790			var coming = {},
791				obj,
792				href,
793				type,
794				margin,
795				padding;
796
797			index = getScalar( index );
798			obj   = F.group[ index ] || null;
799
800			if (!obj) {
801				return false;
802			}
803
804			coming = $.extend(true, {}, F.opts, obj);
805
806			// Convert margin and padding properties to array - top, right, bottom, left
807			margin  = coming.margin;
808			padding = coming.padding;
809
810			if ($.type(margin) === 'number') {
811				coming.margin = [margin, margin, margin, margin];
812			}
813
814			if ($.type(padding) === 'number') {
815				coming.padding = [padding, padding, padding, padding];
816			}
817
818			// 'modal' propery is just a shortcut
819			if (coming.modal) {
820				$.extend(true, coming, {
821					closeBtn   : false,
822					closeClick : false,
823					nextClick  : false,
824					arrows     : false,
825					mouseWheel : false,
826					keys       : null,
827					helpers: {
828						overlay : {
829							closeClick : false
830						}
831					}
832				});
833			}
834
835			// 'autoSize' property is a shortcut, too
836			if (coming.autoSize) {
837				coming.autoWidth = coming.autoHeight = true;
838			}
839
840			if (coming.width === 'auto') {
841				coming.autoWidth = true;
842			}
843
844			if (coming.height === 'auto') {
845				coming.autoHeight = true;
846			}
847
848			/*
849			 * Add reference to the group, so it`s possible to access from callbacks, example:
850			 * afterLoad : function() {
851			 *     this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
852			 * }
853			 */
854
855			coming.group  = F.group;
856			coming.index  = index;
857
858			// Give a chance for callback or helpers to update coming item (type, title, etc)
859			F.coming = coming;
860
861			if (false === F.trigger('beforeLoad')) {
862				F.coming = null;
863
864				return;
865			}
866
867			type = coming.type;
868			href = coming.href;
869
870			if (!type) {
871				F.coming = null;
872
873				//If we can not determine content type then drop silently or display next/prev item if looping through gallery
874				if (F.current && F.router && F.router !== 'jumpto') {
875					F.current.index = index;
876
877					return F[ F.router ]( F.direction );
878				}
879
880				return false;
881			}
882
883			F.isActive = true;
884
885			if (type === 'image' || type === 'swf') {
886				coming.autoHeight = coming.autoWidth = false;
887				coming.scrolling  = 'visible';
888			}
889
890			if (type === 'image') {
891				coming.aspectRatio = true;
892			}
893
894			if (type === 'iframe' && isTouch) {
895				coming.scrolling = 'scroll';
896			}
897
898			// Build the neccessary markup
899			coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
900
901			$.extend(coming, {
902				skin  : $('.fancybox-skin',  coming.wrap),
903				outer : $('.fancybox-outer', coming.wrap),
904				inner : $('.fancybox-inner', coming.wrap)
905			});
906
907			$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
908				coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
909			});
910
911			F.trigger('onReady');
912
913			// Check before try to load; 'inline' and 'html' types need content, others - href
914			if (type === 'inline' || type === 'html') {
915				if (!coming.content || !coming.content.length) {
916					return F._error( 'content' );
917				}
918
919			} else if (!href) {
920				return F._error( 'href' );
921			}
922
923			if (type === 'image') {
924				F._loadImage();
925
926			} else if (type === 'ajax') {
927				F._loadAjax();
928
929			} else if (type === 'iframe') {
930				F._loadIframe();
931
932			} else {
933				F._afterLoad();
934			}
935		},
936
937		_error: function ( type ) {
938			$.extend(F.coming, {
939				type       : 'html',
940				autoWidth  : true,
941				autoHeight : true,
942				minWidth   : 0,
943				minHeight  : 0,
944				scrolling  : 'no',
945				hasError   : type,
946				content    : F.coming.tpl.error
947			});
948
949			F._afterLoad();
950		},
951
952		_loadImage: function () {
953			// Reset preload image so it is later possible to check "complete" property
954			var img = F.imgPreload = new Image();
955
956			img.onload = function () {
957				this.onload = this.onerror = null;
958
959				F.coming.width  = this.width / F.opts.pixelRatio;
960				F.coming.height = this.height / F.opts.pixelRatio;
961
962				F._afterLoad();
963			};
964
965			img.onerror = function () {
966				this.onload = this.onerror = null;
967
968				F._error( 'image' );
969			};
970
971			img.src = F.coming.href;
972
973			if (img.complete !== true) {
974				F.showLoading();
975			}
976		},
977
978		_loadAjax: function () {
979			var coming = F.coming;
980
981			F.showLoading();
982
983			F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
984				url: coming.href,
985				error: function (jqXHR, textStatus) {
986					if (F.coming && textStatus !== 'abort') {
987						F._error( 'ajax', jqXHR );
988
989					} else {
990						F.hideLoading();
991					}
992				},
993				success: function (data, textStatus) {
994					if (textStatus === 'success') {
995						coming.content = data;
996
997						F._afterLoad();
998					}
999				}
1000			}));
1001		},
1002
1003		_loadIframe: function() {
1004			var coming = F.coming,
1005				iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
1006					.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
1007					.attr('src', coming.href);
1008
1009			// This helps IE
1010			$(coming.wrap).bind('onReset', function () {
1011				try {
1012					$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
1013				} catch (e) {}
1014			});
1015
1016			if (coming.iframe.preload) {
1017				F.showLoading();
1018
1019				iframe.one('load', function() {
1020					$(this).data('ready', 1);
1021
1022					// iOS will lose scrolling if we resize
1023					if (!isTouch) {
1024						$(this).bind('load.fb', F.update);
1025					}
1026
1027					// Without this trick:
1028					//   - iframe won't scroll on iOS devices
1029					//   - IE7 sometimes displays empty iframe
1030					$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
1031
1032					F._afterLoad();
1033				});
1034			}
1035
1036			coming.content = iframe.appendTo( coming.inner );
1037
1038			if (!coming.iframe.preload) {
1039				F._afterLoad();
1040			}
1041		},
1042
1043		_preloadImages: function() {
1044			var group   = F.group,
1045				current = F.current,
1046				len     = group.length,
1047				cnt     = current.preload ? Math.min(current.preload, len - 1) : 0,
1048				item,
1049				i;
1050
1051			for (i = 1; i <= cnt; i += 1) {
1052				item = group[ (current.index + i ) % len ];
1053
1054				if (item.type === 'image' && item.href) {
1055					new Image().src = item.href;
1056				}
1057			}
1058		},
1059
1060		_afterLoad: function () {
1061			var coming   = F.coming,
1062				previous = F.current,
1063				placeholder = 'fancybox-placeholder',
1064				current,
1065				content,
1066				type,
1067				scrolling,
1068				href,
1069				embed;
1070
1071			F.hideLoading();
1072
1073			if (!coming || F.isActive === false) {
1074				return;
1075			}
1076
1077			if (false === F.trigger('afterLoad', coming, previous)) {
1078				coming.wrap.stop(true).trigger('onReset').remove();
1079
1080				F.coming = null;
1081
1082				return;
1083			}
1084
1085			if (previous) {
1086				F.trigger('beforeChange', previous);
1087
1088				previous.wrap.stop(true).removeClass('fancybox-opened')
1089					.find('.fancybox-item, .fancybox-nav')
1090					.remove();
1091			}
1092
1093			F.unbindEvents();
1094
1095			current   = coming;
1096			content   = coming.content;
1097			type      = coming.type;
1098			scrolling = coming.scrolling;
1099
1100			$.extend(F, {
1101				wrap  : current.wrap,
1102				skin  : current.skin,
1103				outer : current.outer,
1104				inner : current.inner,
1105				current  : current,
1106				previous : previous
1107			});
1108
1109			href = current.href;
1110
1111			switch (type) {
1112				case 'inline':
1113				case 'ajax':
1114				case 'html':
1115					if (current.selector) {
1116						content = $('<div>').html(content).find(current.selector);
1117
1118					} else if (isQuery(content)) {
1119						if (!content.data(placeholder)) {
1120							content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
1121						}
1122
1123						content = content.show().detach();
1124
1125						current.wrap.bind('onReset', function () {
1126							if ($(this).find(content).length) {
1127								content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
1128							}
1129						});
1130					}
1131				break;
1132
1133				case 'image':
1134					content = current.tpl.image.replace(
vendor: 14,919 bytes, lines 1134-1703
1134'{href}', href);
1135				break;
1136
1137				case 'swf':
1138					content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
1139					embed   = '';
1140
1141					$.each(current.swf, function(name, val) {
1142						content += '<param name="' + name + '" value="' + val + '"></param>';
1143						embed   += ' ' + name + '="' + val + '"';
1144					});
1145
1146					content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
1147				break;
1148			}
1149
1150			if (!(isQuery(content) && content.parent().is(current.inner))) {
1151				current.inner.append( content );
1152			}
1153
1154			// Give a chance for helpers or callbacks to update elements
1155			F.trigger('beforeShow');
1156
1157			// Set scrolling before calculating dimensions
1158			current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1159
1160			// Set initial dimensions and start position
1161			F._setDimension();
1162
1163			F.reposition();
1164
1165			F.isOpen = false;
1166			F.coming = null;
1167
1168			F.bindEvents();
1169
1170			if (!F.isOpened) {
1171				$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
1172
1173			} else if (previous.prevMethod) {
1174				F.transitions[ previous.prevMethod ]();
1175			}
1176
1177			F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
1178
1179			F._preloadImages();
1180		},
1181
1182		_setDimension: function () {
1183			var viewport   = F.getViewport(),
1184				steps      = 0,
1185				canShrink  = false,
1186				canExpand  = false,
1187				wrap       = F.wrap,
1188				skin       = F.skin,
1189				inner      = F.inner,
1190				current    = F.current,
1191				width      = current.width,
1192				height     = current.height,
1193				minWidth   = current.minWidth,
1194				minHeight  = current.minHeight,
1195				maxWidth   = current.maxWidth,
1196				maxHeight  = current.maxHeight,
1197				scrolling  = current.scrolling,
1198				scrollOut  = current.scrollOutside ? current.scrollbarWidth : 0,
1199				margin     = current.margin,
1200				wMargin    = getScalar(margin[1] + margin[3]),
1201				hMargin    = getScalar(margin[0] + margin[2]),
1202				wPadding,
1203				hPadding,
1204				wSpace,
1205				hSpace,
1206				origWidth,
1207				origHeight,
1208				origMaxWidth,
1209				origMaxHeight,
1210				ratio,
1211				width_,
1212				height_,
1213				maxWidth_,
1214				maxHeight_,
1215				iframe,
1216				body;
1217
1218			// Reset dimensions so we could re-check actual size
1219			wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
1220
1221			wPadding = getScalar(skin.outerWidth(true)  - skin.width());
1222			hPadding = getScalar(skin.outerHeight(true) - skin.height());
1223
1224			// Any space between content and viewport (margin, padding, border, title)
1225			wSpace = wMargin + wPadding;
1226			hSpace = hMargin + hPadding;
1227
1228			origWidth  = isPercentage(width)  ? (viewport.w - wSpace) * getScalar(width)  / 100 : width;
1229			origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
1230
1231			if (current.type === 'iframe') {
1232				iframe = current.content;
1233
1234				if (current.autoHeight && iframe.data('ready') === 1) {
1235					try {
1236						if (iframe[0].contentWindow.document.location) {
1237							inner.width( origWidth ).height(9999);
1238
1239							body = iframe.contents().find('body');
1240
1241							if (scrollOut) {
1242								body.css('overflow-x', 'hidden');
1243							}
1244
1245							origHeight = body.outerHeight(true);
1246						}
1247
1248					} catch (e) {}
1249				}
1250
1251			} else if (current.autoWidth || current.autoHeight) {
1252				inner.addClass( 'fancybox-tmp' );
1253
1254				// Set width or height in case we need to calculate only one dimension
1255				if (!current.autoWidth) {
1256					inner.width( origWidth );
1257				}
1258
1259				if (!current.autoHeight) {
1260					inner.height( origHeight );
1261				}
1262
1263				if (current.autoWidth) {
1264					origWidth = inner.width();
1265				}
1266
1267				if (current.autoHeight) {
1268					origHeight = inner.height();
1269				}
1270
1271				inner.removeClass( 'fancybox-tmp' );
1272			}
1273
1274			width  = getScalar( origWidth );
1275			height = getScalar( origHeight );
1276
1277			ratio  = origWidth / origHeight;
1278
1279			// Calculations for the content
1280			minWidth  = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
1281			maxWidth  = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
1282
1283			minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
1284			maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
1285
1286			// These will be used to determine if wrap can fit in the viewport
1287			origMaxWidth  = maxWidth;
1288			origMaxHeight = maxHeight;
1289
1290			if (current.fitToView) {
1291				maxWidth  = Math.min(viewport.w - wSpace, maxWidth);
1292				maxHeight = Math.min(viewport.h - hSpace, maxHeight);
1293			}
1294
1295			maxWidth_  = viewport.w - wMargin;
1296			maxHeight_ = viewport.h - hMargin;
1297
1298			if (current.aspectRatio) {
1299				if (width > maxWidth) {
1300					width  = maxWidth;
1301					height = getScalar(width / ratio);
1302				}
1303
1304				if (height > maxHeight) {
1305					height = maxHeight;
1306					width  = getScalar(height * ratio);
1307				}
1308
1309				if (width < minWidth) {
1310					width  = minWidth;
1311					height = getScalar(width / ratio);
1312				}
1313
1314				if (height < minHeight) {
1315					height = minHeight;
1316					width  = getScalar(height * ratio);
1317				}
1318
1319			} else {
1320				width = Math.max(minWidth, Math.min(width, maxWidth));
1321
1322				if (current.autoHeight && current.type !== 'iframe') {
1323					inner.width( width );
1324
1325					height = inner.height();
1326				}
1327
1328				height = Math.max(minHeight, Math.min(height, maxHeight));
1329			}
1330
1331			// Try to fit inside viewport (including the title)
1332			if (current.fitToView) {
1333				inner.width( width ).height( height );
1334
1335				wrap.width( width + wPadding );
1336
1337				// Real wrap dimensions
1338				width_  = wrap.width();
1339				height_ = wrap.height();
1340
1341				if (current.aspectRatio) {
1342					while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
1343						if (steps++ > 19) {
1344							break;
1345						}
1346
1347						height = Math.max(minHeight, Math.min(maxHeight, height - 10));
1348						width  = getScalar(height * ratio);
1349
1350						if (width < minWidth) {
1351							width  = minWidth;
1352							height = getScalar(width / ratio);
1353						}
1354
1355						if (width > maxWidth) {
1356							width  = maxWidth;
1357							height = getScalar(width / ratio);
1358						}
1359
1360						inner.width( width ).height( height );
1361
1362						wrap.width( width + wPadding );
1363
1364						width_  = wrap.width();
1365						height_ = wrap.height();
1366					}
1367
1368				} else {
1369					width  = Math.max(minWidth,  Math.min(width,  width  - (width_  - maxWidth_)));
1370					height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
1371				}
1372			}
1373
1374			if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
1375				width += scrollOut;
1376			}
1377
1378			inner.width( width ).height( height );
1379
1380			wrap.width( width + wPadding );
1381
1382			width_  = wrap.width();
1383			height_ = wrap.height();
1384
1385			canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
1386			canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
1387
1388			$.extend(current, {
1389				dim : {
1390					width	: getValue( width_ ),
1391					height	: getValue( height_ )
1392				},
1393				origWidth  : origWidth,
1394				origHeight : origHeight,
1395				canShrink  : canShrink,
1396				canExpand  : canExpand,
1397				wPadding   : wPadding,
1398				hPadding   : hPadding,
1399				wrapSpace  : height_ - skin.outerHeight(true),
1400				skinSpace  : skin.height() - height
1401			});
1402
1403			if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
1404				inner.height('auto');
1405			}
1406		},
1407
1408		_getPosition: function (onlyAbsolute) {
1409			var current  = F.current,
1410				viewport = F.getViewport(),
1411				margin   = current.margin,
1412				width    = F.wrap.width()  + margin[1] + margin[3],
1413				height   = F.wrap.height() + margin[0] + margin[2],
1414				rez      = {
1415					position: 'absolute',
1416					top  : margin[0],
1417					left : margin[3]
1418				};
1419
1420			if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1421				rez.position = 'fixed';
1422
1423			} else if (!current.locked) {
1424				rez.top  += viewport.y;
1425				rez.left += viewport.x;
1426			}
1427
1428			rez.top  = getValue(Math.max(rez.top,  rez.top  + ((viewport.h - height) * current.topRatio)));
1429			rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width)  * current.leftRatio)));
1430
1431			return rez;
1432		},
1433
1434		_afterZoomIn: function () {
1435			var current = F.current;
1436
1437			if (!current) {
1438				return;
1439			}
1440
1441			F.isOpen = F.isOpened = true;
1442
1443			F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
1444
1445			F.update();
1446
1447			// Assign a click event
1448			if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
1449				F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
1450					if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1451						e.preventDefault();
1452
1453						F[ current.closeClick ? 'close' : 'next' ]();
1454					}
1455				});
1456			}
1457
1458			// Create a close button
1459			if (current.closeBtn) {
1460				$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
1461					e.preventDefault();
1462
1463					F.close();
1464				});
1465			}
1466
1467			// Create navigation arrows
1468			if (current.arrows && F.group.length > 1) {
1469				if (current.loop || current.index > 0) {
1470					$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
1471				}
1472
1473				if (current.loop || current.index < F.group.length - 1) {
1474					$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
1475				}
1476			}
1477
1478			F.trigger('afterShow');
1479
1480			// Stop the slideshow if this is the last item
1481			if (!current.loop && current.index === current.group.length - 1) {
1482				F.play( false );
1483
1484			} else if (F.opts.autoPlay && !F.player.isActive) {
1485				F.opts.autoPlay = false;
1486
1487				F.play();
1488			}
1489		},
1490
1491		_afterZoomOut: function ( obj ) {
1492			obj = obj || F.current;
1493
1494			$('.fancybox-wrap').trigger('onReset').remove();
1495
1496			$.extend(F, {
1497				group  : {},
1498				opts   : {},
1499				router : false,
1500				current   : null,
1501				isActive  : false,
1502				isOpened  : false,
1503				isOpen    : false,
1504				isClosing : false,
1505				wrap   : null,
1506				skin   : null,
1507				outer  : null,
1508				inner  : null
1509			});
1510
1511			F.trigger('afterClose', obj);
1512		}
1513	});
1514
1515	/*
1516	 *	Default transitions
1517	 */
1518
1519	F.transitions = {
1520		getOrigPosition: function () {
1521			var current  = F.current,
1522				element  = current.element,
1523				orig     = current.orig,
1524				pos      = {},
1525				width    = 50,
1526				height   = 50,
1527				hPadding = current.hPadding,
1528				wPadding = current.wPadding,
1529				viewport = F.getViewport();
1530
1531			if (!orig && current.isDom && element.is(':visible')) {
1532				orig = element.find('img:first');
1533
1534				if (!orig.length) {
1535					orig = element;
1536				}
1537			}
1538
1539			if (isQuery(orig)) {
1540				pos = orig.offset();
1541
1542				if (orig.is('img')) {
1543					width  = orig.outerWidth();
1544					height = orig.outerHeight();
1545				}
1546
1547			} else {
1548				pos.top  = viewport.y + (viewport.h - height) * current.topRatio;
1549				pos.left = viewport.x + (viewport.w - width)  * current.leftRatio;
1550			}
1551
1552			if (F.wrap.css('position') === 'fixed' || current.locked) {
1553				pos.top  -= viewport.y;
1554				pos.left -= viewport.x;
1555			}
1556
1557			pos = {
1558				top     : getValue(pos.top  - hPadding * current.topRatio),
1559				left    : getValue(pos.left - wPadding * current.leftRatio),
1560				width   : getValue(width  + wPadding),
1561				height  : getValue(height + hPadding)
1562			};
1563
1564			return pos;
1565		},
1566
1567		step: function (now, fx) {
1568			var ratio,
1569				padding,
1570				value,
1571				prop       = fx.prop,
1572				current    = F.current,
1573				wrapSpace  = current.wrapSpace,
1574				skinSpace  = current.skinSpace;
1575
1576			if (prop === 'width' || prop === 'height') {
1577				ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
1578
1579				if (F.isClosing) {
1580					ratio = 1 - ratio;
1581				}
1582
1583				padding = prop === 'width' ? current.wPadding : current.hPadding;
1584				value   = now - padding;
1585
1586				F.skin[ prop ](  getScalar( prop === 'width' ?  value : value - (wrapSpace * ratio) ) );
1587				F.inner[ prop ]( getScalar( prop === 'width' ?  value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
1588			}
1589		},
1590
1591		zoomIn: function () {
1592			var current  = F.current,
1593				startPos = current.pos,
1594				effect   = current.openEffect,
1595				elastic  = effect === 'elastic',
1596				endPos   = $.extend({opacity : 1}, startPos);
1597
1598			// Remove "position" property that breaks older IE
1599			delete endPos.position;
1600
1601			if (elastic) {
1602				startPos = this.getOrigPosition();
1603
1604				if (current.openOpacity) {
1605					startPos.opacity = 0.1;
1606				}
1607
1608			} else if (effect === 'fade') {
1609				startPos.opacity = 0.1;
1610			}
1611
1612			F.wrap.css(startPos).animate(endPos, {
1613				duration : effect === 'none' ? 0 : current.openSpeed,
1614				easing   : current.openEasing,
1615				step     : elastic ? this.step : null,
1616				complete : F._afterZoomIn
1617			});
1618		},
1619
1620		zoomOut: function () {
1621			var current  = F.current,
1622				effect   = current.closeEffect,
1623				elastic  = effect === 'elastic',
1624				endPos   = {opacity : 0.1};
1625
1626			if (elastic) {
1627				endPos = this.getOrigPosition();
1628
1629				if (current.closeOpacity) {
1630					endPos.opacity = 0.1;
1631				}
1632			}
1633
1634			F.wrap.animate(endPos, {
1635				duration : effect === 'none' ? 0 : current.closeSpeed,
1636				easing   : current.closeEasing,
1637				step     : elastic ? this.step : null,
1638				complete : F._afterZoomOut
1639			});
1640		},
1641
1642		changeIn: function () {
1643			var current   = F.current,
1644				effect    = current.nextEffect,
1645				startPos  = current.pos,
1646				endPos    = { opacity : 1 },
1647				direction = F.direction,
1648				distance  = 200,
1649				field;
1650
1651			startPos.opacity = 0.1;
1652
1653			if (effect === 'elastic') {
1654				field = direction === 'down' || direction === 'up' ? 'top' : 'left';
1655
1656				if (direction === 'down' || direction === 'right') {
1657					startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
1658					endPos[ field ]   = '+=' + distance + 'px';
1659
1660				} else {
1661					startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
1662					endPos[ field ]   = '-=' + distance + 'px';
1663				}
1664			}
1665
1666			// Workaround for http://bugs.jquery.com/ticket/12273
1667			if (effect === 'none') {
1668				F._afterZoomIn();
1669
1670			} else {
1671				F.wrap.css(startPos).animate(endPos, {
1672					duration : current.nextSpeed,
1673					easing   : current.nextEasing,
1674					complete : F._afterZoomIn
1675				});
1676			}
1677		},
1678
1679		changeOut: function () {
1680			var previous  = F.previous,
1681				effect    = previous.prevEffect,
1682				endPos    = { opacity : 0.1 },
1683				direction = F.direction,
1684				distance  = 200;
1685
1686			if (effect === 'elastic') {
1687				endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
1688			}
1689
1690			previous.wrap.animate(endPos, {
1691				duration : effect === 'none' ? 0 : previous.prevSpeed,
1692				easing   : previous.prevEasing,
1693				complete : function () {
1694					$(this).trigger('onReset').remove();
1695				}
1696			});
1697		}
1698	};
1699
1700	/*
1701	 *	Overlay helper
1702	 */
1703
1704	F.helpers.overlay = {
1705		defaults : {
1706			closeClick : true,      // if true, fancyBox will be closed when user clicks on the overlay
1707			speedOut   : 200,       // duration of fadeOut animation
1708			showEarly  : true,      // indicates if should be opened immediately or wait until the content is ready
1709			css        : {},        // custom CSS properties
1710			locked     : !isTouch,  // if true, the content will be locked into overlay
1711			fixed      : true       // if false, the overlay CSS position property will not be set to "fixed"
1712		},
1713
1714		overlay : null,      // current handle
1715		fixed   : false,     // indicates if the overlay has position "fixed"
1716		el      : $('html'), // element that contains "the lock"
1717
1718		// Public methods
1719		create : function(opts) {
1720			opts = $.extend({}, this.defaults, opts);
1721
1722			if (this.overlay) {
1723				this.close();
1724			}
1725
1726			this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
1727			this.fixed   = false;
1728
1729			if (opts.fixed && F.defaults.fixed) {
1730				this.overlay.addClass('fancybox-overlay-fixed');
1731
1732				this.fixed = true;
1733			}
1734		},
1735
1736		open : function(opts) {
1737			var that = this;
1738
1739			opts = $.extend({}, this.defaults, opts);
1740
1741			if (this.overlay) {
1742				this.overlay.unbind('.overlay').width('auto').height('auto');
1743
1744			} else {
1745				this.create(opts);
1746			}
1747
1748			if (!this.fixed) {
1749				W.bind('resize.overlay', $.proxy( this.update, this) );
1750
1751				this.update();
1752			}
1753
1754			if (opts.closeClick) {
1755				this.overlay.bind('click.overlay', function(e) {
1756					if ($(e.target).hasClass('fancybox-overlay')) {
1757						if (F.isActive) {
1758							F.close();
1759						} else {
1760							that.close();
1761						}
1762
1763						return false;
1764					}
1765				});
1766			}
1767
1768			this.overlay.css( opts.css ).show();
1769		},
1770
1771		close : function() {
1772			var scrollV, scrollH;
1773
1774			W.unbind('resize.overlay');
1775
1776			if (this.el.hasClass('fancybox-lock')) {
1777				$('.fancybox-margin').removeClass('fancybox-margin');
1778
1779				scrollV = W.scrollTop();
1780				scrollH = W.scrollLeft();
1781
1782				this.el.removeClass('fancybox-lock');
1783
1784				W.scrollTop( scrollV ).scrollLeft( scrollH );
1785			}
1786
1787			$('.fancybox-overlay').remove().hide();
1788
1789			$.extend(this, {
1790				overlay : null,
1791				fixed   : false
1792			});
1793		},
1794
1795		// Private, callbacks
1796
1797		update : function () {
1798			var width = '100%', offsetWidth;
1799
1800			// Reset width/height so it will not mess
1801			this.overlay.width(width).height('100%');
1802
1803			// jQuery does not return reliable result for IE
1804			if (IE) {
1805				offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1806
1807				if (D.width() > offsetWidth) {
1808					width = D.width();
1809				}
1810
1811			} else if (D.width() > W.width()) {
1812				width = D.width();
1813			}
1814
1815			this.overlay.width(width).height(D.height());
1816		},
1817
1818		// This is where we can manipulate DOM, because later it would cause iframes to reload
1819		onReady : function (opts, obj) {
1820			var overlay = this.overlay;
1821
1822			$('.fancybox-overlay').stop(true, true);
1823
1824			if (!overlay) {
1825				this.create(opts);
1826			}
1827
1828			if (opts.locked && this.fixed && obj.fixed) {
1829				if (!overlay) {
1830					this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
1831				}
1832
1833				obj.locked = this.overlay.append( obj.wrap );
1834				obj.fixed  = false;
1835			}
1836
1837			if (opts.showEarly === true) {
1838				this.beforeShow.apply(this, arguments);
1839			}
1840		},
1841
1842		beforeShow : function(opts, obj) {
1843			var scrollV, scrollH;
1844
1845			if (obj.locked) {
1846				if (this.margin !== false) {
1847					$('*').filter(function(){
1848						return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
1849					}).addClass('fancybox-margin');
1850
1851					this.el.addClass('fancybox-margin');
1852				}
1853
1854				scrollV = W.scrollTop();
1855				scrollH = W.scrollLeft();
1856
1857				this.el.addClass('fancybox-lock');
1858
1859				W.scrollTop( scrollV ).scrollLeft( scrollH );
1860			}
1861
1862			this.open(opts);
1863		},
1864
1865		onUpdate : function() {
1866			if (!this.fixed) {
1867				this.update();
1868			}
1869		},
1870
1871		afterClose: function (opts) {
1872			// Remove overlay if exists and fancyBox is not opening
1873			// (e.g., it is not being open using afterClose callback)
1874			//if (this.overlay && !F.isActive) {
1875			if (this.overlay && !F.coming) {
1876				this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
1877			}
1878		}
1879	};
1880
1881	/*
1882	 *	Title helper
1883	 */
1884
1885	F.helpers.title = {
1886		defaults : {
1887			type     : 'float', // 'float', 'inside', 'outside' or 'over',
1888			position : 'bottom' // 'top' or 'bottom'
1889		},
1890
1891		beforeShow: function (opts) {
1892			var current = F.current,
1893				text    = current.title,
1894				type    = opts.type,
1895				title,
1896				target;
1897
1898			if ($.isFunction(text)) {
1899				text = text.call(current.element, current);
1900			}
1901
1902			if (!isString(text) || $.trim(text) === '') {
1903				return;
1904			}
1905
1906			title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">
1906' + text + '</div>');
1907
1908			switch (type) {
1909				case 'inside':
1910					target = F.skin;
1911				break;
1912
1913				case 'outside':
1914					target = F.wrap;
1915				break;
1916
1917				case 'over':
1918					target = F.inner;
1919				break;
1920
1921				default: // 'float'
1922					target = F.skin;
1923
1924					title.appendTo('body');
1925
1926					if (IE) {
1927						title.width( title.width() );
1928					}
1929
1930					title.wrapInner('<span class="child"></span>');
1931
1932					//Increase bottom margin so this title will also fit into viewport
1933					F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
1934				break;
1935			}
1936
1937			title[ (opts.position === 'top' ? 'prependTo'  : 'appendTo') ](target);
1938		}
1939	};
1940
1941	// jQuery plugin initialization
1942	$.fn.fancybox = function (options) {
1943		var index,
1944			that     = $(this),
1945			selector = this.selector || '',
1946			run      = function(e) {
1947				var what = $(this).blur(), idx = index, relType, relVal;
1948
1949				if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
1950					relType = options.groupAttr || 'data-fancybox-group';
1951					relVal  = what.attr(relType);
1952
1953					if (!relVal) {
1954						relType = 'rel';
1955						relVal  = what.get(0)[ relType ];
1956					}
1957
1958					if (relVal && relVal !== '' && relVal !== 'nofollow') {
1959						what = selector.length ? $(selector) : that;
1960						what = what.filter('[' + relType + '="' + relVal + '"]');
1961						idx  = what.index(this);
1962					}
1963
1964					options.index = idx;
1965
1966					// Stop an event from bubbling if everything is fine
1967					if (F.open(what, options) !== false) {
1968						e.preventDefault();
1969					}
1970				}
1971			};
1972
1973		options = options || {};
1974		index   = options.index || 0;
1975
1976		if (!selector || options.live === false) {
1977			that.unbind('click.fb-start').bind('click.fb-start', run);
1978
1979		} else {
1980			D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
1981		}
1982
1983		this.filter('[data-fancybox-start=1]').trigger('click');
1984
1985		return this;
1986	};
1987
1988	// Tests that need a body at doc ready
1989	D.ready(function() {
1990		var w1, w2;
1991
1992		if ( $.scrollbarWidth === undefined ) {
1993			// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
1994			$.scrollbarWidth = function() {
1995				var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
1996					child  = parent.children(),
1997					width  = child.innerWidth() - child.height( 99 ).innerWidth();
1998
1999				parent.remove();
2000
2001				return width;
2002			};
2003		}
2004
2005		if ( $.support.fixedPosition === undefined ) {
2006			$.support.fixedPosition = (function() {
2007				var elem  = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
2008					fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
2009
2010				elem.remove();
2011
2012				return fixed;
2013			}());
2014		}
2015
2016		$.extend(F.defaults, {
2017			scrollbarWidth : $.scrollbarWidth(),
2018			fixed  : $.support.fixedPosition,
2019			parent : $('body')
2020		});
2021
2022		//Get real width of page scroll-bar
2023		w1 = $(window).width();
2024
2025		H.addClass('fancybox-lock-test');
2026
2027		w2 = $(window).width();
2028
2029		H.removeClass('fancybox-lock-test');
2030
2031		$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
2032	});
2033
2034}(window, document, jQuery));
2035// Avoid `console` errors in browsers that lack a console.
2036(function() {
2037    var method;
2038    var noop = function () {};
2039    var methods = [
2040        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
2041        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
2042        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
2043        'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
2044    ];
2045    var length = methods.length;
2046    var console = (window.console = window.console || {});
2047
2048    while (length--) {
2049        method = methods[length];
2050
2051        // Only stub undefined methods.
2052        if (!console[method]) {
2053            console[method] = noop;
2054        }
2055    }
2056}());
2057
2058// Place any jQuery/helper plugins in here.
2059
2060/**
2061* jquery-match-height master by @liabru
2062* http://brm.io/jquery-match-height/
2063* License: MIT
2064*/
2065
2066;(function(factory) { // eslint-disable-line no-extra-semi
2067    'use strict';
2068    if (typeof define === 'function' && define.amd) {
2069        // AMD
2070        define(['jquery'], factory);
2071    } else if (typeof module !== 'undefined' && module.exports) {
2072        // CommonJS
2073        module.exports = factory(require('jquery'));
2074    } else {
2075        // Global
2076        factory(jQuery);
2077    }
2078})(function($) {
2079    /*
2080    *  internal
2081    */
2082
2083    var _previousResizeWidth = -1,
2084        _updateTimeout = -1;
2085
2086    /*
2087    *  _parse
2088    *  value parse utility function
2089    */
2090
2091    var _parse = function(value) {
2092        // parse value and convert NaN to 0
2093        return parseFloat(value) || 0;
2094    };
2095
2096    /*
2097    *  _rows
2098    *  utility function returns array of jQuery selections representing each row
2099    *  (as displayed after float wrapping applied by browser)
2100    */
2101
2102    var _rows = function(elements) {
2103        var tolerance = 1,
2104            $elements = $(elements),
2105            lastTop = null,
2106            rows = [];
2107
2108        // group elements by their top position
2109        $elements.each(function(){
2110            var $that = $(this),
2111                top = $that.offset().top - _parse($that.css('margin-top')),
2112                lastRow = rows.length > 0 ? rows[rows.length - 1] : null;
2113
2114            if (lastRow === null) {
2115                // first item on the row, so just push it
2116                rows.push($that);
2117            } else {
2118                // if the row top is the same, add to the row group
2119                if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {
2120                    rows[rows.length - 1] = lastRow.add($that);
2121                } else {
2122                    // otherwise start a new row group
2123                    rows.push($that);
2124                }
2125            }
2126
2127            // keep track of the last row top
2128            lastTop = top;
2129        });
2130
2131        return rows;
2132    };
2133
2134    /*
2135    *  _parseOptions
2136    *  handle plugin options
2137    */
2138
2139    var _parseOptions = function(options) {
2140        var opts = {
2141            byRow: true,
2142            property: 'height',
2143            target: null,
2144            remove: false
2145        };
2146
2147        if (typeof options === 'object') {
2148            return $.extend(opts, options);
2149        }
2150
2151        if (typeof options === 'boolean') {
2152            opts.byRow = options;
2153        } else if (options === 'remove') {
2154            opts.remove = true;
2155        }
2156
2157        return opts;
2158    };
2159
2160    /*
2161    *  matchHeight
2162    *  plugin definition
2163    */
2164
2165    var matchHeight = $.fn.matchHeight = function(options) {
2166        var opts = _parseOptions(options);
2167
2168        // handle remove
2169        if (opts.remove) {
2170            var that = this;
2171
2172            // remove fixed height from all selected elements
2173            this.css(opts.property, '');
2174
2175            // remove selected elements from all groups
2176            $.each(matchHeight._groups, function(key, group) {
2177                group.elements = group.elements.not(that);
2178            });
2179
2180            // TODO: cleanup empty groups
2181
2182            return this;
2183        }
2184
2185        if (this.length <= 1 && !opts.target) {
2186            return this;
2187        }
2188
2189        // keep track of this group so we can re-apply later on load and resize events
2190        matchHeight._groups.push({
2191            elements: this,
2192            options: opts
2193        });
2194
2195        // match each element's height to the tallest element in the selection
2196        matchHeight._apply(this, opts);
2197
2198        return this;
2199    };
2200
2201    /*
2202    *  plugin global options
2203    */
2204
2205    matchHeight.version = 'master';
2206    matchHeight._groups = [];
2207    matchHeight._throttle = 80;
2208    matchHeight._maintainScroll = false;
2209    matchHeight._beforeUpdate = null;
2210    matchHeight._afterUpdate = null;
2211    matchHeight._rows = _rows;
2212    matchHeight._parse = _parse;
2213    matchHeight._parseOptions = _parseOptions;
2214
2215    /*
2216    *  matchHeight._apply
2217    *  apply matchHeight to given elements
2218    */
2219
2220    matchHeight._apply = function(elements, options) {
2221        var opts = _parseOptions(options),
2222            $elements = $(elements),
2223            rows = [$elements];
2224
2225        // take note of scroll position
2226        var scrollTop = $(window).scrollTop(),
2227            htmlHeight = $('html').outerHeight(true);
2228
2229        // get hidden parents
2230        var $hiddenParents = $elements.parents().filter(':hidden');
2231
2232        // cache the original inline style
2233        $hiddenParents.each(function() {
2234            var $that = $(this);
2235            $that.data('style-cache', $that.attr('style'));
2236        });
2237
2238        // temporarily must force hidden parents visible
2239        $hiddenParents.css('display', 'block');
2240
2241        // get rows if using byRow, otherwise assume one row
2242        if (opts.byRow && !opts.target) {
2243
2244            // must first force an arbitrary equal height so floating elements break evenly
2245            $elements.each(function() {
2246                var $that = $(this),
2247                    display = $that.css('display');
2248
2249                // temporarily force a usable display value
2250                if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
2251                    display = 'block';
2252                }
2253
2254                // cache the original inline style
2255                $that.data('style-cache', $that.attr('style'));
2256
2257                $that.css({
2258                    'display': display,
2259                    'padding-top': '0',
2260                    'padding-bottom': '0',
2261                    'margin-top': '0',
2262                    'margin-bottom': '0',
2263                    'border-top-width': '0',
2264                    'border-bottom-width': '0',
2265                    'height': '100px',
2266                    'overflow': 'hidden'
2267                });
2268            });
2269
2270            // get the array of rows (based on element top position)
2271            rows = _rows($elements);
2272
2273            // revert original inline styles
2274            $elements.each(function() {
2275                var $that = $(this);
2276                $that.attr('style', $that.data('style-cache') || '');
2277            });
2278        }
2279
2280        $.each(rows, function(key, row) {
2281            var $row = $(row),
2282                targetHeight = 0;
2283
2284            if (!opts.target) {
2285                // skip apply to rows with only one item
2286                if (opts.byRow && $row.length <= 1) {
2287                    $row.css(opts.property, '');
2288                    return;
2289                }
2290
2291                // iterate the row and find the max height
2292                $row.each(function(){
2293                    var $that = $(this),
2294                        style = $that.attr('style'),
2295                        display = $that.css('display');
2296
2297                    // temporarily force a usable display value
2298                    if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
2299                        display = 'block';
2300                    }
2301
2302                    // ensure we get the correct actual height (and not a previously set height value)
2303                    var css = { 'display': display };
2304                    css[opts.property] = '';
2305                    $that.css(css);
2306
2307                    // find the max height (including padding, but not margin)
2308                    if ($that.outerHeight(false) > targetHeight) {
2309                        targetHeight = $that.outerHeight(false);
2310                    }
2311
2312                    // revert styles
2313                    if (style) {
2314                        $that.attr('style', style);
2315                    } else {
2316                        $that.css('display', '');
2317                    }
2318                });
2319            } else {
2320                // if target set, use the height of the target element
2321                targetHeight = opts.target.outerHeight(false);
2322            }
2323
2324            // iterate the row and apply the height to all elements
2325            $row.each(function(){
2326                var $that = $(this),
2327                    verticalPadding = 0;
2328
2329                // don't apply to a target
2330                if (opts.target && $that.is(opts.target)) {
2331                    return;
2332                }
2333
2334                // handle padding and border correctly (required when not using border-box)
2335                if ($that.css('box-sizing') !== 'border-box') {
2336                    verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));
2337                    verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));
2338                }
2339
2340                // set the height (accounting for padding and border)
2341                $that.css(opts.property, (targetHeight - verticalPadding) + 'px');
2342            });
2343        });
2344
2345        // revert hidden parents
2346        $hiddenParents.each(function() {
2347            var $that = $(this);
2348            $that.attr('style', $that.data('style-cache') || null);
2349        });
2350
2351        // restore scroll position if enabled
2352        if (matchHeight._maintainScroll) {
2353            $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));
2354        }
2355
2356        return this;
2357    };
2358
2359    /*
2360    *  matchHeight._applyDataApi
2361    *  applies matchHeight to all elements with a data-match-height attribute
2362    */
2363
2364    matchHeight._applyDataApi = function() {
2365        var groups = {};
2366
2367        // generate groups by their groupId set by elements using data-match-height
2368        $('[data-match-height], [data-mh]').each(function() {
2369            var $this = $(this),
2370                groupId = $this.attr('data-mh') || $this.attr('data-match-height');
2371
2372            if (groupId in groups) {
2373                groups[groupId] = groups[groupId].add($this);
2374            } else {
2375                groups[groupId] = $this;
2376            }
2377        });
2378
2379        // apply matchHeight to each group
2380        $.each(groups, function() {
2381            this.matchHeight(true);
2382        });
2383    };
2384
2385    /*
2386    *  matchHeight._update
2387    *  updates matchHeight on all current groups with their correct options
2388    */
2389
2390    var _update = function(event) {
2391        if (matchHeight._beforeUpdate) {
2392            matchHeight._beforeUpdate(event, matchHeight._groups);
2393        }
2394
2395        $.each(matchHeight._groups, function() {
2396            matchHeight._apply(this.elements, this.options);
2397        });
2398
2399        if (matchHeight._afterUpdate) {
2400            matchHeight._afterUpdate(event, matchHeight._groups);
2401        }
2402    };
2403
2404    matchHeight._update = function(throttle, event) {
2405        // prevent update if fired from a resize event
2406        // where the viewport width hasn't actually changed
2407        // fixes an event looping bug in IE8
2408        if (event && event.type === 'resize') {
2409            var windowWidth = $(window).width();
2410            if (windowWidth === _previousResizeWidth) {
2411                return;
2412            }
2413            _previousResizeWidth = windowWidth;
2414        }
2415
2416        // throttle updates
2417        if (!throttle) {
2418            _update(event);
2419        } else if (_updateTimeout === -1) {
2420            _updateTimeout = setTimeout(function() {
2421                _update(event);
2422                _updateTimeout = -1;
2423            }, matchHeight._throttle);
2424        }
2425    };
2426
2427    /*
2428    *  bind events
2429    */
2430
2431    // apply on DOM ready event
2432    $(matchHeight._applyDataApi);
2433
2434    // update heights on load and resize events
2435    $(window).bind('load', function(event) {
2436        matchHeight._update(false, event);
2437    });
2438
2439    // throttled update heights on resize events
2440    $(window).bind('resize orientationchange', function(event) {
2441        matchHeight._update(true, event);
2442    });
2443
2444});
2445(function(h,o,g){var p=function(){for(var b=/audio(.min)?.js.*/,a=document.getElementsByTagName("script"),c=0,d=a.length;c<d;c++){var e=a[c].getAttribute("src");if(b.test(e))return e.replace(b,"")}}();g[h]={instanceCount:0,instances:{},flashSource:'      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="$1" width="1" height="1" name="$1" style="position: absolute; left: -1px;">         <param name="movie" value="$2?playerInstance='+h+'.instances[\'$1\']&datetime=$3">         <param name="allowscriptaccess" value="always">         <embed name="$1" src="$2?playerInstance='+
2446h+'.instances[\'$1\']&datetime=$3" width="1" height="1" allowscriptaccess="always">       </object>',settings:{autoplay:false,loop:false,preload:true,imageLocation:p+"player-graphics.gif",swfLocation:p+"audiojs.swf",useFlash:function(){var b=document.createElement("audio");return!(b.canPlayType&&b.canPlayType("audio/mpeg;").replace(/no/,""))}(),hasFlash:function(){if(navigator.plugins&&navigator.plugins.length&&navigator.plugins["Shockwave Flash"])return true;else if(navigator.mimeTypes&&navigator.mimeTypes.length){var b=
2447navigator.mimeTypes["application/x-shockwave-flash"];return b&&b.enabledPlugin}else try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(a){}return false}(),createPlayer:{markup:'          <div class="play-pause">             <p class="play"></p>             <p class="pause"></p>             <p class="loading"></p>             <p class="error"></p>           </div>           <div class="scrubber">             <div class="progress"></div>             <div class="loaded"></div>           </div>           <div class="time">             <em class="played">00:00</em>/<strong class="duration">00:00</strong>           </div>           <div class="error-message"></div>',
2448playPauseClass:"play-pause",scrubberClass:"scrubber",progressClass:"progress",loaderClass:"loaded",timeClass:"time",durationClass:"duration",playedClass:"played",errorMessageClass:"error-message",playingClass:"playing",loadingClass:"loading",errorClass:"error"},css:'        .audiojs audio { position: absolute; left: -1px; }         .audiojs { width: 460px; height: 36px; background: #404040; overflow: hidden; font-family: monospace; font-size: 12px;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #444), color-stop(0.5, #555), color-stop(0.51, #444), color-stop(1, #444));           background-image: -moz-linear-gradient(center top, #444 0%, #555 50%, #444 51%, #444 100%);           -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
2448           -o-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); }         .audiojs .play-pause { width: 25px; height: 40px; padding: 4px 6px; margin: 0px; float: left; overflow: hidden; border-right: 1px solid #000; }         .audiojs p { display: none; width: 25px; height: 40px; margin: 0px; cursor: pointer; }         .audiojs .play { display: block; }         .audiojs .scrubber { position: relative; float: left; width: 280px; background: #5a5a5a; height: 14px; margin: 10px; border-top: 1px solid #3f3f3f; border-left: 0px; border-bottom: 0px; overflow: hidden; }         .audiojs .progress { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #ccc; z-index: 1;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(0.5, #ddd), color-stop(0.51, #ccc), color-stop(1, #ccc));           background-image: -moz-linear-gradient(center top, #ccc 0%, #ddd 50%, #ccc 51%, #ccc 100%); }         .audiojs .loaded { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #000;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222));           background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); }         .audiojs .time { float: left; height: 36px; line-height: 36px; margin: 0px 0px 0px 6px; padding: 0px 6px 0px 12px; border-left: 1px solid #000; color: #ddd; text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5); }         .audiojs .time em { padding: 0px 2px 0px 0px; color: #f9f9f9; font-style: normal; }         .audiojs .time strong { padding: 0px 0px 0px 2px; font-weight: normal; }         .audiojs .error-message { float: left; display: none; margin: 0px 10px; height: 36px; width: 400px; overflow: hidden; line-height: 36px; white-space: nowrap; color: #fff;           text-overflow: ellipsis; -o-text-overflow: ellipsis; -icab-text-overflow: ellipsis; -khtml-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; }         .audiojs .error-message a { color: #eee; text-decoration: none; padding-bottom: 1px; border-bottom: 1px solid #999; white-space: wrap; }                 .audiojs .play { background: url("$1") -2px -1px no-repeat; }         .audiojs .loading { background: url("$1") -2px -31px no-repeat; }         .audiojs .error { background: url("$1") -2px -61px no-repeat; }         .audiojs .pause { background: url("$1") -2px -91px no-repeat; }                 .playing .play, .playing .loading, .playing .error { display: none; }         .playing .pause { display: block; }                 .loading .play, .loading .pause, .loading .error { display: none; }         .loading .loading { display: block; }                 .error .time, .error .play, .error .pause, .error .scrubber, .error .loading { display: none; }         .error .error { display: block; }         .error .play-pause p { cursor: auto; }         .error .error-message { display: block; }',
2449trackEnded:function(){},flashError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper),c='Missing <a href="http://get.adobe.com/flashplayer/">flash player</a> plugin.';if(this.mp3)c+=' <a href="'+this.mp3+'">Download audio file</a>.';g[h].helpers.removeClass(this.wrapper,b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML=c},loadError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper);g[h].helpers.removeClass(this.wrapper,
2450b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML='Error loading: "'+this.mp3+'"'},init:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.loadingClass)},loadStarted:function(){var b=this.settings.createPlayer,a=j(b.durationClass,this.wrapper),c=Math.floor(this.duration/60),d=Math.floor(this.duration%60);g[h].helpers.removeClass(this.wrapper,b.loadingClass);a.innerHTML=(c<10?"0":"")+c+":"+(d<10?"0":"")+d},loadProgress:function(b){var a=this.settings.createPlayer,
2451c=j(a.scrubberClass,this.wrapper);j(a.loaderClass,this.wrapper).style.width=c.offsetWidth*b+"px"},playPause:function(){this.playing?this.settings.play():this.settings.pause()},play:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.playingClass)},pause:function(){g[h].helpers.removeClass(this.wrapper,this.settings.createPlayer.playingClass)},updatePlayhead:function(b){var a=this.settings.createPlayer,c=j(a.scrubberClass,this.wrapper);j(a.progressClass,this.wrapper).style.width=
2452c.offsetWidth*b+"px";a=j(a.playedClass,this.wrapper);c=this.duration*b;b=Math.floor(c/60);c=Math.floor(c%60);a.innerHTML=(b<10?"0":"")+b+":"+(c<10?"0":"")+c}},create:function(b,a){a=a||{};return b.length?this.createAll(a,b):this.newInstance(b,a)},createAll:function(b,a){var c=a||document.getElementsByTagName("audio"),d=[];b=b||{};for(var e=0,i=c.length;e<i;e++)d.push(this.newInstance(c[e],b));return d},newInstance:function(b,a){var c=this.helpers.clone(this.settings),d="audiojs"+this.instanceCount,
2453e="audiojs_wrapper"+this.instanceCount;this.instanceCount++;
2453if(b.getAttribute("autoplay")!=null)c.autoplay=true;if(b.getAttribute("loop")!=null)c.loop=true;if(b.getAttribute("preload")=="none")c.preload=false;a&&this.helpers.merge(c,a);if(c.createPlayer.markup)b=this.createPlayer(b,c.createPlayer,e);else b.parentNode.setAttribute("id",e);e=new g[o](b,c);c.css&&this.helpers.injectCss(e,c.css);if(c.useFlash&&c.hasFlash){this.injectFlash(e,d);this.attachFlashEvents(e.wrapper,e)}else c.useFlash&&!c.hasFlash&&
2454this.settings.flashError.apply(e);if(!c.useFlash||c.useFlash&&c.hasFlash)this.attachEvents(e.wrapper,e);return this.instances[d]=e},createPlayer:function(b,a,c){var d=document.createElement("div"),e=b.cloneNode(true);d.setAttribute("class","audiojs");d.setAttribute("className","audiojs");d.setAttribute("id",c);if(e.outerHTML&&!document.createElement("audio").canPlayType){e=this.helpers.cloneHtml5Node(b);d.innerHTML=a.markup;d.appendChild(e);b.outerHTML=d.outerHTML;d=document.getElementById(c)}else{d.appendChild(e);
2455d.innerHTML+=a.markup;b.parentNode.replaceChild(d,b)}return d.getElementsByTagName("audio")[0]},attachEvents:function(b,a){if(a.settings.createPlayer){var c=a.settings.createPlayer,d=j(c.playPauseClass,b),e=j(c.scrubberClass,b);g[h].events.addListener(d,"click",function(){a.playPause.apply(a)});g[h].events.addListener(e,"click",function(i){i=i.clientX;var f=this,k=0;if(f.offsetParent){do k+=f.offsetLeft;while(f=f.offsetParent)}a.skipTo((i-k)/e.offsetWidth)});if(!a.settings.useFlash){g[h].events.trackLoadProgress(a);
2456g[h].events.addListener(a.element,"timeupdate",function(){a.updatePlayhead.apply(a)});g[h].events.addListener(a.element,"ended",function(){a.trackEnded.apply(a)});g[h].events.addListener(a.source,"error",function(){clearInterval(a.readyTimer);clearInterval(a.loadTimer);a.settings.loadError.apply(a)})}}},attachFlashEvents:function(b,a){a.swfReady=false;a.load=function(c){a.mp3=c;a.swfReady&&a.element.load(c)};a.loadProgress=function(c,d){a.loadedPercent=c;a.duration=d;a.settings.loadStarted.apply(a);
2457a.settings.loadProgress.apply(a,[c])};a.skipTo=function(c){if(!(c>a.loadedPercent)){a.updatePlayhead.call(a,[c]);a.element.skipTo(c)}};a.updatePlayhead=function(c){a.settings.updatePlayhead.apply(a,[c])};a.play=function(){if(!a.settings.preload){a.settings.preload=true;a.element.init(a.mp3)}a.playing=true;a.element.pplay();a.settings.play.apply(a)};a.pause=function(){a.playing=false;a.element.ppause();a.settings.pause.apply(a)};a.setVolume=function(c){a.element.setVolume(c)};a.loadStarted=function(){a.swfReady=
2458true;a.settings.preload&&a.element.init(a.mp3);a.settings.autoplay&&a.play.apply(a)}},injectFlash:function(b,a){var c=this.flashSource.replace(/\$1/g,a);c=c.replace(/\$2/g,b.settings.swfLocation);c=c.replace(/\$3/g,+new Date+Math.random());var d=b.wrapper.innerHTML,e=document.createElement("div");e.innerHTML=c+d;b.wrapper.innerHTML=e.innerHTML;b.element=this.helpers.getSwf(a)},helpers:{merge:function(b,a){for(attr in a)if(b.hasOwnProperty(attr)||a.hasOwnProperty(attr))b[attr]=a[attr]},clone:function(b){if(b==
2459null||typeof b!=="object")return b;var a=new b.constructor,c;for(c in b)a[c]=arguments.callee(b[c]);return a},addClass:function(b,a){RegExp("(\\s|^)"+a+"(\\s|$)").test(b.className)||(b.className+=" "+a)},removeClass:function(b,a){b.className=b.className.replace(RegExp("(\\s|^)"+a+"(\\s|$)")," ")},injectCss:function(b,a){for(var c="",d=document.getElementsByTagName("style"),e=a.replace(/\$1/g,b.settings.imageLocation),i=0,f=d.length;i<f;i++){var k=d[i].getAttribute("title");if(k&&~k.indexOf("audiojs")){f=
2460d[i];if(f.innerHTML===e)return;c=f.innerHTML;break}}d=document.getElementsByTagName("head")[0];i=d.firstChild;f=document.createElement("style");if(d){f.setAttribute("type","text/css");f.setAttribute("title","audiojs");if(f.styleSheet)f.styleSheet.cssText=c+e;else f.appendChild(document.createTextNode(c+e));i?d.insertBefore(f,i):d.appendChild(styleElement)}},cloneHtml5Node:function(b){var a=document.createDocumentFragment(),c=a.createElement?a:document;c.createElement("audio");c=c.createElement("div");
2461a.appendChild(c);c.innerHTML=b.outerHTML;return c.firstChild},getSwf:function(b){b=document[b]||window[b];return b.length>1?b[b.length-1]:b}},events:{memoryLeaking:false,listeners:[],addListener:function(b,a,c){if(b.addEventListener)b.addEventListener(a,c,false);else if(b.attachEvent){this.listeners.push(b);if(!this.memoryLeaking){window.attachEvent("onunload",function(){if(this.listeners)for(var d=0,e=this.listeners.length;d<e;d++)g[h].events.purge(this.listeners[d])});this.memoryLeaking=true}b.attachEvent("on"+
2462a,function(){c.call(b,window.event)})}},trackLoadProgress:function(b){if(b.settings.preload){var a,c;b=b;var d=/(ipod|iphone|ipad)/i.test(navigator.userAgent);a=setInterval(function(){if(b.element.readyState>
2462-1)d||b.init.apply(b);if(b.element.readyState>1){b.settings.autoplay&&b.play.apply(b);clearInterval(a);c=setInterval(function(){b.loadProgress.apply(b);b.loadedPercent>=1&&clearInterval(c)})}},10);b.readyTimer=a;b.loadTimer=c}},purge:function(b){var a=b.attributes,c;if(a)for(c=0;c<a.length;c+=
24631)if(typeof b[a[c].name]==="function")b[a[c].name]=null;if(a=b.childNodes)for(c=0;c<a.length;c+=1)purge(b.childNodes[c])},ready:function(){return function(b){var a=window,c=false,d=true,e=a.document,i=e.documentElement,f=e.addEventListener?"addEventListener":"attachEvent",k=e.addEventListener?"removeEventListener":"detachEvent",n=e.addEventListener?"":"on",m=function(l){if(!(l.type=="readystatechange"&&e.readyState!="complete")){(l.type=="load"?a:e)[k](n+l.type,m,false);if(!c&&(c=true))b.call(a,l.type||
2464l)}},q=function(){try{i.doScroll("left")}catch(l){setTimeout(q,50);return}m("poll")};if(e.readyState=="complete")b.call(a,"lazy");else{if(e.createEventObject&&i.doScroll){try{d=!a.frameElement}catch(r){}d&&q()}e[f](n+"DOMContentLoaded",m,false);e[f](n+"readystatechange",m,false);a[f](n+"load",m,false)}}}()}};g[o]=function(b,a){this.element=b;this.wrapper=b.parentNode;this.source=b.getElementsByTagName("source")[0]||b;this.mp3=function(c){var d=c.getElementsByTagName("source")[0];return c.getAttribute("src")||
2465(d?d.getAttribute("src"):null)}(b);this.settings=a;this.loadStartedCalled=false;this.loadedPercent=0;this.duration=1;this.playing=false};g[o].prototype={updatePlayhead:function(){this.settings.updatePlayhead.apply(this,[this.element.currentTime/this.duration])},skipTo:function(b){if(!(b>this.loadedPercent)){this.element.currentTime=this.duration*b;this.updatePlayhead()}},load:function(b){this.loadStartedCalled=false;this.source.setAttribute("src",b);this.element.load();this.mp3=b;g[h].events.trackLoadProgress(this)},
2466loadError:function(){this.settings.loadError.apply(this)},init:function(){this.settings.init.apply(this)},loadStarted:function(){if(!this.element.duration)return false;this.duration=this.element.duration;this.updatePlayhead();this.settings.loadStarted.apply(this)},loadProgress:function(){if(this.element.buffered!=null&&this.element.buffered.length){if(!this.loadStartedCalled)this.loadStartedCalled=this.loadStarted();this.loadedPercent=this.element.buffered.end(this.element.buffered.length-1)/this.duration;
2467this.settings.loadProgress.apply(this,[this.loadedPercent])}},playPause:function(){this.playing?this.pause():this.play()},play:function(){/(ipod|iphone|ipad)/i.test(navigator.userAgent)&&this.element.readyState==0&&this.init.apply(this);if(!this.settings.preload){this.settings.preload=true;this.element.setAttribute("preload","auto");g[h].events.trackLoadProgress(this)}this.playing=true;this.element.play();this.settings.play.apply(this)},pause:function(){this.playing=false;this.element.pause();this.settings.pause.apply(this)},
2468setVolume:function(b){this.element.volume=b},trackEnded:function(){this.skipTo.apply(this,[0]);this.settings.loop||this.pause.apply(this);this.settings.trackEnded.apply(this)}};var j=function(b,a){var c=[];a=a||document;if(a.getElementsByClassName)c=a.getElementsByClassName(b);else{var d,e,i=a.getElementsByTagName("*"),f=RegExp("(^|\\s)"+b+"(\\s|$)");d=0;for(e=i.length;d<e;d++)f.test(i[d].className)&&c.push(i[d])}return c.length>1?c:c[0]}})("audiojs","audiojsInstance",this);
2469
2470!function(e,n,i,s){"use strict";function t(n,i){this.element=n,this.$elem=e(this.element),this.options=e.extend(d,i),this.init()}var l="slimmenu",a=0,d={resizeWidth:"767",initiallyVisible:!1,collapserTitle:"Main Menu",animSpeed:"medium",easingEffect:null,indentChildren:!1,childrenIndenter:"&nbsp;&nbsp;",expandIcon:"<i>&#9660;</i>",collapseIcon:"<i>&#9650;</i>"};t.prototype={init:function(){var i,s=e(n),t=this.options,l=this.$elem,a='<div class="menu-collapser">'+t.collapserTitle+'<div class="collapse-button"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></div></div>';l.before(a),i=l.prev(".menu-collapser"),l.on("click",".sub-toggle",function(n){n.preventDefault(),n.stopPropagation();var i=e(this).closest("li");e(this).hasClass("expanded")?(e(this).removeClass("expanded").html(t.expandIcon),i.find(">
2470ul").slideUp(t.animSpeed,t.easingEffect)):(e(this).addClass("expanded").html(t.collapseIcon),i.find(">ul").slideDown(t.animSpeed,t.easingEffect))}),i.on("click",".collapse-button",function(e){e.preventDefault(),l.slideToggle(t.animSpeed,t.easingEffect)}),this.resizeMenu(),s.on("resize",this.resizeMenu.bind(this)),s.trigger("resize")},resizeMenu:function(){var i=this,t=e(n),l=t.width(),d=this.options,o=e(this.element),h=e("body").find(".menu-collapser");n.innerWidth!==s&&n.innerWidth>l&&(l=n.innerWidth),l!=a&&(a=l,o.find("li").each(function(){e(this).has("ul").length&&(e(this).addClass("has-submenu").has(".sub-toggle").length?e(this).children(".sub-toggle").html(d.expandIcon):e(this).addClass("has-submenu").append('<span class="sub-toggle">'+d.expandIcon+"</span>")),e(this).children("ul").hide().end().find(".sub-toggle").removeClass("expanded").html(d.expandIcon)}),d.resizeWidth>=l?(d.indentChildren&&o.find("ul").each(function(){var n=e(this).parents("ul").length;e(this).children("li").children("a").has("i").length||e(this).children("li").children("a").prepend(i.indent(n,d))}),o.addClass("collapsed").find("li").has("ul").off("mouseenter mouseleave"),h.show(),d.initiallyVisible||o.hide()):(o.find("li").has("ul").on("mouseenter",function(){e(this).find(">ul").stop().slideDown(d.animSpeed,d.easingEffect)}).on("mouseleave",function(){e(this).find(">ul").stop().slideUp(d.animSpeed,d.easingEffect)}),o.find("li > a > i").remove(),o.removeClass("collapsed").show(),h.hide()))},indent:function(e,n){for(var i=0,s="";e>i;i++)s+=n.childrenIndenter;return"<i>"+s+"</i> "}},e.fn[l]=function(n){return this.each(function(){e.data(this,"plugin_"+l)||e.data(this,"plugin_"+l,new t(this,n))})}}(jQuery,window,document);
2471/*
2472 *	jQuery dotdotdot 1.8.3
2473 *
2474 *	Copyright (c) Fred Heusschen
2475 *	www.frebsite.nl
2476 *
2477 *	Plugin website:
2478 *	dotdotdot.frebsite.nl
2479 *
2480 *	Licensed under the MIT license.
2481 *	http://en.wikipedia.org/wiki/MIT_License
2482 */
2483!function(t,e){"use strict";function n(t,e,n){var r=t.children(),a=!1;t.empty();for(var i=0,d=r.length;i<d;i++){var l=r.eq(i);if(t.append(l),n&&t.append(n),o(t,e)){l.remove(),a=!0;break}n&&n.detach()}return a}function r(e,n,i,d,l){var s=!1,c="a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",u="script, .dotdotdot-keep";return e.contents().detach().each(function(){var h=this,f=t(h);if("undefined"==typeof h)return!0;if(f.is(u))e.append(f);else{if(s)return!0;e.append(f),!l||f.is(d.after)||f.find(d.after).length||e[e.is(c)?"after":"append"](l),o(i,d)&&(s=3==h.nodeType?a(f,n,i,d,l):r(f,n,i,d,l)),s||l&&l.detach()}}),n.addClass("is-truncated"),s}function a(e,n,r,a,d){var c=e[0];if(!c)return!1;var h=s(c),f=h.indexOf(" ")!==-1?" ":" ",p="letter"==a.wrap?"":f,g=h.split(p),v=-1,w=-1,m=0,b=g.length-1;if(a.fallbackToLetter&&0===m&&0===b&&(p="",g=h.split(p),b=g.length-1),a.maxLength)h=i(h.trim().substr(0,a.maxLength),a),l(c,h);else{for(;m<=b&&(0!==m||0!==b);){var y=Math.floor((m+b)/2);if(y==w)break;w=y,l(c,g.slice(0,w+1).join(p)+a.ellipsis),r.children().each(function(){t(this).toggle().toggle()}),o(r,a)?(b=w,a.fallbackToLetter&&0===m&&0===b&&(p="",g=g[0].split(p),v=-1,w=-1,m=0,b=g.length-1)):(v=w,m=w)}if(v==-1||1===g.length&&0===g[0].length){var x=e.parent();e.detach();var C=d&&d.closest(x).length?d.length:0;if(x.contents().length>C?c=u(x.contents().eq(-1-C),n):(c=u(x,n,!0),C||x.detach()),c&&(h=i(s(c),a),l(c,h),C&&d)){var T=d.parent();t(c).parent().append(d),t.trim(T.html())||T.remove()}}else h=i(g.slice(0,v+1).join(p),a),l(c,h)}return!0}function o(t,e){return t.innerHeight()>e.maxHeight||e.maxLength&&t.text().trim().length>e.maxLength}function i(e,n){for(;t.inArray(e.slice(-1),n.lastCharacter.remove)>-1;)e=e.slice(0,-1);return t.inArray(e.slice(-1),n.lastCharacter.noEllipsis)<0&&(e+=n.ellipsis),e}function d(t){return{width:t.innerWidth(),height:t.innerHeight()}}function l(t,e){t.innerText?t.innerText=e:t.nodeValue?t.nodeValue=e:t.textContent&&(t.textContent=e)}function s(t){return t.innerText?t.innerText:t.nodeValue?t.nodeValue:t.textContent?t.textContent:""}function c(t){do t=t.previousSibling;while(t&&1!==t.nodeType&&3!==t.nodeType);return t}function u(e,n,r){var a,o=e&&e[0];if(o){if(!r){if(3===o.nodeType)return o;
2483if(t.trim(e.text()))return u(e.contents().last(),n)}for(a=c(o);!a;){if(e=e.parent(),e.is(n)||!e.length)return!1;a=c(e[0])}if(a)return u(t(a),n)}return!1}function h(e,n){return!!e&&("string"==typeof e?(e=t(e,n),!!e.length&&e):!!e.jquery&&e)}function f(t){for(var e=t.innerHeight(),n=["paddingTop","paddingBottom"],r=0,a=n.length;r<a;r++){var o=parseInt(t.css(n[r]),10);isNaN(o)&&(o=0),e-=o}return e}if(!t.fn.dotdotdot){t.fn.dotdotdot=function(e){if(0===this.length)return t.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){t(this).dotdotdot(e)});var a=this,i=a.contents();a.data("dotdotdot")&&a.trigger("destroy.dot"),a.data("dotdotdot-style",a.attr("style")||""),a.css("word-wrap","break-word"),"nowrap"===a.css("white-space")&&a.css("white-space","normal"),a.bind_events=function(){return a.bind("update.dot",function(e,d){switch(a.removeClass("is-truncated"),e.preventDefault(),e.stopPropagation(),typeof l.height){case"number":l.maxHeight=l.height;break;case"function":l.maxHeight=l.height.call(a[0]);break;default:l.maxHeight=f(a)}l.maxHeight+=l.tolerance,"undefined"!=typeof d&&(("string"==typeof d||"nodeType"in d&&1===d.nodeType)&&(d=t("<div />").append(d).contents()),d instanceof t&&(i=d)),g=a.wrapInner('<div class="dotdotdot" />').children(),g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,u=!1;return s.afterElement&&(c=s.afterElement.clone(!0),c.show(),s.afterElement.detach()),o(g,l)&&(u="children"==l.wrap?n(g,l,c):r(g,a,g,l,c)),g.replaceWith(g.contents()),g=null,t.isFunction(l.callback)&&l.callback.call(a[0],u,i),s.isTruncated=u,u}).bind("isTruncated.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(a[0],s.isTruncated),s.isTruncated}).bind("originalContent.dot",function(t,e){return t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e.call(a[0],i),i}).bind("destroy.dot",function(t){t.preventDefault(),t.stopPropagation(),a.unwatch().unbind_events().contents().detach().end().append(i).attr("style",a.data("dotdotdot-style")||"").removeClass("is-truncated").data("dotdotdot",!1)}),a},a.unbind_events=function(){return a.unbind(".dot"),a},a.watch=function(){if(a.unwatch(),"window"==l.watch){var e=t(window),n=e.width(),r=e.height();e.bind("resize.dot"+s.dotId,function(){n==e.width()&&r==e.height()&&l.windowResizeFix||(n=e.width(),r=e.height(),u&&clearInterval(u),u=setTimeout(function(){a.trigger("update.dot")},100))})}else c=d(a),u=setInterval(function(){if(a.is(":visible")){var t=d(a);c.width==t.width&&c.height==t.height||(a.trigger("update.dot"),c=t)}},500);return a},a.unwatch=function(){return t(window).unbind("resize.dot"+s.dotId),u&&clearInterval(u),a};var l=t.extend(!0,{},t.fn.dotdotdot.defaults,e),s={},c={},u=null,g=null;return l.lastCharacter.remove instanceof Array||(l.lastCharacter.remove=t.fn.dotdotdot.defaultArrays.lastCharacter.remove),l.lastCharacter.noEllipsis instanceof Array||(l.lastCharacter.noEllipsis=t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),s.afterElement=h(l.after,a),s.isTruncated=!1,s.dotId=p++,a.data("dotdotdot",!0).bind_events().trigger("update.dot"),l.watch&&a.watch(),a},t.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,maxLength:null},t.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" "," ",",",";",".","!","?"],noEllipsis:[]}},t.fn.dotdotdot.debug=function(t){};var p=1,g=t.fn.html;t.fn.html=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?this.trigger("update",[n]):g.apply(this,arguments)};var v=t.fn.text;t.fn.text=function(n){return n!=e&&!t.isFunction(n)&&this.data("dotdotdot")?(n=t("<div />").text(n).html(),this.trigger("update",[n])):v.apply(this,arguments)}}}(jQuery),jQuery(document).ready(function(t){t(".dot-ellipsis").each(function(){var e=t(this).hasClass("dot-resize-update"),n=t(this).hasClass("dot-timer-update"),r=0,a=t(this).attr("class").split(/\s+/);t.each(a,function(t,e){var n=e.match(/^dot-height-(\d+)$/);null!==n&&(r=Number(n[1]))});var o={};n&&(o.watch=!0),e&&(o.watch="window"),r>0&&(o.height=r),t(this).dotdotdot(o)})}),jQuery(window).on("load",function(){jQuery(".dot-ellipsis.dot-load-update").trigger("update.dot")});
2484/*! lazysizes - v4.0.0-rc2 */
2485!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports&&(module.exports=c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d,e=b.documentElement,f=a.Date,g=a.HTMLPictureElement,h="addEventListener",i="getAttribute",j=a[h],k=a.setTimeout,l=a.requestAnimationFrame||k,m=a.requestIdleCallback,n=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],p={},q=Array.prototype.forEach,r=function(a,b){return p[b]||(p[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),p[b].test(a[i]("class")||"")&&p[b]},s=function(a,b){r(a,b)||a.setAttribute("class",(a[i]("class")||"").trim()+" "+b)},t=function(a,b){var c;(c=r(a,b))&&a.setAttribute("class",(a[i]("class")||"").replace(c," "))},u=function(a,b,c){var d=c?h:"removeEventListener";c&&u(a,b),o.forEach(function(c){a[d](c,b)}
2485)},v=function(a,d,e,f,g){var h=b.createEvent("CustomEvent");return e||(e={}),e.instance=c,h.initCustomEvent(d,!f,!g,e),a.dispatchEvent(h),h},w=function(b,c){var e;!g&&(e=a.picturefill||d.pf)?e({reevaluate:!0,elements:[b]}):c&&c.src&&(b.src=c.src)},x=function(a,b){return(getComputedStyle(a,null)||{})[b]},y=function(a,b,c){for(c=c||a.offsetWidth;c<d.minSize&&b&&!a._lazysizesWidth;)c=b.offsetWidth,b=b.parentNode;return c},z=function(){var a,c,d=[],e=[],f=d,g=function(){var b=f;for(f=d.length?e:d,a=!0,c=!1;b.length;)b.shift()();a=!1},h=function(d,e){a&&!e?d.apply(this,arguments):(f.push(d),c||(c=!0,(b.hidden?k:l)(g)))};return h._lsFlush=g,h}(),A=function(a,b){return b?function(){z(a)}:function(){var b=this,c=arguments;z(function(){a.apply(b,c)})}},B=function(a){var b,c=0,d=125,e=666,g=e,h=function(){b=!1,c=f.now(),a()},i=m?function(){m(h,{timeout:g}),g!==e&&(g=e)}:A(function(){k(h)},!0);return function(a){var e;(a=a===!0)&&(g=44),b||(b=!0,e=d-(f.now()-c),0>e&&(e=0),a||9>e&&m?i():k(i,e))}},C=function(a){var b,c,d=99,e=function(){b=null,a()},g=function(){var a=f.now()-c;d>a?k(g,d-a):(m||e)(e)};return function(){c=f.now(),b||(b=k(g,d))}},D=function(){var g,l,m,o,p,y,D,F,G,H,I,J,K,L,M=/^img$/i,N=/^iframe$/i,O="onscroll"in a&&!/glebot/.test(navigator.userAgent),P=0,Q=0,R=0,S=-1,T=function(a){R--,a&&a.target&&u(a.target,T),(!a||0>R||!a.target)&&(R=0)},U=function(a,c){var d,f=a,g="hidden"==x(b.body,"visibility")||"hidden"!=x(a,"visibility");for(F-=c,I+=c,G-=c,H+=c;g&&(f=f.offsetParent)&&f!=b.body&&f!=e;)g=(x(f,"opacity")||1)>0,g&&"visible"!=x(f,"overflow")&&(d=f.getBoundingClientRect(),g=H>d.left&&G<d.right&&I>d.top-1&&F<d.bottom+1);return g},V=function(){var a,f,h,j,k,m,n,p,q,r=c.elements;if((o=d.loadMode)&&8>R&&(a=r.length)){f=0,S++,null==K&&("expand"in d||(d.expand=e.clientHeight>500&&e.clientWidth>500?500:370),J=d.expand,K=J*d.expFactor),K>Q&&1>R&&S>2&&o>2&&!b.hidden?(Q=K,S=0):Q=o>1&&S>1&&6>R?J:P;for(;a>f;f++)if(r[f]&&!r[f]._lazyRace)if(O)if((p=r[f][i]("data-expand"))&&(m=1*p)||(m=Q),q!==m&&(y=innerWidth+m*L,D=innerHeight+m,n=-1*m,q=m),h=r[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)<=D&&(H=h.right)>=n*L&&(G=h.left)<=y&&(I||H||G||F)&&(d.loadHidden||"hidden"!=x(r[f],"visibility"))&&(l&&3>R&&!p&&(3>o||4>S)||U(r[f],m))){if(ba(r[f]),k=!0,R>9)break}else!k&&l&&!j&&4>R&&4>S&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||"auto"!=r[f][i](d.sizesAttr)))&&(j=g[0]||r[f]);else ba(r[f]);j&&!k&&ba(j)}},W=B(V),X=function(a){s(a.target,d.loadedClass),t(a.target,d.loadingClass),u(a.target,Z),v(a.target,"lazyloaded")},Y=A(X),Z=function(a){Y({target:a.target})},$=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},_=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i]("data-media")||a[i]("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},aa=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute("sizes",e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||l),o={target:a},p&&(u(a,T,!0),clearTimeout(m),m=k(T,2500),s(a,d.loadingClass),u(a,Z,!0)),l&&q.call(j.getElementsByTagName("source"),_),h?a.setAttribute("srcset",h):g&&!l&&(N.test(a.nodeName)?$(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){(!p||a.complete&&a.naturalWidth>1)&&(p?T(o):R--,X(o))},!0)}),ba=function(a){var b,c=M.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i]("sizes")),f="auto"==e;(!f&&l||!c||!a[i]("src")&&!a.srcset||a.complete||r(a,d.errorClass))&&(b=v(a,"lazyunveilread").detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,R++,aa(a,b,f,e,c))},ca=function(){if(!l){if(f.now()-p<999)return void k(ca,999);var a=C(function(){d.loadMode=3,W()});l=!0,d.loadMode=3,W(),j("scroll",function(){3==d.loadMode&&(d.loadMode=2),a()},!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),L=d.hFac,j("scroll",W,!0),j("resize",W,!0),a.MutationObserver?new MutationObserver(W).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",W,!0),e[h]("DOMAttrModified",W,!0),setInterval(W,999)),j("hashchange",W,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b[h](a,W,!0)}),/d$|^c/.test(b.readyState)?ca():(j("load",ca),b[h]("DOMContentLoaded",W),k(ca,2e4)),c.elements.length?(V(),z._lsFlush()):W()},checkElems:W,unveil:ba}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)e[f].setAttribute("sizes",d);c.detail.dataAttr||w(a,c.detail)}),e=function(a,b,d){var e,f=a.parentNode;f&&(d=y(a,f,d),e=v(a,"lazybeforesizes",{width:d,dataAttr:!!b}),e.defaultPrevented||(d=e.detail.width,d&&d!==a._lazysizesWidth&&c(a,f,e,d)))},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)e(a[b])},g=C(f);
2485return{_:function(){a=b.getElementsByClassName(d.autosizesClass),j("resize",g)},checkElems:g,updateElem:e}}(),F=function(){F.i||(F.i=!0,E._(),D._())};return function(){var b,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0};d=a.lazySizesConfig||a.lazysizesConfig||{};for(b in c)b in d||(d[b]=c[b]);a.lazySizesConfig=d,k(function(){d.init&&F()})}(),c={cfg:d,autoSizer:E,loader:D,init:F,uP:w,aC:s,rC:t,hC:r,fire:v,gW:y,rAF:z}}});
2486var minSlides = 4;
2487var maxSlides = 4;
2488var sliderMargin = 20;
2489var slideWidth = 213;
2490var pager = true;
2491var controls = true;
2492var aufgabenfelder = null;
2493var aufgabenfelderNeu = null;
2494var emotionslider = null;
2495var infiniteLoop = false;
2496var weite = '';
2497var newssliderMinSlides = 2;
2498var newssliderMaxSlides = 2;
2499var newssliderSlideMargin = 20;
2500var newsdetailsliderMinSlides = 2;
2501var newsdetailsliderMaxSlides = 2;
2502var newsdetailsliderSlideMargin = 20;
2503var individualPause = 6000;
2504
2505var minSlidesNeu = 5;
2506var maxSlidesNeu = 5;
2507var sliderMarginNeu = 12;
2508var slideWidthNeu = 173;
2509
2510var logviewportTimeout;
2511
2512var fancyboxCookieConsentExternalDeactivated = 0;
2513
2514// fancyBox
2515$('a.lightbox').fancybox({
2516	padding: 10,
2517	openSpeed: 250,
2518	closeSpeed: 250,
2519	openEffect: 'fade',
2520	closeEffect: 'fade',
2521	nextEffect: 'elastic',
2522	prevEffect: 'elastic',
2523	helpers: {
2524		title: null,
2525		overlay: {
2526			css: {
2527				'background': 'rgba(88, 88, 88, 0.60)'
2528			}
2529		}
2530	},
2531	helpers: {
2532		title: {
2533			type: 'inside'
2534		}
2535	},
2536	beforeShow: function(){
2537		this.title = $(this.element).parent().find('.news-img-caption').text();
2538	},
2539});
2540
2541
2542$('a.kontaktbox-lightbox').fancybox({
2543	padding: 25,
2544	openSpeed: 250,
2545	closeSpeed: 250,
2546	openEffect: 'fade',
2547	closeEffect: 'fade',
2548	nextEffect: 'elastic',
2549	prevEffect: 'elastic',
2550	scrolling: 'auto',
2551	maxWidth: 600,
2552	helpers: {
2553		title: null,
2554		overlay: {
2555			css: {
2556				'background': 'rgba(88, 88, 88, 0.60)'
2557			}
2558		}
2559	},
2560	helpers: {
2561		title: {
2562			type: 'inside'
2563		}
2564	}
2565});
2566
2567
2568
2569// hilfefinder touch infoboxen
2570
2571$("body").on("touchstart",".angebote-icon-mobile",function(e){
2572	$(this).parent().find('.icon-info-mobile').toggleClass('open');
2573});
2574
2575// fancyBox
2576$('a.lightboxiframe').fancybox({
2577	helpers: {
2578
2579		// Enable the media helper to better handle video.
2580		media: true,
2581
2582		// Put comments within the white border.
2583		title: {
2584			type: 'inside'
2585		}
2586	},
2587
2588	// Do not use this because it tries to fit title text as well.
2589	fitToView: false,
2590
2591	afterShow: function(){
2592		this.inner.css({
2593			overflow: 'auto' // or 'no'<
2594		});
2595	},
2596
2597	// Prevent the introduction of black bars when resized for mobile.
2598	aspectRatio: true,
2599
2600	// Restrict content to the display dimensions.
2601	maxWidth: "100%",
2602	maxHeight: "100%",
2603
2604	// Change the title keyword to 'caption' to avoid title text in tooltips.
2605	beforeLoad: function() {
2606
2607		if(SgCookieOptin.checkIsExternalGroupAccepted()) {
2608			this.title = $(this.element).attr('caption');
2609		} else {
2610			fancyboxCookieConsentExternalDeactivated = 1;
2611			SgCookieOptin.openCookieOptin();
2612			//SgCookieOptin.openExternalContentConsent();
2613			return false;
2614		}
2615	},
2616
2617	// Override the default iframe dimensions with manually set dimensions.
2618	afterLoad: function() {
2619		this.width = $(this.element).data("width");
2620		this.height = $(this.element).data("height");
2621	}
2622});
2623
2624document.body.addEventListener('consentCookieSet', function() {
2625	if (fancyboxCookieConsentExternalDeactivated == 1) {
2626		console.log('check ob external jetzt erlaubt ist, wenn ja seitenrefresh durchführen');
2627		if (SgCookieOptin.checkIsExternalGroupAccepted()) {
2628			fancyboxCookieConsentExternalDeactivated = 0;
2629			location.reload();
2630		}
2631	}
2632});
2633
2634
2635
2636var showSidebar = function() {
2637	$('body').removeClass("active-nav").toggleClass("active-sidebar");
2638	$('.menu-button').removeClass("active-button");
2639}
2640
2641var showMenu = function() {
2642	$('body').removeClass("active-sidebar").toggleClass("active-nav");
2643	$('.menu-button').toggleClass("active-button");
2644}
2645
2646
2647// add/remove classes everytime the window resize event fires
2648jQuery(window).resize(function(){
2649	var off_canvas_nav_display = $('.off-canvas-navigation').css('display');
2650	var menu_button_display = $('.menu-button').css('display');
2651	if (off_canvas_nav_display === 'block') {
2652		$("body").removeClass("three-column").addClass("small-screen");
2653	}
2654	if (off_canvas_nav_display === 'none') {
2655		$("body").removeClass("active-sidebar active-nav small-screen")
2656			.addClass("three-column");
2657	}
2658
2659});
2660
2661audiojs.events.ready(function() {
2662	var as = audiojs.createAll();
2663});
2664
2665
2666
2667
2668
2669jQuery(document).ready(function($) {
2670
2671	/*$('#tx-solr-faceting .facet-option a.facet').on('click', function(e) {
2672
2673		if (!$(this).hasClass('active')) {
2674			$('#tx-solr-faceting .facet-option a.facet').removeClass('active');
2675			$(this).addClass('active');
2676		}
2677	});*/
2678
2679	var headerSliderSliderpunkte = document.querySelector("#headerSliderSliderpunkte");
2680
2681	if ( headerSliderSliderpunkte == null ) {
2682		var headerSliderSliderpunkteDeaktivieren = 1;
2683	} else {
2684		var headerSliderSliderpunkteDeaktivieren = headerSliderSliderpunkte.dataset.deactivate;
2685	}
2686
2687	if ( typeof(headerSliderSliderpunkteDeaktivieren) == 'undefined' ) {
2688		var headerSliderSliderpunkteDeaktivieren = true;
2689	} if ( headerSliderSliderpunkteDeaktivieren == "0" ) {
2690		var headerSliderSliderpunkteDeaktivieren = false;
2691	} else if ( headerSliderSliderpunkteDeaktivieren == "1" ) {
2692		var headerSliderSliderpunkteDeaktivieren = true;
2693	}
2694
2695	// headerSliderRandom
2696	var headerSliderRandomZustand = document.querySelector("#headerSliderRandom");
2697	var kampagnenSliderRandomZustand = document.querySelector("#kampagnenSliderRandom");
2698
2699	if ( headerSliderRandomZustand == null ) {
2700		var headerSliderRandom = 0;
2701	} else {
2702		var headerSliderRandom = headerSliderRandomZustand.dataset.activate;
2703	}
2704
2705	if ( typeof(headerSliderRandom) == 'undefined' ) {
2706		var headerSliderRandom = 0;
2707	} if ( headerSliderRandom == "0" ) {
2708		var headerSliderRandom = false;
2709	} else if ( headerSliderRandom == "1" ) {
2710		var headerSliderRandom = true;
2711	}
2712
2713	if ( kampagnenSliderRandomZustand == null ) {
2714		var kampagnenSliderRandom = 0;
2715	} else {
2716		var kampagnenSliderRandom = kampagnenSliderRandomZustand.dataset.activate;
2717	}
2718
2719	if ( typeof(kampagnenSliderRandom) == 'undefined' ) {
2720		var kampagnenSliderRandom = 0;
2721	} if ( kampagnenSliderRandom == "0" ) {
2722		var kampagnenSliderRandom = false;
2723	} else if ( kampagnenSliderRandom == "1" ) {
2724		var kampagnenSliderRandom = true;
2725	}
2726
2727	var startSlideNr;
2728	var urlParams = new URLSearchParams(window.location.search);
2729	var accordionToOpenId;
2730
2731	if(urlParams.has('slideStart')){
2732		// true
2733		startSlideNr = parseInt(urlParams.get('slideStart'));
2734		startSlideNr = startSlideNr-1;
2735
2736		var headerSliderRandom = 0;
2737		var kampagnenSliderRandom = 0;
2738	}
2739
2740	if(urlParams.has('accOpen')){
2741		$(".contentInnerMaxWidth .contentInner .csc-default .accordion-content").addClass('hidden');
2742
2743		accordionToOpenId = '#c'+parseInt(urlParams.get('accOpen'));
2744
2745		$(accordionToOpenId).next().children().first().removeClass('icon-close').addClass('icon-open');
2746		$(accordionToOpenId).next().children().closest('.accordion-content').removeClass('hidden');
2747	}
2748
2749	weite = $(window).width();
2750
2751	$('#mobileMenu').slimmenu({
2752		resizeWidth: '1200',
2753		collapserTitle: '',
2754		animSpeed: 'medium',
2755		easingEffect: null,
2756		initiallyVisible: true,
2757		indentChildren: false,
2758		childrenIndenter: '&nbsp;'
2759	});
2760
2761	//$(".lazyload").unveil();
2762
2763	// browser window scroll (in pixels) after which the "back to top" link is shown
2764	var offset = 300;
2765	var offsetFlexteamCTA = 850;
2766	//browser window scroll (in pixels) after which the "back to top" link opacity is reduced
2767	offset_opacity = 1200,
2768		//duration of the top scrolling animation (in ms)
2769		scroll_top_duration = 700,
2770		//grab the "back to top" link
2771		$back_to_top = $('.cd-top');
2772	//grab the "flexteamCTA" link
2773	$flexteam_cta = $('.flexteamctacontent-fixed');
2774
2775
2776	$(document.body).on('touchmove', onScroll); // for mobile
2777	$(window).on('scroll', onScroll);
2778
2779	var timeoutID;
2780
2781	var indexelement = document.getElementById('indexelementTrigger');
2782
2783	function onScroll() {
2784		//hide or show the "back to top" link
2785		($(this).scrollTop() > offset) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out');
2786		if ($(this).scrollTop() > offset_opacity) {
2787			$back_to_top.addClass('cd-fade-out');
2788		}
2789
2790		($(this).scrollTop() > offsetFlexteamCTA) ? $flexteam_cta.addClass('cd-is-visible') : $flexteam_cta.removeClass('cd-is-visible cd-fade-out');
2791		if ($(this).scrollTop() > offset_opacity) {
2792			$flexteam_cta.addClass('cd-fade-out');
2793		}
2794
2795		//console.log('onscroll aufgerufen');
2796
2797		if ($('.jobfinderfilter-to-top').length) {
2798			if (weite < 1100) {
2799				timeoutID = setTimeout(checkPosition, 1000);
2800			}
2801		}
2802
2803		if (weite >= 1300) {
2804
2805			var target = document.querySelector('.emotion');
2806
2807			if (!target || !indexelement) {
2808				return;
2809			}
2810
2811			const observer = new IntersectionObserver(
2812				([entry]) => {
2813					// entry.isIntersecting: true if the element is in the viewport
2814					indexelement.classList.toggle('fixed', !entry.isIntersecting);
2815				},
2816				{ threshold: 0 } // Fires when even a single pixel enters or leaves the viewport
2817			);
2818
2819			observer.observe(target);
2820
2821		}
2822	}
2823
2824	function checkPosition() {
2825		//console.log('checkPosition');
2826		if ($('.jobfinderfilter-to-top').length) {
2827
2828			var top_of_element = $(".hilfefinderJobFinden").offset().top;
2829			var bottom_of_element = $(".hilfefinderJobFinden").offset().top + $(".hilfefinderJobFinden").outerHeight();
2830			var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight();
2831			var top_of_screen = $(window).scrollTop();
2832
2833			if ((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)) {
2834				// the element is visible, do something
2835				//console.log("the element is visible");
2836				clearTimeout(timeoutID);
2837				$('.jobfinderfilter-to-top').fadeOut("slow", function () {
2838
2839				});
2840			} else {
2841				// the element is not visible, do something else
2842				//console.log("the element is not visible, show the jobfinderfilter-to-top");
2843				$('.jobfinderfilter-to-top').css('display', 'flex');
2844			}
2845
2846			//console.log('top_of_element'+top_of_element);
2847		}
2848	}
2849
2850
2851	// Formulare label readonly abfragen und setzen
2852	$('.tx-powermail div.readonly input').prop('readonly', 'readonly');
2853
2854
2855	// Aufgabenfelder Hinweis nur anzeigen, wenn auch Aufgabenfelder vorhanden sind
2856	if ( $('.aufgabenfelderKarusel').length) {
2857
2858	} else {
2859		$('.aufgabenfelderHinweis').hide();
2860	}
2861
2862	if ( $('.aufgabenfelderKaruselNeu').length) {
2863
2864	} else {
2865		$('.aufgabenfelderHinweis').hide();
2866	}
2867
2868	// International
2869	$('.internationalOpener').on('click', function(e) {
2870		e.preventDefault();
2871		if ($(this).hasClass('act')) {
2872			$('ul.internationalLinks').hide();
2873			$(this).removeClass('act');
2874		} else {
2875			$('ul.internationalLinks').show();
2876			$(this).addClass('act');
2877		}
2878	});
2879
2880	//smooth scroll to top
2881	$back_to_top.on('click', function(e){
2882		e.preventDefault();
2883		$('body,html').animate({
2884				scrollTop: 0 ,
2885			}, scroll_top_duration
2886		);
2887	});
2888
2889	//smooth scroll to top for mobile back to filter link
2890	$('.jobfinderfilter-to-top').on('click', function(e){
2891		e.preventDefault();
2892		$(this).fadeOut( "slow", function() {
2893
2894		});
2895		$('.container').animate({
2896			scrollTop: 0 ,
2897		}, scroll_top_duration);
2898	});
2899
2900	$( "#powermail_field_wiesindsieaufdiestelleaufmerksamgeworden" ).change(function() {
2901
2902		if ($(this).val() == 'Sonstiges (bitte unten nennen)') {
2903			$('.powermail_form_4 .powermail_fieldwrap_sonstiges').show();
2904		} else {
2905			$('.powermail_form_4 .powermail_fieldwrap_sonstiges').hide();
2906		}
2907	});
2908
2909	$( "#powermail_field_wiesindsieaufunsaufmerksamgeworden" ).change(function() {
2910
2911		if ($(this).val() == 'Sonstiges (bitte unten nennen)') {
2912			$('.powermail_form_3 .powermail_fieldwrap_sonstiges').show();
2913		} else {
2914			$('.powermail_form_3 .powermail_fieldwrap_sonstiges').hide();
2915		}
2916	});
2917
2918	$( ".powermail_fieldwrap_gewnschtereinsatzbereichmax2 .powermail_checkbox" ).click(function() {
2919		zaehler = 0;
2920		$(".powermail_fieldwrap_gewnschtereinsatzbereichmax2 .powermail_checkbox:checked").each(function(){
2921			++zaehler;
2922			if(zaehler > 2) {
2923				alert('Sie können nur maximal 2 Einsatzbereiche auswählen.');
2924				$(this).prop('checked', false);
2925				return false;
2926			}
2927		});
2928	});
2929
2930	$( ".powermail_fieldwrap_preferredareaofworkmax2 .powermail_checkbox" ).click(function() {
2931		zaehler = 0;
2932		$(".powermail_fieldwrap_preferredareaofworkmax2 .powermail_checkbox:checked").each(function(){
2933			++zaehler;
2934			if(zaehler > 2) {
2935				alert('Sie können nur maximal 2 Einsatzbereiche auswählen.');
2936				$(this).prop('checked', false);
2937				return false;
2938			}
2939		});
2940	});
2941
2942
2943	// smooth Scroll Functions
2944// Select all links with hashes
2945	if ($('#c26013').length > 0 && $('body').hasClass('small-screen')) {
2946		console.log('Auf der Seite Vorteile und kleiner Screen');
2947	} else {
2948		if (isIOS() || (weite < 1100)) {
2949
2950		} else {
2951			$('a[href*="#"]')
2952				// Remove links that don't actually link to anything
2953				.not('[href="#"]')
2954				.not('[href="#0"]')
2955				.not('.url')
2956				.click(function (event) {
2957					// On-page links
2958					if (
2959						location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
2960						&&
2961						location.hostname == this.hostname
2962					) {
2963						// Figure out element to scroll to
2964						var target = $(this.hash);
2965						target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
2966						targetID = target.selector.replace("#", "");
2967						// Does a scroll target exist?
2968						if (target.length) {
2969
2970							event.preventDefault();
2971
2972							var element = document.getElementById(targetID);
2973							var offset = 80; // Abstand zum oberen Rand
2974							var position = element.getBoundingClientRect().top + window.scrollY - offset;
2975
2976							window.scrollTo({
2977								top: position,
2978								behavior: "smooth"
2979							});
2980
2981							//var top = getOffsetTop(document.getElementById(target));
2982							// Only prevent default if animation is actually gonna happen
2983							/*event.preventDefault();
2984							$('html,body').animate({
2985								scrollTop: target.offset().top - 100
2986							}, 700, function () {
2987								// Callback after animation
2988								// Must change focus!
2989								var $target = $(target);
2990								$target.focus();
2991								if ($target.is(":focus")) { // Checking if the target was focused
2992									return false;
2993								} else {
2994									$target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
2995									$target.focus(); // Set focus again
2996								}
2997							});*/
2998						}
2999					}
3000				});
3001		}
3002
3003
3004		$(function smoothscroll() {
3005			setTimeout(function () {
3006				if (location.hash) {
3007					window.scrollTo(0, 0);
3008					target = location.hash.split('#');
3009					smoothScrollTo($('#' + target[1]));
3010				}
3011			}, 1);
3012
3013			function smoothScrollTo(target) {
3014				target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
3015
3016				if (target.length) {
3017					$('html,body').animate({
3018						scrollTop: target.offset().top - 100
3019					}, scroll_top_duration);
3020				}
3021			}
3022		});
3023	}
3024
3025	function isIOS() {
3026		return /iPhone|iPad|iPod/i.test(navigator.userAgent);
3027	}
3028
3029
3030	// Submenu Ebene 1 aufklappbar
3031	/*
3032	$('.hauptnav ul li.menu a.hauptnav').on('click', function(e){
3033
3034		var naviZielId;
3035		var naviZiel;
3036
3037		naviZielId = $(this).parent().attr('data-id');
3038		naviZiel = '.subnavigation_klick_'+naviZielId;
3039
3040        // || (naviZielId == 53 && language == 'en') || (naviZielId == 2 && language == 'en')
3041
3042		if (naviZielId == 82 || naviZielId == 83 || (naviZielId == 53 && language == 'en') || (naviZielId == 2 && language == 'en') ) {
3043		} else {
3044			e.preventDefault();
3045		}
3046
3047		$('.hauptnav ul li.menu a.hauptnav').each(function( index ) {
3048			$(this).removeClass('clicked');
3049		});
3050		$(this).addClass('clicked');
3051
3052		if ($(this).hasClass('aktiv')) {
3053			$('.subnavigation_klick').each(function( index ) {
3054				$(this).css('zindex', '500');
3055				$(this).css('max-height', '0px');
3056				$(this).css('border-bottom', '0px solid #ff0000');
3057			});
3058			$('.mainNavi').css('max-height', '2000px');
3059		} else {
3060			$('.subnavigation_klick').each(function( index ) {
3061				$(this).css('zindex', '500');
3062				$(this).css('max-height', '0px');
3063				$(this).css('border-bottom', '0px solid #ff0000');
3064			});
3065
3066			$(naviZiel).css('max-height', '56px');
3067			$(naviZiel).css('zindex', '1000');
3068			$('.mainNavi').css('max-height', '47px');
3069			//$(naviZiel).css('border-bottom', '1px solid #ff0000');
3070		}
3071
3072		//subnavigation_klick_25
3073	});
3074	*/
3075
3076	if (weite > 1100) {
3077		// ScrollDown
3078		$('.scrolldown').bind("click", function (event) {
3079			// Standard Verhalten unterdrücken
3080			event.preventDefault();
3081			// Linkziel in Variable schreiben
3082			var ziel = $(this).attr("href");
3083
3084			$('html, body').animate({
3085				//Zum Ziel scrollen (Variable)
3086				scrollTop: $(ziel).offset().top
3087				// Dauer der Animation und Callbackfunktion die nach der Animation aufgerufen wird, sie stellt das Standardverhalten wieder her und ergänzt die URL
3088			}, 500);
3089		});
3090	}
3091
3092	// Alle geschlossenen Akkordeon-Inhalte beim Laden als inert markieren
3093	$('.accordion-content.hidden').attr('inert', '');
3094
3095	// Gridelements Accordion Element
3096	$('.frame-type-gridelements_pi1 .accordion-headline').click(function(e)  {
3097		if($(this).hasClass('icon-close')){
3098			//content is closed
3099			$(this).removeClass('icon-close');
3100			$(this).addClass('icon-open');
3101			$(this).closest('.csc-default').find('.accordion-content').removeClass('hidden').removeAttr('inert');
3102			$(this).attr("aria-expanded", "true");
3103		} else {
3104			//content is visibel
3105			$(this).removeClass('icon-open');
3106			$(this).addClass('icon-close');
3107			$(this).closest('.csc-default').find('.accordion-content').addClass('hidden').attr('inert', '');
3108			$(this).attr("aria-expanded", "false");
3109		}
3110	});
3111
3112	// DCE FAQ Schema.org Element
3113	$('.faqs .accordion-headline').click(function(e)  {
3114		if($(this).hasClass('icon-close')){
3115			//content is closed
3116			$(this).removeClass('icon-close');
3117			$(this).addClass('icon-open');
3118			$(this).closest('.accordion-item').find('.accordion-content').removeClass('hidden').removeAttr('inert');
3119			$(this).attr("aria-expanded", "true");
3120		} else {
3121			//content is visibel
3122			$(this).removeClass('icon-open');
3123			$(this).addClass('icon-close');
3124			$(this).closest('.accordion-item').find('.accordion-content').addClass('hidden').attr('inert', '');
3125			$(this).attr("aria-expanded", "false");
3126		}
3127	});
3128
3129	// Hilfefinder Single Akkordioninhalte
3130	$('.hilfefinderSingleAkkordioninhalte .accordion-headline').click(function(e)  {
3131		if($(this).hasClass('icon-close')){
3132			//content is closed
3133			$(this).removeClass('icon-close');
3134			$(this).addClass('icon-open');
3135			$(this).closest('.csc-default').find('.accordion-content').removeClass('hidden').removeAttr('inert');
3136			$(this).attr("aria-expanded", "true");
3137		} else {
3138			//content is visibel
3139			$(this).removeClass('icon-open');
3140			$(this).addClass('icon-close');
3141			$(this).closest('.csc-default').find('.accordion-content').addClass('hidden').attr('inert', '');
3142			$(this).attr("aria-expanded", "false");
3143		}
3144	});
3145
3146	// Hilfefinder Single Brennholz Formular
3147	$('.hilfefinderSingle .powermail_form_14 .accordion-headline').click(function(e)  {
3148		if($(this).hasClass('icon-close')){
3149			//content is closed
3150			$(this).removeClass('icon-close');
3151			$(this).addClass('icon-open');
3152			$(this).closest('.csc-default').find('.accordion-content').removeClass('hidden').removeAttr('inert');
3153			$(this).attr("aria-expanded", "true");
3154		} else {
3155			//content is visibel
3156			$(this).removeClass('icon-open');
3157			$(this).addClass('icon-close');
3158			$(this).closest('.csc-default').find('.accordion-content').addClass('hidden').attr('inert', '');
3159			$(this).attr("aria-expanded", "false");
3160		}
3161	});
3162
3163
3164	if ($(".hilfefinderSingle .powermail_form").hasClass('powermail_form_33') || $(".hilfefinderSingle .powermail_form").hasClass('powermail_form_45') || $(".hilfefinderSingle .powermail_form").hasClass('powermail_form_51') || $(".hilfefinderSingle .powermail_form").hasClass('powermail_form_52') || $(".hilfefinderSingle .powermail_form").hasClass('powermail_form_44')) {
3165
3166	} else {
3167		$(".hilfefinderSingle .powermail_form .powermail_fieldset .powermail_fieldwrap").hide();
3168		$(".hilfefinderSingle .powermail_form .powermail_fieldset .powermail_legend").addClass('closed');
3169
3170		/* Accordion in Formularen im Angebotsfinder Detailseite */
3171		$(".hilfefinderSingle .powermail_form .powermail_fieldset .powermail_legend").click(function(){ // trigger
3172			$(this).parent().children(".accordion-content").children(".powermail_fieldwrap ").slideToggle("fast"); // blendet beim Klick auf fieldset die nächste form_wraps ein
3173			$(this).toggleClass("closed open"); // wechselt beim Klick auf "dt" die Klasse des enthaltenen a-Tags von "closed" zu "open".
3174		});
3175	}
3176
3177	/* Pflichtfelder im Accordion werden über einen Listener abgefangen ob diese invalid sind, falls ja wird das entsprechende Accordion Element geöffnet, falls es geschloßen wäre */
3178	$('.hilfefinderSingle .powermail_form .powermail_fieldset .powermail_fieldwrap input').each(function(i){
3179		this.addEventListener('invalid', function(e){
3180			if (e.target.id != '') {
3181				if ($('#'+e.target.id).parent().parent().parent().children(".powermail_fieldwrap ").css('display') == 'none') {
3182					$('#'+e.target.id).parent().parent().parent().children(".powermail_fieldwrap ").slideToggle("fast");
3183				}
3184			}
3185			return true;
3186		}, false);
3187	})
3188
3189
3190	// Schweizer Schnellfinder Template Formulare
3191	$(".powermail_form_33 .powermail_fieldset .powermail_legend").addClass('closed');
3192	$(".powermail_form_33 .powermail_fieldset .powermail_fieldwrap").hide();
3193	$(".powermail_form_45 .powermail_fieldset .powermail_legend").addClass('closed');
3194	$(".powermail_form_45 .powermail_fieldset .powermail_fieldwrap").hide();
3195
3196	$(".powermail_form_45 .powermail_fieldset").click(function(){
3197		if (!$(this).children(".powermail_legend").hasClass("open")) {
3198			$(".powermail_form_45 .powermail_fieldwrap ").slideUp("fast");
3199			$(".powermail_form_45 .powermail_legend").removeClass('open').addClass("closed");
3200			$(this).children(".powermail_fieldwrap ").slideDown("fast");
3201			$(this).children(".powermail_legend").removeClass('closed').addClass("open");
3202		}
3203	});
3204
3205	$(".powermail_form_33 .powermail_fieldset").click(function(){
3206		if (!$(this).children(".powermail_legend").hasClass("open")) {
3207			$(".powermail_form_33 .powermail_fieldwrap ").slideUp("fast");
3208			$(".powermail_form_33 .powermail_legend").removeClass('open').addClass("closed");
3209			$(this).children(".powermail_fieldwrap ").slideDown("fast");
3210			$(this).children(".powermail_legend").removeClass('closed').addClass("open");
3211		}
3212	});
3213
3214
3215	// bunte Listenpunkte
3216	$('.content .contentInnerMaxWidth .contentInner ul').each(function(el){
3217		$(this).find('li').addClass('js-li').wrapInner('<span></span>');
3218	});
3219
3220	$('.content .contentInnerFullWidth .contentInner ul').each(function(el){
3221		$(this).find('li').addClass('js-li').wrapInner('<span></span>');
3222	});
3223
3224	// Toggle for nav menu
3225	$('.menu-button').click(function(e) {
3226		e.preventDefault();
3227		showMenu();
3228	});
3229	// Toggle for sidebar
3230	$('.sidebar-button').click(function(e) {
3231		e.preventDefault();
3232		showSidebar();
3233	});
3234
3235	if ($('.aufgabenfelderKarusel').length > 0 ) {
3236		// Zufallsreihenfolge Karusel nur wenn aktiviert im DCE
3237		if (karuselRandom == 1) {
3238			$("div.aufgabenfelderKarusel").randomize(".aufgabenfelderBox .carousel1", "a.slide");
3239		}
3240	}
3241
3242	if ($('.aufgabenfelderKaruselNeu').length > 0 ) {
3243		// Zufallsreihenfolge Karusel nur wenn aktiviert im DCE
3244		if (karuselRandomNeu == 1) {
3245			$("div.aufgabenfelderKaruselNeu").randomize(".aufgabenfelderBoxNeu .carousellNeu", "a.slide");
3246		}
3247	}
3248
3249	if ($('.kampagnenSlider').length > 0 ) {
3250
3251		if (kampagnenSliderRandom === true) {
3252			kampagnenslider = $('.kampagnenbxslider').bxSlider({
3253				mode: 'fade',
3254				speed: 1000,
3255				auto: ($('.kampagnenbxslider li').length > 1) ? true: false,
3256				pause: individualPause,
3257				pager: headerSliderSliderpunkteDeaktivieren,
3258				controls: false,
3259				randomStart: true,
3260			});
3261		} else {
3262			if (startSlideNr == '') {
3263				startSlideNr = 0;
3264			}
3265			kampagnenslider = $('.kampagnenbxslider').bxSlider({
3266				mode: 'fade',
3267				speed: 1000,
3268				auto: ($('.kampagnenbxslider li').length > 1) ? true: false,
3269				pause: individualPause,
3270				pager: headerSliderSliderpunkteDeaktivieren,
3271				controls: false,
3272				startSlide: startSlideNr
3273			});
3274		}
3275
3276	}
3277
3278	if ($('.emotionSlider').length > 0 ) {
3279		// Zufallsreihenfolge Header Slider nur wenn aktiviert im DCE
3280		if (headerSliderRandom === true) {
3281
3282			//$("div.emotionSlider").randomize(".bxslider", "li");
3283			// bxslider Startseite
3284			emotionslider = $('.bxslider').bxSlider({
3285				mode: 'fade',
3286				speed: 1000,
3287				auto: true,
3288				pause: individualPause,
3289				pager: headerSliderSliderpunkteDeaktivieren,
3290				controls: false,
3291				randomStart: headerSliderRandom,
3292				onSliderLoad: function(currentIndex) {
3293					//logViewport();
3294					//console.log(currentIndex);
3295					posCaption = parseInt($(".bxslider li:nth-child("+currentIndex+") .caption").css('top'));
3296					//console.log(posCaption);
3297					targetIndex = currentIndex + 1;
3298					myTimeout = setTimeout(function() {
3299						if (weite > 880) {
3300							$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 80);
3301						}
3302						if (weite > 1200) {
3303							$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 110);
3304						}
3305						if (weite > 1500) {
3306							$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 140);
3307						}
3308						$(".bx-controls").css('top', posCaption-50);
3309
3310						if ($(".bxslider li:nth-child(1) .caption").hasClass('headertextschraeg')) {
3311							//console.log('headertextschraeg vorhanden');
3312							if (weite > 880) {
3313								$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 80);
3314							}
3315							if (weite > 1200) {
3316								$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 110);
3317							}
3318							if (weite > 1500) {
3319								$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', 140);
3320							}
3321							posCaption = parseInt($(".bxslider li:nth-child("+targetIndex+") .caption").css('top'));
3322							$(".bx-controls").css('top', posCaption-40);
3323						} else {
3324							// wenn keine Schräge
3325							//console.log('hier wird geliefert');
3326							$(".bxslider li:nth-child("+targetIndex+") .caption").css('top', '40%');
3327							$(".bx-controls").css('top', 'calc(40% - 40px)');
3328						}
3329
3330						clearTimeout(myTimeout);
3331					}, 1500);
3332
3333				},
3334				onSlideBefore: function($slideElement, oldIndex, newIndex) {
3335					//console.log('onSlideBefore');
3336					//console.log($slideElement);
3337					//console.log(oldIndex);
3338					//console.log(newIndex);
3339					//$($slideElement + '.headertextschraeg').hide();
3340
3341					actualIndex = newIndex + 1;
3342					//console.log(actualIndex);
3343
3344					posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3345
3346					if (newIndex > 3) {
3347						if ($(".bxslider li:nth-child("+actualIndex+") .caption").hasClass('headertextschraeg')) {
3348							//console.log('headertextschraeg vorhanden');
3349							if (weite > 880) {
3350								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 80);
3351							}
3352							if (weite > 1200) {
3353								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 110);
3354							}
3355							if (weite > 1500) {
3356								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 140);
3357							}
3358							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3359							$(".bx-controls").css('top', posCaption-40);
3360						} else {
3361							// wenn keine Schräge
3362							$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', '40%');
3363							$(".bx-controls").css('top', 'calc(40% - 40px)');
3364						}
3365					}
3366					else if (newIndex == 3) {
3367						if ($(".bxslider li:nth-child(4) .caption").hasClass('headertextschraeg')) {
3368							//console.log('headertextschraeg vorhanden');
3369							if (weite > 880) {
3370								$(".bxslider li:nth-child(4) .caption").css('top', 80);
3371							}
3372							if (weite > 1200) {
3373								$(".bxslider li:nth-child(4) .caption").css('top', 110);
3374							}
3375							if (weite > 1500) {
3376								$(".bxslider li:nth-child(4) .caption").css('top', 140);
3377							}
3378							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3379							$(".bx-controls").css('top', posCaption-40);
3380						} else {
3381							// wenn keine Schräge
3382							$(".bxslider li:nth-child(4) .caption").css('top', '40%');
3383							$(".bx-controls").css('top', 'calc(40% - 40px)');
3384						}
3385					} else if (newIndex == 2) {
3386						if ($(".bxslider li:nth-child(3) .caption").hasClass('headertextschraeg')) {
3387							//console.log('headertextschraeg vorhanden');
3388							if (weite > 880) {
3389								$
3389(".bxslider li:nth-child(3) .caption").css('top', 80);
3390							}
3391							if (weite > 1200) {
3392								$(".bxslider li:nth-child(3) .caption").css('top', 110);
3393							}
3394							if (weite > 1500) {
3395								$(".bxslider li:nth-child(3) .caption").css('top', 140);
3396							}
3397							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3398							$(".bx-controls").css('top', posCaption-40);
3399						} else {
3400							// wenn keine Schräge
3401							$(".bxslider li:nth-child(3) .caption").css('top', '40%');
3402							$(".bx-controls").css('top', 'calc(40% - 40px)');
3403						}
3404					}
3405					else if (newIndex == 1) {
3406						if ($(".bxslider li:nth-child(2) .caption").hasClass('headertextschraeg')) {
3407							//console.log('headertextschraeg vorhanden');
3408							if (weite > 880) {
3409								$(".bxslider li:nth-child(2) .caption").css('top', 80);
3410							}
3411							if (weite > 1200) {
3412								$(".bxslider li:nth-child(2) .caption").css('top', 110);
3413							}
3414							if (weite > 1500) {
3415								$(".bxslider li:nth-child(2) .caption").css('top', 140);
3416							}
3417							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3418							$(".bx-controls").css('top', posCaption-40);
3419						} else {
3420							// wenn keine Schräge
3421							$(".bxslider li:nth-child(2) .caption").css('top', '40%');
3422							$(".bx-controls").css('top', 'calc(40% - 40px)');
3423						}
3424					}
3425					else {
3426						// console.log('Positin wird gesetzt');
3427						// $(".bx-controls").css('top', posCaption-40);
3428						if ($(".bxslider li:nth-child(1) .caption").hasClass('headertextschraeg')) {
3429							//console.log('headertextschraeg vorhanden');
3430							if (weite > 880) {
3431								$(".bxslider li:nth-child(1) .caption").css('top', 80);
3432							}
3433							if (weite > 1200) {
3434								$(".bxslider li:nth-child(1) .caption").css('top', 110);
3435							}
3436							if (weite > 1500) {
3437								$(".bxslider li:nth-child(1) .caption").css('top', 140);
3438							}
3439							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3440							$(".bx-controls").css('top', posCaption-40);
3441						} else {
3442							// wenn keine Schräge
3443							$(".bxslider li:nth-child(1) .caption").css('top', '40%');
3444							$(".bx-controls").css('top', 'calc(40% - 40px)');
3445						}
3446					}
3447				},
3448			});
3449		} else {
3450			// bxslider Startseite
3451			if (startSlideNr == '') {
3452				startSlideNr = 0;
3453			}
3454			emotionslider = $('.bxslider').bxSlider({
3455				mode: 'fade',
3456				speed: 1000,
3457				auto: true,
3458				pause: individualPause,
3459				controls: false,
3460				pager: headerSliderSliderpunkteDeaktivieren,
3461				startSlide: startSlideNr,
3462				onSliderLoad: function(currentIndex) {
3463					//logViewport();
3464					//console.log('Positin wird initial gesetzt');
3465
3466					if (typeof actualIndex === 'undefined')  {
3467						//console.log('undefined');
3468						actualIndex = 0;
3469					}
3470					if ($(".bxslider li:nth-child(1) .caption").hasClass('headertextschraeg')) {
3471						//console.log('headertextschraeg vorhanden');
3472						if (weite > 880) {
3473							$(".bxslider li:nth-child(1) .caption").css('top', 80);
3474						}
3475						if (weite > 1200) {
3476							$(".bxslider li:nth-child(1) .caption").css('top', 110);
3477						}
3478						if (weite > 1500) {
3479							$(".bxslider li:nth-child(1) .caption").css('top', 140);
3480						}
3481						posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3482						$(".bx-controls").css('top', posCaption-40);
3483					} else {
3484						// wenn keine Schräge
3485						//console.log('hier wird geliefert');
3486						$(".bxslider li:nth-child(1) .caption").css('top', '40%');
3487						$(".bx-controls").css('top', 'calc(40% - 40px)');
3488					}
3489				},
3490				onSlideBefore: function($slideElement, oldIndex, newIndex) {
3491					//console.log('onSlideBefore');
3492					//console.log($slideElement);
3493					//console.log(oldIndex);
3494					//console.log(newIndex);
3495					//$($slideElement + '.headertextschraeg').hide();
3496
3497					actualIndex = newIndex + 1;
3498					//console.log(newIndex);
3499
3500					posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3501
3502					if (newIndex > 2) {
3503						if ($(".bxslider li:nth-child("+actualIndex+") .caption").hasClass('headertextschraeg')) {
3504							//console.log('headertextschraeg vorhanden');
3505							if (weite > 880) {
3506								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 80);
3507							}
3508							if (weite > 1200) {
3509								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 110);
3510							}
3511							if (weite > 1500) {
3512								$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', 140);
3513							}
3514							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3515							$(".bx-controls").css('top', posCaption-40);
3516						} else {
3517							// wenn keine Schräge
3518							$(".bxslider li:nth-child("+actualIndex+") .caption").css('top', '40%');
3519							$(".bx-controls").css('top', 'calc(40% - 40px)');
3520						}
3521					}
3522					else if (newIndex == 2) {
3523						if ($(".bxslider li:nth-child(3) .caption").hasClass('headertextschraeg')) {
3524							//console.log('headertextschraeg vorhanden');
3525							if (weite > 880) {
3526								$(".bxslider li:nth-child(3) .caption").css('top', 80);
3527							}
3528							if (weite > 1200) {
3529								$(".bxslider li:nth-child(3) .caption").css('top', 110);
3530							}
3531							if (weite > 1500) {
3532								$(".bxslider li:nth-child(3) .caption").css('top', 140);
3533							}
3534							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3535							$(".bx-controls").css('top', posCaption-40);
3536						} else {
3537							// wenn keine Schräge
3538							$(".bxslider li:nth-child(3) .caption").css('top', '40%');
3539							$(".bx-controls").css('top', 'calc(40% - 40px)');
3540						}
3541					}
3542					else if (newIndex == 1) {
3543						if ($(".bxslider li:nth-child(2) .caption").hasClass('headertextschraeg')) {
3544							//console.log('headertextschraeg vorhanden');
3545							if (weite > 880) {
3546								$(".bxslider li:nth-child(2) .caption").css('top', 80);
3547							}
3548							if (weite > 1200) {
3549								$(".bxslider li:nth-child(2) .caption").css('top', 110);
3550							}
3551							if (weite > 1500) {
3552								$(".bxslider li:nth-child(2) .caption").css('top', 140);
3553							}
3554							posCaption = parseInt($(".bxslider li:nth-child("+actualIndex+") .caption").css('top'));
3555							$(".bx-controls").css('top', posCaption-40);
3556						} else {
3557							// wenn keine Schräge
3558							$(".bxslider li:nth-child(2) .caption").css('top', '40%');
3559							$(".bx-controls").css('top', 'calc(40% - 40px)');
3560						}
3561					}
3562					else {
3563
3564						//console.log(posCaption-40);
3565						//$(".bx-controls").css('top', posCaption-40);
3566
3567						// console.log('Positin wird initial gesetzt');
3568						// $(".bx-controls").css('top', posCaption-40);
3569						if ($(".bxslider li:nth-child(1) .caption").hasClass('headertextschraeg')) {
3570							//console.log('headertextschraeg vorhanden');
3571							if (weite > 880) {
3572								$(".bxslider li:nth-child(1) .caption").css('top', 80);
3573							}
3574							if (weite > 1200) {
3575								$(".bxslider li:nth-child(1) .caption").css('top', 110);
3576							}
3577							if (weite > 1500) {
3578								$(".bxslider li:nth-child(1) .caption").css('top', 140);
3579							}
3580							posCaption = parseInt($(".bxslider li:nth-child(1) .caption").css('top'));
3581							$(".bx-controls").css('top', posCaption-40);
3582						} else {
3583							// wenn keine Schräge
3584							$(".bxslider li:nth-child(1) .caption").css('top', '40%');
3585							$(".bx-controls").css('top', 'calc(40% - 40px)');
3586						}
3587					}
3588				},
3589			});
3590		}
3591	}
3592
3593	reloadAufgabenfelder();
3594
3595	if (weite > 901) {
3596		if (($('.aufgabenfelderKarusel .aufgabenfelderBox .carousel1 .slide').size() < 5)) {
3597			$('.aufgabenfelderKarusel .aufgabenfelderBox .bx-pager').hide();
3598		}
3599
3600		if (($('.aufgabenfelderKaruselNeu .aufgabenfelderBoxNeu .carousellNeu .slide').size() < 6)) {
3601			$('.aufgabenfelderKaruselNeu .aufgabenfelderBoxNeu .bx-pager').hide();
3602		}
3603	}
3604
3605	// Kalender Höhe abgleichen der Boxen auf der Startseite
3606	var kalenderblattHoehe = $('#month-block').height();
3607	$('.startseite .tx-cal-controller .calendarEventList').height(kalenderblattHoehe);
3608
3609	var $li = $('.subnavigation ul.mainNavi li.firstLine');
3610	var maxHeight = $li.map(function() {
3611		return $(this).height();
3612	}).get();
3613	$li.height(Math.max.apply(this, maxHeight));
3614
3615
3616	$('.hilfefinderSingleDownloads').each(function() {
3617		$('.downloadBox', this).matchHeight({
3618			byRow: true
3619		});
3620	});
3621
3622	$('.cols2').each(function() {
3623		$('.downloadBox', this).matchHeight({
3624			byRow: true
3625		});
3626	});
3627
3628	$('.cols2').each(function() {
3629		$('.downloadBox', this).matchHeight({
3630			byRow: true
3631		});
3632	});
3633
3634	$('.cols2').each(function() {
3635		$('.sameHeightBox', this).matchHeight({
3636			byRow: true
3637		});
3638	});
3639
3640	$('.standorte.liebenauCh .cols2').each(function() {
3641		$('.inhalteRoterRahmen', this).matchHeight({
3642			byRow: true
3643		});
3644	});
3645
3646	$('.standorte.liebenauAt .cols2').each(function() {
3647		$('.inhalteRoterRahmen', this).matchHeight({
3648			byRow: true
3649		});
3650	});
3651
3652	$('.hilfefinderSingleDatenUndAnfahrt').each(function() {
3653		$('.sameHeightBox', this).matchHeight({
3654			byRow: true
3655		});
3656	});
3657
3658	$('.hilfefinderSingleAnsprechpartner').each(function() {
3659		$('.sameHeightBox', this).matchHeight({
3660			byRow: true
3661		});
3662	});
3663
3664	$('.cols4').each(function() {
3665		$('.linkbox .linkboxHeadline', this).matchHeight({
3666			byRow: true
3667		});
3668	});
3669
3670	$('.aufgabenfelderBox .slide .slideHeader', this).matchHeight({
3671		byRow: true
3672	});
3673
3674
3675	// matchHeight für Kontaktboxen und Downloadboxen
3676	/*$('.contactbox').matchHeight({
3677		byRow: true,
3678		property: 'height',
3679		target: null,
3680		remove: false
3681	});*/
3682
3683
3684	// cal detail view check if ganztags or not
3685	if ( $('.eventSingleTimeLocation .nichtGanztags').length ) {
3686		$('.eventSingleTimeLocation .ganztags').hide();
3687	} else {
3688		$('.eventSingleTimeLocation .detailUhr').hide();
3689	}
3690
3691	// cal check if endtime is displayed or not, if not show the "ab" befor the starttime
3692
3693	$('.eventListSingleElement').each(function(index,item){
3694		if ( $('.eventListTimeLocation .endtimeVorhanden', this).length > 0 ) {
3695
3696		} else {
3697			$('.eventListTimeLocation div .starttimeAb', this).show();
3698		}
3699	});
3700
3701	if ( $('.eventSingleTimeLocation .endtimeVorhanden').length > 0 ) {
3702
3703	} else {
3704		$('.eventSingleTimeLocation .starttimeAb').show();
3705	}
3706
3707	//logviewportTimeout  = setTimeout(function(){ logViewport(); }, 1000);
3708
3709});
3710
3711var elem = document.querySelector('#schnellfinderbutton');
3712
3713/*var logViewport = function () {
3714	clearTimeout(logviewportTimeout);
3715	if (elem != null) {
3716		var isOut = isOutOfViewport(elem);
3717		if (isOut.any) {
3718			//console.log('Not in the viewport! =(');
3719			if ($(elem).hasClass('back-to-viewport')) {
3720				$(elem).addClass('back-to-viewport2');
3721			} else {
3722				$(elem).addClass('back-to-viewport');
3723				logViewport();
3724			}
3725		} else {
3726			//console.log('In the viewport! =)');
3727		}
3728	}
3729};*/
3730
3731
3732$(window).load(function () {
3733	// Anordnung Bühnen-Headlines zentriert in der Höhe
3734	if ( $(".emotionSlider").length && !$(".tx-hilfefinder .headerbild .emotionSlider").length) {
3735
3736		if(!$(".emotionSlider .bxslider li").hasClass('flexschraeg')) {
3737			var emotionSliderHeight;
3738			var emotionSliderMitte;
3739			emotionSliderHeight = $(".emotionSlider .bx-wrapper .bx-viewport").height();
3740			emotionSliderCaptionHeight = $('.emotionSlider .bx-wrapper ul li div.caption').height();
3741
3742			if (emotionSliderHeight != '' && emotionSliderHeight > 0) {
3743				emotionSliderMitte = emotionSliderHeight/2 - (emotionSliderCaptionHeight/2);
3744				console.log(emotionSliderMitte);
3745				$('.emotionSlider .bx-wrapper ul li div.caption').css('top', emotionSliderMitte);
3746				$('.emotionSlider .bx-controls').css('top', emotionSliderMitte-40);
3747			}
3748		}
3749	}
3750
3751	if ( $(".emotionImage").length) {
3752		var emotionImageHeight;
3753		var emotionImageMitte;
3754		emotionImageHeight = $(".emotionImage").height();
3755		emotionImageCaptionHeight = $('.emotionImage div.caption').height();
3756
3757		if (emotionImageHeight != '' && emotionImageHeight > 0) {
3758			emotionImageMitte = emotionImageHeight/2 - (emotionImageCaptionHeight/2);
3759			$('.emotionImage div.caption').css('top', emotionImageMitte);
3760		}
3761	}
3762
3763	// Angebotsfinder - Adresse für Druckvorschau aus Karte ausgliedern
3764	setTimeout(
3765		function()
3766		{
3767			var $googleAdress = $('.mapMarkerWrapper_right');
3768			var checkGoogleAdress = $googleAdress.length;
3769			if(checkGoogleAdress) {
3770				$googleAdress.clone().appendTo('.hilfefinderSingleAnfahrt');
3771			}
3772		}, 4000);
3773
3774
3775});
3776
3777(function($) {
3778
3779	$.fn.randomize = function(tree, childElem) {
3780		return this.each(function() {
3781			var $this = $(this);
3782			if (tree) $this = $(this).find(tree);
3783			var unsortedElems = $this.children(childElem);
3784			var elems = unsortedElems.clone();
3785
3786			elems.sort(function() { return (Math.round(Math.random())-0.5); });
3787
3788			for(var i=0; i < elems.length; i++)
3789				unsortedElems.eq(i).replaceWith(elems[i]);
3790		});
3791	};
3792
3793})(jQuery);
3794
3795
3796
3797function reloadAufgabenfelder() {
3798	weite = $(window).width();
3799
3800	referenzenMinSlides = 1;
3801	referenzenMaxSlides = 5;
3802	referenzenSliderWidth = 200;
3803
3804	if (weite < 901 && weite > 700) {
3805		minSlides = 3;
3806		minSlidesNeu = 3;
3807		maxSlides = 3;
3808		maxSlidesNeu = 3;
3809		slideWidth = 600;
3810		slideWidthNeu = 600;
3811	} else if (weite < 701 && weite > 480) {
3812		minSlides = 2;
3813		minSlidesNeu = 2;
3814		maxSlides = 2;
3815		maxSlidesNeu = 2;
3816		slideWidth = 600;
3817		slideWidthNeu = 600;
3818	} else if (weite < 481) {
3819		minSlides = 1;
3820		minSlidesNeu = 1;
3821		maxSlides = 1;
3822		maxSlidesNeu = 1;
3823		sliderMargin = 0;
3824		sliderMarginNeu = 0;
3825		pager = false;
3826		controls = false;
3827		slideWidth = 600;
3828		slideWidthNeu = 600;
3829		infiniteLoop = true;
3830	} else {
3831
3832	}
3833
3834	if (weite < 601) {
3835		newssliderMinSlides = 1;
3836		newssliderMaxSlides = 1;
3837		newssliderSlideMargin = 0;
3838		newsdetailsliderMinSlides = 1;
3839		newsdetailsliderMaxSlides = 1;
3840		newsdetailsliderSlideMargin = 0;
3841		referenzenMinSlides = 1;
3842		referenzenMaxSlides = 1;
3843		referenzenSliderWidth = 400;
3844	}
3845
3846	// bxslider Carousel
3847
3848	if ( $(".carousel1").length) {
3849		aufgabenfelder = $('.carousel1').bxSlider({
3850			slideWidth: slideWidth,
3851			minSlides: minSlides,
3852			maxSlides: maxSlides,
3853			slideMargin: sliderMargin,
3854			pager: pager,
3855			controls: controls,
3856			infiniteLoop: infiniteLoop,
3857			hideControlOnEnd: true
3858		});
3859	}
3860
3861	if ( $(".carousellNeu").length) {
3862		aufgabenfelderNeu = $('.carousellNeu').bxSlider({
3863			slideWidth: slideWidthNeu,
3864			minSlides: minSlidesNeu,
3865			maxSlides: maxSlidesNeu,
3866			slideMargin: sliderMarginNeu,
3867			pager: pager,
3868			controls: controls,
3869			infiniteLoop: infiniteLoop,
3870			hideControlOnEnd: true
3871		});
3872	}
3873
3874	// bxslider Carousel
3875	if ( $(".carousel2").length) {
3876		newsslider = $('.carousel2').bxSlider({
3877			slideWidth: 600,
3878			minSlides: newssliderMinSlides,
3879			maxSlides: newssliderMaxSlides,
3880			slideMargin: newssliderSlideMargin,
3881			pager: false,
3882			controls: true,
3883			infiniteLoop: false,
3884			hideControlOnEnd: true
3885		});
3886	}
3887
3888	if ( $(".carousel3").length) {
3889		// bxslider Carousel
3890		newsdetailslider = $('.carousel3').bxSlider({
3891			slideWidth: 600,
3892			minSlides: newsdetailsliderMinSlides,
3893			maxSlides: newsdetailsliderMaxSlides,
3894			slideMargin: newsdetailsliderSlideMargin,
3895			pager: false,
3896			controls: true,
3897			infiniteLoop: false,
3898			hideControlOnEnd: true
3899		});
3900	}
3901
3902	if ( $(".carouselHilfefinderSingleBildergalerie").length) {
3903		// bxslider Carousel
3904		hilfefinderSingleBildergalerie = $('.carouselHilfefinderSingleBildergalerie').bxSlider({
3905			slideWidth: 600,
3906			minSlides: newssliderMinSlides,
3907			maxSlides: newssliderMaxSlides,
3908			slideMargin: newssliderSlideMargin,
3909			pager: false,
3910			controls: true,
3911			infiniteLoop: true,
3912			hideControlOnEnd: false
3913		});
3914	}
3915
3916	if ( $(".carouselHilfefinderSingleBildergalerieReferenzen").length) {
3917		// bxslider Carousel
3918		hilfefinderSingleBildergalerie = $('.carouselHilfefinderSingleBildergalerieReferenzen').bxSlider({
3919			slideWidth: referenzenSliderWidth,
3920			minSlides: referenzenMinSlides,
3921			maxSlides: referenzenMaxSlides,
3922			slideMargin: newssliderSlideMargin,
3923			pager: false,
3924			controls: true,
3925			infiniteLoop: true,
3926			hideControlOnEnd: false
3927		});
3928	}
3929
3930}
3931
3932/*!
3933 * Check if an element is out of the viewport
3934 * (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com
3935 * @param  {Node}  elem The element to check
3936 * @return {Object}     A set of booleans for each side of the element
3937 */
3938var isOutOfViewport = function (elem) {
3939
3940	// Get element's bounding
3941	var bounding = elem.getBoundingClientRect();
3942
3943	// Check if it's out of the viewport on each side
3944	var out = {};
3945	out.top = bounding.top < 0;
3946	out.left = bounding.left < 0;
3947	out.bottom = bounding.bottom > (window.innerHeight || document.documentElement.clientHeight);
3948	out.right = bounding.right > (window.innerWidth || document.documentElement.clientWidth);
3949	out.any = out.top || out.left || out.bottom || out.right;
3950	out.all = out.top && out.left && out.bottom && out.right;
3951
3952	return out;
3953
3954};
3955
3956// <!--
3957
3958if (! window.rsConf) { window.rsConf = {}; }
3959if (! window.rsConf.ui) { window.rsConf.ui = {}; }
3960window.rsConf.ui.rsbtnClass = 'rsbtn_colorskin';
3961window.rsConf.ui.player = [
3962	'<span class="rsbtn_box">',
3963	'	<a href="javascript:void(0);" class="rsbtn_pause rsimg rspart rsbutton" title="Pause">',
3964	'		<span class="rsbtn_btnlabel">
3964Pause</span>',
3965	'	</a>',
3966	'	<span class="rsbtn_progress_container rspart">',
3967	'		<span class="rsbtn_progress_played"></span>',
3968	'	</span>',
3969	'	<a href="javascript:void(0);" class="rsbtn_volume rsimg rspart rsbutton" title="Volume">',
3970	'		<span class="rsbtn_btnlabel">Volume</span>',
3971	'	</a>',
3972	'	<span class="rsbtn_volume_container">',
3973	'		<span class="rsbtn_volume_slider"></span>',
3974	'	</span>',
3975	'	<a href="javascript:void(0);" class="rsbtn_settings rsimg rspart rsbutton" title="Settings">',
3976	'		<span class="rsbtn_btnlabel">Settings</span>',
3977	'	</a>',
3978	'	<a href="javascript:void(0);" class="rsbtn_closer rsimg rspart rsbutton" title="Close player">',
3979	'		<span class="rsbtn_btnlabel">Close</span>',
3980	'	</a>',
3981	'	<span class="rsdefloat"></span>',
3982	'	<span class="rsbtn_powered rsimg"><span class="rsbtn_btnlabel">Speech-enabled by ReadSpeaker</span></span>',
3983	'</span>'
3984];
3985
3986
3987window.rsConf.ui.popupbutton = [
3988  '<a class="rsbtn_play" accesskey="L" title="Listen with ReadSpeaker" href="">',
3989    '<span class="rsbtn_left rspart"><span class="rsbtn_text"><span>Listen</span></span></span>',
3990    '<span class="rsbtn_right rsimg rsplay rspart"></span>',
3991  '</a>'
3992];
3993/*
3994window.rsConf.ui.popupbutton = [];
3995window.rsConf.ui.popupplayer = [];
3996*/
3997// -->
3998
3999
4000/**
4001 * The Controller. Controller responds to user actions and
4002 * invokes changes on the model.
4003 */
4004function OptionFacetController() {
4005    var _this = this;
4006
4007    this.init = function () {
4008        _this.initToggle();
4009        _this.initFilter();
4010    };
4011
4012    this.initToggle = function () {
4013
4014        jQuery('.tx-solr-facet-hidden').hide();
4015        jQuery('a.tx-solr-facet-show-all').click(function() {
4016            if (jQuery(this).parent().siblings('.tx-solr-facet-hidden:visible').length == 0) {
4017                jQuery(this).parent().siblings('.tx-solr-facet-hidden').show();
4018                jQuery(this).text(jQuery(this).data('label-less'));
4019            } else {
4020                jQuery(this).parent().siblings('.tx-solr-facet-hidden').hide();
4021                jQuery(this).text(jQuery(this).data('label-more'));
4022            }
4023
4024            return false;
4025        });
4026    }
4027
4028    this.initFilter = function () {
4029        filterableFacets = jQuery(".facet-filter-box").closest('.facet');
4030        filterableFacets.each(
4031            function () {
4032                var searchBox = jQuery(this).find('.facet-filter-box');
4033                var searchItems = jQuery(this).find('.facet-filter-item');
4034                searchBox.on("keyup", function() {
4035                    var value = searchBox.val().toLowerCase();
4036                    searchItems.each(function() {
4037                        var filteredItem = jQuery(this);
4038                        filteredItem.toggle(filteredItem.text().toLowerCase().indexOf(value) > -1)
4039                    });
4040                });
4041            }
4042        );
4043    }
4044}
4045
4046jQuery(document).ready(function () {
4047    var optionsController = new OptionFacetController();
4048    optionsController.init();
4049
4050    jQuery("body").on("tx_solr_updated", function() {
4051        optionsController.init();
4052    });
4053});
4054
4055/**
4056 *  Ajax Autocomplete for jQuery, version 1.4.11
4057 *  (c) 2017 Tomas Kirda
4058 *
4059 *  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
4060 *  For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
4061 */
4062!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e}},s=27,i=9,n=13,o=38,a=39,u=40,l=t.noop;function r(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.noSuggestionsContainer=null,this.options=t.extend(!0,{},r.defaults,s),this.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},this.hint=null,this.hintValue="",this.selection=null,this.initialize(),this.setOptions(s)}r.utils=e,t.Autocomplete=r,r.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,onHint:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(t,s){if(!s)return t.value;var i="("+e.escapeRegExChars(s)+")";return t.value.replace(new RegExp(i,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},formatGroup:function(t,e){return'<div class="autocomplete-group">'+e+"</div>"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:l,onSearchComplete:l,onSearchError:l,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(e){return"string"==typeof e?t.parseJSON(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},r.prototype={initialize:function(){var e,s=this,i="."+s.classes.suggestion,n=s.classes.selected,o=s.options;s.element.setAttribute("autocomplete","off"),s.noSuggestionsContainer=t('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),s.suggestionsContainer=r.utils.createNode(o.containerClass),(e=t(s.suggestionsContainer)).appendTo(o.appendTo||"body"),"auto"!==o.width&&e.css("width",o.width),e.on("mouseover.autocomplete",i,function(){s.activate(t(this).data("index"))}),e.on("mouseout.autocomplete",function(){s.selectedIndex=-1,e.children("."+n).removeClass(n)}),e.on("click.autocomplete",i,function(){s.select(t(this).data("index"))}),e.on("click.autocomplete",function(){clearTimeout(s.blurTimeoutId)}),s.fixPositionCapture=function(){s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",s.fixPositionCapture),s.el.on("key
4062down.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},onFocus:function(){this.disabled||(this.fixPosition(),this.el.val().length>=this.options.minChars&&this.onValueChange())},onBlur:function(){var e=this,s=e.options,i=e.el.val(),n=e.getQuery(i);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==n&&(s.onInvalidateSelection||t.noop).call(e.element)},200)},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=t.extend({},this.options,e);this.isLocal=Array.isArray(s.lookup),this.isLocal&&(s.lookup=this.verifySuggestionsFormat(s.lookup)),s.orientation=this.validateOrientation(s.orientation,"bottom"),t(this.suggestionsContainer).css({"max-height":s.maxHeight+"px",width:s.width+"px","z-index":s.zIndex}),this.options=s},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e=t(this.suggestionsContainer),s=e.parent().get(0);if(s===document.body||this.options.forceFixPosition){var i=this.options.orientation,n=e.outerHeight(),o=this.el.outerHeight(),a=this.el.offset(),u={top:a.top,left:a.left};if("auto"===i){var l=t(window).height(),r=t(window).scrollTop(),h=-r+a.top-n,c=r+l-(a.top+o+n);i=Math.max(h,c)===h?"top":"bottom"}if(u.top+="top"===i?-n:o,s!==document.body){var g,d=e.css("opacity");this.visible||e.css("opacity",0).show(),g=e.offsetParent().offset(),u.top-=g.top,u.top+=s.scrollTop,u.left-=g.left,this.visible||e.css("opacity",d).hide()}"auto"===this.options.width&&(u.width=this.el.outerWidth()+"px"),e.css(u)}},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==u||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case s:this.el.val(this.currentValue),this.hide();break;case a:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case i:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case n:if(-1===this.selectedIndex)return void this.hide();this.select(this.selectedIndex);break;case o:this.moveUp();break;case u:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case o:case u:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?this.hide():this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e},getSuggestionsLocal:function(e){var s,i=this.options,n=e.toLowerCase(),o=i.lookupFilter,a=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return o(t,e,n)})},a&&s.suggestions.length>a&&(s.suggestions=s.suggestions.slice(0,a)),s},getSuggestions:function(e){var s,i,n,o,a=this,u=a.options,l=u.serviceUrl;u.params[u.paramName]=e,!1!==u.onSearchStart.call(a.element,u.params)&&(i=u.ignoreParams?null:u.params,t.isFunction(u.lookup)?u.lookup(e,function(t){a.suggestions=t.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,t.suggestions)}):(a.isLocal?s=a.getSuggestionsLocal(e):(t.isFunction(l)&&(l=l.call(a.element,e)),n=l+"?"+t.param(i||{}),s=a.cachedResponse[n]),s&&Array.isArray(s.suggestions)?(a.suggestions=s.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,s.suggestions)):a.isBadQuery(e)?u.onSearchComplete.call(a.element,e,[]):(a.abortAjax(),o={url:l,data:i,type:u.type,dataType:u.dataType},t.extend(o,u.ajaxSettings),a.currentRequest=t.ajax(o).done(function(t){var s;a.currentRequest=null,s=u.transformResult(t,e),a.processResponse(s,e,n),u.onSearchComplete.call(a.element,e,s.suggestions)}).fail(function(t,s,i){u.onSearchError.call(a.element,e,t,s,i)}))))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(){var e=t(this.suggestionsContainer);t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,e),this.visible=!1,this.selectedIndex=-1,
4062clearTimeout(this.onChangeTimeout),t(this.suggestionsContainer).hide(),this.onHint(null)},suggest:function(){if(this.suggestions.length){var e,s=this.options,i=s.groupBy,n=s.formatResult,o=this.getQuery(this.currentValue),a=this.classes.suggestion,u=this.classes.selected,l=t(this.suggestionsContainer),r=t(this.noSuggestionsContainer),h=s.beforeRender,c="";s.triggerSelectOnValidInput&&this.isExactMatch(o)?this.select(0):(t.each(this.suggestions,function(t,u){i&&(c+=function(t,n){var o=t.data[i];return e===o?"":(e=o,s.formatGroup(t,e))}(u,0)),c+='<div class="'+a+'" data-index="'+t+'">'+n(u,o,t)+"</div>"}),this.adjustContainerWidth(),r.detach(),l.html(c),t.isFunction(h)&&h.call(this.element,l,this.suggestions),this.fixPosition(),l.show(),s.autoSelectFirst&&(this.selectedIndex=0,l.scrollTop(0),l.children("."+a).first().addClass(u)),this.visible=!0,this.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var e=this.options.beforeRender,s=t(this.suggestionsContainer),i=t(this.noSuggestionsContainer);this.adjustContainerWidth(),i.detach(),s.empty(),s.append(i),t.isFunction(e)&&e.call(this.element,s,this.suggestions),this.fixPosition(),s.show(),this.visible=!0},adjustContainerWidth:function(){var e,s=this.options,i=t(this.suggestionsContainer);"auto"===s.width?(e=this.el.outerWidth(),i.css("width",e>0?e:300)):"flex"===s.width&&i.css("width","")},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var n=0===i.value.toLowerCase().indexOf(e);return n&&(s=i),!n}),this.onHint(s))},onHint:function(e){var s=this.options.onHint,i="";e&&(i=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==i&&(this.hintValue=i,this.hint=e,t.isFunction(s)&&s.call(this.element,i))},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&(this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,n=t(this.suggestionsContainer),o=n.find("."+this.classes.suggestion);return n.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&o.length>this.selectedIndex?(s=o.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.hide(),this.onSelect(t)},moveUp:function(){if(-1!==this.selectedIndex)return 0===this.selectedIndex?(t(this.suggestionsContainer).children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint()):void this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s=this.activate(e);if(s){var i,n,o,a=t(s).outerHeight();i=s.offsetTop,o=(n=t(this.suggestionsContainer).scrollTop())+this.options.maxHeight-a,i<n?t(this.suggestionsContainer).scrollTop(i):i>o&&t(this.suggestionsContainer).scrollTop(i-this.options.maxHeight+a),this.options.preserveInput||(this.ignoreValueChange=!0,this.el.val(this.getValue(this.suggestions[e].value))),this.onHint(null)}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue),this.onHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),t(this.suggestionsContainer).remove()}},t.fn.devbridgeAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),n=i.data("autocomplete");"string"==typeof e?n&&"function"==typeof n[e]&&n[e](s):(n&&n.dispose&&n.dispose(),n=new r(this,e),i.data("autocomplete",n))}):this.first().data("autocomplete")}
4062,t.fn.autocomplete||(t.fn.autocomplete=t.fn.devbridgeAutocomplete)});
4063
4064function SuggestController() {
4065
4066    this.init = function () {
4067
4068        jQuery('form[data-suggest]').each(function () {
4069            var $form = $(this), $searchBox = $form.find('.tx-solr-suggest'), $formAutoComplete;
4070
4071            if ($form.find('.tx-solr-autocomplete').length > 0){
4072                $formAutoComplete = $form.find('.tx-solr-autocomplete');
4073            } else {
4074                $formAutoComplete = $('body');
4075            }
4076
4077            // when no specific container found, use the form as container
4078            if ($searchBox.length === 0) {
4079                $searchBox = $form;
4080            }
4081            $searchBox.css('position', 'relative');
4082
4083            $form.find('.tx-solr-suggest-focus').focus();
4084
4085            // Prevent submit of empty search form
4086            $form.on('submit', function (e) {
4087                if ($form.find('.tx-solr-suggest-focus').val() === '') {
4088                    e.preventDefault();
4089                    $form.find('.tx-solr-suggest-focus').focus();
4090                }
4091            });
4092
4093            $form.find('.tx-solr-suggest').devbridgeAutocomplete({
4094                serviceUrl: $form.data('suggest'),
4095                dataType: 'json',
4096                paramName: 'tx_solr[queryString]',
4097                groupBy: 'category',
4098                maxHeight: 1000,
4099                appendTo: $formAutoComplete,
4100                autoSelectFirst: false,
4101                triggerSelectOnValidInput: false,
4102                width: $searchBox.outerWidth() * 0.66,
4103                onSelect: function (suggestion) {
4104                    // go to link when selecting found result
4105                    if (suggestion.data.link) {
4106                        // Open youtube in overlay
4107                        if (suggestion.data.link.indexOf('https://www.youtube.com') === 0) {
4108                            openVideoOverlay(suggestion.data.link);
4109                        } else {
4110                            location.href = suggestion.data.link;
4111                        }
4112                        // else trigger form submit (do search)
4113                    } else {
4114                        $form.trigger('submit');
4115                    }
4116                },
4117                transformResult: function (response) {
4118                    if (!response.suggestions) return {suggestions: []};
4119                    var firstSuggestion, result = {
4120                        suggestions: $.map(response.suggestions, function (count, suggestion) {
4121                            if (!firstSuggestion) firstSuggestion = suggestion;
4122                            return {value: suggestion, data: {category: 'suggestion', count: count}};
4123                        })
4124                    };
4125
4126                    $.each(response.documents, function (key, value) {
4127                        var dataObject = value;
4128
4129                        var defaultGroup = $form.data('suggest-header') ? $form.data('suggest-header') : 'Top results';
4130                        dataObject.category = defaultGroup;
4131
4132                        // if a group is set we try to get a label
4133                        if(dataObject.group) {
4134                            dataObject.category = $form.data('suggest-header-' + dataObject.group) ? $form.data('suggest-header-' + dataObject.group) : dataObject.group;
4135                        }
4136
4137                        result.suggestions.push(
4138                            {
4139                                value: firstSuggestion,
4140                                data: dataObject
4141                            }
4142                        );
4143                    });
4144
4145                    return result;
4146                },
4147                beforeRender: function (container) {
4148                    // remove first group header
4149                    container.find('.autocomplete-group:first').remove();
4150                    container.addClass('tx-solr-autosuggest');
4151
4152                    // add active class to container
4153                    $searchBox.parent().addClass('autocomplete-active').fadeIn();
4154                },
4155                formatResult: function (suggestion, currentValue) {
4156                    // Do not replace anything if there current value is empty
4157                    if (!currentValue) {
4158                        return suggestion.value;
4159                    }
4160                    var pattern = '(' + $.Autocomplete.utils.escapeRegExChars(currentValue.trim()) + ')';
4161                    // normal suggestion
4162                    if (suggestion.data.category === 'suggestion') {
4163                        return suggestion.value
4164                            .replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>')
4165                            .replace(/&/g, '&amp;')
4166                            .replace(/</g, '&lt;')
4167                            .replace(/>/g, '&gt;')
4168                            .replace(/"/g, '&quot;')
4169                            .replace(/&lt;(\/?strong)&gt;/g, '<$1>');
4170
4171                        // results
4172                    } else {
4173                        var title = suggestion.data.title
4174                            .replace(new RegExp(pattern, 'gi'), '<em>$1<\/em>')
4175                            .replace(/&/g, '&amp;')
4176                            .replace(/</g, '&lt;')
4177                            .replace(/>/g, '&gt;')
4178                            .replace(/"/g, '&quot;')
4179                            .replace(/&lt;(\/?em)&gt;/g, '<$1>');
4180
4181                        return '<div class="' + suggestion.data.type + '">' +
4182                            (!!suggestion.data.previewImage ? '<figure ' + (!!suggestion.data.hasVideo ? 'class="hasVideo"' : '') + '>
4182<img src="' + suggestion.data.previewImage + '" /></figure>' : '') +
4183                            '<a href="' + suggestion.data.link + '" class="internal-link">' + title + '</a>' +
4184                            '</div>';
4185                    }
4186
4187                }
4188            }).on('blur', function () {
4189                $searchBox.parent().removeClass('autocomplete-active');
4190                var $box = $(this);
4191                setTimeout(function () {
4192                    $box.devbridgeAutocomplete('hide');
4193                }, 200);
4194            });
4195        });
4196    };
4197}
4198
4199jQuery(document).ready(function() {
4200    /** solr search autocomplete **/
4201    var solrSuggestController = new SuggestController();
4202    solrSuggestController.init();
4203
4204    jQuery("body").on("tx_solr_updated", function() {
4205        solrSuggestController.init();
4206    });
4207});
4208
4209
4210
4211function SearchController() {
4212    var _this = this;
4213
4214    _this.ajaxType = 7383;
4215
4216    this.init = function() {
4217        jQuery("body").delegate("a.solr-ajaxified", "click", _this.handleClickOnAjaxifiedUri);
4218    };
4219
4220    this.handleClickOnAjaxifiedUri = function() {
4221        var clickedLink = jQuery(this);
4222
4223        var solrContainer = clickedLink.closest(".tx_solr");
4224        var solrParent = solrContainer.parent();
4225
4226        var loader = jQuery("<div class='tx-solr-loader'></div>");
4227        var uri = clickedLink.uri();
4228
4229        solrParent.append(loader);
4230        uri.addQuery("type", _this.ajaxType);
4231
4232        jQuery.get(
4233            uri.href(),
4234            function(data) {
4235                solrContainer = solrContainer.replaceWith(data);
4236                _this.scrollToTopOfElement(solrParent, 50);
4237                jQuery("body").trigger("tx_solr_updated");
4238                loader.fadeOut().remove();
4239                history.replaceState({}, null, uri.removeQuery("type").href());
4240            }
4241        );
4242        return false;
4243    };
4244
4245    this.scrollToTopOfElement = function(element, deltaTop) {
4246        jQuery('html, body').animate({
4247            scrollTop: (element.offset().top - deltaTop) + 'px'
4248        }, 'slow');
4249    };
4250
4251    this.setAjaxType = function(ajaxType) {
4252        _this.ajaxType = ajaxType;
4253    };
4254}
4255
4256jQuery(document).ready(function() {
4257    var solrSearchController = new SearchController();
4258    solrSearchController.init();
4259
4260    if(typeof solrSearchAjaxType !== "undefined") {
4261        solrSearchController.setAjaxType(solrSearchAjaxType);
4262    }
4263});

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.