PageSourceSearch

https://www.rhhtreuhand.de/static/generated/js/scripts.js?timestamp=1709639859

js rhhtreuhand.de collected 2026-10-06 19:06:26 UTC 113,295 bytes, 3,404 lines download raw bytes

1/* Source common/js/scripts/099_counter.js */
2
3// NUMBER COUNTER
4// -------------------------------------------------------------------------------------------------
5
6(function(document) {
7    var CountNumber = function($number) {
8        var _this = this;
9
10        _this.$number  = $number;
11        _this.offset = 300;
12
13        _this.already_animated = false;
14
15        _this.duration = 5000; // 10 Sekunden dauer der Animation
16        _this.update = 50;     // alle 0,05 Sekunden update im Frontend
17    };
18
19    CountNumber.prototype = {
20        init: function() {
21            var _this = this;
22
23            window.addEventListener('scroll', _this._animate_number.bind(this));
24            window.addEventListener('resize', _this._animate_number.bind(this));
25
26            var $placeholder = _this.$number.nextElementSibling;
27
28            if ($placeholder.classList.contains('number_fix')) {
29                var number = Number($placeholder.innerHTML);
30                $placeholder.innerHTML = _this._commafy(number);
31            }
32
33            _this._animate_number();
34        },
35
36        _animate_number: function() {
37            var _this = this,
38                scroll_pos_y = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop,
39                offset = _this.$number.clientHeight - _this.offset,
40                window_height = window.innerHeight,
41                number_pos_y = _this.$number.getBoundingClientRect().top;
42
43            if (scroll_pos_y >= offset
44                && number_pos_y <= window_height
45                && !_this.already_animated) {
46                    _this.already_animated = true;
47                    _this._calc_number(_this.$number.innerHTML);
48            }
49        },
50
51        _calc_number: function(end) {
52            var _this = this,
53                start = (end >= 100) ? Math.floor(end / 2) : 1,
54                range = Math.floor(end - start),
55                current = start,
56                update_range = range / _this.duration * _this.update;
57
58            var timer = setInterval(function() {
59                current = current + update_range;
60
61                if (current >= end) {
62                    current = Math.abs(end);
63                    window.clearInterval(timer);
64                }
65
66                if (_this.$number.classList.contains('date')) {
67                    _this.$number.innerHTML = Math.abs(Math.floor(current));
68                } else {
69                    _this.$number.innerHTML = _this._commafy(Math.abs(Math.floor(current)));
70                }
71
72            }, _this.update);
73        },
74
75        _commafy: function(num) {
76            var _this = this,
77                str = num.toString().split('.');
78
79            if (str[0].length >= 4) {
80                str[0] = str[0].replace(/(\d)(?=(\d{3})+$)/g, '$1.');
81            }
82
83            if (str[1] && str[1].length >= 4) {
84                str[1] = str[1].replace(/(\d{3})/g, '$1 ');
85            }
86            return str.join('.');
87        }
88
89    };
90
91    var $counters = document.querySelectorAll('[data-counter]');
92
93    for (var i = 0, $counter; $counter = $counters[i]; i++) {
94        new CountNumber($counter).init();
95    }
96
97})(document);
98
99/* Source common/js/scripts/20_cookie_banner.js */
100
101// COOKIE-HINWEIS
102// -------------------------------------------------------------------------------------------------
103
104(function(document) {
105    var $cookie_banner = document.querySelector('#cookie_banner'),
106        $body          = document.querySelector('body');
107
108    if (!$cookie_banner) {
109        return;
110    }
111
112    var $close  = $cookie_banner.querySelector('.close'),
113        now     = new Date().getTime(),
114        storage = localStorage.getItem(domain + '_cookie_banner');
115
116    if (storage === null || now > storage) {
117        $cookie_banner.classList.remove('hideme');
118        $body.classList.add('cb_visible');
119    } else {
120        $cookie_banner.classList.add('hideme');
121    }
122
123    $close.addEventListener('click', function(event) {
124        event.preventDefault();
125
126        localStorage.setItem(domain + '_cookie_banner', now + 31536000);
127        $cookie_banner.classList.add('hideme');
128        $body.classList.remove('cb_visible');
129    });
130}(document));
131
132/* Source common/js/scripts/21_cookie_banner_insert_spacing_footer.js */
133
134// COOKIE-HINWEIS FUSSZEILE VERLÄNGERN
135// -------------------------------------------------------------------------------------------------
136
137(function(document) {
138    let $cookie_banner  = document.querySelector('#cookie_banner'),
139        $footer         = document.querySelector('footer'),
140        $close          = $cookie_banner.querySelector('.close'),
141        $cookie_spacing;
142
143    if (!$cookie_banner) {
144        return;
145    }
146
147    $close.addEventListener('click', function() {
148        if ($footer) {
149            $footer.removeChild($cookie_spacing);
150        }
151    });
152
153    if ($footer) {
154        $cookie_spacing = document.createElement('div');
155        $footer.appendChild($cookie_spacing);
156        $cookie_spacing.style.paddingBottom = $cookie_banner.offsetHeight + 'px';
157        window.addEventListener('resize', function() {
158            $cookie_spacing.style.paddingBottom = $cookie_banner.offsetHeight + 'px';
159        }, false);
160    }
161
162}(document));
163
164/* Source common/js/scripts/21_pop_up.js */
165
166// POP-UP-HINWEIS
167// -------------------------------------------------------------------------------------------------
168
169(function(document) {
170    var PopUp = function($pop_up) {
171        this.$pop_up  = $pop_up;
172        this.$close   = $pop_up.querySelector('.close_button');
173    }
174
175    PopUp.prototype = {
176        init: function() {
177            this.$close.addEventListener('click', (event) => {
178                event.preventDefault();
179                this.$pop_up.classList.add('hideme');
180            });
181        },
182    }
183
184    let $pop_ups = document.querySelectorAll('.pop_up');
185
186    for (let $pop_up of $pop_ups) {
187        new PopUp($pop_up).init();
188    }
189})(document, window);
190
191/* Source common/js/scripts/40_dropdown_menu.js */
192
193// DROPDOWN MENU
194// -------------------------------------------------------------------------------------------------
195
196(function(document) {
197    var DropdownMenu = function($dropdown_menu) {
198        var _this = this,
199            id    = $dropdown_menu.getAttribute('id');
200
201        _this.$dropdown_menu                   = $dropdown_menu;
202        _this.$main_menuitems                  = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li > a');
203        _this.$sub_menuitems                   = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li li > a');
204        _this.$sub_menuitems_with_sub_sub_menu = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li li > a.has_sub_sub_menu');
205        _this.$main_menuitems_with_sub_menu    = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li > a[aria-controls]');
206        _this.main_menu_index                  = 0;
207        _this.event_type                       = false;
208
209        _this.$key = {
210            'tab'         : 9,
211            'enter'       : 13,
212            'escape'      : 27,
213            'space'       : 32,
214            'arrow_left'  : 37,
215            'arrow_up'    : 38,
216            'arrow_right' : 39,
217            'arrow_down'  : 40
218        };
219    };
220
221    DropdownMenu.prototype = {
222        init: function() {
223            var _this = this;
224
225            _this._init_accessibility();
226            _this._init_keyboard();
227
228            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems[i]; i++) {
229                var $li = $main_menuitem.parentElement;
230
231                $li.addEventListener('mouseenter',
232                    _this._on_mouseenter_main_menuitem.bind(_this, $main_menuitem)
233                );
234
235                $li.addEventListener('mouseover',
236                    _this._on_mouseover_main_menuitem.bind(_this, $main_menuitem)
237                );
238
239                $li.addEventListener('mouseout',
240                    _this._on_mouseout_main_menuitem.bind(_this)
241                );
242
243                $main_menuitem.addEventListener('focus',
244                    _this._on_focus_main_menuitem.bind(_this, $main_menuitem)
245                );
246            }
247        },
248
249        _init_accessibility: function() {
250            var _this = this;
251
252            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
253                $main_menuitem.setAttribute('aria-expanded', 'false');
254
255                $main_menuitem.addEventListener('click', function(event) {
256                    event.preventDefault();
257                });
258            }
259        },
260
261        _init_keyboard: function() {
262            var _this = this;
263
264            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems[i]; i++) {
265                $main_menuitem.addEventListener('keydown',
266                    _this._on_keydown_main_menuitem.bind(_this, $main_menuitem)
267                );
268            }
269
270            for (var j = 0, $sub_menuitem; $sub_menuitem = _this.$sub_menuitems[j]; j++) {
271                $sub_menuitem.addEventListener('keydown',
272                    _this._on_keydown_sub_menuitem.bind(_this, $sub_menuitem)
273                );
274            }
275        },
276
277        _on_keydown_main_menuitem: function($main_menuitem, event) {
278            var _this = this;
279
280            _this.event_type      = event.type;
281            _this.main_menu_index = _this._get_main_menuitem_index();
282            _this.$main_menuitem  = $main_menuitem;
283            _this.$sub_menu       = $main_menuitem.nextElementSibling;
284
285            switch(event.keyCode) {
286                case _this.$key.tab:
287                    if (event.shiftKey) {
288                        _this.main_menu_index -= 1;
289                    }
290                    else {
291                        _this.main_menu_index += 1;
292                    }
293
294                    break;
295
296                case _this.$key.enter:
297                    if (_this.$sub_menu) {
298                        event.preventDefault();
299                        _this._close_sub_menus();
300                        this._open_sub_menu(false);
301                    }
302
303                    break;
304
305                case _this.$key.escape:
306                    event.preventDefault();
307
308                    if (_this.sub_menu_is_open) {
309                        event.stopPropagation();
310                    }
311
312                    _this._close_sub_menu();
313
314                    break;
315
316                case _this.$key.arrow_left:
317                    event.preventDefault();
318
319                    _this._focus_prev_main_menuitem();
320
321                    break;
322
323                case _this.$key.arrow_up:
324                    event.preventDefault();
325
326                    if (_this.sub_menu_is_open) {
327                        _this._focus_prev_menuitem();
328                    }
329
330                    break;
331
332                case _this.$key.arrow_right:
333                    event.preventDefault();
334
335                    _this._focus_next_main_menuitem();
336
337                    break;
338
339                case _this.$key.arrow_down:
340                    event.preventDefault();
341
342                    if (_this.$sub_menu) {
343                        this._open_sub_menu(false);
344                    }
345                    else {
346                        _this._focus_next_main_menuitem();
347                    }
348
349                    break;
350            }
351        },
352
353        _get_main_menuitem_index: function() {
354            var _this = this;
355
356            return Array.prototype.indexOf.call(_this.$main_menuitems, document.activeElement);
357        },
358
359        _focus_prev_menuitem: function() {
360            var _this = this;
361
362            _this.main_menu_index -= 1;
363
364            if (_this.main_menu_index < 0) {
365                _this.main_menu_index = 0;
366
367                return;
368            }
369
370            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
371            _this.$sub_menu      = _this.$main_menuitem.nextElementSibling;
372
373            if (_this.$sub_menu && _this.sub_menu_is_open) {
374                this._open_sub_menu(true);
375            }
376            else {
377                _this.$main_menuitem.focus();
378            }
379        },
380
381        _focus_prev_main_menuitem: function() {
382            var _this = this;
383
384            _this.main_menu_index -= 1;
385
386            if (_this.main_menu_index < 0) {
387                _this.main_menu_index = 0;
388
389                return;
390            }
391
392            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
393
394            _this.$main_menuitem.focus();
395        },
396
397        _focus_next_main_menuitem: function() {
398            var _this = this;
399
400            _this.main_menu_index += 1;
401
402            if (_this.main_menu_index === _this.$main_menuitems.length) {
403                _this.main_menu_index = _this.$main_menuitems.length - 1;
404
405                return;
406            }
407
408            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
409
410            _this.$main_menuitem.focus();
411        },
412
413        _on_mouseenter_main_menuitem: function($main_menuitem, event) {
414            var _this = this;
415
416            _this.event_type     = event.type;
417            _this.$main_menuitem = $main_menuitem;
418            _this.$sub_menu      = $main_menuitem.nextElementSibling;
419
420            _this._close_sub_menus();
421
422            if (_this.$sub_menu) {
423                _this._open_sub_menu(false);
424            }
425        },
426
427        _on_mouseover_main_menuitem: function() {
428            var _this = this;
429
430            clearTimeout(_this.close_sub_menu_timeout);
431        },
432
433        _on_mouseout_main_menuitem: function() {
434            var _this = this;
435
436            _this.close_sub_menu_timeout = setTimeout(function() {
437                _this._close_sub_menus();
438            }, 1000);
439        },
440
441        _on_focus_main_menuitem: function($main_menuitem, event) {
442            var _this = this;
443
444            _this.event_type = event.type;
445
446            if (_this.sub_menu_is_open) {
447                _this.$main_menuitem = $main_menuitem;
448                _this.$sub_menu      = $main_menuitem.nextElementSibling;
449
450                _this._close_sub_menus();
451
452                if (_this.$sub_menu) {
453                    _this._open_sub_menu();
454                }
455            }
456        },
457
458        _on_keydown_sub_menuitem: function($sub_menuitem, event) {
459            var _this = this;
460
461            switch(event.keyCode) {
462                case _this.$key.tab:
463
464                    if (event.shiftKey) {
465                        _this.sub_menu_index -= 1;
466                    }
467                    else {
468                        _this.sub_menu_index += 1;
469                    }
470
471                    break;
472
473                case _this.$key.escape:
474                    event.preventDefault();
475                    event.stopPropagation();
476
477                    _this._close_sub_menu();
478
479                    break;
480
481                case _this.$key.arrow_left:
482                    event.preventDefault();
483
484                    _this.sub_menu_index = 0;
485                    _this._focus_prev_sub_menuitem();
486
487                    break;
488
489                case _this.$key.arrow_up:
490                    event.preventDefault();
491
492                    _this._focus_prev_sub_menuitem();
493
494                    break;
495
496                case _this.$key.arrow_right:
497                    event.preventDefault();
498
499                    _this.sub_menu_index = 0;
500                    _this._focus_prev_sub_menuitem();
501
502                    break;
503
504                case _this.$key.arrow_down:
505                    event.preventDefault();
506
507                    _this._focus_next_sub_menuitem();
508
509                    break;
510            }
511
512            _this._open_sub_sub_menu();
513        },
514
515        _open_sub_sub_menu: function() {
516            var _this          = this;
517                $sub_menuitem  = _this.$main_menuitem.nextElementSibling.querySelectorAll('li li > a')[_this.sub_menu_index];
518
519            if($sub_menuitem) {
520
521                for (var i = 0, $menuitem; $menuitem = _this.$sub_menuitems[i]; i++) {
522                    var is_current_menuitem    = $sub_menuitem === $menuitem,
523                        $sub_sub_menu          = $sub_menuitem.parentNode.querySelector('ul');
524                        is_sub_sub_menuitem    = $sub_menuitem.classList.contains('sub_sub_menuitem');
525
526                    if (is_current_menuitem && $sub_sub_menu) {
527                        $menuitem.parentElement.classList.add('hover');
528                        $menuitem.setAttribute('aria-expanded', true);
529                    }
530
531                    else if (is_current_menuitem && is_sub_sub_menuitem) {
532                        $menuitem.parentElement.parentElement.parentElement.classList.add('hover');
533                        $menuitem.parentElement.parentElement.parentElement.setAttribute('aria-expanded', true);
534                    }
535
536                    else {
537                        $menuitem.parentElement.classList.remove('hover');
538                        $menuitem.setAttribute('aria-expanded', false);
539                    }
540                }
541            }
542
543            else {
544                _this._close_sub_sub_menus();
545            }
546        },
547
548        _close_sub_sub_menus: function() {
549            var _this = this;
550
551            for (var i = 0, $sub_menuitem; $sub_menuitem = _this.$sub_menuitems_with_sub_sub_menu[i]; i++) {
552                $sub_menuitem.parentElement.classList.remove('hover');
553                $sub_menuitem.setAttribute('aria-expanded', 'false');
554            }
555        },
556
557        _focus_prev_sub_menuitem: function() {
558            var _this          = this,
559                $sub_menuitems = _this.$main_menuitem.nextElementSibling.querySelectorAll('a'),
560                $sub_menuitem,
561                $main_menuitem;
562
563            _this.sub_menu_index -= 1;
564
565            $sub_menuitem = $sub_menuitems[_this.sub_menu_index];
566
567            if (_this.sub_menu_index < 0) {
568                $main_menuitem = _this.$main_menuitems[_this.main_menu_index];
569
570                if ($main_menuitem) {
571                    $main_menuitem.focus();
572                }
573            }
574            else if ($sub_menuitem) {
575                $sub_menuitem.focus();
576            }
577        },
578
579        _focus_next_sub_menuitem: function() {
580            var _this          = this,
581                $sub_menuitems = _this.$main_menuitem.nextElementSibling.querySelectorAll('a'),
582                $sub_menuitem,
583                $main_menuitem;
584
585            _this.sub_menu_index += 1;
586
587            $sub_menuitem = $sub_menuitems[_this.sub_menu_index];
588
589            if (_this.sub_menu_index === $sub_menuitems.length) {
590                _this.main_menu_index += 1;
591
592                $main_menuitem = _this.$main_menuitems[_this.main_menu_index];
593
594                if ($main_menuitem) {
595                    $main_menuitem.focus();
596                }
597                else {
598                    _this.main_menu_index -= 1;
599                    _this.sub_menu_index  -= 1;
600                }
601            }
602            else {
603                $sub_menuitem.focus();
604            }
605        },
606
607        _open_sub_menu: function(focus_last_sub_menuitem) {
608            var _this = this,
609                $sub_menuitems;
610
611            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
612                var is_current_menuitem = _this.$main_menuitem === $main_menuitem;
613
614                if (is_current_menuitem) {
615                    $main_menuitem.parentElement.classList.add('hover');
616                }
617                else {
618                    $main_menuitem.parentElement.classList.remove('hover');
619                }
620
621                $main_menuitem.setAttribute('aria-expanded', is_current_menuitem);
622            }
623
624            _this.sub_menu_index = 0;
625
626            if (_this.event_type === 'keydown') {
627                $sub_menuitems = _this.$sub_menu.querySelectorAll('a');
628
629                if (focus_last_sub_menuitem) {
630                    _this.sub_menu_index = $sub_menuitems.length - 1;
631                }
632
633                $sub_menuitems[_this.sub_menu_index].focus();
634
635                _this.event_type = false;
636            }
637
638            _this.sub_menu_is_open = true;
639        },
640
641        _close_sub_menu: function() {
642            var _this = this;
643
644            _this.$main_menuitem.parentElement.classList.remove('hover');
645            _this.$main_menuitem.setAttribute('aria-expanded', 'false');
646
647            _this.sub_menu_is_open = false;
648
649            _this.$main_menuitem.focus();
650        },
651
652        _close_sub_menus: function() {
653            var _this = this;
654
655            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
656                $main_menuitem.parentElement.classList.remove('hover');
657                $main_menuitem.setAttribute('aria-expanded', 'false');
658            }
659
660            _this._close_sub_sub_menus();
661        }
662    };
663
664    var $dropdown_menu = document.getElementsByClassName('dropdown_menu');
665
666    for (var i = 0, len = $dropdown_menu.length; i < len; i++) {
667        new DropdownMenu($dropdown_menu[i]).init();
668    }
669})(document);
670
671/* Source common/js/scripts/44_offcanvas_menu_accordion.js */
672
673// OFFCANVAS MENU ACORDION
674// MUSS VOR DEM EIGENTLICHEN ACORDION GELADEN WERDEN
675// -------------------------------------------------------------------------------------------------
676
677(function(document) {
678    var OffCanvasMenuAccordion = function($toggle_offcanvas_menu) {
679        var controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls');
680
681        this.window_width                   = window.innerWidth;
682        this.$main_menuitems_with_sub_menu  = document.querySelector('#' + controls + " .offcanvas_menu_content").querySelectorAll('a[aria-controls]');
683    };
684
685    OffCanvasMenuAccordion.prototype = {
686        init: function() {
687            var _this = this;
688
689            _this._init_accessibility();
690
691            for (var j = 0, $main_menuitem_with_sub_menu; $main_menuitem_with_sub_menu = _this.$main_menuitems_with_sub_menu[j]; j++) {
692                $main_menuitem_with_sub_menu.addEventListener('click',
693                    _this._on_click_main_menuitem.bind(_this, $main_menuitem_with_sub_menu)
694                );
695            }
696
697            window.addEventListener('resize',
698                _this._window_size_changed.bind(_this, $main_menuitem_with_sub_menu)
699            );
700        },
701
702        _init_accessibility: function() {
703            var _this = this;
704
705            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
706                if ($main_menuitem.classList.contains('active')) {
707                    $element = $main_menuitem.parentElement.querySelector('ul');
708                    $element.style.height = $element.scrollHeight + 'px';
709                }
710            }
711        },
712
713        _window_size_changed: function() {
714            var _this = this;
715
716            if (_this.window_width != window.innerWidth) { // Notwendig damit die Veränderung der Höhe der Seite nicht den Event auslöst
717                for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
718                    if ($main_menuitem.getAttribute('aria-expanded') === 'true') {
719                        var $element = $main_menuitem.parentElement.querySelector('ul');
720                        // reset height font.size manipulates height of element
721                        $element.style.height = 'auto';
722                        $element.style.height = $element.scrollHeight + 'px';
723                    }
724                }
725            }
726        },
727
728        _on_click_main_menuitem: function($main_menuitem_selected) {
729            var _this = this;
730
731            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
732                var $element = $main_menuitem.parentElement.querySelector('ul');
733
734                if ($main_menuitem_selected === $main_menuitem) {
735                    $element.style.height = '0px';
736                    if ($main_menuitem.getAttribute('aria-expanded') === 'false') {
737                        $element.style.height = $element.scrollHeight + 'px';
738                    } else {
739                        $element.style.height = '0px';
740                    }
741                }
742                else {
743                    $element.style.height = '0px';
744                }
745            }
746        }
747    };
748
749    // init OffCanvasMenu only once
750    var $toggle_offcanvas_menu = document.getElementsByClassName('toggle_offcanvas_menu');
751
752    // create an Opener for each button
753    for (var i = 0, len = $toggle_offcanvas_menu.length; i < len; i++) {
754        new OffCanvasMenuAccordion($toggle_offcanvas_menu[i]).init();
755    }
756
757})(document);
758
759/* Source common/js/scripts/45_offcanvas_menu.js */
760
761// OFFCANVAS MENU
762// -------------------------------------------------------------------------------------------------
763
764(function(document) {
765    var OffCanvasMenu = function($toggle_offcanvas_menu) {
766        var _this = this,
767            controls;
768
769        controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls');
770
771        _this.$offcanvas_menu               = document.getElementById(controls);
772        _this.$main_menuitems_with_sub_menu = _this.$offcanvas_menu.querySelectorAll('a[aria-controls]');
773        _this.$focus_elements               = _this.$offcanvas_menu.querySelectorAll('a');
774        _this.focus_element                 = false;
775        _this.$offcanvas_menu_state         = false;
776
777        _this.$navigation_links             = _this.$offcanvas_menu.querySelectorAll('.submenu');
778
779        _this.$key = {
780            'tab'    : 9,
781        };
782    };
783
784    OffCanvasMenu.prototype = {
785        init: function() {
786            var _this = this;
787
788            _this._init_accessibility();
789            _this._init_keyboard();
790
791            for (var j = 0, $main_menuitem_with_sub_menu; $main_menuitem_with_sub_menu = _this.$main_menuitems_with_sub_menu[j]; j++) {
792                $main_menuitem_with_sub_menu.addEventListener('click',
793                    _this._on_click_main_menuitem.bind(_this, $main_menuitem_with_sub_menu)
794                );
795            }
796
797            for (var k = 0, $navigation_link; $navigation_link = _this.$navigation_links[k]; k++) {
798                $navigation_link.addEventListener('click', function() {
799                    document.dispatchEvent(navigation_link_event);
800                });
801            }
802        },
803
804        _init_accessibility: function() {
805            var _this = this;
806
807            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
808                $main_menuitem.setAttribute('aria-expanded', $main_menuitem.classList.contains('active'));
809            }
810        },
811
812        _init_keyboard: function() {
813            var _this = this;
814
815            document.addEventListener('keydown', function(event) {
816                if (!_this.$offcanvas_menu_state.checked) {
817                    return;
818                }
819
820                if (event.keyCode === _this.$key.tab) {
821                    event.preventDefault();
822
823                    if (event.shiftKey) {
824                        _this._focus_element_with_shift_tab_key(event);
825                    }
826                    else {
827                        _this._focus_element_with_tab_key(event);
828                    }
829                }
830            });
831        },
832
833        _focus_element_with_shift_tab_key: function() {
834            var _this = this;
835
836            _this.tab_index -= 1;
837
838            if (_this.tab_index < 0) {
839                _this.tab_index = _this.$focus_elements.length - 1;
840            }
841
842            for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i--) {
843                if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) {
844                    _this.tab_index -= 1;
845                    continue;
846                }
847
848                _this.$focus_elements[_this.tab_index].focus();
849                break;
850            }
851        },
852
853        _focus_element_with_tab_key: function() {
854            var _this = this;
855
856            if (_this.tab_index === _this.$focus_elements.length - 1) {
857                _this.tab_index = 0;
858            }
859            else {
860                _this.tab_index += 1;
861            }
862
863            for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i++) {
864                if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) {
865                    _this.tab_index += 1;
866
867                    if (_this.tab_index > _this.$focus_elements.length - 1) {
868                        _this.tab_index = 0;
869                    }
870                    else {
871                        continue;
872                    }
873                }
874
875                _this.$focus_elements[_this.tab_index].focus();
876                break;
877            }
878        },
879
880        _on_click_main_menuitem: function($main_menuitem, event) {
881            var _this = this;
882
883            event.preventDefault();
884
885            _this.$main_menuitem = $main_menuitem;
886
887            _this._toggle_sub_menus();
888        },
889
890        _toggle_sub_menus: function() {
891            var _this = this;
892
893            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
894                var is_active_menuitem = _this.$main_menuitem === $main_menuitem,
895                    $parent_menuitems  = _this._get_parent_menu_elements();
896
897                if (is_active_menuitem) {
898                    _this.sub_menu_is_open = $main_menuitem.getAttribute('aria-expanded') === 'false';
899
900                    $main_menuitem.parentElement.classList.toggle('expanded', _this.sub_menu_is_open);
901                    $main_menuitem.setAttribute('aria-expanded', _this.sub_menu_is_open);
902                }
903                else if ($parent_menuitems.indexOf($main_menuitem) !== -1) { // Check parents
904                    $main_menuitem.parentElement.classList.toggle('expanded', 'true');
905                    $main_menuitem.setAttribute('aria-expanded', 'true');
906                }
907                else {
908                    $main_menuitem.parentElement.classList.remove('expanded');
909                    $main_menuitem.setAttribute('aria-expanded', 'false');
910                }
911            }
912        },
913
914        _get_parent_menu_elements: function() {
915            var _this = this.$main_menuitem,
916                $findings = [];
917
918            while (_this.parentNode) {
919                _this = _this.parentNode;
920
921                if (_this.nodeName.toLowerCase() === 'li') {
922                    $findings.push(_this.querySelector('a'));
923                }
924            }
925
926            return $findings || False;
927        }
928    };
929
930    var OffCanvasMenuOpener = function($toggle_offcanvas_menu) {
931        var _this = this;
932        var  controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls');
933
934        _this.$toggle_offcanvas_menu = $toggle_offcanvas_menu.querySelector('label');
935        _this.$open_offcanvas_menu   = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu');
936        _this.$close_offcanvas_menu  = $toggle_offcanvas_menu.querySelector('.close_offcanvas_menu');
937        _this.$offcanvas_menu_state  = document.querySelector('#' + _this.$toggle_offcanvas_menu.getAttribute('for'));
938        _this.$offcanvas_menu        = document.getElementById(controls);
939        _this.$focus_elements        = _this.$offcanvas_menu.querySelectorAll('a');
940
941        _this.$key = {
942            'enter'  : 13,
943            'escape' : 27,
944            'space'  : 32
945        };
946    };
947
948    OffCanvasMenuOpener.prototype = {
949        init: function() {
950            var _this = this;
951
952            _this._init_keyboard();
953
954            _this.$toggle_offcanvas_menu.addEventListener('click', _this._toggle_menu.bind(_this));
955            _this.$open_offcanvas_menu.addEventListener('click', _this._open_menu.bind(_this));
956            _this.$close_offcanvas_menu.addEventListener('click', _this._close_menu.bind(_this));
957
958            _this.$offcanvas_menu.addEventListener('transitionend', function(event) {
959
960                // var _this = this;
961                if (event.target !== this) {
962                    return;
963                }
964
965                if (_this.$offcanvas_menu_state.checked) {
966                    if (_this.focus_element) {
967                        _this.focus_element = false;
968                        _this.$focus_elements[0].focus();
969                    }
970                }
971                else if (_this.focus_element) {
972                    _this.focus_element = false;
973                    _this.$open_offcanvas_menu.focus();
974                }
975            });
976
977            document.addEventListener('onclick_navigationlink', function (e) {
978                _this._close_menu(e);
979            }, false);
980        },
981
982        _init_keyboard: function() {
983            var _this = this;
984
985            _this.$open_offcanvas_menu.addEventListener('keydown', function(event) {
986                if (event.keyCode === _this.$key.space || event.keyCode === _this.$key.enter) {
987                    _this.focus_element = true;
988                }
989
990                if (event.keyCode === _this.$key.space) {
991                    event.preventDefault();
992                }
993            });
994
995            _this.$close_offcanvas_menu.addEventListener('keydown', function(event) {
996                if (event.keyCode === _this.$key.space) {
997                    event.preventDefault();
998                }
999            });
1000
1001            document.addEventListener('keydown', function(event) {
1002                if (!_this.$offcanvas_menu_state.checked) {
1003                    return;
1004                }
1005
1006                if (event.keyCode === _this.$key.escape) {
1007                    _this.focus_element = true;
1008                    _this._close_menu(event);
1009                }
1010            });
1011        },
1012
1013        _toggle_menu: function(event) {
1014            var _this = this;
1015
1016            if (_this.$offcanvas_menu_state.checked) {
1017                _this._close_menu(event);
1018            }
1019            else {
1020                _this._open_menu(event);
1021            }
1022        },
1023
1024        _open_menu: function(event) {
1025            var _this = this;
1026
1027            event.preventDefault();
1028
1029            _this.$offcanvas_menu_state.checked = true;
1030            _this.tab_index = 0;
1031        },
1032
1033        _close_menu: function(event) {
1034            var _this = this;
1035
1036            event.preventDefault();
1037
1038            _this.$offcanvas_menu_state.checked = false;
1039            _this.tab_index = 0;
1040        }
1041    };
1042
1043    var $offcanvas_menu = document.getElementsByClassName('toggle_offcanvas_menu');
1044
1045    if ($offcanvas_menu.length) {
1046        new OffCanvasMenu($offcanvas_menu[0]).init(); // init once
1047
1048        // create an opener for each button
1049        for (var i = 0, len = $offcanvas_menu.length; i < len; i++) {
1050            new OffCanvasMenuOpener($offcanvas_menu[i]).init();
1051        }
1052    }
1053
1054    const navigation_link_event = new Event("onclick_navigationlink", {bubbles: true, cancelable: true});
1055})(document);
1056
1057/* Source common/js/scripts/70_form_search_datalist.js */
1058
1059// FORMULARE: SUCHBEGRIFF-VORSCHLÄGE FÜR DIE SUCHE
1060// Wird gebraucht in: steuernews_search, search
1061// -------------------------------------------------------------------------------------------------
1062
1063(function(document) {
1064    var FormSearchDataList = function($form) {
1065        var _this = this;
1066
1067        _this.$form    = $form;
1068        _this.$search  = $form.querySelector('input[type="search"]');
1069        _this.$submit  = $form.querySelector('button[type="submit"]');
1070        _this.datalist = $form.getAttribute('data-datalist');
1071        _this.list     = _this.$search.getAttribute('list');
1072
1073        _this.datalist_loaded   = false;
1074        _this.datalist_inserted = false;
1075    };
1076
1077    FormSearchDataList.prototype = {
1078        init: function() {
1079            var _this = this;
1080
1081            _this.$form.addEventListener('submit', _this._submit.bind(this));
1082            _this.$search.addEventListener('focus', _this._focus.bind(this));
1083
1084            _this._init_keyboard();
1085            _this._get_datalist();
1086        },
1087
1088        _init_keyboard: function() {
1089            var _this = this,
1090                $key  = {
1091                    'enter' : 13
1092                };
1093
1094            _this.$search.addEventListener('keyup', function(event) {
1095                if (event.keyCode !== $key.enter) {
1096                    return;
1097                }
1098
1099                var url = _this._get_url();
1100
1101                if (url) {
1102                    location.href = url;
1103                }
1104            });
1105        },
1106
1107        _get_datalist: function() {
1108            var _this     = this,
1109                $datalist = sessionStorage.getItem(domain + '_datalist_search'),
1110                $ajax,
1111                $options;
1112
1113            if (!_this.datalist) {
1114                return;
1115            }
1116
1117            if ($datalist) {
1118                $options = _this._get_sorted_datalist($datalist);
1119                _this._create_datalist($options);
1120            }
1121            else {
1122                $ajax = new XMLHttpRequest();
1123                $ajax.open('GET', _this.datalist, true);
1124
1125                $ajax.onload = function() {
1126                    if (this.status === 200) {
1127                        sessionStorage.setItem(domain + '_datalist_search', this.responseText);
1128
1129                        $options = _this._get_sorted_datalist(this.responseText);
1130                        _this._create_datalist($options);
1131                    }
1132                };
1133
1134                $ajax.send();
1135            }
1136        },
1137
1138        _get_sorted_datalist: function($datalist) {
1139            var $options = JSON.parse($datalist);
1140
1141            $options = $options.sort(function($a, $b) {
1142                var a_value = $a.value.toLowerCase(),
1143                    b_value = $b.value.toLowerCase();
1144
1145                if (a_value < b_value) {
1146                    return -1;
1147                }
1148
1149                if (b_value < a_value) {
1150                    return 1;
1151                }
1152            });
1153
1154            return $options;
1155        },
1156
1157        _create_datalist: function($options) {
1158            var _this     = this,
1159                $datalist = document.createDocumentFragment(),
1160                $datalist_entry;
1161
1162            for (var i = 0, $option; $option = $options[i]; i++) {
1163                $datalist_entry = document.createElement('option');
1164
1165                if ($option.url) {
1166                    $datalist_entry.setAttribute('data-url', $option.url);
1167                }
1168
1169                if ($option.label && /Chrome\b/.test(navigator.userAgent)) {
1170                    if (!(/Edge\b/.test(navigator.userAgent))) {
1171                        $datalist_entry.setAttribute('label', $option.label);
1172                    }
1173                }
1174
1175                $datalist_entry.setAttribute('data-value', $option.value.toLowerCase());
1176                $datalist_entry.textContent = $option.value;
1177                $datalist.appendChild($datalist_entry);
1178            }
1179
1180            _this.$datalist = $datalist;
1181        },
1182
1183        _focus: function() {
1184            var _this = this;
1185
1186            if (_this.$datalist && !_this.datalist_inserted) {
1187                document.querySelector('#' + _this.list).appendChild(_this.$datalist);
1188                _this.datalist_inserted = true;
1189                _this.$submit.removeAttribute('disabled');
1190            }
1191        },
1192
1193        _get_url: function() {
1194            var _this   = this,
1195                value   = _this.$search.value.toLowerCase(),
1196                $option = document.querySelector('#' + _this.list + ' option[data-value="' + value + '"]');
1197
1198            return $option ? $option.getAttribute('data-url') : '';
1199        },
1200
1201        _submit: function(event) {
1202            var _this = this,
1203                url   = _this._get_url();
1204
1205            if (url) {
1206                event.preventDefault();
1207
1208                location.href = url;
1209            }
1210        }
1211    };
1212
1213    var $forms = document.querySelectorAll('[data-form*="datalist"]');
1214
1215    for (var i = 0, $form; $form = $forms[i]; i++) {
1216        new FormSearchDataList($form).init();
1217    }
1218})(document);
1219
1220/* Source common/js/scripts/71_form_search.js */
1221
1222// SUCHE
1223// Wird gebraucht in: steuernews_search, suche
1224// -------------------------------------------------------------------------------------------------
1225
1226(function(document) {
1227    var FormSearch = function($search) {
1228        var _this = this;
1229
1230        _this.$search       = $search;
1231        _this.$input_search = $search.querySelector('input[type="search"]');
1232        _this.$button       = $search.querySelector('button[type="submit"]');
1233    };
1234
1235    FormSearch.prototype = {
1236        init: function() {
1237            var _this = this;
1238
1239            _this.$button.setAttribute('disabled', 'disabled');
1240            _this.$input_search.addEventListener('input', _this._on_input.bind(_this));
1241        },
1242
1243        _on_input: function() {
1244            var _this = this;
1245
1246            if (_this.$input_search.value.length > 0) {
1247                _this.$button.removeAttribute('disabled');
1248            }
1249            else {
1250                _this.$button.setAttribute('disabled', 'disabled');
1251            }
1252        }
1253    };
1254
1255    var $search = document.querySelectorAll('[role="search"]');
1256
1257    if ($search.length) {
1258        for (var i = 0, len = $search.length; i < len; i++) {
1259            new FormSearch($search[i]).init();
1260        }
1261    }
1262})(document);
1263
1264/* Source common/js/scripts/72_form_search_box.js */
1265
1266// SUCHE (BOX)
1267// -------------------------------------------------------------------------------------------------
1268
1269(function(document) {
1270    var FormSearchBox = function($toggle_search_box) {
1271        var _this = this,
1272            controls;
1273
1274        _this.$toggle_search_box  = $toggle_search_box.querySelector('label');
1275        _this.$open_search_box    = $toggle_search_box.querySelector('.open_search_box');
1276        _this.$close_search_box_1 = $toggle_search_box.querySelector('.close_search_box');
1277        _this.$search_box_state   = document.querySelector('#' + _this.$toggle_search_box.getAttribute('for'));
1278
1279        controls = _this.$open_search_box.getAttribute('aria-controls');
1280
1281        _this.$search_box         = document.getElementById(controls);
1282        _this.$input_search       = _this.$search_box.querySelector('input[type="search"]');
1283        _this.$search_button      = _this.$search_box.querySelector('button[type="submit"]');
1284        _this.$close_search_box_2 = _this.$search_box.querySelector('.close_search_box');
1285        _this.$focus_elements     = _this.$search_box.querySelectorAll('input[type="search"], button[type="submit"], .close_search_box');
1286
1287        _this.$key = {
1288            'escape' : 27,
1289            'space'  : 32,
1290            'tab'    : 9
1291        };
1292    };
1293
1294    FormSearchBox.prototype = {
1295        init: function() {
1296            var _this = this;
1297
1298            _this.$toggle_search_box.addEventListener('click', _this._toggle.bind(_this));
1299            _this.$open_search_box.addEventListener('click', _this._open.bind(_this));
1300            _this.$close_search_box_1.addEventListener('click', _this._close.bind(_this));
1301            _this.$close_search_box_2.addEventListener('click', _this._close.bind(_this));
1302
1303            _this.$search_box.addEventListener('transitionend', function(event) {
1304                if (event.target !== this) {
1305                    return;
1306                }
1307
1308                if (_this.$search_box_state.checked) {
1309                    _this.$input_search.focus();
1310                }
1311            });
1312
1313            _this._init_keyboard();
1314        },
1315
1316        _init_keyboard: function() {
1317            var _this = this;
1318
1319            _this.$open_search_box.addEventListener('keydown', function(event) {
1320                if (event.keyCode === _this.$key.space) {
1321                    event.preventDefault();
1322                }
1323            });
1324
1325            _this.$close_search_box_1.addEventListener('keydown', function(event) {
1326                if (event.keyCode === _this.$key.space) {
1327                    event.preventDefault();
1328                }
1329            });
1330
1331            _this.$close_search_box_2.addEventListener('keydown', function(event) {
1332                if (event.keyCode === _this.$key.space) {
1333                    event.preventDefault();
1334                }
1335            });
1336
1337            document.addEventListener('keydown', function(event) {
1338                if (!_this.$search_box_state.checked) {
1339                    return;
1340                }
1341
1342                switch(event.keyCode) {
1343                    case _this.$key.escape:
1344                        _this._close(event);
1345
1346                        break;
1347
1348                    case _this.$key.tab:
1349                        event.preventDefault();
1350
1351                        if (event.shiftKey) {
1352                            _this._focus_element_with_shift_tab_key(event);
1353                        }
1354                        else {
1355                            _this._focus_element_with_tab_key(event);
1356                        }
1357
1358                        break;
1359                }
1360            });
1361        },
1362
1363        _focus_element_with_shift_tab_key: function() {
1364            var _this = this;
1365
1366            _this.tab_index -= 1;
1367
1368            if (_this.$search_button === _this.$focus_elements[_this.tab_index] &&
1369                _this.$search_button.getAttribute('disabled') === 'disabled') {
1370                _this.tab_index -= 1;
1371            }
1372            if (_this.tab_index < 0) {
1373                _this.tab_index = _this.$focus_elements.length - 1;
1374            }
1375
1376            _this.$focus_elements[_this.tab_index].focus();
1377        },
1378
1379        _focus_element_with_tab_key: function() {
1380            var _this = this;
1381
1382            if (_this.tab_index === _this.$focus_elements.length - 1) {
1383                _this.tab_index = 0;
1384            }
1385            else {
1386                _this.tab_index += 1;
1387            }
1388
1389            if (_this.$search_button === _this.$focus_elements[_this.tab_index] &&
1390                _this.$search_button.getAttribute('disabled') === 'disabled') {
1391                _this.tab_index += 1;
1392            }
1393
1394            _this.$focus_elements[_this.tab_index].focus();
1395        },
1396
1397        _toggle: function(event) {
1398            var _this = this;
1399
1400            if (_this.$search_box_state.checked) {
1401                _this._close(event);
1402            }
1403            else {
1404                _this._open(event);
1405            }
1406        },
1407
1408        _open: function(event) {
1409            var _this = this;
1410
1411            event.preventDefault();
1412
1413            _this.$search_box_state.checked = true;
1414            _this.tab_index = 0;
1415        },
1416
1417        _close: function(event) {
1418            var _this = this;
1419
1420            event.preventDefault();
1421
1422            _this.$search_box_state.checked = false;
1423            _this.$open_search_box.focus();
1424            _this.tab_index = 0;
1425
1426            if (event.type === 'click') {
1427                _this.$open_search_box.setAttribute('data-focus-method', 'mouse');
1428            }
1429        }
1430    };
1431
1432    var $toggle_search_box = document.getElementsByClassName('toggle_search_box');
1433
1434    for (var i = 0, len = $toggle_search_box.length; i < len; i++) {
1435        new FormSearchBox($toggle_search_box[i]).init();
1436    }
1437})(document);
1438
1439/* Source common/js/scripts/75_kpt_gallery.js */
1440
1441// KARRIEREPAKET BILDER-GALERIE
1442// Wird gebraucht in: kpt_gallery
1443// -------------------------------------------------------------------------------------------------
1444
1445(function(document, window) {
1446    var ImageGallery = function($images) {
1447        var _this = this;
1448
1449        _this.$images   = $images;
1450        _this.$overlay  = document.querySelector('#kpt_gallery_overlay');
1451        _this.$kpt_gallery_slider   = _this.$overlay.querySelector('.kpt_gallery_slider');
1452        _this.$previous = _this.$overlay.querySelector('.previous');
1453        _this.$next     = _this.$overlay.querySelector('.next');
1454        _this.$close    = _this.$overlay.querySelector('.close');
1455
1456        _this._current_index = 0;
1457        _this._touch_flag    = false;
1458    };
1459
1460    ImageGallery.prototype = {
1461        init: function() {
1462            var _this = this;
1463
1464            _this._init_animations();
1465            _this._init_mouse();
1466            _this._init_keyboard();
1467            _this._init_touch();
1468        },
1469
1470        _init_animations: function() {
1471            var _this = this;
1472
1473            _this.$overlay.addEventListener('transitionend', _this._overlay_transtion_end.bind(_this));
1474            _this.$kpt_gallery_slider.addEventListener('animationend', _this._bounce_animation_end.bind(_this));
1475        },
1476
1477        _init_mouse: function() {
1478            var _this = this;
1479
1480            for (var i = 0, len = _this.$images.length; i < len; i++) {
1481                var $image = _this.$images[i];
1482
1483                $image.addEventListener('click', _this._open.bind(_this, i));
1484            }
1485
1486            if (window.navigator.msMaxTouchPoints || 'ontouchstart' in document.documentElement) {
1487                _this.$previous.classList.add('hideme');
1488                _this.$next.classList.add('hideme');
1489            }
1490            else {
1491                _this.$previous.addEventListener('click', function(event) {
1492                    event.stopPropagation();
1493                    event.preventDefault();
1494                    _this._show_previous_image();
1495                });
1496
1497                _this.$next.addEventListener('click', function(event) {
1498                    event.stopPropagation();
1499                    event.preventDefault();
1500                    _this._show_next_image();
1501                });
1502            }
1503
1504            _this.$close.addEventListener('click', _this._close.bind(_this));
1505            _this.$overlay.addEventListener('click', _this._close.bind(_this));
1506        },
1507
1508        _init_keyboard: function() {
1509            var _this = this,
1510                $key  = {
1511                    'escape'      : 27,
1512                    'arrow_left'  : 37,
1513                    'arrow_right' : 39
1514                };
1515
1516            document.addEventListener('keydown', function(event) {
1517                if (!_this.$overlay.classList.contains('show')) {
1518                    return;
1519                }
1520
1521                if (event.keyCode === $key.escape) {
1522                    _this._hide_overlay();
1523                }
1524                else if (event.keyCode === $key.arrow_left) {
1525                    _this._show_previous_image();
1526                }
1527                else if (event.keyCode === $key.arrow_right) {
1528                    _this._show_next_image();
1529                }
1530            });
1531        },
1532
1533        _init_touch: function() {
1534            var _this = this;
1535
1536            _this.$overlay.addEventListener('touchstart', function(event) {
1537                _this._touch_start_x = event.changedTouches[0].pageX;
1538                _this._touch_start_y = event.changedTouches[0].pageY;
1539            }, {
1540                'passive' : true
1541            });
1542
1543            _this.$overlay.addEventListener('touchmove', function(event) {
1544                if (_this._touch_flag) {
1545                    return;
1546                }
1547
1548                var touch   = event.touches[0] || event.changedTouches[0],
1549                    touch_x = touch.pageX,
1550                    touch_y = touch.pageY;
1551
1552                event.preventDefault();
1553
1554                if (touch_x - _this._touch_start_x > 40) {
1555                    _this._touch_flag = true;
1556                    _this._show_previous_image();
1557                }
1558                else if (touch_x - _this._touch_start_x < -40) {
1559                    _this._touch_flag = true;
1560                    _this._show_next_image();
1561                }
1562                else if (_this._touch_start_y - touch_y > 100) {
1563                    _this._hide_overlay();
1564                }
1565            });
1566
1567            _this.$overlay.addEventListener('touchend', function() {
1568                _this._touch_flag = false;
1569            });
1570        },
1571
1572        _open: function(index, event) {
1573            var _this = this;
1574
1575            event.preventDefault();
1576
1577            _this._prepare_overlay(index);
1578            _this._show_overlay(index);
1579        },
1580
1581        _close: function(event) {
1582            var _this = this;
1583
1584            event.preventDefault();
1585            event.stopPropagation();
1586
1587            if (event.target.tagName !== 'IMG') {
1588                _this._hide_overlay();
1589            }
1590        },
1591
1592        _overlay_transtion_end: function(event) {
1593            var _this = this;
1594
1595            if (event.target !== _this.$overlay) {
1596                return;
1597            }
1598
1599            if (!_this.$overlay.classList.contains('show')) {
1600                _this.$overlay.classList.add('hideme');
1601            }
1602        },
1603
1604        _bounce_animation_end: function() {
1605            var _this = this;
1606
1607            _this.$kpt_gallery_slider.classList.remove('bounce_from_left');
1608            _this.$kpt_gallery_slider.classList.remove('bounce_from_right');
1609        },
1610
1611        _prepare_overlay: function(index) {
1612            var _this   = this,
1613                gallery = _this.$images[index].getAttribute('data-kpt-gallery');
1614
1615            if (_this._current_gallery === gallery) {
1616                return;
1617            }
1618
1619            _this.$full_images    = [];
1620            _this.$current_images = document.querySelectorAll('[data-kpt-gallery="' + gallery + '"]');
1621            _this._current_gallery = gallery;
1622
1623            while (_this.$kpt_gallery_slider.firstChild) {
1624                _this.$kpt_gallery_slider.removeChild(_this.$kpt_gallery_slider.firstChild);
1625            }
1626
1627            for (var i = 0, $full_image; i < _this.$current_images.length; i++) {
1628                $full_image = document.createElement('div');
1629                $full_image.className = 'full_image';
1630
1631                _this.$full_images.push($full_image);
1632
1633                _this.$kpt_gallery_slider.setAttribute('data-image-group', gallery);
1634                _this.$kpt_gallery_slider.appendChild($full_image);
1635            }
1636        },
1637
1638        _show_overlay: function(index) {
1639            var _this = this;
1640
1641            index = Array.prototype.indexOf.call(_this.$current_images, _this.$images[index]);
1642
1643            _this._current_index = index;
1644
1645            _this.$overlay.classList.remove('hideme');
1646
1647            setTimeout(function() {
1648                _this.$overlay.classList.add('show');
1649            }, 50);
1650
1651            _this._load_image(_this._current_index, function() {
1652                _this._preload_previous_image(_this._current_index);
1653                _this._preload_next_image(_this._current_index);
1654            });
1655
1656            _this._update_offset();
1657        },
1658
1659        _hide_overlay: function() {
1660            var _this = this;
1661
1662            _this.$overlay.classList.remove('show');
1663        },
1664
1665        _update_offset: function() {
1666            var _this  = this,
1667                offset = -_this._current_index * 100 + '%';
1668
1669            _this.$kpt_gallery_slider.style.transform       = 'translate3d(' + offset + ', 0, 0)';
1670            _this.$kpt_gallery_slider.style.webkitTransform = 'translate3d(' + offset + ', 0, 0)'; // Für iOS8
1671        },
1672
1673        _show_previous_image: function() {
1674            var _this = this;
1675
1676            if (_this._current_index >= 1) {
1677                _this._current_index--;
1678                _this._preload_previous_image(_this._current_index);
1679                _this._update_offset();
1680            }
1681            else {
1682                _this.$kpt_gallery_slider.classList.add('bounce_from_left');
1683            }
1684        },
1685
1686        _show_next_image: function() {
1687            var _this = this;
1688
1689            if (_this._current_index <= _this.$full_images.length - 2) {
1690                _this._current_index++;
1691                _this._preload_next_image(_this._current_index);
1692                _this._update_offset();
1693            }
1694            else {
1695                _this.$kpt_gallery_slider.classList.add('bounce_from_right');
1696            }
1697        },
1698
1699        _preload_previous_image: function(index) {
1700            var _this = this;
1701
1702            if (_this._current_index - index >= 2) {
1703                return;
1704            }
1705
1706            _this._load_image(index - 1, function() {
1707                _this._preload_previous_image(index - 1);
1708            });
1709        },
1710
1711        _preload_next_image: function(index) {
1712            var _this = this;
1713
1714            if (index - _this._current_index >= 2) {
1715                return;
1716            }
1717
1718            _this._load_image(index + 1, function() {
1719                _this._preload_next_image(index + 1);
1720            });
1721        },
1722
1723        _load_image: function(index, callback) {
1724            var _this       = this,
1725                $full_image = _this.$full_images[index];
1726
1727            if (typeof $full_image === 'undefined') {
1728                return;
1729            }
1730
1731            if ($full_image.querySelector('img')) {
1732                if (callback) {
1733                    callback();
1734                }
1735
1736                return;
1737            }
1738
1739            var $figure           = document.createElement('figure'),
1740                $image            = document.createElement('img'),
1741                image_source      = _this.$current_images[index].getAttribute('href'),
1742                image_width       = _this.$current_images[index].getAttribute('data-image-width'),
1743                image_height      = _this.$current_images[index].getAttribute('data-image-height'),
1744                image_description = _this.$current_images[index].getAttribute('data-image-description'),
1745                image_text        = _this.$current_images[index].querySelector('.text');
1746
1747            if (image_text) {
1748                var $full_image_text = image_text.cloneNode(true);
1749                $full_image.appendChild($full_image_text);
1750            }
1751
1752            $figure.innerHTML = '<div class="spinner">' +
1753                                '<div class="bounce bounce_1"></div>' +
1754                                '<div class="bounce bounce_2"></div>' +
1755                                '<div class="bounce bounce_3"></div>' +
1756                                '</div>';
1757
1758            $image.setAttribute('src', image_source);
1759            $image.setAttribute('alt', '');
1760
1761            if (image_height != null) {
1762                $image.setAttribute('height', image_height);
1763            }
1764
1765            if (image_width != null) {
1766                $image.setAttribute('width', image_width);
1767            }
1768
1769            $image.addEventListener('load', function() {
1770                var $spinner = $figure.querySelector('.spinner');
1771
1772                $image.classList.add('show');
1773                $figure.removeChild($spinner);
1774
1775                if (callback) {
1776                    callback();
1777                }
1778            });
1779
1780            $figure.appendChild($image);
1781
1782            if (image_description) {
1783                var $figcaption = document.createElement('figcaption');
1784
1785                $figcaption.innerHTML = image_description;
1786                $figure.appendChild($figcaption);
1787            }
1788
1789            $full_image.appendChild($figure);
1790            // $full_image.appendChild($full_image_text);
1791        }
1792    };
1793
1794    var $images = document.querySelectorAll('[data-kpt-gallery]');
1795
1796    if ($images.length) {
1797        new ImageGallery($images).init();
1798    }
1799})(document, window);
1800
1801/* Source common/js/scripts/76_kpt_slider.js */
1802
1803// KARRIEREPAKET SLIDER
1804// ------------------------------------------------------------------------------------------------
1805
1806(function(document, window) {
1807    var Slider = function($slider) {
1808        this.$slider          = $slider;
1809        this.$slides          = this.$slider.querySelectorAll('.slide');
1810        this.active_index     = 0;
1811
1812        this.$navigation      = this.$slider.querySelector('.navigation');
1813        this.$navigation_next = this.$slider.querySelector('.navigation .next');
1814        this.$navigation_prev = this.$slider.querySelector('.navigation .prev');
1815        this.$pagination      = this.$slider.querySelectorAll('.pagination > a');
1816
1817        this.auto_slide       = this.$slider.className.match(/(\auto_slide\S*)/g);
1818        this.timeout          = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000);
1819        this.auto_stop        = this.$slider.className.match(/(\auto_stop)/g);
1820        this.run              = true;
1821        this.touch_flag       = false;
1822        this.motion_query     = matchMedia('(prefers-reduced-motion: reduce)');
1823    };
1824
1825    Slider.prototype = {
1826        init: function() {
1827            var _this = this;
1828
1829            if (!this.motion_query.matches) {
1830                if (_this.auto_slide) {
1831                    _this._auto_slide();
1832                }
1833            }
1834
1835            if (_this.auto_stop) {
1836                _this._auto_stop();
1837            }
1838
1839            if (_this.$navigation) {
1840                _this._init_navigation();
1841            }
1842
1843            if (_this.$pagination.length) {
1844                _this._init_pagination();
1845            }
1846
1847            _this._update_slides(0);
1848            _this._init_slides_animation();
1849            _this._init_accessibility();
1850            _this._init_touch();
1851        },
1852
1853        next: function() {
1854            this.active_index = this._get_index(this.$slides, this.active_index + 1);
1855            this._update_slides();
1856            this._set_slides_animation();
1857        },
1858
1859        prev: function() {
1860            this.active_index = this._get_index(this.$slides, this.active_index - 1);
1861            this._update_slides();
1862            this._set_slides_animation();
1863        },
1864
1865        _init_slides_animation: function() {
1866            var _this = this;
1867
1868            for (var i = 0; i < _this.$slides.length; i++) {
1869                _this.$slides[i].addEventListener('transitionend', function() {
1870                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
1871                });
1872
1873                _this.$slides[i].addEventListener('animationend', function() {
1874                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
1875                });
1876            }
1877        },
1878
1879        _init_navigation: function() {
1880            var _this = this;
1881
1882            _this.$navigation_next.addEventListener('click', function(event) {
1883                event.preventDefault();
1884
1885                _this.next();
1886            });
1887
1888            _this.$navigation_prev.addEventListener('click', function(event) {
1889                event.preventDefault();
1890
1891                _this.prev();
1892            });
1893        },
1894
1895        _init_accessibility: function() {
1896            var _this = this;
1897
1898            _this.$slider.addEventListener('click', function(event) {
1899                this.is_keyboard = false;
1900            }, true);
1901
1902            _this.$slider.addEventListener('keydown', function(event) {
1903                this.is_keyboard = true;
1904            }, true);
1905
1906            _this.$slider.addEventListener('focusin', function(event) {
1907                slide = event.target.closest('.slide');
1908
1909                if (slide && this.is_keyboard) {
1910                    _this.active_index = parseInt(slide.getAttribute('data-index'));
1911                    _this._update_slides();
1912                    _this._set_slides_animation();
1913
1914                    _this.$slider.querySelector('.slides').scrollLeft = 0;
1915                    this.is_keyboard = false;
1916                }
1917            }, true);
1918        },
1919
1920        _init_pagination: function() {
1921            var _this = this;
1922
1923            for (var i = 0; i < _this.$pagination.length; i++) {
1924                _this.$pagination[i].addEventListener('click', function(event) {
1925                    event.preventDefault();
1926
1927                    _this.active_index = parseInt(this.getAttribute('data-index'));
1928                    _this._update_slides();
1929                    _this._set_slides_animation();
1930                });
1931            }
1932        },
1933
1934        _init_touch: function() {
1935            var _this = this;
1936
1937            _this.$slider.addEventListener('touchstart', function(event) {
1938                _this._touch_start_x  = event.changedTouches[0].pageX;
1939                _this._touch_start_y  = event.changedTouches[0].pageY;
1940            }, {
1941                'passive' : true
1942            });
1943
1944            _this.$slider.addEventListener('touchmove', function(event) {
1945                if (_this.touch_flag) {
1946                    return;
1947                }
1948
1949                var touch   = event.touches[0] || event.changedTouches[0],
1950                    touch_x = touch.pageX;
1951
1952                if (touch_x - _this._touch_start_x > 40) {
1953                    _this.touch_flag = true;
1954                    _this.prev();
1955                }
1956                else if (touch_x - _this._touch_start_x < -40) {
1957                    _this.touch_flag = true;
1958                    _this.next();
1959                }
1960            }, {
1961                'passive' : true
1962            });
1963
1964            _this.$slider.addEventListener('touchend', function() {
1965                _this.touch_flag = false;
1966            });
1967        },
1968
1969        _auto_slide: function() {
1970            var _this = this;
1971
1972            setInterval(function() {
1973                if (_this.run) {
1974                    _this.next();
1975                }
1976            }, _this.timeout);
1977        },
1978
1979        _auto_stop: function() {
1980            var _this = this;
1981
1982            this.$slider.addEventListener('mousemove', function() {
1983                _this.run = false;
1984            });
1985
1986            this.$slider.addEventListener('mouseleave', function() {
1987                _this.run = true;
1988            });
1989        },
1990
1991        _update_slides: function() {
1992            this._set_active_slide();
1993            this._set_slides_position();
1994            this._set_slides_visibility();
1995
1996            if (this.$pagination.length) {
1997                this._update_pagination();
1998            }
1999        },
2000
2001        _update_pagination: function() {
2002            var index = this._get_index(this.$pagination, this.active_index);
2003
2004            this.$pagination = this._remove_all_classes(this.$pagination, 'active');
2005            this.$pagination[index].classList.add('active');
2006        },
2007
2008        _remove_all_classes: function(elements, class_name) {
2009
2010            for (var i = 0; i < elements.length; i++) {
2011                elements[i].classList.remove(class_name);
2012            }
2013
2014            return elements;
2015        },
2016
2017        _get_index: function(element, number) {
2018            var _this = this;
2019
2020            if (number >= (element.length * 2)) {
2021                number = number - (element.length * 2);
2022            }
2023
2024            if (number >= element.length) {
2025                number = number - element.length;
2026            }
2027
2028            if (number < 0) {
2029                number = number + element.length;
2030            }
2031
2032            return number;
2033        },
2034
2035        _set_slides_animation: function() {
2036            var slide_length_third = this.$slides.length / 3;
2037
2038            this.$slides = this._remove_all_classes(this.$slides, 'animated');
2039
2040            for (var i = -1; i <= slide_length_third; i++) {
2041                var index = this._get_index(this.$slides, this.active_index + i);
2042                this.$slides[index].classList.add('animated');
2043            }
2044        },
2045
2046        _set_active_slide: function() {
2047            var index = this._get_index(this.$slides, this.active_index);
2048
2049            this.$slides = this._remove_all_classes(this.$slides, 'active');
2050            this.$slides[index].classList.add('active');
2051        },
2052
2053        _set_slides_position: function() {
2054            var slide_length_half = Math.floor(this.$slides.length / 2);
2055
2056            for (var i = -slide_length_half - 1; i <= slide_length_half; i++) {
2057                var index = this._get_index(this.$slides, this.active_index + i);
2058                this.$slides[index].setAttribute('data-position', i * 100);
2059            }
2060        },
2061
2062        _set_slides_visibility: function() {
2063            var slide_length_third = this.$slides.length / 3;
2064
2065            this.$slides = this._remove_all_classes(this.$slides, 'visible');
2066
2067            for (var i = -1; i <= slide_length_third; i++) {
2068                var index = this._get_index(this.$slides, this.active_index + i);
2069                this.$slides[index].classList.add('visible');
2070            }
2071        }
2072    };
2073
2074    var $slider = document.querySelectorAll(['.kpt_slider']);
2075
2076    for (var i = 0; i < $slider.length; i++) {
2077        new Slider($slider[i]).init();
2078    }
2079})(document, window);
2080
2081/* Source common/js/scripts/77_slider.js */
2082
2083// SLIDER
2084// ------------------------------------------------------------------------------------------------
2085
2086(function(document, window) {
2087    var Slider = function($slider) {
2088        this.$slider          = $slider;
2089        this.$slides          = this.$slider.querySelectorAll('.slide');
2090        this.active_index     = 0;
2091
2092        this.$navigation      = this.$slider.querySelector('.navigation');
2093        this.$navigation_next = this.$slider.querySelector('.navigation .next');
2094        this.$navigation_prev = this.$slider.querySelector('.navigation .prev');
2095        this.$pagination      = this.$slider.querySelectorAll('.pagination > a');
2096
2097        this.auto_slide       = this.$slider.className.match(/(\auto_slide\S*)/g);
2098        this.timeout          = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000);
2099        this.auto_stop        = this.$slider.className.match(/(\auto_stop)/g);
2100        this.run              = true;
2101        this.touch_flag       = false;
2102        this.motion_query     = matchMedia('(prefers-reduced-motion: reduce)');
2103    };
2104
2105    Slider.prototype = {
2106        init: function() {
2107            var _this = this;
2108
2109            if (!this.motion_query.matches) {
2110                if (_this.auto_slide) {
2111                    _this._auto_slide();
2112                }
2113            }
2114
2115            if (_this.auto_stop) {
2116                _this._auto_stop();
2117            }
2118
2119            if (_this.$navigation) {
2120                _this._init_navigation();
2121            }
2122
2123            if (_this.$pagination.length) {
2124                _this._init_pagination();
2125            }
2126
2127            _this._update_slides(0);
2128            _this._init_slides_animation();
2129            _this._init_accessibility();
2130            _this._init_touch();
2131        },
2132
2133        next: function() {
2134            this.active_index = this._get_index(this.$slides, this.active_index + 1);
2135            this._update_slides();
2136            this._set_slides_animation();
2137        },
2138
2139        prev: function() {
2140            this.active_index = this._get_index(this.$slides, this.active_index - 1);
2141            this._update_slides();
2142            this._set_slides_animation();
2143        },
2144
2145        _init_slides_animation: function() {
2146            var _this = this;
2147
2148            for (var i = 0; i < _this.$slides.length; i++) {
2149                _this.$slides[i].addEventListener('transitionend', function() {
2150                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2151                });
2152
2153                _this.$slides[i].addEventListener('animationend', function() {
2154                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2155                });
2156            }
2157        },
2158
2159        _init_navigation: function() {
2160            var _this = this;
2161
2162            _this.$navigation_next.addEventListener('click', function(event) {
2163                event.preventDefault();
2164
2165                _this.next();
2166            });
2167
2168            _this.$navigation_prev.addEventListener('click', function(event) {
2169                event.preventDefault();
2170
2171                _this.prev();
2172            });
2173        },
2174
2175        _init_accessibility: function() {
2176            var _this = this;
2177
2178            _this.$slider.addEventListener('click', function(event) {
2179                this.is_keyboard = false;
2180            }, true);
2181
2182            _this.$slider.addEventListener('keydown', function(event) {
2183                this.is_keyboard = true;
2184            }, true);
2185
2186            _this.$slider.addEventListener('focusin', function(event) {
2187                slide = event.target.closest('.slide');
2188
2189                if (slide && this.is_keyboard) {
2190                    _this.active_index = parseInt(slide.getAttribute('data-index'));
2191                    _this._update_slides();
2192                    _this._set_slides_animation();
2193
2194                    _this.$slider.querySelector('.slides').scrollLeft = 0;
2195                    this.is_keyboard = false;
2196                }
2197            }, true);
2198        },
2199
2200        _init_pagination: function() {
2201            var _this = this;
2202
2203            for (var i = 0; i < _this.$pagination.length; i++) {
2204                _this.$pagination[i].addEventListener('click', function(event) {
2205                    event.preventDefault();
2206
2207                    _this.active_index = parseInt(this.getAttribute('data-index'));
2208                    _this._update_slides();
2209                    _this._set_slides_animation();
2210                });
2211            }
2212        },
2213
2214        _init_touch: function() {
2215            var _this = this;
2216
2217            _this.$slider.addEventListener('touchstart', function(event) {
2218                _this._touch_start_x  = event.changedTouches[0].pageX;
2219                _this._touch_start_y  = event.changedTouches[0].pageY;
2220            }, {
2221                'passive' : true
2222            });
2223
2224            _this.$slider.addEventListener('touchmove', function(event) {
2225                if (_this.touch_flag) {
2226                    return;
2227                }
2228
2229                var touch   = event.touches[0] || event.changedTouches[0],
2230                    touch_x = touch.pageX;
2231
2232                if (touch_x - _this._touch_start_x > 40) {
2233                    _this.touch_flag = true;
2234                    _this.prev();
2235                }
2236                else if (touch_x - _this._touch_start_x < -40) {
2237                    _this.touch_flag = true;
2238                    _this.next();
2239                }
2240            }, {
2241                'passive' : true
2242            });
2243
2244            _this.$slider.addEventListener('touchend', function() {
2245                _this.touch_flag = false;
2246            });
2247        },
2248
2249        _auto_slide: function() {
2250            var _this = this;
2251
2252            setInterval(function() {
2253                if (_this.run) {
2254                    _this.next();
2255                }
2256            }, _this.timeout);
2257        },
2258
2259        _auto_stop: function() {
2260            var _this = this;
2261
2262            this.$slider.addEventListener('mousemove', function() {
2263                _this.run = false;
2264            });
2265
2266            this.$slider.addEventListener('mouseleave', function() {
2267                _this.run = true;
2268            });
2269        },
2270
2271        _update_slides: function() {
2272            this._set_active_slide();
2273            this._set_slides_position();
2274            this._set_slides_visibility();
2275
2276            if (this.$pagination.length) {
2277                this._update_pagination();
2278            }
2279        },
2280
2281        _update_pagination: function() {
2282            var index = this._get_index(this.$pagination, this.active_index);
2283
2284            this.$pagination = this._remove_all_classes(this.$pagination, 'active');
2285            this.$pagination[index].classList.add('active');
2286        },
2287
2288        _remove_all_classes: function(elements, class_name) {
2289
2290            for (var i = 0; i < elements.length; i++) {
2291                elements[i].classList.remove(class_name);
2292            }
2293
2294            return elements;
2295        },
2296
2297        _get_index: function(element, number) {
2298            var _this = this;
2299
2300            if (number >= (element.length * 2)) {
2301                number = number - (element.length * 2);
2302            }
2303
2304            if (number >= element.length) {
2305                number = number - element.length;
2306            }
2307
2308            if (number < 0) {
2309                number = number + element.length;
2310            }
2311
2312            return number;
2313        },
2314
2315        _set_slides_animation: function() {
2316            var slide_length_third = this.$slides.length / 3;
2317
2318            this.$slides = this._remove_all_classes(this.$slides, 'animated');
2319
2320            for (var i = -1; i <= slide_length_third; i++) {
2321                var index = this._get_index(this.$slides, this.active_index + i);
2322                this.$slides[index].classList.add('animated');
2323            }
2324        },
2325
2326        _set_active_slide: function() {
2327            var index = this._get_index(this.$slides, this.active_index);
2328
2329            this.$slides = this._remove_all_classes(this.$slides, 'active');
2330            this.$slides[index].classList.add('active');
2331        },
2332
2333        _set_slides_position: function() {
2334            var slide_length_half = Math.floor(this.$slides.length / 2);
2335
2336            for (var i = -slide_length_half - 1; i <= slide_length_half; i++) {
2337                var index = this._get_index(this.$slides, this.active_index + i);
2338                this.$slides[index].setAttribute('data-position', i * 100);
2339            }
2340        },
2341
2342        _set_slides_visibility: function() {
2343            var slide_length_third = this.$slides.length / 3;
2344
2345            this.$slides = this._remove_all_classes(this.$slides, 'visible');
2346
2347            for (var i = -1; i <= slide_length_third; i++) {
2348                var index = this._get_index(this.$slides, this.active_index + i);
2349                this.$slides[index].classList.add('visible');
2350            }
2351        }
2352    };
2353
2354    var $slider = document.querySelectorAll(['.slider']);
2355
2356    for (var i = 0; i < $slider.length; i++) {
2357        new Slider($slider[i]).init();
2358    }
2359})(document, window);
2360
2361/* Source common/js/scripts/82_scrolled_down_header.js */
2362
2363// SCROLL DOWN HEADER
2364// Vergibt eine Klasse scrolled_down auf den Header
2365// -------------------------------------------------------------------------------------------------
2366
2367(function(document, window) {
2368    var scrolled_down = function($animated_element) {
2369        var _this = this;
2370        _this._$animated_element = $animated_element;
2371    };
2372
2373    scrolled_down.prototype = {
2374
2375        init: function() {
2376            var _this = this;
2377
2378            _this._is_scrolled_down();
2379            window.addEventListener('scroll', this._is_scrolled_down.bind(_this), true);
2380        },
2381
2382        _is_scrolled_down: function() {
2383            var _this  = this;
2384
2385            if (window.pageYOffset > 1) {
2386                _this._$animated_element.classList.add('scrolled_down');
2387            } else {
2388                _this._$animated_element.classList.remove('scrolled_down');
2389            }
2390        }
2391    };
2392
2393    var $animated_elements = document.querySelectorAll('header');
2394
2395    for (var i = 0, len = $animated_elements.length; i < len; i++) {
2396        new scrolled_down($animated_elements[i]).init();
2397    }
2398
2399}(document, window));
2400
2401/* Source common/js/scripts/85_bildabstand_zum_header.js */
2402
2403// Bild soll erst unter dem fixen Header beginnen
2404// -------------------------------------------------------------------------------------------------
2405
2406// (function(document, window) {
2407
2408//     var $header = document.querySelector('.top_header_wrapper'),
2409//         $image  = document.querySelector('.header_background, .header_image, .header_picture');
2410
2411//     function set_margin() {
2412//         $image.style.marginTop = $header.offsetHeight + 'px';
2413//     }
2414
2415//     set_margin();
2416
2417//     window.addEventListener('resize', set_margin);
2418//     window.addEventListener('scroll', set_margin);
2419
2420// }(document, window));
2421
2422/* Source common/js/scripts/90_vcard.js */
2423
2424// VCARD SWITCHER FÜR DESKTOP/MOBIL
2425// Wird verwendet für: team_overview, team_entry, address_vcard_button, steuernews_contact_person
2426// -------------------------------------------------------------------------------------------------
2427
2428(function(document) {
2429    if (device.mobile || device.tablet) {
2430        return;
2431    }
2432
2433    var $vcards = document.querySelectorAll('[data-vcard-href]');
2434
2435    for (var i = 0, len = $vcards.length; i < len; i++) {
2436        var $vcard = $vcards[i],
2437            href   = $vcard.getAttribute('data-vcard-href');
2438
2439        if (href) {
2440            $vcard.setAttribute('href', href);
2441            $vcard.removeAttribute('data-vcard-href');
2442        }
2443    }
2444}(document));
2445
2446/* Source common/js/scripts/94_slider.js */
2447
2448// SLIDER
2449// Wird verwendet für: steuernews_article_slider
2450// -------------------------------------------------------------------------------------------------
2451
2452(function(document, window) {
2453    var Slider = function($slider) {
2454        var _this = this;
2455
2456        _this._$slider = $slider;
2457        _this._$slides = $slider.querySelectorAll('[data-slide]');
2458        _this._$status = $slider.querySelectorAll('[data-slider-status]');
2459
2460        _this._animated   = true;
2461        _this._touch_flag = false;
2462    };
2463
2464    Slider.prototype = {
2465        init: function() {
2466            var _this = this;
2467
2468            _this._init_animation();
2469            _this._init_mouse();
2470            _this._init_touch();
2471        },
2472
2473        _init_mouse: function() {
2474            var _this = this;
2475
2476            _this._$slider.addEventListener('mouseover', function() {
2477                _this._animated = false;
2478            });
2479
2480            _this._$slider.addEventListener('mouseout', function() {
2481                _this._animated = true;
2482            });
2483        },
2484
2485        _init_touch: function() {
2486            var _this = this;
2487
2488            _this._$slider.addEventListener('touchstart', function(event) {
2489                _this._touch_start_x  = event.changedTouches[0].pageX;
2490                _this._touch_start_y  = event.changedTouches[0].pageY;
2491                _this._animated       = false;
2492            }, {
2493                'passive' : true
2494            });
2495
2496            _this._$slider.addEventListener('touchmove', function(event) {
2497                if (_this._touch_flag) {
2498                    return;
2499                }
2500
2501                var touch   = event.touches[0] || event.changedTouches[0],
2502                    touch_x = touch.pageX;
2503
2504                if (touch_x - _this._touch_start_x > 40) {
2505                    _this._touch_flag = true;
2506                    _this._prev_slide();
2507                }
2508                else if (touch_x - _this._touch_start_x < -40) {
2509                    _this._touch_flag = true;
2510                    _this._next_slide();
2511                }
2512            }, {
2513                'passive' : true
2514            });
2515
2516            _this._$slider.addEventListener('touchend', function() {
2517                _this._touch_flag = false;
2518                _this._animated   = true;
2519            });
2520        },
2521
2522        _init_animation: function() {
2523            var _this = this,
2524                start,
2525                progress;
2526
2527            function step(timestamp) {
2528                if (!start || !_this._animated) {
2529                    start = timestamp;
2530                }
2531
2532                progress = timestamp - start;
2533
2534                if (progress >= 5000) {
2535                    _this._next_slide();
2536                    start = timestamp;
2537                }
2538
2539                window.requestAnimationFrame(step);
2540            }
2541
2542            window.requestAnimationFrame(step);
2543        },
2544
2545        _prev_slide: function() {
2546            var _this = this;
2547
2548            for (var index = 0, len = _this._$status.length; index < len; index++) {
2549                var checked = _this._$status[index].checked;
2550
2551                if (checked) {
2552                    _this._$slides[index].querySelector('[data-prev-slide]').click();
2553                    break;
2554                }
2555            }
2556        },
2557
2558        _next_slide: function() {
2559            var _this = this;
2560
2561            for (var index = 0, len = _this._$status.length; index < len; index++) {
2562                var checked = _this._$status[index].checked;
2563
2564                if (checked) {
2565                    _this._$slides[index].querySelector('[data-next-slide]').click();
2566                    break;
2567                }
2568            }
2569        },
2570    };
2571
2572    var $sliders = document.querySelectorAll('[data-slider]');
2573
2574    for (var i = 0, len = $sliders.length; i < len; i++) {
2575        new Slider($sliders[i]).init();
2576    }
2577})(document, window);
2578
2579/* Source common/js/scripts/95_load_youtube_vimeo_iframe.js */
2580
2581// YOUTUBE / VIMEO NACHTRÄGLICH LADEN
2582// -------------------------------------------------------------------------------------------------
2583
2584(function(document) {
2585    var YoutubeVimeoPlayer = function($movies, $isYoutube) {
2586        this.$movies    = $movies;
2587        this.$isYoutube = $isYoutube;
2588    };
2589
2590    YoutubeVimeoPlayer.prototype = {
2591        initYoutube: function() {
2592            if (sessionStorage.getItem('show_youtube')) {
2593                this._show_all_movies();
2594            } else {
2595                this._setup_ui();
2596            }
2597        },
2598
2599        initVimeo: function() {
2600            if (sessionStorage.getItem('show_vimeo')) {
2601                this._show_all_movies();
2602            } else {
2603                this._setup_ui();
2604            }
2605        },
2606
2607        _setup_ui: function() {
2608            var _this = this;
2609
2610            for (var i = 0; i < this.$movies.length; i++) {
2611                this.$movies[i].querySelector('.button').addEventListener('click', function(event) {
2612                    event.preventDefault();
2613
2614                    if (_this.$isYoutube){
2615                        sessionStorage.setItem('show_youtube', true);
2616                    } else {
2617                        sessionStorage.setItem('show_vimeo', true);
2618                    }
2619                    
2620                    _this._show_all_movies();
2621                });
2622            }
2623        },
2624
2625        _show_all_movies: function() {
2626            for (var i = 0; i < this.$movies.length; i++) {
2627                var $iframe     = this.$movies[i].querySelector('iframe'),
2628                    $overlay    = this.$isYoutube ? this.$movies[i].querySelector('.youtube_wrapper') : this.$movies[i].querySelector('.vimeo_wrapper');
2629
2630                $iframe.setAttribute('src', $iframe.getAttribute('data-src'));
2631                $iframe.removeAttribute('data-src');
2632                $overlay.classList.remove('show_message');
2633            }
2634        }
2635    };
2636
2637    var $youtube_player = document.querySelectorAll('.youtube_player');
2638
2639    if ($youtube_player.length > 0) {
2640        new YoutubeVimeoPlayer($youtube_player, true).initYoutube();
2641    }
2642
2643    var $vimeo_player = document.querySelectorAll('.vimeo_player');
2644
2645    if ($vimeo_player.length > 0) {
2646        new YoutubeVimeoPlayer($vimeo_player, false).initVimeo();
2647    }
2648
2649}(document));
2650
2651/* Source common/js/scripts/96_open_street_map.js */
2652
2653// OPEN STREET MAPS
2654// -------------------------------------------------------------------------------------------------
2655
2656(function(window) {
2657    var OpenStreetMap = function(id, locations, additional_markers, options) {
2658        this.id                         = id;
2659        this.locations                  = locations;
2660        this.additional_markers         = additional_markers;
2661        this.options                    = options;
2662        this.$map_id                    = document.querySelector('#open_street_map_' + this.id);
2663        this.$layer_additional_markers  = [];
2664        this.window_width               = window.innerWidth;
2665        this.$selected_location;
2666        this.$map;
2667    };
2668
2669    OpenStreetMap.prototype = {
2670        init: function() {
2671            var _this = this;
2672
2673            this._init_map();
2674            this._init_locations_markers();
2675            this._init_additional_markers();
2676            this._init_plan_route();
2677
2678            window.addEventListener('resize', function() {
2679
2680                // Manche mobilen Geräte lösen beim vertikalen Scrollen ein resize-Event aus, da die Browserleiste ein-/ausgeblendet wird
2681
2682                if (_this.window_width !== window.innerWidth) {
2683                    _this.window_width = window.innerWidth;
2684                    _this._center_map();
2685                }
2686            });
2687        },
2688
2689        // OpenStreetMap Karte initialisieren
2690
2691        _init_map: function() {
2692            var _this = this;
2693            $view = new ol.View({
2694                center:         ol.proj.fromLonLat([this.options.center_lng, this.options.center_lat]),
2695                zoom:           this.options.zoom,
2696                minZoom:        this.options.min_zoom,
2697                maxZoom:        this.options.max_zoom,
2698                enableRotation: false
2699            });
2700
2701            var url = '/maps/tile/{z}/{x}/{y}.png';
2702
2703            // Anderer Tiles Server für die Verwendung auf der Beta
2704            if (window.location.hostname === 'beta.atikon.io') {
2705                url = 'https://maps.atikon.com/maps/tile/{z}/{x}/{y}.png';
2706            }
2707
2708            var tile = new ol.layer.Tile({
2709                source: new ol.source.OSM({
2710                    url: url
2711                })
2712            });
2713
2714            this.$map = new ol.Map({
2715
2716                // Auf iOS-Geräten soll das Srollen in der Karte nur mit zwei Fingern möglich sein. iOS benötigt ein eigenes Handling. Nur im Konstruktor der Map funktioniert dieser Event-Listener in Kombination mit DragPan flüssig. Bei Chrome greift ein CSS Regel.
2717
2718                interactions: ol.interaction.defaults({
2719                    dragPan:        false,  // Lösche die DragPan Standard Funktion
2720                    mouseWheelZoom: false   // Kein Zoomen beim Betätigen des Mausrads
2721                }).extend([new ol.interaction.DragPan({
2722
2723                    // Fügt eine eigene abgeleitete Drag Funktion ein und erweitere die Standardfunktionen um diese
2724
2725                    condition: function(event) {
2726
2727                        // Wenn iOS: return regelt das Aktivieren der Drag-Funktion
2728
2729                        if (document.querySelector('html').classList.contains('ios')) {
2730
2731                            // Chrome hat momentan ein Pointer-Event und kein Touch-Event wie iOS
2732
2733                            if (event.originalEvent.touches) {
2734                                var $map_overlay = _this.$map_id.querySelector('.map_overlay');
2735
2736                                if (event.originalEvent.touches.length > 1) {
2737                                    $map_overlay.classList.remove('show');
2738                                } else {
2739
2740                                    // Blende eine Bedienwarnung "zwei Finger zum Verschieben" ein
2741
2742                                    $map_overlay.classList.add('show');
2743                                    setTimeout(function() {
2744                                        $map_overlay.classList.remove('show');
2745                                    }, 1000);
2746                                    return false;
2747                                }
2748                            }
2749                        }
2750
2751                        return true;
2752                    }
2753                })]),
2754                target: 'map_' + this.id,
2755                layers: [tile],
2756                loadTilesWhileAnimating: true,
2757                view:   $view
2758            });
2759
2760            // Soll Karte nach Graustufen konvertiert werden?
2761
2762            if (this.options.grayscale) {
2763                tile.on('postcompose', function(event) {
2764                    var imageData = _this._convert_map_to_greyscale(event.context)
2765                    event.context.putImageData(imageData, 0, 0);
2766                });
2767            }
2768
2769            if (this.options.debug) {
2770                console.log('OpenStreetMap Debug ist ein!');
2771
2772                this.$map.on('pointerdrag', function() {
2773                    var center = ol.proj.transform(_this.$map.getView().getCenter(), _this.options.featureProjection,  _this.options.dataProjection);
2774                    console.log('Mittelpunkt Karte: ' + center[1] + ' ' + center[0]);
2775                });
2776            }
2777
2778            this._setup_zoom_buttons();
2779        },
2780
2781        // Zoom Buttons als inaktiv kennzeichnen
2782
2783        _setup_zoom_buttons: function() {
2784            var _this = this,
2785                $zoom_in_button    = this.$map_id.querySelector('.ol-zoom-in'),
2786                $zoom_out_button   = this.$map_id.querySelector('.ol-zoom-out'),
2787                $view              = this.$map.getView();
2788
2789            if ($view.getZoom() >= this.options.max_zoom) {
2790                $zoom_in_button.classList.add('disabled');
2791            }
2792            if ($view.getZoom() <= this.options.min_zoom) {
2793                $zoom_out_button.classList.add('disabled');
2794            }
2795
2796            $view.on('change:resolution', function() {
2797                if ($view.getZoom() >= _this.options.max_zoom) {
2798                    $zoom_in_button.classList.add('disabled');
2799                } else {
2800                    $zoom_in_button.classList.remove('disabled');
2801                }
2802
2803                if ($view.getZoom() <= _this.options.min_zoom) {
2804                    $zoom_out_button.classList.add('disabled');
2805                } else {
2806                    $zoom_out_button.classList.remove('disabled');
2807                }
2808            });
2809        },
2810
2811        // Karte nach Graustufen konvertieren
2812
2813        _convert_map_to_greyscale: function(context) {
2814            var imageData = context.getImageData(0, 0, context.canvas.width, context.canvas.height),
2815                data = imageData.data;
2816
2817            for (var i = 0; i < data.length; i = i + 4) {
2818                var red     = data[i],
2819                    green   = data[i + 1],
2820                    blue    = data[i + 2],
2821                    alpha   = data[i + 3];
2822
2823                 var average = (red + green + blue) / 3;
2824
2825                 // Beim Laden der Karte die Transparenz auf Null setzen
2826
2827                 if (average === 0) {
2828                     alpha = 0;
2829                 } else {
2830                     alpha = 255;
2831                 }
2832
2833                 data[i] = average;     // Rot
2834                 data[i + 1] = average; // Grün
2835                 data[i + 2] = average; // Blau
2836                 data[i + 3] = alpha;   // Alpha
2837            }
2838
2839            return imageData;
2840        },
2841
2842        // Marker für Standort positionieren
2843
2844        _init_locations_markers: function() {
2845            for (var i = 0; i < this.locations.length; i++) {
2846
2847                $marker = this._add_marker(
2848                    this.locations[i].lng,
2849                    this.locations[i].lat,
2850                    this.locations[i].marker
2851                );
2852
2853                this.$map.addLayer($marker);
2854                $marker.setZIndex(10);
2855            }
2856
2857            if (this.locations.length === 1) {
2858                this.$selected_location = this.locations[0];
2859            }
2860
2861            this._center_map();
2862        },
2863
2864        // Zusätzlich Marker positionieren
2865
2866        _init_additional_markers: function() {
2867            for (var i = 0; i < this.additional_markers.length; i++) {
2868                $marker = this._add_marker(
2869                    this.additional_markers[i].lng,
2870                    this.additional_markers[i].lat,
2871                    this.additional_markers[i].marker
2872                );
2873
2874                this.$layer_additional_markers.push($marker);
2875                this.$map.addLayer($marker);
2876                $marker.setZIndex(8);
2877                $marker.setVisible(false);
2878            }
2879
2880            if (this.additional_markers.length > 0) {
2881                this._manage_additional_markers_visibility();
2882                var _this = this;
2883
2884                this.$map.getView().on('propertychange', function(event) {
2885                    if (event.key === 'resolution') {
2886                        _this._manage_additional_markers_visibility();
2887                    }
2888                });
2889            }
2890        },
2891
2892        // Zusätzlich Marker Sichtbarkeit anhand der Zoomstufe regulieren
2893
2894        _manage_additional_markers_visibility: function() {
2895            for (var i = 0; i < this.additional_markers.length; i++) {
2896                if (this.$map.getView().getZoom() >= this.additional_markers[i].min_zoom_visible) {
2897                    this.$layer_additional_markers[i].setVisible(true);
2898                } else {
2899                    this.$layer_additional_markers[i].setVisible(false);
2900                }
2901            }
2902        },
2903
2904        // Routenplanung initialisieren
2905
2906        _init_plan_route: function() {
2907            var _this = this,
2908                $destination_select = this.$map_id.querySelector('select'),
2909                $plan_route_form    = this.$map_id.querySelector('form');
2910
2911            if ($plan_route_form) {
2912
2913                // Mehrere Standorte?
2914
2915                if ($destination_select) {
2916                    $destination_select.addEventListener('change', function() {
2917                        if (this.options[this.selectedIndex].value !== '') {
2918                            _this.$selected_location = _this.locations[(this.options[this.selectedIndex].value)];
2919                            _this._update_plan_route_form($plan_route_form);
2920                        } else {
2921
2922                            // Kein Standort ausgewählt
2923                            _this.$selected_location = '';
2924                            $plan_route_form.action = '';
2925                            _this._center_map();
2926                        }
2927                        _this._center_map();
2928                    });
2929                } else {
2930                    _this._update_plan_route_form($plan_route_form);
2931                }
2932            }
2933        },
2934
2935        // Aktion für die Routenplanung via GoogleMaps zusammenbauen
2936
2937        _update_plan_route_form: function($form) {
2938            var $daddr          = this.$map_id.querySelector('[name="daddr"]');
2939
2940            $form.action = 'https://maps.google.de/maps';
2941            $daddr.value = this.$selected_location.postal_code + ' ' + this.$selected_location.locality + ', ' + this.$selected_location.street_address;
2942        },
2943
2944        // Standardaktion für das Setzen von Markierungen (Standort und zusätzliche Markierungen)
2945
2946        _add_marker: function(lng, lat, marker) {
2947            return new ol.layer.Vector({
2948                source: new ol.source.Vector({
2949                    features: [new ol.Feature({
2950                        geometry: new ol.geom.Point(
2951                            ol.proj.transform([lng, lat],
2952                            this.options.dataProjection,
2953                            this.options.featureProjection
2954                        )),
2955                    })]
2956                }),
2957
2958                // Dient zur Ausrichtung der Markierung
2959
2960                style: new ol.style.Style({
2961                    image: new ol.style.Icon({
2962                        anchor:         [0.5, 1],
2963                        anchorXUnits:   'fraction',
2964                        anchorYUnits:   'fraction',
2965                        src:            marker['href'],
2966                        scale:          0.5,
2967                        maxZoom:        1,
2968                    })
2969                })
2970            });
2971        },
2972
2973        // Standardaktion zum Zentrieren der Karte
2974
2975        _center_map: function() {
2976
2977            // Ist eine Zentrierung der Karte gewünscht?
2978
2979            if (this.options.center_lng === 0 && this.options.center_lat === 0) {
2980
2981                // Gibt es nur einen Standort bzw. ist einer ausgewählt?
2982
2983                if (this.locations.length === 1 || this.$selected_location) {
2984                    this._center_map_point(
2985                        this.$selected_location.lng,
2986                        this.$selected_location.lat,
2987                        this.options.zoom
2988                    );
2989                } else {
2990                    // mehrere Standorte anzeigen
2991
2992                    this._center_map_more_locations();
2993                }
2994            } else {
2995                this._center_map_point(
2996                    this.options.center_lng,
2997                    this.options.center_lat,
2998                    this.options.center_zoom
2999                );
3000            }
3001        },
3002
3003        // Karte auf einen Punkt zentrieren
3004
3005        _center_map_point: function(lng, lat, zoom) {
3006            this.$map.getView().animate({
3007                center:     ol.proj.fromLonLat([lng, lat]),
3008                duration:   500,
3009                zoom:       zoom
3010            });
3011        },
3012
3013        // Karte neu zentrieren anhand von mehreren Standorten mit einem Sicherheitsabstand
3014
3015        _center_map_more_locations: function() {
3016            var extent = ol.proj.transformExtent(
3017                this._get_locations_bounds(),
3018                this.options.dataProjection,
3019                this.options.featureProjection
3020            );
3021
3022            this.$map.getView().fit(extent, {
3023                size:                   this.$map.getSize(),
3024                padding:                this._max_marker_padding(),
3025                constrainResolution:    false,
3026                duration:               500
3027            });
3028        },
3029
3030        // Minimale und maximale Grenzen der Standorte als Koordinaten-Array
3031
3032        _get_locations_bounds: function() {
3033            var lng_min = this.locations[0].lng,
3034                lng_max = this.locations[0].lng,
3035                lat_min = this.locations[0].lat,
3036                lat_max = this.locations[0].lat;
3037
3038            for (var i = 1; i < this.locations.length; i++) {
3039                if (this.locations[i].lng > lng_max) {
3040                    lng_max = this.locations[i].lng;
3041                }
3042                if (this.locations[i].lng < lng_min) {
3043                    lng_min = this.locations[i].lng;
3044                }
3045                if (this.locations[i].lat > lat_max) {
3046                    lat_max = this.locations[i].lat;
3047                }
3048                if (this.locations[i].lat < lat_min) {
3049                    lat_min = this.locations[i].lat;
3050                }
3051            }
3052
3053            return [lng_min, lat_min, lng_max, lat_max];
3054        },
3055
3056        // Sicherheitsabstand der Markierungen zum User-Interface und den Kartenrändern
3057
3058        _max_marker_padding: function() {
3059            var max_height      = 0,
3060                max_width       = 0,
3061                default_padding = 30
3062                result          = [];
3063
3064            for (var i = 0; i < this.locations.length; i++) {
3065                if (this.locations[i].marker.width > max_width) {
3066                    max_width = this.locations[i].marker.width;
3067                }
3068                if (this.locations[i].marker.height > max_height) {
3069                    max_height = this.locations[i].marker.height;
3070                }
3071            }
3072
3073            result = [max_height + default_padding, max_width / 2 + default_padding + this.$map_id.querySelector('button').offsetWidth, default_padding, max_width / 2 + default_padding];
3074
3075            return result;
3076        }
3077    };
3078
3079    // Hole von jeder Karte die vorkommt die Daten und lege ein eigenes JavaScript-Objekt an
3080
3081    if (window.$open_street_map_data) {
3082        for (var i = 0, len = window.$open_street_map_data.length; i < len; i++) {
3083            var id                  = window.$open_street_map_data[i].id,
3084                locations           = window.$open_street_map_data[i].locations,
3085                additional_markers  = window.$open_street_map_data[i].additional_markers,
3086                options             = window.$open_street_map_data[i].options;
3087
3088            new OpenStreetMap(id, locations, additional_markers, options).init();
3089        }
3090    }
3091
3092})(window);
3093
3094/* Source common/js/scripts/98_onlinetool_popup.js */
3095
3096// ONLINETOOL POPUP
3097// Wird verwendet für: download_overview, onlinetools_popup_overview
3098// -------------------------------------------------------------------------------------------------
3099
3100(function(document, window) {
3101    var OnlinetoolPopup = function($onlinetool) {
3102        var _this = this;
3103
3104        _this.$onlinetool = $onlinetool;
3105
3106        _this.title = $onlinetool.getAttribute('title');
3107        _this.id    = '#' + $onlinetool.getAttribute('data-popup-id');
3108        _this.href  = $onlinetool.getAttribute('href');
3109    },
3110
3111    $body = document.querySelector('body'),
3112    $popup,
3113    $content,
3114    $close,
3115    $iframe;
3116
3117    // Private
3118
3119    function _create_element(html) {
3120        var $div            = document.createElement('div'),
3121            $filtered_nodes = [],
3122            $nodes;
3123
3124        $div.innerHTML = html.trim();
3125        $nodes         = $div.childNodes;
3126
3127        for (var i = 0, len = $nodes.length; $nodes !== null && i < len; i++) {
3128            if ($nodes[i].nodeType === 1) {
3129                $filtered_nodes.push($nodes[i]);
3130            }
3131        }
3132
3133        return $filtered_nodes;
3134    }
3135
3136    function _create_popup() {
3137        $popup   = document.querySelector('.popup_overlay');
3138        $content = $popup.querySelector('.popup_content');
3139        $close   = $popup.querySelector('.popup_close');
3140        $iframe  = $popup.querySelector('iframe');
3141
3142        $iframe.addEventListener('load', function() {
3143            if ($iframe.getAttribute('src') && $iframe.getAttribute('src').length && $popup.classList.contains('show')) {
3144                $iframe.classList.add('show');
3145            }
3146        });
3147    }
3148
3149    function _close_popup() {
3150        var _close = function() {
3151            $body.classList.remove('no_scroll');
3152            $content.classList.remove('show');
3153            $iframe.classList.remove('show');
3154
3155            window.history.replaceState(null, document.title, window.location.pathname);
3156        };
3157
3158        $close.addEventListener('click', function(event) {
3159            event.preventDefault();
3160            _close();
3161        });
3162
3163        document.addEventListener('keydown', function(event) {
3164            if ($popup.classList.contains('show') && event.which === 27) {
3165                _close();
3166            }
3167        });
3168
3169        $content.addEventListener('transitionend', function() {
3170            if (!$content.classList.contains('show')) {
3171                $popup.classList.remove('show');
3172            }
3173        });
3174    }
3175
3176    _create_popup();
3177    _close_popup();
3178
3179    // Public
3180
3181    OnlinetoolPopup.prototype = {
3182        init: function() {
3183            var _this = this;
3184
3185            _this.$onlinetool.addEventListener('click', function(event) {
3186                event.preventDefault();
3187                _this.open();
3188            });
3189        },
3190
3191        open: function() {
3192            var _this = this;
3193
3194            $body.classList.add('no_scroll');
3195            $popup.classList.add('show');
3196            $content.classList.add('show');
3197            $iframe.setAttribute('src', _this.href);
3198
3199            window.history.replaceState(null, document.title, _this.id);
3200        }
3201    };
3202
3203    if (window.device.mobile || window.device.tablet) {
3204        return;
3205    }
3206
3207    var $onlinetools = document.querySelectorAll('[data-popup="true"]'),
3208        $onlinetool;
3209
3210    for (var i = 0, len = $onlinetools.length; i < len; i++) {
3211        $onlinetool = new OnlinetoolPopup($onlinetools[i]);
3212
3213        $onlinetool.init();
3214
3215        if ($onlinetool.id === window.location.hash) {
3216            $onlinetool.open();
3217        }
3218    }
3219})(document, window);
3220
3221/* Source common/js/scripts/99_benefit_slide.js */
3222
3223// KARRIEREPAKET VORTEILE SLIDES
3224// -------------------------------------------------------------------------------------------------
3225
3226(function(document) {
3227    var next = document.querySelectorAll('.kpt_benefit_entry .navigation .next'),
3228        prev = document.querySelectorAll('.kpt_benefit_entry .navigation .prev'),
3229        kpt_benefit_entries = document.querySelectorAll('.kpt_benefit_entry');
3230
3231    for (var i = 0, nextbutton; nextbutton = next[i]; i++) {
3232        nextbutton.addEventListener('click', function(event) {
3233            this.parentNode.parentNode.classList.add('show');
3234        });
3235    }
3236
3237    for (var i = 0, prevbutton; prevbutton = prev[i]; i++) {
3238        prevbutton.addEventListener('click', function(event) {
3239            this.parentNode.parentNode.classList.remove('show');
3240        });
3241    }
3242}(document));
3243
3244/* Source common/js/scripts/99_job_filter.js */
3245
3246// JOB FILTER BLITZBEWERBUNG
3247// -------------------------------------------------------------------------------------------------
3248
3249(function(document) {
3250    var JobFilter = function($location_select) {
3251        this.$select = $location_select;
3252        this.$select_buttons = this.$select.querySelectorAll('a[data-locality]');
3253        this.$form  = this.$select.closest('form');
3254        this.$jobs = this.$form.querySelectorAll('.select_location_option');
3255        this.locality = new Set();
3256    };
3257
3258    JobFilter.prototype = {
3259        init: function() {
3260            this.setup_buttons();
3261            this.handle_jobs();
3262        },
3263
3264        setup_buttons: function() {
3265            for (let $button of this.$select_buttons) {
3266                $button.addEventListener('click', (e) => {
3267                    let loc = $button.getAttribute('data-locality');
3268                    this.set_localities(loc);
3269                    $button.classList.toggle('active');
3270                    e.preventDefault();
3271                });
3272            }
3273        },
3274
3275        set_localities: function(loc) {
3276            if (this.locality.has(loc)) {
3277                this.locality.delete(loc);
3278            } else {
3279                this.locality.add(loc);
3280            }
3281
3282            this.handle_jobs();
3283        },
3284
3285        handle_jobs: function() {
3286            for (let $job of this.$jobs) {
3287                let data_locs = new Set($job.getAttribute('data-locality').split(' '));
3288
3289                for (let loc of data_locs) {
3290                    if (this.locality.size && this.locality.has(loc)) {
3291                        $job.classList.remove('hide');
3292                        break;
3293                    } else if (!this.locality.size) {
3294                        $job.classList.remove('hide');
3295                    } else {
3296                        $job.classList.add('hide');
3297                        $job.querySelector('input').checked = false;
3298                    }
3299                }
3300            }
3301        }
3302    }
3303
3304    var $location_selects = document.querySelectorAll('.select_location_wrapper');
3305
3306    for (let $location_select of $location_selects) {
3307        new JobFilter($location_select).init();
3308    }
3309
3310}(document));
3311
3312/* Source common/js/scripts/99_kpt_interview_card.js */
3313
3314(function(document) {
3315
3316    var CardFlipper = function($interview_overview) {
3317        var _this = this;
3318
3319        _this.$overview = $interview_overview;
3320        _this.$interviews = _this.$overview.querySelectorAll('.kpt_interview');
3321    };
3322
3323    CardFlipper.prototype = {
3324        init: function() {
3325            var _this = this;
3326
3327            for (var i = 0; i < _this.$interviews.length; i++) {
3328                var $interview = _this.$interviews[i];
3329
3330                $interview.addEventListener('click', function() {
3331                    _this._flip_element(this);
3332                });
3333
3334                $interview.addEventListener('keydown', function(event) {
3335                    if (event.keyCode == 13) { // Enter
3336                        _this._flip_element(this);
3337                    }
3338                });
3339            }
3340        },
3341
3342        _flip_element: function($element) {
3343            $element.classList.toggle("flip");
3344        }
3345    }
3346
3347    var $interview_overviews = document.querySelectorAll('.kpt_interview_overview.card');
3348
3349    for (var i = 0; i < $interview_overviews.length; i++) {
3350        new CardFlipper($interview_overviews[i]).init();
3351    }
3352}(document));
3353
3354/* Source common/js/scripts/99_team_popup.js */
3355
3356// Team Popup
3357(function(document) {
3358    var $entries = document.querySelectorAll('.team_overview_popup .entry');
3359
3360    if (!$entries && $entries.length < 1) {
3361        return;
3362    }
3363
3364    function init() {
3365        for (var i = 0; i < $entries.length; i++) {
3366            $entries[i].$pop_up  = $entries[i].querySelector('.popup_info');
3367
3368            if ($entries[i].$pop_up) {
3369                var $callers    = $entries[i].querySelectorAll('.caller'), // Es kann mehrere Aufrufer geben
3370                    $close      = $entries[i].querySelector('.close');
3371
3372                for (var h = 0; h < $callers.length; h++) {
3373                    $callers[h].$pop_up = $entries[i].$pop_up;
3374
3375                    $callers[h].addEventListener('click', function(event) {
3376                        event.preventDefault();
3377                        this.$pop_up.classList.add('show');
3378                    });
3379                }
3380
3381                // ESC Taste gedrückt?
3382                document.addEventListener('keydown', function(event) {
3383                    if (event.which === 27) {
3384                        for (var h = 0; h < $entries.length; h++) {
3385                            var $entry = $entries[h].$pop_up;
3386
3387                            if ($entry && $entry.classList.contains('show')) {
3388                                $entry.classList.remove('show');
3389                            }
3390                        }
3391                    }
3392                });
3393
3394                $close.$pop_up = $entries[i].$pop_up;
3395                $close.addEventListener('click', function() {
3396                    this.$pop_up.classList.remove('show');
3397                });
3398            }
3399        }
3400    }
3401
3402    init();
3403}(document));
3404

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.