PageSourceSearch

https://www.gob-stbg.de/static/generated/js/scripts.js?timestamp=1715940373

js gob-stbg.de collected 2026-10-06 04:06:25 UTC 144,443 bytes, 4,249 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                _this.$number.innerHTML = _this._commafy(Math.abs(Math.floor(current)));
67
68            }, _this.update);
69        },
70
71        _commafy: function(num) {
72            var _this = this,
73                str = num.toString().split('.');
74
75            if (str[0].length >= 4) {
76                str[0] = str[0].replace(/(\d)(?=(\d{3})+$)/g, '$1.');
77            }
78
79            if (str[1] && str[1].length >= 4) {
80                str[1] = str[1].replace(/(\d{3})/g, '$1 ');
81            }
82            return str.join('.');
83        }
84
85    };
86
87    var $counters = document.querySelectorAll('[data-counter]');
88
89    for (var i = 0, $counter; $counter = $counters[i]; i++) {
90        new CountNumber($counter).init();
91    }
92
93})(document);
94
95/* Source common/js/scripts/100_word_style.js */
96
97(function() {
98    var word = "GOB",
99        queue = [document.body],
100        curr
101    ;
102
103    while (curr = queue.pop()) {
104        if (!curr.textContent.match(word)) continue;
105        for (var i = 0; i < curr.childNodes.length; ++i) {
106            switch (curr.childNodes[i].nodeType) {
107                case Node.TEXT_NODE : // 3
108                    if (curr.childNodes[i].textContent.match(word)) {
109                        var txt = curr.innerHTML;
110                        var repl = txt !== undefined && txt.replace('GOB', '<span class="word_transform">GOB</span>') || txt;
111                        
112                        curr.innerHTML = repl;
113                    }
114                    break;
115                case Node.ELEMENT_NODE : // 1
116                    queue.push(curr.childNodes[i]);
117                    break;
118            }
119        }
120    }
121}());
122
123/* Source common/js/scripts/101_job_filter.js */
124
125// Ansprechpartner Filter
126// Wird verwendet um die Ansprechpartner nach Standort zu filtern und nach den Namen zu suchen
127// -------------------------------------------------------------------------------------------------
128
129(function(document) {
130
131    var JobFilter = function($filter_wrapper) {
132        var _this = this;
133
134        _this.$filter_wrapper          = $filter_wrapper;
135        _this.$job_overview           = _this.$filter_wrapper.parentNode;
136        _this.$search_entities         = _this.$job_overview.querySelectorAll('.search_entity');
137        _this.$location_filter         = _this.$job_overview.querySelector('.location_filter');
138        // _this.$search_team_input       = _this.$filter_wrapper.querySelector('input');
139    }
140
141    JobFilter.prototype = {
142        init: function() {
143            var _this  = this;
144            
145            if(_this.$location_filter) {
146                _this.$location_filter_buttons = _this.$location_filter.querySelectorAll('.button');
147
148                for(var i = 0; i < _this.$location_filter_buttons.length; i++) {
149                    _this.$location_filter_buttons[i].addEventListener('click', function() {
150                        _this._update_location_filter(this);
151                    })
152                }
153            }
154        },
155
156        _update_location_filter: function(button) {
157            var _this         = this;
158            var location_term = button.getAttribute('data-location');
159
160            _this._remove_active_from_buttons();
161            button.classList.add('active');
162
163            // _this._update_team_image(location_term);
164
165            if(location_term === 'all') {
166                _this._show_all_entities_by_location();
167            }
168            else {
169                _this._hide_all_entities_by_location();
170                _this._show_selected_location_entities(location_term);
171            }
172        },
173
174        _show_all_entities_by_location: function() {
175            var _this = this;
176            var active_jobs = 0;
177            var no_job = document.getElementsByClassName('no_job');
178
179            for(var i = 0; i < _this.$search_entities.length; i++) {
180                _this.$search_entities[i].classList.remove('hideme_location');
181                active_jobs++;
182            }
183
184            for(var j = 0; j < no_job.length; j++) {
185
186                if(active_jobs === 0) {
187                    no_job[j].classList.remove('hidden');
188                }
189                else {
190
191                    if(no_job[j].classList.contains('hidden') === false) {
192                        no_job[j].classList.add('hidden');
193                    }
194                }
195            }
196        },
197
198        _hide_all_entities_by_location: function() {
199            var _this = this;
200
201            for(var i = 0; i < _this.$search_entities.length; i++) {
202                _this.$search_entities[i].classList.add('hideme_location');
203            }
204        },
205
206        _show_selected_location_entities: function(location_term) {
207            var _this = this;
208            var active_jobs = 0;
209            var no_job = document.getElementsByClassName('no_job');
210
211
212            for(var i = 0; i < _this.$search_entities.length; i++) {
213                if(_this.$search_entities[i].classList.contains(location_term)) {
214                    _this.$search_entities[i].classList.remove('hideme_location');
215                    active_jobs++;
216                }
217            }
218
219            for(var j = 0; j < no_job.length; j++) {
220
221                if(active_jobs === 0) {
222                    no_job[j].classList.remove('hidden');
223                }
224                else {
225
226                    if(no_job[j].classList.contains('hidden') === false) {
227                        no_job[j].classList.add('hidden');
228                    }
229                }
230            }
231        },
232
233        _remove_active_from_buttons: function() {
234            var _this = this;
235
236            for(var i = 0; i < _this.$location_filter_buttons.length; i++) {
237                _this.$location_filter_buttons[i].classList.remove('active');
238            }
239        },
240
241        // _update_search_filter: function(input) {
242        //     var _this = this;
243        //     var value = input.value;
244        //
245        //     if(value.length <= 0) {
246        //         _this._show_all_entities_by_search_input();
247        //     }
248        //     else {
249        //         _this._hide_all_entities_by_search_input();
250        //         _this._show_selected_search_entities(value);
251        //     }
252        // },
253
254        // _show_all_entities_by_search_input: function() {
255        //     var _this = this;
256        //
257        //     for(var i = 0; i < _this.$search_entities.length; i++) {
258        //         _this.$search_entities[i].classList.remove('hideme_search_input');
259        //     }
260        // },
261        //
262        // _hide_all_entities_by_search_input: function() {
263        //     var _this = this;
264        //
265        //     for(var i = 0; i < _this.$search_entities.length; i++) {
266        //         _this.$search_entities[i].classList.add('hideme_search_input');
267        //     }
268        // },
269        //
270        // _show_selected_search_entities: function(term) {
271        //     var _this = this;
272        //
273        //     for(var i = 0; i < _this.$search_entities.length; i++) {
274        //         var entity      = _this.$search_entities[i];
275        //         var name_title  = entity.querySelector('.name_title').innerHTML.toLowerCase();
276        //         var job_title   = entity.querySelector('.job_title').innerHTML.toLowerCase();
277        //         var search_term = term.toLowerCase();
278        //
279        //         if(name_title.indexOf(search_term) !== -1 || job_title.indexOf(search_term) !== -1) {
280        //             _this.$search_entities[i].classList.remove('hideme_search_input');
281        //         }
282        //     }
283        // }
284    };
285
286    var $job_filters = document.querySelectorAll('.location_filter_wrapper');
287
288    for (var i = 0; i < $job_filters.length; i++) {
289        new JobFilter($job_filters[i]).init();
290    }
291
292})(document, window);
293
294/* Source common/js/scripts/102_germany_map.js */
295
296// Standorte Karte
297
298/* Maße -----------
299Karte                                           638     866
300
301Standort            data-id                     x       y       x%  y%
302Aschersleben        standort_aschersleben       386     370
303Bad Dürrenberg      standort_bad_duerrenberg    427     421
304Bergen auf Rügen    standort_bergen_auf_ruegen  508     68
305Berlin              standort_berlin             518     281
306Burg                standort_burg               414     310
307Haldensleben        standort_haldensleben       383     308
308Halle               standort_halle              418     398
309Leipzig             standort_leipzig            454     418
310Luckenwalde         standort_luckenwalde        507     332
311Magdeburg           standort_magdeburg          402     335
312Staßfurt            standort_stassfurt          398     360
313Stendal             standort_stendal            408     269
314Tangemünde          standort_tangemuende        418     281
315Verden              standort_verden_aller_      242     245
316Zeitz               standort_zeitz              435     447
317Zerbst              standort_zerbst_anhalt             431     344
318*/
319
320(function() {
321    var karte_xy = {x:638, y:866},
322        standort_aschersleben = {name:'standort_aschersleben', x:386, y:370},
323        standort_bad_duerrenberg = {name:'standort_bad_duerrenberg', x:427, y:421},
324        standort_bergen_auf_ruegen = {name:'standort_bergen_auf_ruegen', x:508, y:68},
325        standort_berlin = {name:'standort_berlin', x:518, y:281},
326        standort_burg = {name:'standort_burg', x:414, y:310},
327        standort_haldensleben = {name:'standort_haldensleben', x:383, y:308},
328        standort_halle = {name:'standort_halle', x:418, y:398},
329        standort_leipzig = {name:'standort_leipzig', x:454, y:418},
330        standort_luckenwalde = {name:'standort_luckenwalde', x:507, y:332},
331        standort_magdeburg = {name:'standort_magdeburg', x:402, y:335},
332        standort_stassfurt = {name:'standort_stassfurt', x:398, y:360},
333        standort_stendal = {name:'standort_stendal', x:408, y:269},
334        standort_tangermuende = {name:'standort_tangermuende', x:418, y:281},
335        standort_verden_aller_ = {name:'standort_verden_aller_', x:242, y:245},
336        standort_zeitz = {name:'standort_zeitz', x:435, y:447},
337        standort_zerbst_anhalt = {name:'standort_zerbst_anhalt', x:431, y:344},
338        standorte = [standort_aschersleben, standort_bad_duerrenberg, standort_bergen_auf_ruegen,
339                     standort_berlin, standort_burg, standort_haldensleben, standort_halle,
340                     standort_leipzig, standort_luckenwalde, standort_magdeburg, standort_stassfurt,
341                     standort_stendal, standort_tangermuende, standort_verden_aller_, standort_zeitz, standort_zerbst_anhalt];
342
343    var karte = document.querySelector('.map_locations');
344
345    if (!karte) return;
346
347    var karte_width = karte.clientWidth,
348        karte_height = karte.clientHeight,
349        dot = document.createElement('div'),
350        standorte_links = document.querySelector('.standorte_links').children
351
352    if (!standorte_links) return;
353
354
355    for (var i = 0; i < standorte_links.length; i++) {
356        standorte_links[i].addEventListener('mouseover', fade_in);
357        standorte_links[i].addEventListener('mouseout', fade_out);
358    }
359
360    function fade_in() {
361        var dot_active = document.getElementById(this.dataset.id)
362
363        dot_active.style.opacity = 1;
364    }
365
366    function fade_out() {
367        var dot_active = document.getElementById(this.dataset.id)
368
369        dot_active.style.opacity = 0;
370    }
371
372    function first_init() {
373        for (var i = 0; i < standorte.length; i++) {
374            convert_coordinates_to_percent(standorte[i]);
375            create_dot(standorte[i]);
376        }
377    }
378
379    function convert_coordinates_to_percent(standort) {
380        standort.x = (100 * standort.x / karte_xy.x);
381        standort.y = (100 * standort.y / karte_xy.y);
382    }
383
384    function create_dot(standort) {
385        var new_dot = document.createElement('div');
386
387        new_dot.classList.add('dot');
388        new_dot.id = standort.name;
389        new_dot.style.left = standort.x + '%';
390        new_dot.style.top = standort.y + '%';
391        karte.appendChild(new_dot);
392    }
393
394    first_init();
395
396}());
397
398/* Source common/js/scripts/20_cookie_banner.js */
399
400// COOKIE-HINWEIS
401// -------------------------------------------------------------------------------------------------
402
403/*
404(function(document) {
405    var $cookie_banner = document.querySelector('#cookie_banner'),
406        $body          = document.querySelector('body');
407
408    if (!$cookie_banner) {
409        return;
410    }
411
412    var $close  = $cookie_banner.querySelector('.close'),
413        now     = new Date().getTime(),
414        storage = localStorage.getItem(domain + '_cookie_banner');
415
416    if (storage === null || now > storage) {
417        $cookie_banner.classList.remove('hideme');
418        $body.classList.add('cb_visible');
419    } else {
420        $cookie_banner.classList.add('hideme');
421    }
422
423    $close.addEventListener('click', function(event) {
424        event.preventDefault();
425
426        localStorage.setItem(domain + '_cookie_banner', now + 31536000);
427        $cookie_banner.classList.add('hideme');
428        $body.classList.remove('cb_visible');
429    });
430}(document));
431*/
432/* Source common/js/scripts/21_cookie_banner_insert_spacing_footer.js */
433
434// COOKIE-HINWEIS FUSSZEILE VERLÄNGERN
435// -------------------------------------------------------------------------------------------------
436/*
437
438(function(document) {
439    var $cookie_banner  = document.querySelector('#cookie_banner'),
440        $footer         = document.querySelector('footer'),
441        $close          = $cookie_banner.querySelector('.close'),
442        $cookie_spacing;
443
444    if (!$cookie_banner) {
445        return;
446    }
447
448    $close.addEventListener('click', function() {
449        if ($footer) {
450            $footer.removeChild($cookie_spacing);
451        }
452    });
453
454    if ($footer) {
455        $cookie_spacing = document.createElement('div');
456        $footer.appendChild($cookie_spacing);
457        $cookie_spacing.style.paddingBottom = $cookie_banner.clientHeight + 'px';
458        window.addEventListener('resize', function() {
459            $cookie_spacing.style.paddingBottom = $cookie_banner.clientHeight + 'px';
460        }, false);
461    }
462
463}(document));
464*/
465
466/* Source common/js/scripts/40_dropdown_menu.js */
467
468// DROPDOWN MENU
469// -------------------------------------------------------------------------------------------------
470
471(function(document) {
472    var DropdownMenu = function($dropdown_menu) {
473        var _this = this,
474            id    = $dropdown_menu.getAttribute('id');
475
476        _this.$dropdown_menu                   = $dropdown_menu;
477        _this.$main_menuitems                  = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li > a');
478        _this.$sub_menuitems                   = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li li > a');
479        _this.$sub_menuitems_with_sub_sub_menu = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li li > a.has_sub_sub_menu');
480        _this.$main_menuitems_with_sub_menu    = $dropdown_menu.querySelectorAll('#' + id + ' > ul > li > a[aria-controls]');
481        _this.main_menu_index                  = 0;
482        _this.event_type                       = false;
483
484        _this.$key = {
485            'tab'         : 9,
486            'enter'       : 13,
487            'escape'      : 27,
488            'space'       : 32,
489            'arrow_left'  : 37,
490            'arrow_up'    : 38,
491            'arrow_right' : 39,
492            'arrow_down'  : 40
493        };
494    };
495
496    DropdownMenu.prototype = {
497        init: function() {
498            var _this = this;
499
500            _this._init_accessibility();
501            _this._init_keyboard();
502
503            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems[i]; i++) {
504                var $li = $main_menuitem.parentElement;
505
506                $li.addEventListener('mouseenter',
507                    _this._on_mouseenter_main_menuitem.bind(_this, $main_menuitem)
508                );
509
510                $li.addEventListener('mouseover',
511                    _this._on_mouseover_main_menuitem.bind(_this, $main_menuitem)
512                );
513
514                $li.addEventListener('mouseout',
515                    _this._on_mouseout_main_menuitem.bind(_this)
516                );
517
518                $main_menuitem.addEventListener('focus',
519                    _this._on_focus_main_menuitem.bind(_this, $main_menuitem)
520                );
521            }
522        },
523
524        _init_accessibility: function() {
525            var _this = this;
526
527            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
528                $main_menuitem.setAttribute('aria-expanded', 'false');
529
530                $main_menuitem.addEventListener('click', function(event) {
531                    event.preventDefault();
532                });
533            }
534        },
535
536        _init_keyboard: function() {
537            var _this = this;
538
539            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems[i]; i++) {
540                $main_menuitem.addEventListener('keydown',
541                    _this._on_keydown_main_menuitem.bind(_this, $main_menuitem)
542                );
543            }
544
545            for (var j = 0, $sub_menuitem; $sub_menuitem = _this.$sub_menuitems[j]; j++) {
546                $sub_menuitem.addEventListener('keydown',
547                    _this._on_keydown_sub_menuitem.bind(_this, $sub_menuitem)
548                );
549            }
550        },
551
552        _on_keydown_main_menuitem: function($main_menuitem, event) {
553            var _this = this;
554
555            _this.event_type      = event.type;
556            _this.main_menu_index = _this._get_main_menuitem_index();
557            _this.$main_menuitem  = $main_menuitem;
558            _this.$sub_menu       = $main_menuitem.nextElementSibling;
559
560            switch(event.keyCode) {
561                case _this.$key.tab:
562                    if (event.shiftKey) {
563                        _this.main_menu_index -= 1;
564                    }
565                    else {
566                        _this.main_menu_index += 1;
567                    }
568
569                    break;
570
571                case _this.$key.enter:
572                    if (_this.$sub_menu) {
573                        event.preventDefault();
574                        _this._close_sub_menus();
575                        this._open_sub_menu(false);
576                    }
577
578                    break;
579
580                case _this.$key.escape:
581                    event.preventDefault();
582
583                    if (_this.sub_menu_is_open) {
584                        event.stopPropagation();
585                    }
586
587                    _this._close_sub_menu();
588
589                    break;
590
591                case _this.$key.arrow_left:
592                    event.preventDefault();
593
594                    _this._focus_prev_main_menuitem();
595
596                    break;
597
598                case _this.$key.arrow_up:
599                    event.preventDefault();
600
601                    if (_this.sub_menu_is_open) {
602                        _this._focus_prev_menuitem();
603                    }
604
605                    break;
606
607                case _this.$key.arrow_right:
608                    event.preventDefault();
609
610                    _this._focus_next_main_menuitem();
611
612                    break;
613
614                case _this.$key.arrow_down:
615                    event.preventDefault();
616
617                    if (_this.$sub_menu) {
618                        this._open_sub_menu(false);
619                    }
620                    else {
621                        _this._focus_next_main_menuitem();
622                    }
623
624                    break;
625            }
626        },
627
628        _get_main_menuitem_index: function() {
629            var _this = this;
630
631            return Array.prototype.indexOf.call(_this.$main_menuitems, document.activeElement);
632        },
633
634        _focus_prev_menuitem: function() {
635            var _this = this;
636
637            _this.main_menu_index -= 1;
638
639            if (_this.main_menu_index < 0) {
640                _this.main_menu_index = 0;
641
642                return;
643            }
644
645            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
646            _this.$sub_menu      = _this.$main_menuitem.nextElementSibling;
647
648            if (_this.$sub_menu && _this.sub_menu_is_open) {
649                this._open_sub_menu(true);
650            }
651            else {
652                _this.$main_menuitem.focus();
653            }
654        },
655
656        _focus_prev_main_menuitem: function() {
657            var _this = this;
658
659            _this.main_menu_index -= 1;
660
661            if (_this.main_menu_index < 0) {
662                _this.main_menu_index = 0;
663
664                return;
665            }
666
667            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
668
669            _this.$main_menuitem.focus();
670        },
671
672        _focus_next_main_menuitem: function() {
673            var _this = this;
674
675            _this.main_menu_index += 1;
676
677            if (_this.main_menu_index === _this.$main_menuitems.length) {
678                _this.main_menu_index = _this.$main_menuitems.length - 1;
679
680                return;
681            }
682
683            _this.$main_menuitem = _this.$main_menuitems[_this.main_menu_index];
684
685            _this.$main_menuitem.focus();
686        },
687
688        _on_mouseenter_main_menuitem: function($main_menuitem, event) {
689            var _this = this;
690
691            _this.event_type     = event.type;
692            _this.$main_menuitem = $main_menuitem;
693            _this.$sub_menu      = $main_menuitem.nextElementSibling;
694
695            _this._close_sub_menus();
696
697            if (_this.$sub_menu) {
698                _this._open_sub_menu(false);
699            }
700        },
701
702        _on_mouseover_main_menuitem: function() {
703            var _this = this;
704
705            clearTimeout(_this.close_sub_menu_timeout);
706        },
707
708        _on_mouseout_main_menuitem: function() {
709            var _this = this;
710
711            _this.close_sub_menu_timeout = setTimeout(function() {
712                _this._close_sub_menus();
713            }, 1000);
714        },
715
716        _on_focus_main_menuitem: function($main_menuitem, event) {
717            var _this = this;
718
719            _this.event_type = event.type;
720
721            if (_this.sub_menu_is_open) {
722                _this.$main_menuitem = $main_menuitem;
723                _this.$sub_menu      = $main_menuitem.nextElementSibling;
724
725                _this._close_sub_menus();
726
727                if (_this.$sub_menu) {
728                    _this._open_sub_menu();
729                }
730            }
731        },
732
733        _on_keydown_sub_menuitem: function($sub_menuitem, event) {
734            var _this = this;
735
736            switch(event.keyCode) {
737                case _this.$key.tab:
738
739                    if (event.shiftKey) {
740                        _this.sub_menu_index -= 1;
741                    }
742                    else {
743                        _this.sub_menu_index += 1;
744                    }
745
746                    break;
747
748                case _this.$key.escape:
749                    event.preventDefault();
750                    event.stopPropagation();
751
752                    _this._close_sub_menu();
753
754                    break;
755
756                case _this.$key.arrow_left:
757                    event.preventDefault();
758
759                    _this.sub_menu_index = 0;
760                    _this._focus_prev_sub_menuitem();
761
762                    break;
763
764                case _this.$key.arrow_up:
765                    event.preventDefault();
766
767                    _this._focus_prev_sub_menuitem();
768
769                    break;
770
771                case _this.$key.arrow_right:
772                    event.preventDefault();
773
774                    _this.sub_menu_index = 0;
775                    _this._focus_prev_sub_menuitem();
776
777                    break;
778
779                case _this.$key.arrow_down:
780                    event.preventDefault();
781
782                    _this._focus_next_sub_menuitem();
783
784                    break;
785            }
786
787            _this._open_sub_sub_menu();
788        },
789
790        _open_sub_sub_menu: function() {
791            var _this          = this;
792                $sub_menuitem  = _this.$main_menuitem.nextElementSibling.querySelectorAll('li li > a')[_this.sub_menu_index];
793
794            if($sub_menuitem) {
795
796                for (var i = 0, $menuitem; $menuitem = _this.$sub_menuitems[i]; i++) {
797                    var is_current_menuitem    = $sub_menuitem === $menuitem,
798                        $sub_sub_menu          = $sub_menuitem.parentNode.querySelector('ul');
799                        is_sub_sub_menuitem    = $sub_menuitem.classList.contains('sub_sub_menuitem');
800
801                    if (is_current_menuitem && $sub_sub_menu) {
802                        $menuitem.parentElement.classList.add('hover');
803                        $menuitem.setAttribute('aria-expanded', true);
804                    }
805
806                    else if (is_current_menuitem && is_sub_sub_menuitem) {
807                        $menuitem.parentElement.parentElement.parentElement.classList.add('hover');
808                        $menuitem.parentElement.parentElement.parentElement.setAttribute('aria-expanded', true);
809                    }
810
811                    else {
812                        $menuitem.parentElement.classList.remove('hover');
813                        $menuitem.setAttribute('aria-expanded', false);
814                    }
815                }
816            }
817
818            else {
819                _this._close_sub_sub_menus();
820            }
821        },
822
823        _close_sub_sub_menus: function() {
824            var _this = this;
825
826            for (var i = 0, $sub_menuitem; $sub_menuitem = _this.$sub_menuitems_with_sub_sub_menu[i]; i++) {
827                $sub_menuitem.parentElement.classList.remove('hover');
828                $sub_menuitem.setAttribute('aria-expanded', 'false');
829            }
830        },
831
832        _focus_prev_sub_menuitem: function() {
833            var _this          = this,
834                $sub_menuitems = _this.$main_menuitem.nextElementSibling.querySelectorAll('a'),
835                $sub_menuitem,
836                $main_menuitem;
837
838            _this.sub_menu_index -= 1;
839
840            $sub_menuitem = $sub_menuitems[_this.sub_menu_index];
841
842            if (_this.sub_menu_index < 0) {
843                $main_menuitem = _this.$main_menuitems[_this.main_menu_index];
844
845                if ($main_menuitem) {
846                    $main_menuitem.focus();
847                }
848            }
849            else if ($sub_menuitem) {
850                $sub_menuitem.focus();
851            }
852        },
853
854        _focus_next_sub_menuitem: function() {
855            var _this          = this,
856                $sub_menuitems = _this.$main_menuitem.nextElementSibling.querySelectorAll('a'),
857                $sub_menuitem,
858                $main_menuitem;
859
860            _this.sub_menu_index += 1;
861
862            $sub_menuitem = $sub_menuitems[_this.sub_menu_index];
863
864            if (_this.sub_menu_index === $sub_menuitems.length) {
865                _this.main_menu_index += 1;
866
867                $main_menuitem = _this.$main_menuitems[_this.main_menu_index];
868
869                if ($main_menuitem) {
870                    $main_menuitem.focus();
871                }
872                else {
873                    _this.main_menu_index -= 1;
874                    _this.sub_menu_index  -= 1;
875                }
876            }
877            else {
878                $sub_menuitem.focus();
879            }
880        },
881
882        _open_sub_menu: function(focus_last_sub_menuitem) {
883            var _this = this,
884                $sub_menuitems;
885
886            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
887                var is_current_menuitem = _this.$main_menuitem === $main_menuitem;
888
889                if (is_current_menuitem) {
890                    $main_menuitem.parentElement.classList.add('hover');
891                }
892                else {
893                    $main_menuitem.parentElement.classList.remove('hover');
894                }
895
896                $main_menuitem.setAttribute('aria-expanded', is_current_menuitem);
897            }
898
899            _this.sub_menu_index = 0;
900
901            if (_this.event_type === 'keydown') {
902                $sub_menuitems = _this.$sub_menu.querySelectorAll('a');
903
904                if (focus_last_sub_menuitem) {
905  
905                  _this.sub_menu_index = $sub_menuitems.length - 1;
906                }
907
908                $sub_menuitems[_this.sub_menu_index].focus();
909
910                _this.event_type = false;
911            }
912
913            _this.sub_menu_is_open = true;
914        },
915
916        _close_sub_menu: function() {
917            var _this = this;
918
919            _this.$main_menuitem.parentElement.classList.remove('hover');
920            _this.$main_menuitem.setAttribute('aria-expanded', 'false');
921
922            _this.sub_menu_is_open = false;
923
924            _this.$main_menuitem.focus();
925        },
926
927        _close_sub_menus: function() {
928            var _this = this;
929
930            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
931                $main_menuitem.parentElement.classList.remove('hover');
932                $main_menuitem.setAttribute('aria-expanded', 'false');
933            }
934
935            _this._close_sub_sub_menus();
936        }
937    };
938
939    var $dropdown_menu = document.getElementsByClassName('dropdown_menu');
940
941    for (var i = 0, len = $dropdown_menu.length; i < len; i++) {
942        new DropdownMenu($dropdown_menu[i]).init();
943    }
944})(document);
945
946/* Source common/js/scripts/41_dropdown_menu_onepage.js */
947
948// DROPDOWN MENU
949// -------------------------------------------------------------------------------------------------
950
951(function(document) {
952    var DropdownMenuActiveItem = function($dropdown_menu, $sections) {
953        var _this = this,
954            id    = $dropdown_menu.getAttribute('id');
955
956        _this.$dropdown_menu = $dropdown_menu;
957        _this.$sections      = $sections;
958        _this.$menuitems     = $dropdown_menu.querySelectorAll('#' + id + ' > ul a');
959
960        // Sprachvariable für aktiven Bereich
961        _this.lang_active_area = _this.$dropdown_menu.getAttribute('data-lang-active_area');
962
963        // Scroll Event Timer
964        _this.$scrollTimer;
965        _this.lastScrollFireTime = 0;
966        _this.minScrollTime = 300;
967
968        // "aktiver Bereich"
969        _this.offset_height = window.innerHeight * 0.3;
970    };
971
972    DropdownMenuActiveItem.prototype = {
973        init: function() {
974            var _this = this;
975
976            _this._check_active();
977
978            window.addEventListener('scroll', function() {
979                var $now = new Date().getTime();
980
981                if (!_this.scrollTimer) {
982                    if ($now - _this.lastScrollFireTime > _this.minScrollTime) {
983                        // fire immediately on first scroll
984                        _this._check_active();
985                        _this.lastScrollFireTime = $now;
986                    }
987
988                    scrollTimer = setTimeout(function() {
989                        _this.scrollTimer = null;
990                        _this.lastScrollFireTime = new Date().getTime();
991                        _this._check_active();
992                    }, _this.minScrollTime);
993                }
994            });
995
996            window.addEventListener('resize', function() {
997                _this.offset_height = window.innerHeight * 0.3;
998            });
999        },
1000
1001        _check_active: function() {
1002            var _this = this,
1003                window_offset = window.scrollY + _this.offset_height,
1004                $active_element_ids = [];
1005
1006            for (var i = 0; i < _this.$sections.length; i++) {
1007                var $item = _this.$sections[i],
1008                    target_offset = $item.getBoundingClientRect().top +  document.documentElement.scrollTop,
1009                    target_offset_height = target_offset + $item.getBoundingClientRect().height;
1010
1011                if (target_offset < window_offset && window_offset < target_offset_height) {
1012                    _this._set_active_state_in_menu($item.id);
1013                } else {
1014                    _this._remove_active_state_in_menu($item.id);
1015                }
1016            }
1017        },
1018
1019        _set_active_state_in_menu: function($active_element_id) {
1020            var _this = this,
1021                $menu_item = _this.$dropdown_menu.querySelector('[href$="#' + $active_element_id + '"]');
1022
1023            if ($menu_item) {
1024                $menu_item.classList.add('active');
1025                $menu_item.ariaLabel = $menu_item.innerText + ' (' + _this.lang_active_area + ')';
1026            }
1027        },
1028
1029        _remove_active_state_in_menu: function($active_element_id) {
1030            var _this = this,
1031                $menu_item = _this.$dropdown_menu.querySelector('[href$="#' + $active_element_id + '"]');
1032
1033            if ($menu_item) {
1034                $menu_item.classList.remove('active');
1035                $menu_item.removeAttribute('aria-label');
1036            }
1037        }
1038    };
1039
1040    var $dropdown_menu = document.getElementsByClassName('dropdown_menu'),
1041        $sections = document.querySelectorAll('.kpt_section_content > .section');
1042
1043    if ($sections) {
1044        for (var i = 0, len = $dropdown_menu.length; i < len; i++) {
1045            new DropdownMenuActiveItem($dropdown_menu[i], $sections).init();
1046        }
1047    }
1048
1049})(document);
1050
1051/* Source common/js/scripts/46_offcanvas_menu.js */
1052
1053// OFFCANVAS MENU
1054// -------------------------------------------------------------------------------------------------
1055
1056(function(document) {
1057    var OffCanvasMenu = function($toggle_offcanvas_menu) {
1058        var _this = this,
1059            controls;
1060
1061        controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls');
1062
1063        _this.$offcanvas_menu               = document.getElementById(controls);
1064        _this.$main_menuitems_with_sub_menu = _this.$offcanvas_menu.querySelectorAll('a[aria-controls]');
1065        _this.$focus_elements               = _this.$offcanvas_menu.querySelectorAll('a');
1066        _this.focus_element                 = false;
1067        _this.$offcanvas_menu_state         = false;
1068
1069        _this.$key = {
1070            'tab'    : 9,
1071        };
1072    };
1073
1074    OffCanvasMenu.prototype = {
1075        init: function() {
1076            var _this = this; 
1077
1078            _this._init_accessibility();
1079            _this._init_keyboard();
1080
1081            for (var j = 0, $main_menuitem_with_sub_menu; $main_menuitem_with_sub_menu = _this.$main_menuitems_with_sub_menu[j]; j++) {
1082                $main_menuitem_with_sub_menu.addEventListener('click',
1083                    _this._on_click_main_menuitem.bind(_this, $main_menuitem_with_sub_menu)
1084                );
1085            }
1086        },
1087
1088        _init_accessibility: function() {
1089            var _this = this;
1090
1091            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
1092                $main_menuitem.setAttribute('aria-expanded', $main_menuitem.classList.contains('active'));
1093            }
1094        },
1095
1096        _init_keyboard: function() {
1097            var _this = this;
1098
1099            document.addEventListener('keydown', function(event) {
1100                if (!_this.$offcanvas_menu_state.checked) {
1101                    return;
1102                }
1103
1104                if (event.keyCode === _this.$key.tab) {
1105                    event.preventDefault();
1106
1107                    if (event.shiftKey) {
1108                        _this._focus_element_with_shift_tab_key(event);
1109                    }
1110                    else {
1111                        _this._focus_element_with_tab_key(event);
1112                    }
1113                }
1114            });
1115        },
1116
1117        _focus_element_with_shift_tab_key: function() {
1118            var _this = this;
1119
1120            _this.tab_index -= 1;
1121
1122            if (_this.tab_index < 0) {
1123                _this.tab_index = _this.$focus_elements.length - 1;
1124            }
1125
1126            for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i--) {
1127                if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) {
1128                    _this.tab_index -= 1;
1129                    continue;
1130                }
1131
1132                _this.$focus_elements[_this.tab_index].focus();
1133                break;
1134            }
1135        },
1136
1137        _focus_element_with_tab_key: function() {
1138            var _this = this;
1139
1140            if (_this.tab_index === _this.$focus_elements.length - 1) {
1141                _this.tab_index = 0;
1142            }
1143            else {
1144                _this.tab_index += 1;
1145            }
1146
1147            for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i++) {
1148                if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) {
1149                    _this.tab_index += 1;
1150
1151                    if (_this.tab_index > _this.$focus_elements.length - 1) {
1152                        _this.tab_index = 0;
1153                    }
1154                    else {
1155                        continue;
1156                    }
1157                }
1158
1159                _this.$focus_elements[_this.tab_index].focus();
1160                break;
1161            }
1162        },
1163
1164        _on_click_main_menuitem: function($main_menuitem, event) {
1165            var _this = this;
1166
1167            event.preventDefault();
1168
1169            _this.$main_menuitem = $main_menuitem;
1170
1171            _this._toggle_sub_menus();
1172        },
1173
1174        _toggle_sub_menus: function() {
1175            var _this = this;
1176
1177            for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) {
1178                var is_active_menuitem = _this.$main_menuitem === $main_menuitem,
1179                    $parent_menuitems  = _this._get_parent_menu_elements();
1180
1181                if (is_active_menuitem) {
1182                    _this.sub_menu_is_open = $main_menuitem.getAttribute('aria-expanded') === 'false';
1183
1184                    $main_menuitem.parentElement.classList.toggle('expanded', _this.sub_menu_is_open);
1185                    $main_menuitem.setAttribute('aria-expanded', _this.sub_menu_is_open);
1186                }
1187                else if ($parent_menuitems.indexOf($main_menuitem) !== -1) { // Check parents
1188                    $main_menuitem.parentElement.classList.toggle('expanded', 'true');
1189                    $main_menuitem.setAttribute('aria-expanded', 'true');
1190                }
1191                else {
1192                    $main_menuitem.parentElement.classList.remove('expanded');
1193                    $main_menuitem.setAttribute('aria-expanded', 'false');
1194                }
1195            }
1196        },
1197
1198        _get_parent_menu_elements: function() {
1199            var _this = this.$main_menuitem,
1200                $findings = [];
1201
1202            while (_this.parentNode) {
1203                _this = _this.parentNode;
1204
1205                if (_this.nodeName.toLowerCase() === 'li') {
1206                    $findings.push(_this.querySelector('a'));
1207                }
1208            }
1209
1210            return $findings || False;
1211        }
1212    };
1213
1214    var OffCanvasMenuOpener = function($toggle_offcanvas_menu) {
1215        var _this = this;
1216        var  controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls');
1217
1218        _this.$toggle_offcanvas_menu = $toggle_offcanvas_menu.querySelector('label');
1219        _this.$open_offcanvas_menu   = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu');
1220        _this.$close_offcanvas_menu  = $toggle_offcanvas_menu.querySelector('.close_offcanvas_menu');
1221        _this.$offcanvas_menu_state  = document.querySelector('#' + _this.$toggle_offcanvas_menu.getAttribute('for'));
1222        _this.$offcanvas_menu        = document.getElementById(controls);
1223        _this.$focus_elements        = _this.$offcanvas_menu.querySelectorAll('a');
1224
1225        _this.$key = {
1226            'enter'  : 13,
1227            'escape' : 27,
1228            'space'  : 32
1229        };
1230    };
1231
1232    OffCanvasMenuOpener.prototype = {
1233        init: function() {
1234            var _this = this;
1235
1236            _this._init_keyboard();
1237
1238            _this.$toggle_offcanvas_menu.addEventListener('click', _this._toggle_menu.bind(_this));
1239            _this.$open_offcanvas_menu.addEventListener('click', _this._open_menu.bind(_this));
1240            _this.$close_offcanvas_menu.addEventListener('click', _this._close_menu.bind(_this));
1241
1242            _this.$offcanvas_menu.addEventListener('transitionend', function(event) {
1243
1244                // var _this = this;
1245                if (event.target !== this) {
1246                    return;
1247                }
1248
1249                if (_this.$offcanvas_menu_state.checked) {
1250                    if (_this.focus_element) {
1251                        _this.focus_element = false;
1252                        _this.$focus_elements[0].focus();
1253                    }
1254                }
1255                else if (_this.focus_element) {
1256                    _this.focus_element = false;
1257                    _this.$open_offcanvas_menu.focus();
1258                }
1259            });
1260        },
1261
1262        _init_keyboard: function() {
1263            var _this = this;
1264
1265            _this.$open_offcanvas_menu.addEventListener('keydown', function(event) {
1266                if (event.keyCode === _this.$key.space || event.keyCode === _this.$key.enter) {
1267                    _this.focus_element = true;
1268                }
1269
1270                if (event.keyCode === _this.$key.space) {
1271                    event.preventDefault();
1272                }
1273            });
1274
1275            _this.$close_offcanvas_menu.addEventListener('keydown', function(event) {
1276                if (event.keyCode === _this.$key.space) {
1277                    event.preventDefault();
1278                }
1279            });
1280
1281            document.addEventListener('keydown', function(event) {
1282                if (!_this.$offcanvas_menu_state.checked) {
1283                    return;
1284                }
1285
1286                if (event.keyCode === _this.$key.escape) {
1287                    _this.focus_element = true;
1288                    _this._close_menu(event);
1289                }
1290            });
1291        },
1292
1293        _scroll_to_top: function() {
1294            var _this = this;
1295
1296            setTimeout(function() {
1297                var duration = 300,
1298                    interval;
1299
1300                interval = setInterval(function() {
1301                    var diff = -window.pageYOffset,
1302                        step = diff / duration * 10;
1303
1304                    if (Math.abs(diff) <= Math.abs(step)) {
1305                        if (_this.$anchor) {
1306                            _this.$anchor.focus();
1307                        }
1308
1309                        clearInterval(interval);
1310                    }
1311
1312                    window.scrollBy(0, step);
1313                    duration -= 10;
1314                }, 10);
1315            }, 300);
1316        },
1317
1318        _toggle_menu: function(event) {
1319            var _this = this;
1320
1321            if (_this.$offcanvas_menu_state.checked) {
1322                _this._close_menu(event);
1323            }
1324            else {
1325                _this._open_menu(event);
1326            }
1327        },
1328
1329        _open_menu: function(event) {
1330            var _this = this;
1331
1332            event.preventDefault();
1333
1334            _this.$offcanvas_menu_state.checked = true;
1335            _this.tab_index = 0;
1336
1337            _this._scroll_to_top();
1338        },
1339
1340        _close_menu: function(event) {
1341            var _this = this;
1342
1343            event.preventDefault();
1344
1345            _this.$offcanvas_menu_state.checked = false;
1346            _this.tab_index = 0;
1347        }
1348    };
1349
1350    var $offcanvas_menu = document.getElementsByClassName('toggle_offcanvas_menu');
1351
1352    if ($offcanvas_menu.length) {
1353        new OffCanvasMenu($offcanvas_menu[0]).init(); // init once
1354
1355        // create an opener for each button
1356        for (var i = 0, len = $offcanvas_menu.length; i < len; i++) {
1357            new OffCanvasMenuOpener($offcanvas_menu[i]).init();
1358        }
1359    }
1360})(document);
1361
1362/* Source common/js/scripts/70_form_search_datalist.js */
1363
1364// FORMULARE: SUCHBEGRIFF-VORSCHLÄGE FÜR DIE SUCHE
1365// Wird gebraucht in: steuernews_search, search
1366// -------------------------------------------------------------------------------------------------
1367
1368(function(document) {
1369    var FormSearchDataList = function($form) {
1370        var _this = this;
1371
1372        _this.$form    = $form;
1373        _this.$search  = $form.querySelector('input[type="search"]');
1374        _this.$submit  = $form.querySelector('button[type="submit"]');
1375        _this.datalist = $form.getAttribute('data-datalist');
1376        _this.list     = _this.$search.getAttribute('list');
1377
1378        _this.datalist_loaded   = false;
1379        _this.datalist_inserted = false;
1380    };
1381
1382    FormSearchDataList.prototype = {
1383        init: function() {
1384            var _this = this;
1385
1386            _this.$form.addEventListener('submit', _this._submit.bind(this));
1387            _this.$search.addEventListener('focus', _this._focus.bind(this));
1388
1389            _this._init_keyboard();
1390            _this._get_datalist();
1391        },
1392
1393        _init_keyboard: function() {
1394            var _this = this,
1395                $key  = {
1396                    'enter' : 13
1397                };
1398
1399            _this.$search.addEventListener('keyup', function(event) {
1400                if (event.keyCode !== $key.enter) {
1401                    return;
1402                }
1403
1404                var url = _this._get_url();
1405
1406                if (url) {
1407                    location.href = url;
1408                }
1409            });
1410        },
1411
1412        _get_datalist: function() {
1413            var _this     = this,
1414                $datalist = sessionStorage.getItem(domain + '_datalist_search'),
1415                $ajax,
1416                $options;
1417
1418            if (!_this.datalist) {
1419                return;
1420            }
1421
1422            if ($datalist) {
1423                $options = _this._get_sorted_datalist($datalist);
1424                _this._create_datalist($options);
1425            }
1426            else {
1427                $ajax = new XMLHttpRequest();
1428                $ajax.open('GET', _this.datalist, true);
1429
1430                $ajax.onload = function() {
1431                    if (this.status === 200) {
1432                        sessionStorage.setItem(domain + '_datalist_search', this.responseText);
1433
1434                        $options = _this._get_sorted_datalist(this.responseText);
1435                        _this._create_datalist($options);
1436                    }
1437                };
1438
1439                $ajax.send();
1440            }
1441        },
1442
1443        _get_sorted_datalist: function($datalist) {
1444            var $options = JSON.parse($datalist);
1445
1446            $options = $options.sort(function($a, $b) {
1447                var a_value = $a.value.toLowerCase(),
1448                    b_value = $b.value.toLowerCase();
1449
1450                if (a_value < b_value) {
1451                    return -1;
1452                }
1453
1454                if (b_value < a_value) {
1455                    return 1;
1456                }
1457            });
1458
1459            return $options;
1460        },
1461
1462        _create_datalist: function($options) {
1463            var _this     = this,
1464                $datalist = document.createDocumentFragment(),
1465                $datalist_entry;
1466
1467            for (var i = 0, $option; $option = $options[i]; i++) {
1468                $datalist_entry = document.createElement('option');
1469
1470                if ($option.url) {
1471                    $datalist_entry.setAttribute('data-url', $option.url);
1472                }
1473
1474                if ($option.label && /Chrome\b/.test(navigator.userAgent)) {
1475                    if (!(/Edge\b/.test(navigator.userAgent))) {
1476                        $datalist_entry.setAttribute('label', $option.label);
1477                    }
1478                }
1479
1480                $datalist_entry.setAttribute('data-value', $option.value.toLowerCase());
1481                $datalist_entry.textContent = $option.value;
1482                $datalist.appendChild($datalist_entry);
1483            }
1484
1485            _this.$datalist = $datalist;
1486        },
1487
1488        _focus: function() {
1489            var _this = this;
1490
1491            if (_this.$datalist && !_this.datalist_inserted) {
1492                document.querySelector('#' + _this.list).appendChild(_this.$datalist);
1493                _this.datalist_inserted = true;
1494                _this.$submit.removeAttribute('disabled');
1495            }
1496        },
1497
1498        _get_url: function() {
1499            var _this   = this,
1500                value   = _this.$search.value.toLowerCase(),
1501                $option = document.querySelector('#' + _this.list + ' option[data-value="' + value + '"]');
1502
1503            return $option ? $option.getAttribute('data-url') : '';
1504        },
1505
1506        _submit: function(event) {
1507            var _this = this,
1508                url   = _this._get_url();
1509
1510            if (url) {
1511                event.preventDefault();
1512
1513                location.href = url;
1514            }
1515        }
1516    };
1517
1518    var $forms = document.querySelectorAll('[data-form*="datalist"]');
1519
1520    for (var i = 0, $form; $form = $forms[i]; i++) {
1521        new FormSearchDataList($form).init();
1522    }
1523})(document);
1524
1525/* Source common/js/scripts/71_form_search.js */
1526
1527// SUCHE
1528// Wird gebraucht in: steuernews_search, suche
1529// -------------------------------------------------------------------------------------------------
1530
1531(function(document) {
1532    var FormSearch = function($search) {
1533        var _this = this;
1534
1535        _this.$search       = $search;
1536        _this.$input_search = $search.querySelector('input[type="search"]');
1537        _this.$button       = $search.querySelector('button[type="submit"]');
1538    };
1539
1540    FormSearch.prototype = {
1541        init: function() {
1542            var _this = this;
1543
1544            _this.$button.setAttribute('disabled', 'disabled');
1545            _this.$input_search.addEventListener('input', _this._on_input.bind(_this));
1546        },
1547
1548        _on_input: function() {
1549            var _this = this;
1550
1551            if (_this.$input_search.value.length > 0) {
1552                _this.$button.removeAttribute('disabled');
1553            }
1554            else {
1555                _this.$button.setAttribute('disabled', 'disabled');
1556            }
1557        }
1558    };
1559
1560    var $search = document.querySelectorAll('[role="search"]');
1561
1562    if ($search.length) {
1563        for (var i = 0, len = $search.length; i < len; i++) {
1564            new FormSearch($search[i]).init();
1565        }
1566    }
1567})(document);
1568
1569/* Source common/js/scripts/72_form_search_box.js */
1570
1571// SUCHE (BOX)
1572// -------------------------------------------------------------------------------------------------
1573
1574(function(document) {
1575    var FormSearchBox = function($toggle_search_box) {
1576        var _this = this,
1577            controls;
1578
1579        _this.$toggle_search_box  = $toggle_search_box.querySelector('label');
1580        _this.$open_search_box    = $toggle_search_box.querySelector('.open_search_box');
1581        _this.$close_search_box_1 = $toggle_search_box.querySelector('.close_search_box');
1582        _this.$search_box_state   = document.querySelector('#' + _this.$toggle_search_box.getAttribute('for'));
1583
1584        controls = _this.$open_search_box.getAttribute('aria-controls');
1585
1586        _this.$search_box         = document.getElementById(controls);
1587        _this.$input_search       = _this.$search_box.querySelector('input[type="search"]');
1588        _this.$search_button      = _this.$search_box.querySelector('button[type="submit"]');
1589        _this.$close_search_box_2 = _this.$search_box.querySelector('.close_search_box');
1590        _this.$focus_elements     = _this.$search_box.querySelectorAll('input[type="search"], button[type="submit"], .close_search_box');
1591
1592        _this.$key = {
1593            'escape' : 27,
1594            'space'  : 32,
1595            'tab'    : 9
1596        };
1597    };
1598
1599    FormSearchBox.prototype = {
1600        init: function() {
1601            var _this = this;
1602
1603            _this.$toggle_search_box.addEventListener('click', _this._toggle.bind(_this));
1604            _this.$open_search_box.addEventListener('click', _this._open.bind(_this));
1605            _this.$close_search_box_1.addEventListener('click', _this._close.bind(_this));
1606            _this.$close_search_box_2.addEventListener('click', _this._close.bind(_this));
1607
1608            _this.$search_box.addEventListener('transitionend', function(event) {
1609                if (event.target !== this) {
1610                    return;
1611                }
1612
1613                if (_this.$search_box_state.checked) {
1614                    _this.$input_search.focus();
1615                }
1616            });
1617
1618            _this._init_keyboard();
1619        },
1620
1621        _init_keyboard: function() {
1622            var _this = this;
1623
1624            _this.$open_search_box.addEventListener('keydown', function(event) {
1625                if (event.keyCode === _this.$key.space) {
1626                    event.preventDefault();
1627                }
1628            });
1629
1630            _this.$close_search_box_1.addEventListener('keydown', function(event) {
1631                if (event.keyCode === _this.$key.space) {
1632                    event.preventDefault();
1633                }
1634            });
1635
1636            _this.$close_search_box_2.addEventListener('keydown', function(event) {
1637                if (event.keyCode === _this.$key.space) {
1638                    event.preventDefault();
1639                }
1640            });
1641
1642            document.addEventListener('keydown', function(event) {
1643                if (!_this.$search_box_state.checked) {
1644                    return;
1645                }
1646
1647                switch(event.keyCode) {
1648                    case _this.$key.escape:
1649                        _this._close(event);
1650
1651                        break;
1652
1653                    case _this.$key.tab:
1654                        event.preventDefault();
1655
1656                        if (event.shiftKey) {
1657                            _this._focus_element_with_shift_tab_key(event);
1658                        }
1659                        else {
1660                            _this._focus_element_with_tab_key(event);
1661                        }
1662
1663                        break;
1664                }
1665            });
1666        },
1667
1668        _focus_element_with_shift_tab_key: function() {
1669            var _this = this;
1670
1671            _this.tab_index -= 1;
1672
1673            if (_this.$search_button === _this.$focus_elements[_this.tab_index] &&
1674                _this.$search_button.getAttribute('disabled') === 'disabled') {
1675                _this.tab_index -= 1;
1676            }
1677            if (_this.tab_index < 0) {
1678                _this.tab_index = _this.$focus_elements.length - 1;
1679            }
1680
1681            _this.$focus_elements[_this.tab_index].focus();
1682        },
1683
1684        _focus_element_with_tab_key: function() {
1685            var _this = this;
1686
1687            if (_this.tab_index === _this.$focus_elements.length - 1) {
1688                _this.tab_index = 0;
1689            }
1690            else {
1691                _this.tab_index += 1;
1692            }
1693
1694            if (_this.$search_button === _this.$focus_elements[_this.tab_index] &&
1695                _this.$search_button.getAttribute('disabled') === 'disabled') {
1696                _this.tab_index += 1;
1697            }
1698
1699            _this.$focus_elements[_this.tab_index].focus();
1700        },
1701
1702        _toggle: function(event) {
1703            var _this = this;
1704
1705            if (_this.$search_box_state.checked) {
1706                _this._close(event);
1707            }
1708            else {
1709                _this._open(event);
1710            }
1711        },
1712
1713        _open: function(event) {
1714            var _this = this;
1715
1716            event.preventDefault();
1717
1718            _this.$search_box_state.checked = true;
1719            _this.tab_index = 0;
1720        },
1721
1722        _close: function(event) {
1723            var _this = this;
1724
1725            event.preventDefault();
1726
1727            _this.$search_box_state.checked = false;
1728            _this.$open_search_box.focus();
1729            _this.tab_index = 0;
1730
1731            if (event.type === 'click') {
1732                _this.$open_search_box.setAttribute('data-focus-method', 'mouse');
1733            }
1734        }
1735    };
1736
1737    var $toggle_search_box = document.getElementsByClassName('toggle_search_box');
1738
1739    for (var i = 0, len = $toggle_search_box.length; i < len; i++) {
1740        new FormSearchBox($toggle_search_box[i]).init();
1741    }
1742})(document);
1743
1744/* Source common/js/scripts/75_image_gallery.js */
1745
1746// BILDER-GALERIE
1747// Wird gebraucht in: image_gallery_overview
1748// -------------------------------------------------------------------------------------------------
1749
1750(function(document, window) {
1751    var ImageGallery = function($images) {
1752        var _this = this;
1753
1754        _this.$images   = $images;
1755        _this.$overlay  = document.querySelector('#image_gallery_overlay');
1756        _this.$slider   = _this.$overlay.querySelector('.gallery_slider');
1757        _this.$previous = _this.$overlay.querySelector('.previous');
1758        _this.$next     = _this.$overlay.querySelector('.next');
1759        _this.$close    = _this.$overlay.querySelector('.close');
1760
1761        _this._current_index = 0;
1762        _this._touch_flag    = false;
1763    };
1764
1765    ImageGallery.prototype = {
1766        init: function() {
1767            var _this = this;
1768
1769            _this._init_animations();
1770            _this._init_mouse();
1771            _this._init_keyboard();
1772            _this._init_touch();
1773        },
1774
1775        _init_animations: function() {
1776            var _this = this;
1777
1778            _this.$overlay.addEventListener('transitionend', _this._overlay_transtion_end.bind(_this));
1779            _this.$slider.addEventListener('animationend', _this._bounce_animation_end.bind(_this));
1780        },
1781
1782        _init_mouse: function() {
1783            var _this = this;
1784
1785            for (var i = 0, len = _this.$images.length; i < len; i++) {
1786                var $image = _this.$images[i];
1787
1788                $image.addEventListener('click', _this._open.bind(_this, i));
1789            }
1790
1791            if (window.navigator.msMaxTouchPoints || 'ontouchstart' in document.documentElement) {
1792                _this.$previous.classList.add('hideme');
1793                _this.$next.classList.add('hideme');
1794            }
1795            else {
1796                _this.$previous.addEventListener('click', function(event) {
1797                    event.stopPropagation();
1798                    event.preventDefault();
1799                    _this._show_previous_image();
1800                });
1801
1802                _this.$next.addEventListener('click', function(event) {
1803                    event.stopPropagation();
1804                    event.preventDefault();
1805                    _this._show_next_image();
1806                });
1807            }
1808
1809            _this.$close.addEventListener('click', _this._close.bind(_this));
1810            _this.$overlay.addEventListener('click', _this._close.bind(_this));
1811        },
1812
1813        _init_keyboard: function() {
1814            var _this = this,
1815                $key  = {
1816                            'escape'      : 27,
1817                            'arrow_left'  : 37,
1818                            'arrow_right' : 39
1819                        };
1820
1821            document.addEventListener('keydown', function(event) {
1822                if (!_this.$overlay.classList.contains('show')) {
1823                    return;
1824                }
1825
1826                if (event.keyCode === $key.escape) {
1827                    _this._hide_overlay();
1828                }
1829                else if (event.keyCode === $key.arrow_left) {
1830                    _this._show_previous_image();
1831                }
1832                else if (event.keyCode === $key.arrow_right) {
1833                    _this._show_next_image();
1834                }
1835            });
1836        },
1837
1838        _init_touch: function() {
1839            var _this = this;
1840
1841            _this.$overlay.addEventListener('touchstart', function(event) {
1842                _this._touch_start_x = event.changedTouches[0].pageX;
1843                _this._touch_start_y = event.changedTouches[0].pageY;
1844            }, {
1845                'passive' : true
1846            });
1847
1848            _this.$overlay.addEventListener('touchmove', function(event) {
1849                if (_this._touch_flag) {
1850                    return;
1851                }
1852
1853                var touch   = event.touches[0] || event.changedTouches[0],
1854                    touch_x = touch.pageX,
1855                    touch_y = touch.pageY;
1856
1857                event.preventDefault();
1858
1859                if (touch_x - _this._touch_start_x > 40) {
1860                    _this._touch_flag = true;
1861                    _this._show_previous_image();
1862                }
1863                else if (touch_x - _this._touch_start_x < -40) {
1864                    _this._touch_flag = true;
1865                    _this._show_next_image();
1866                }
1867                else if (_this._touch_start_y - touch_y > 100) {
1868                    _this._hide_overlay();
1869                }
1870            });
1871
1872            _this.$overlay.addEventListener('touchend', function() {
1873                _this._touch_flag = false;
1874            });
1875        },
1876
1877        _open: function(index, event) {
1878            var _this = this;
1879
1880            event.preventDefault();
1881
1882            _this._prepare_overlay(index);
1883            _this._show_overlay(index);
1884        },
1885
1886        _close: function(event) {
1887            var _this = this;
1888
1889            event.preventDefault();
1890            event.stopPropagation();
1891
1892            if (event.target.tagName !== 'IMG') {
1893                _this._hide_overlay();
1894            }
1895        },
1896
1897        _overlay_transtion_end: function(event) {
1898            var _this = this;
1899
1900            if (event.target !== _this.$overlay) {
1901                return;
1902            }
1903
1904            if (!_this.$overlay.classList.contains('show')) {
1905                _this.$overlay.classList.add('hideme');
1906            }
1907        },
1908
1909        _bounce_animation_end: function() {
1910            var _this = this;
1911
1912            _this.$slider.classList.remove('bounce_from_left');
1913            _this.$slider.classList.remove('bounce_from_right');
1914        },
1915
1916        _prepare_overlay: function(index) {
1917            var _this   = this,
1918                gallery = _this.$images[index].getAttribute('data-image-gallery');
1919
1920            if (_this._current_gallery === gallery) {
1921                return;
1922            }
1923
1924            _this.$full_images    = [];
1925            _this.$current_images = document.querySelectorAll('[data-image-gallery="' + gallery + '"]');
1926            _this._current_gallery = gallery;
1927
1928            while (_this.$slider.firstChild) {
1929                _this.$slider.removeChild(_this.$slider.firstChild);
1930            }
1931
1932            for (var i = 0, $full_image; i < _this.$current_images.length; i++) {
1933                $full_image = document.createElement('div');
1934                $full_image.className = 'full_image';
1935
1936                _this.$full_images.push($full_image);
1937
1938                _this.$slider.setAttribute('data-image-group', gallery);
1939                _this.$slider.appendChild($full_image);
1940            }
1941        },
1942
1943        _show_overlay: function(index) {
1944            var _this = this;
1945
1946            index = Array.prototype.indexOf.call(_this.$current_images, _this.$images[index]);
1947
1948            _this._current_index = index;
1949
1950            _this.$overlay.classList.remove('hideme');
1951
1952            setTimeout(function() {
1953                _this.$overlay.classList.add('show');
1954            }, 50);
1955
1956            _this._load_image(_this._current_index, function() {
1957                _this._preload_previous_image(_this._current_index);
1958                _this._preload_next_image(_this._current_index);
1959            });
1960
1961            _this._update_offset();
1962        },
1963
1964        _hide_overlay: function() {
1965            var _this = this;
1966
1967            _this.$overlay.classList.remove('show');
1968        },
1969
1970        _update_offset: function() {
1971            var _this  = this,
1972                offset = -_this._current_index * 100 + '%';
1973
1974            _this.$slider.style.transform       = 'translate3d(' + offset + ', 0, 0)';
1975            _this.$slider.style.webkitTransform = 'translate3d(' + offset + ', 0, 0)'; // Für iOS8
1976        },
1977
1978        _show_previous_image: function() {
1979            var _this = this;
1980
1981            if (_this._current_index >= 1) {
1982                _this._current_index--;
1983                _this._preload_previous_image(_this._current_index);
1984                _this._update_offset();
1985            }
1986            else {
1987                _this.$slider.classList.add('bounce_from_left');
1988            }
1989        },
1990
1991        _show_next_image: function() {
1992            var _this = this;
1993
1994            if (_this._current_index <= _this.$full_images.length - 2) {
1995                _this._current_index++;
1996                _this._preload_next_image(_this._current_index);
1997                _this._update_offset();
1998            }
1999            else {
2000                _this.$slider.classList.add('bounce_from_right');
2001            }
2002        },
2003
2004        _preload_previous_image: function(index) {
2005            var _this = this;
2006
2007            if (_this._current_index - index >= 2) {
2008                return;
2009            }
2010
2011            _this._load_image(index - 1, function() {
2012                _this._preload_previous_image(index - 1);
2013            });
2014        },
2015
2016        _preload_next_image: function(index) {
2017            var _this = this;
2018
2019            if (index - _this._current_index >= 2) {
2020                return;
2021            }
2022
2023            _this._load_image(index + 1, function() {
2024                _this._preload_next_image(index + 1);
2025            });
2026        },
2027
2028        _load_image: function(index, callback) {
2029            var _this       = this,
2030                $full_image = _this.$full_images[index];
2031
2032            if (typeof $full_image === 'undefined') {
2033                return;
2034            }
2035
2036            if ($full_image.querySelector('img')) {
2037                if (callback) {
2038                    callback();
2039                }
2040
2041                return;
2042            }
2043
2044            var $figure           = document.createElement('figure'),
2045                $image            = document.createElement('img'),
2046                image_source      = _this.$current_images[index].getAttribute('href'),
2047                image_description = _this.$current_images[index].getAttribute('data-image-description');
2048
2049            $figure.innerHTML = '<div class="spinner">' +
2050                                '<div class="bounce bounce_1"></div>' +
2051                                '<div class="bounce bounce_2"></div>' +
2052                                '<div class="bounce bounce_3"></div>' +
2053                                '</div>';
2054
2055            $image.setAttribute('src', image_source);
2056
2057            $image.addEventListener('load', function() {
2058                var $spinner = $figure.querySelector('.spinner');
2059
2060                $image.classList.add('show');
2061                $figure.removeChild($spinner);
2062
2063                if (callback) {
2064                    callback();
2065                }
2066            });
2067
2068            $figure.appendChild($image);
2069
2070            if (image_description) {
2071                var $figcaption = document.createElement('figcaption');
2072
2073                $figcaption.innerHTML = image_description;
2074                $figure.appendChild($figcaption);
2075            }
2076
2077            $full_image.appendChild($figure);
2078        }
2079    };
2080
2081    var $images = document.querySelectorAll('[data-image-gallery]');
2082
2083    if ($images.length) {
2084        new ImageGallery($images).init();
2085    }
2086})(document, window);
2087
2088/* Source common/js/scripts/75_kpt_gallery.js */
2089
2090// KARRIEREPAKET BILDER-GALERIE
2091// Wird gebraucht in: kpt_gallery
2092// -------------------------------------------------------------------------------------------------
2093
2094(function(document, window) {
2095    var ImageGallery = function($images) {
2096        var _this = this;
2097
2098        _this.$images   = $images;
2099        _this.$overlay  = document.querySelector('#kpt_gallery_overlay');
2100        _this.$slider   = _this.$overlay.querySelector('.gallery_slider');
2101        _this.$previous = _this.$overlay.querySelector('.previous');
2102        _this.$next     = _this.$overlay.querySelector('.next');
2103        _this.$close    = _this.$overlay.querySelector('.close');
2104
2105        _this._current_index = 0;
2106        _this._touch_flag    = false;
2107    };
2108
2109    ImageGallery.prototype = {
2110        init: function() {
2111            var _this = this;
2112
2113            _this._init_animations();
2114            _this._init_mouse();
2115            _this._init_keyboard();
2116            _this._init_touch();
2117        },
2118
2119        _init_animations: function() {
2120            var _this = this;
2121
2122            _this.$overlay.addEventListener('transitionend', _this._overlay_transtion_end.bind(_this));
2123            _this.$slider.addEventListener('animationend', _this._bounce_animation_end.bind(_this));
2124        },
2125
2126        _init_mouse: function() {
2127            var _this = this;
2128
2129            for (var i = 0, len = _this.$images.length; i < len; i++) {
2130                var $image = _this.$images[i];
2131
2132                $image.addEventListener('click', _this._open.bind(_this, i));
2133            }
2134
2135            if (window.navigator.msMaxTouchPoints || 'ontouchstart' in document.documentElement) {
2136                _this.$previous.classList.add('hideme');
2137                _this.$next.classList.add('hideme');
2138            }
2139            else {
2140                _this.$previous.addEventListener('click', function(event) {
2141                    event.stopPropagation();
2142                    event.preventDefault();
2143                    _this._show_previous_image();
2144                });
2145
2146                _this.$next.addEventListener('click', function(event) {
2147                    event.stopPropagation();
2148                    event.preventDefault();
2149                    _this._show_next_image();
2150                });
2151            }
2152
2153            _this.$close.addEventListener('click', _this._close.bind(_this));
2154            _this.$overlay.addEventListener('click', _this._close.bind(_this));
2155        },
2156
2157        _init_keyboard: function() {
2158            var _this = this,
2159                $key  = {
2160                    'escape'      : 27,
2161                    'arrow_left'  : 37,
2162                    'arrow_right' : 39
2163                };
2164
2165            document.addEventListener('keydown', function(event) {
2166                if (!_this.$overlay.classList.contains('show')) {
2167                    return;
2168                }
2169
2170                if (event.keyCode === $key.escape) {
2171                    _this._hide_overlay();
2172                }
2173                else if (event.keyCode === $key.arrow_left) {
2174                    _this._show_previous_image();
2175                }
2176                else if (event.keyCode === $key.arrow_right) {
2177                    _this._show_next_image();
2178                }
2179            });
2180        },
2181
2182        _init_touch: function() {
2183            var _this = this;
2184
2185            _this.$overlay.addEventListener('touchstart', function(event) {
2186                _this._touch_start_x = event.changedTouches[0].pageX;
2187                _this._touch_start_y = event.changedTouches[0].pageY;
2188            }, {
2189                'passive' : true
2190            });
2191
2192            _this.$overlay.addEventListener('touchmove', function(event) {
2193                if (_this._touch_flag) {
2194                    return;
2195                }
2196
2197                var touch   = event.touches[0] || event.changedTouches[0],
2198                    touch_x = touch.pageX,
2199                    touch_y = touch.pageY;
2200
2201                event.preventDefault();
2202
2203                if (touch_x - _this._touch_start_x > 40) {
2204                    _this._touch_flag = true;
2205                    _this._show_previous_image();
2206                }
2207                else if (touch_x - _this._touch_start_x < -40) {
2208                    _this._touch_flag = true;
2209                    _this._show_next_image();
2210                }
2211                else if (_this._touch_start_y - touch_y > 100) {
2212                    _this._hide_overlay();
2213                }
2214            });
2215
2216            _this.$overlay.addEventListener('touchend', function() {
2217                _this._touch_flag = false;
2218            });
2219        },
2220
2221        _open: function(index, event) {
2222            var _this = this;
2223
2224            event.preventDefault();
2225
2226            _this._prepare_overlay(index);
2227            _this._show_overlay(index);
2228            
2229            document.dispatchEvent(open_gallery_event);
2230        },
2231
2232        _close: function(event) {
2233            var _this = this;
2234
2235            event.preventDefault();
2236            event.stopPropagation();
2237
2238            if (event.target.tagName !== 'IMG') {
2239                _this._hide_overlay();
2240            }
2241            
2242            document.dispatchEvent(close_gallery_event);
2243        },
2244
2245        _overlay_transtion_end: function(event) {
2246            var _this = this;
2247
2248            if (event.target !== _this.$overlay) {
2249                return;
2250            }
2251
2252            if (!_this.$overlay.classList.contains('show')) {
2253                _this.$overlay.classList.add('hideme');
2254            }
2255        },
2256
2257        _bounce_animation_end: function() {
2258            var _this = this;
2259
2260            _this.$slider.classList.remove('bounce_from_left');
2261            _this.$slider.classList.remove('bounce_from_right');
2262        },
2263
2264        _prepare_overlay: function(index) {
2265            var _this   = this,
2266                gallery = _this.$images[index].getAttribute('data-kpt-gallery');
2267
2268            if (_this._current_gallery === gallery) {
2269                return;
2270            }
2271
2272            _this.$full_images    = [];
2273            _this.$current_images = document.querySelectorAll('[data-kpt-gallery="' + gallery + '"]');
2274            _this._current_gallery = gallery;
2275
2276            while (_this.$slider.firstChild) {
2277                _this.$slider.removeChild(_this.$slider.firstChild);
2278            }
2279
2280            for (var i = 0, $full_image; i < _this.$current_images.length; i++) {
2281                $full_image = document.createElement('div');
2282                $full_image.className = 'full_image';
2283
2284                _this.$full_images.push($full_image);
2285
2286                _this.$slider.setAttribute('data-image-group', gallery);
2287                _this.$slider.appendChild($full_image);
2288            }
2289        },
2290
2291        _show_overlay: function(index) {
2292            var _this = this;
2293
2294            index = Array.prototype.indexOf.call(_this.$current_images, _this.$images[index]);
2295
2296            _this._current_index = index;
2297
2298            _this.$overlay.classList.remove('hideme');
2299
2300            setTimeout(function() {
2301                _this.$overlay.classList.add('show');
2302            }, 50);
2303
2304            _this._load_image(_this._current_index, function() {
2305                _this._preload_previous_image(_this._current_index);
2306                _this._preload_next_image(_this._current_index);
2307            });
2308
2309            _this._update_offset();
2310        },
2311
2312        _hide_overlay: function() {
2313            var _this = this;
2314
2315            _this.$overlay.classList.remove('show');
2316        },
2317
2318        _update_offset: function() {
2319            var _this  = this,
2320                offset = -_this._current_index * 100 + '%';
2321
2322            _this.$slider.style.transform       = 'translate3d(' + offset + ', 0, 0)';
2323            _this.$slider.style.webkitTransform = 'translate3d(' + offset + ', 0, 0)'; // Für iOS8
2324        },
2325
2326        _show_previous_image: function() {
2327            var _this = this;
2328
2329            if (_this._current_index >= 1) {
2330                _this._current_index--;
2331                _this._preload_previous_image(_this._current_index);
2332                _this._update_offset();
2333            }
2334            else {
2335                _this.$slider.classList.add('bounce_from_left');
2336            }
2337        },
2338
2339        _show_next_image: function() {
2340            var _this = this;
2341
2342            if (_this._current_index <= _this.$full_images.length - 2) {
2343                _this._current_index++;
2344                _this._preload_next_image(_this._current_index);
2345                _this._update_offset();
2346            }
2347            else {
2348                _this.$slider.classList.add('bounce_from_right');
2349            }
2350        },
2351
2352        _preload_previous_image: function(index) {
2353            var _this = this;
2354
2355            if (_this._current_index - index >= 2) {
2356                return;
2357            }
2358
2359            _this._load_image(index - 1, function() {
2360                _this._preload_previous_image(index - 1);
2361            });
2362        },
2363
2364        _preload_next_image: function(index) {
2365            var _this = this;
2366
2367            if (index - _this._current_index >= 2) {
2368                return;
2369            }
2370
2371            _this._load_image(index + 1, function() {
2372                _this._preload_next_image(index + 1);
2373            });
2374        },
2375
2376        _load_image: function(index, callback) {
2377            var _this       = this,
2378                $full_image = _this.$full_images[index];
2379
2380            if (typeof $full_image === 'undefined') {
2381                return;
2382            }
2383
2384            if ($full_image.querySelector('img')) {
2385                if (callback) {
2386                    callback();
2387                }
2388
2389                return;
2390            }
2391
2392            var $figure           = document.createElement('figure'),
2393                $image            = document.createElement('img'),
2394                image_source      = _this.$current_images[index].getAttribute('href'),
2395                image_width       = _this.$current_images[index].getAttribute('data-image-width'),
2396                image_height      = _this.$current_images[index].getAttribute('data-image-height'),
2397                image_description = _this.$current_images[index].getAttribute('data-image-description'),
2398                image_text        = _this.$current_images[index].querySelector('.text');
2399
2400            if (image_text) {
2401                var $full_image_text = image_text.cloneNode(true);
2402                $full_image.appendChild($full_image_text);
2403            }
2404
2405            $figure.innerHTML = '<div class="spinner">' +
2406                                '<div class="bounce bounce_1"></div>' +
2407                                '<div class="bounce bounce_2"></div>' +
2408                                '<div class="bounce bounce_3"></div>' +
2409                                '</div>';
2410
2411            $image.setAttribute('src', image_source);
2412            $image.setAttribute('alt', '');
2413
2414            if (image_height != null) {
2415                $image.setAttribute('height', image_height);
2416            }
2417
2418            if (image_width != null) {
2419                $image.setAttribute('width', image_width);
2420            }
2421
2422            $image.addEventListener('load', function() {
2423                var $spinner = $figure.querySelector('.spinner');
2424
2425                $image.classList.add('show');
2426                $figure.removeChild($spinner);
2427
2428                if (callback) {
2429                    callback();
2430                }
2431            });
2432
2433            $figure.appendChild($image);
2434
2435            if (image_description) {
2436                var $figcaption = document.createElement('figcaption');
2437
2438                $figcaption.innerHTML = image_description;
2439                $figure.appendChild($figcaption);
2440            }
2441
2442            $full_image.appendChild($figure);
2443            // $full_image.appendChild($full_image_text);
2444        }
2445    };
2446    
2447    var open_gallery_event = document.createEvent('Event');
2448    open_gallery_event.initEvent('open_gallery', true, true);
2449    
2450    var close_gallery_event = document.createEvent('Event');
2451    close_gallery_event.initEvent('close_gallery', true, true);
2452
2453    var $images = document.querySelectorAll('[data-kpt-gallery]');
2454
2455    if ($images.length) {
2456        new ImageGallery($images).init();
2457    }
2458})(document, window);
2459
2460
2461
2462
2463/* Source common/js/scripts/76_kpt_slider.js */
2464
2465// KARRIEREPAKET SLIDER
2466// ------------------------------------------------------------------------------------------------
2467
2468(function(document, window) {
2469    var Slider = function($slider) {
2470        this.$slider          = $slider;
2471        this.$slides          = this.$slider.querySelectorAll('.slide');
2472        this.active_index     = 0;
2473
2474        this.$navigation      = this.$slider.querySelector('.navigation');
2475        this.$navigation_next = this.$slider.querySelector('.navigation .next');
2476        this.$navigation_prev = this.$slider.querySelector('.navigation .prev');
2477        this.$pagination      = this.$slider.querySelectorAll('.pagination > a');
2478
2479        this.auto_slide       = this.$slider.className.match(/(\auto_slide\S*)/g);
2480        this.timeout          = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000);
2481        this.auto_stop        = this.$slider.className.match(/(\auto_stop)/g);
2482        this.run              = true;
2483    };
2484
2485    Slider.prototype = {
2486        init: function() {
2487            var _this = this;
2488
2489            if (_this.auto_slide) {
2490                _this._auto_slide();
2491            }
2492
2493            if (_this.auto_stop) {
2494                _this._auto_stop();
2495            }
2496
2497            if (_this.$navigation) {
2498                _this._init_navigation();
2499            }
2500
2501            if (_this.$pagination.length) {
2502                _this._init_pagination();
2503            }
2504
2505            _this._update_slides(0);
2506            _this._init_slides_animation();
2507            _this._init_accessibility();
2508
2509        },
2510
2511        next: function() {
2512            this.active_index = this._get_index(this.$slides, this.active_index + 1);
2513            this._update_slides();
2514            this._set_slides_animation();
2515        },
2516
2517        prev: function() {
2518            this.active_index = this._get_index(this.$slides, this.active_index - 1);
2519            this._update_slides();
2520            this._set_slides_animation();
2521        },
2522
2523        _init_slides_animation: function() {
2524            var _this = this;
2525
2526            for (var i = 0; i < _this.$slides.length; i++) {
2527                _this.$slides[i].addEventListener('transitionend', function() {
2528                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2529                });
2530
2531                _this.$slides[i].addEventListener('animationend', function() {
2532                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2533                });
2534            }
2535        },
2536
2537        _init_navigation: function() {
2538            var _this = this;
2539
2540            _this.$navigation_next.addEventListener('click', function(event) {
2541                event.preventDefault();
2542
2543                _this.next();
2544            });
2545
2546            _this.$navigation_prev.addEventListener('click', function(event) {
2547                event.preventDefault();
2548
2549                _this.prev();
2550            });
2551        },
2552
2553        _init_accessibility: function() {
2554            var _this = this;
2555
2556            _this.$slider.addEventListener('click', function(event) {
2557                this.is_keyboard = false;
2558            }, true);
2559
2560            _this.$slider.addEventListener('keydown', function(event) {
2561                this.is_keyboard = true;
2562            }, true);
2563
2564            _this.$slider.addEventListener('focusin', function(event) {
2565                slide = event.target.closest('.slide');
2566
2567                if (slide && this.is_keyboard) {
2568                    _this.active_index = parseInt(slide.getAttribute('data-index'));
2569                    _this._update_slides();
2570                    _this._set_slides_animation();
2571
2572                    _this.$slider.querySelector('.slides').scrollLeft = 0;
2573                    this.is_keyboard = false;
2574                }
2575            }, true);
2576        },
2577
2578        _init_pagination: function() {
2579            var _this = this;
2580
2581            for (var i = 0; i < _this.$pagination.length; i++) {
2582                _this.$pagination[i].addEventListener('click', function(event) {
2583                    event.preventDefault();
2584
2585                    _this.active_index = parseInt(this.getAttribute('data-index'));
2586                    _this._update_slides();
2587                    _this._set_slides_animation();
2588                });
2589            }
2590        },
2591
2592        _auto_slide: function() {
2593            var _this = this;
2594
2595            setInterval(function() {
2596                if (_this.run) {
2597                    _this.next();
2598                }
2599            }, _this.timeout);
2600        },
2601
2602        _auto_stop: function() {
2603            var _this = this;
2604
2605            this.$slider.addEventListener('mousemove', function() {
2606                _this.run = false;
2607            });
2608
2609            this.$slider.addEventListener('mouseleave', function() {
2610                _this.run = true;
2611            });
2612        },
2613
2614        _update_slides: function() {
2615            this._set_active_slide();
2616            this._set_slides_position();
2617            this._set_slides_visibility();
2618
2619            if (this.$pagination.length) {
2620                this._update_pagination();
2621            }
2622        },
2623
2624        _update_pagination: function() {
2625            var index = this._get_index(this.$pagination, this.active_index);
2626
2627            this.$pagination = this._remove_all_classes(this.$pagination, 'active');
2628            this.$pagination[index].classList.add('active');
2629        },
2630
2631        _remove_all_classes: function(elements, class_name) {
2632
2633            for (var i = 0; i < elements.length; i++) {
2634                elements[i].classList.remove(class_name);
2635            }
2636
2637            return elements;
2638        },
2639
2640        _get_index: function(element, number) {
2641            var _this = this;
2642
2643            if (number >= (element.length * 2)) {
2644                number = number - (element.length * 2);
2645            }
2646
2647            if (number >= element.length) {
2648                number = number - element.length;
2649            }
2650
2651            if (number < 0) {
2652                number = number + element.length;
2653            }
2654
2655            return number;
2656        },
2657
2658        _set_slides_animation: function() {
2659            var slide_length_third = this.$slides.length / 3;
2660
2661            this.$slides = this._remove_all_classes(this.$slides, 'animated');
2662
2663            for (var i = -1; i <= slide_length_third; i++) {
2664                var index = this._get_index(this.$slides, this.active_index + i);
2665                this.$slides[index].classList.add('animated');
2666            }
2667        },
2668
2669        _set_active_slide: function() {
2670            var index = this._get_index(this.$slides, this.active_index);
2671
2672            this.$slides = this._remove_all_classes(this.$slides, 'active');
2673            this.$slides[index].classList.add('active');
2674        },
2675
2676        _set_slides_position: function() {
2677            var slide_length_half = Math.floor(this.$slides.length / 2);
2678
2679            for (var i = -slide_length_half - 1; i <= slide_length_half; i++) {
2680                var index = this._get_index(this.$slides, this.active_index + i);
2681                this.$slides[index].setAttribute('data-position', i * 100);
2682            }
2683        },
2684
2685        _set_slides_visibility: function() {
2686            var slide_length_third = this.$slides.length / 3;
2687
2688            this.$slides = this._remove_all_classes(this.$slides, 'visible');
2689
2690            for (var i = -1; i <= slide_length_third; i++) {
2691                var index = this._get_index(this.$slides, this.active_index + i);
2692                this.$slides[index].classList.add('visible');
2693            }
2694        }
2695    };
2696
2697    var $slider = document.querySelectorAll(['.kpt_slider']);
2698
2699    for (var i = 0; i < $slider.length; i++) {
2700        new Slider($slider[i]).init();
2701    }
2702})(document, window);
2703
2704/* Source common/js/scripts/77_slider.js */
2705
2706// SLIDER
2707// ------------------------------------------------------------------------------------------------
2708
2709(function(document, window) {
2710    var Slider = function($slider) {
2711        this.$slider          = $slider;
2712        this.$gallery_overlay = $gallery_overlay;
2713        this.$slides          = this.$slider.querySelectorAll('.slide');
2714        this.active_index     = 0;
2715
2716        this.$navigation      = this.$slider.querySelector('.navigation');
2717        this.$navigation_next = this.$slider.querySelector('.navigation .next');
2718        this.$navigation_prev = this.$slider.querySelector('.navigation .prev');
2719        this.$pagination      = this.$slider.querySelectorAll('.pagination > a');
2720
2721        this.auto_slide       = this.$slider.className.match(/(\auto_slide\S*)/g);
2722        this.timeout          = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000);
2723        this.auto_stop        = this.$slider.className.match(/(\auto_stop)/g);
2724        this.run              = true;
2725        this.gallery_run      = true;
2726    };
2727
2728    Slider.prototype = {
2729        init: function() {
2730            var _this = this;
2731
2732            if (_this.auto_slide) {
2733                _this._auto_slide();
2734            }
2735
2736            if (_this.auto_stop) {
2737                _this._auto_stop();
2738            }
2739
2740            if (_this.$navigation) {
2741                _this._init_navigation();
2742            }
2743
2744            if (_this.$pagination.length) {
2745                _this._init_pagination();
2746            }
2747
2748            _this._update_slides(0);
2749            _this._init_slides_animation();
2750            _this._init_accessibility();
2751
2752        },
2753
2754        next: function() {
2755            this.active_index = this._get_index(this.$slides, this.active_index + 1);
2756            this._update_slides();
2757            this._set_slides_animation();
2758        },
2759
2760        prev: function() {
2761            this.active_index = this._get_index(this.$slides, this.active_index - 1);
2762            this._update_slides();
2763            this._set_slides_animation();
2764        },
2765
2766        _init_slides_animation: function() {
2767            var _this = this;
2768
2769            for (var i = 0; i < _this.$slides.length; i++) {
2770                _this.$slides[i].addEventListener('transitionend', function() {
2771                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2772                });
2773
2774                _this.$slides[i].addEventListener('animationend', function() {
2775                    _this.$slides = _this._remove_all_classes(_this.$slides, 'animated');
2776                });
2777            }
2778        },
2779
2780        _init_navigation: function() {
2781            var _this = this;
2782
2783            _this.$navigation_next.addEventListener('click', function(event) {
2784                event.preventDefault();
2785
2786                _this.next();
2787            });
2788
2789            _this.$navigation_prev.addEventListener('click', function(event) {
2790                event.preventDefault();
2791
2792                _this.prev();
2793            });
2794        },
2795
2796        _init_accessibility: function() {
2797            var _this = this;
2798
2799            _this.$slider.addEventListener('click', function(event) {
2800                this.is_keyboard = false;
2801            }, true);
2802
2803            _this.$slider.addEventListener('keydown', function(event) {
2804                this.is_keyboard = true;
2805            }, true);
2806
2807            _this.$slider.addEventListener('focusin', function(event) {
2808                slide = event.target.closest('.slide');
2809
2810                if (slide && this.is_keyboard) {
2811                    _this.active_index = parseInt(slide.getAttribute('data-index'));
2812                    _this._update_slides();
2813                    _this._set_slides_animation();
2814
2815                    _this.$slider.querySelector('.slides').scrollLeft = 0;
2816                    this.is_keyboard = false;
2817                }
2818            }, true);
2819        },
2820
2821        _init_pagination: function() {
2822            var _this = this;
2823
2824            for (var i = 0; i < _this.$pagination.length; i++) {
2825                _this.$pagination[i].addEventListener('click', function(event) {
2826                    event.preventDefault();
2827
2828                    _this.active_index = parseInt(this.getAttribute('data-index'));
2829                    _this._update_slides();
2830                    _this._set_slides_animation();
2831                });
2832            }
2833        },
2834
2835        _auto_slide: function() {
2836            var _this = this;
2837
2838            setInterval(function() {
2839                if (_this.run && _this.gallery_run) {
2840                    _this.next();
2841                }
2842            }, _this.timeout);
2843        },
2844
2845        _auto_stop: function() {
2846            var _this = this;
2847
2848            this.$slider.addEventListener('mousemove', function() {
2849                _this.run = false;
2850            });
2851
2852            this.$slider.addEventListener('mouseleave', function() {
2853                _this.run = true;
2854            });
2855            
2856            document.addEventListener('open_gallery', function() {
2857                _this.gallery_run = false;
2858            });
2859            
2860            document.addEventListener('close_gallery', function() {
2861                _this.gallery_run = true;
2862            });
2863        },
2864
2865        _update_slides: function() {
2866            this._set_active_slide();
2867            this._set_slides_position();
2868            this._set_slides_visibility();
2869
2870            if (this.$pagination.length) {
2871                this._update_pagination();
2872            }
2873        },
2874
2875        _update_pagination: function() {
2876            var index = this._get_index(this.$pagination, this.active_index);
2877
2878            this.$pagination = this._remove_all_classes(this.$pagination, 'active');
2879            this.$pagination[index].classList.add('active');
2880        },
2881
2882        _remove_all_classes: function(elements, class_name) {
2883
2884            for (var i = 0; i < elements.length; i++) {
2885                elements[i].classList.remove(class_name);
2886            }
2887
2888            return elements;
2889        },
2890
2891        _get_index: function(element, number) {
2892            var _this = this;
2893
2894            if (number >= (element.length * 2)) {
2895                number = number - (element.length * 2);
2896            }
2897
2898            if (number >= element.length) {
2899                number = number - element.length;
2900            }
2901
2902            if (number < 0) {
2903                number = number + element.length;
2904            }
2905
2906            return number;
2907        },
2908
2909        _set_slides_animation: function() {
2910            var slide_length_third = this.$slides.length / 3;
2911
2912            this.$slides = this._remove_all_classes(this.$slides, 'animated');
2913
2914            for (var i = -1; i <= slide_length_third; i++) {
2915                var index = this._get_index(this.$slides, this.active_index + i);
2916                this.$slides[index].classList.add('animated');
2917            }
2918        },
2919
2920        _set_active_slide: function() {
2921            var index = this._get_index(this.$slides, this.active_index);
2922
2923            this.$slides = this._remove_all_classes(this.$slides, 'active');
2924            this.$slides[index].classList.add('active');
2925        },
2926
2927        _set_slides_position: function() {
2928            var slide_length_half = Math.floor(this.$slides.length / 2);
2929
2930            for (var i = -slide_length_half - 1; i <= slide_length_half; i++) {
2931                var index = this._get_index(this.$slides, this.active_index + i);
2932                this.$slides[index].setAttribute('data-position', i * 100);
2933            }
2934        },
2935
2936        _set_slides_visibility: function() {
2937            var slide_length_third = this.$slides.length / 3;
2938
2939            this.$slides = this._remove_all_classes(this.$slides, 'visible');
2940
2941            for (var i = -1; i <= slide_length_third; i++) {
2942                var index = this._get_index(this.$slides, this.active_index + i);
2943                this.$slides[index].classList.add('visible');
2944            }
2945        }
2946    };
2947
2948    var $slider = document.querySelectorAll(['.slider']);
2949    var $gallery_overlay = document.querySelectorAll(['.kpt_gallery_overlay']);
2950
2951    for (var i = 0; i < $slider.length; i++) {
2952        new Slider($slider[i]).init();
2953    }
2954})(document, window);
2955
2956/* Source common/js/scripts/82_scrolled_down_header.js */
2957
2958// SCROLL DOWN HEADER
2959// Vergibt eine Klasse scrolled_down auf den Header
2960// -------------------------------------------------------------------------------------------------
2961
2962(function(document, window) {
2963    var scrolled_down = function($animated_element) {
2964        var _this = this;
2965        _this._$animated_element = $animated_element;
2966    };
2967
2968    scrolled_down.prototype = {
2969
2970        init: function() {
2971            var _this = this;
2972
2973            _this._is_scrolled_down();
2974            window.addEventListener('scroll', this._is_scrolled_down.bind(_this), true);
2975        },
2976
2977        _is_scrolled_down: function() {
2978            var _this  = this;
2979
2980            if (window.pageYOffset > 40) {
2981                _this._$animated_element.classList.add('scrolled_down');
2982            } else {
2983                _this._$animated_element.classList.remove('scrolled_down');
2984            }
2985        }
2986    };
2987
2988    var $animated_elements = document.querySelectorAll('body');
2989
2990    for (var i = 0, len = $animated_elements.length; i < len; i++) {
2991        new scrolled_down($animated_elements[i]).init();
2992    }
2993
2994}(document, window));
2995
2996/* Source common/js/scripts/85_infolists.js */
2997
2998// INFOLISTEN: WEITERE WERTE
2999// Wird verwendet für Wichtige Beträge (show_more_content)
3000// -------------------------------------------------------------------------------------------------
3001
3002(function() {
3003    var $show_more_content = document.querySelectorAll('.show_more_content');
3004
3005    for (var i = 0, len = $show_more_content.length; i < len; i++) {
3006        $show_more_content[i].addEventListener('click', function(event) {
3007            event.preventDefault();
3008
3009            var _this      = this,
3010                content_id = _this.getAttribute('aria-controls'),
3011                $content   = document.querySelector('#' + content_id);
3012
3013            if (_this.getAttribute('aria-pressed') === 'true') {
3014                _this.setAttribute('aria-expanded', 'false');
3015                _this.setAttribute('aria-pressed', 'false');
3016                $content.setAttribute('aria-hidden', 'true');
3017                $content.classList.add('hideme');
3018            }
3019            else {
3020                _this.setAttribute('aria-expanded', 'true');
3021                _this.setAttribute('aria-pressed', 'true');
3022                $content.setAttribute('aria-hidden', 'false');
3023                $content.classList.remove('hideme');
3024            }
3025        });
3026    }
3027}());
3028
3029/* Source common/js/scripts/86_infolists_add_tabindex.js */
3030
3031// INFOLISTEN: Tabindex zu infolist_text hinzufügen, wenn dies innerhalb eines text_containers ist
3032// -------------------------------------------------------------------------------------------------
3033
3034(function() {
3035    var $infolist_texts = document.querySelectorAll('.infolist_text');
3036
3037    for (var i = 0, len = $infolist_texts.length; i < len; i++) {
3038        var parent = $infolist_texts[i].parentNode;
3039
3040        if (parent && parent.classList.contains("infolist_text_container")) {
3041            $infolist_texts[i].tabIndex = 0;
3042        }
3043    }
3044}());
3045
3046/* Source common/js/scripts/87_social_media_share_popup.js */
3047
3048// INFOLISTEN: WEITERE WERTE
3049// Wird verwendet für Wichtige Beträge (show_more_content)
3050// -------------------------------------------------------------------------------------------------
3051
3052(function(window) {
3053    var $share_button = document.querySelectorAll('.share_button');
3054
3055    for (var i = 0, len = $share_button.length; i < len; i++) {
3056        $share_button[i].addEventListener('click', function(event) {
3057            event.preventDefault();
3058
3059            var _this = this,
3060                href = _this.getAttribute('href');
3061
3062            window.open(href,'Inhalt teilen','height=450, width=550, top=' + (window.innerHeight / 2 - 275) + ', left=' + (window.innerWidth / 2 - 225) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
3063        });
3064    }
3065}(window));
3066
3067/* Source common/js/scripts/90_vcard.js */
3068
3069// VCARD SWITCHER FÜR DESKTOP/MOBIL
3070// Wird verwendet für: team_overview, team_entry, address_vcard_button, steuernews_contact_person
3071// -------------------------------------------------------------------------------------------------
3072
3073(function(document) {
3074    if (device.mobile || device.tablet) {
3075        return;
3076    }
3077
3078    var $vcards = document.querySelectorAll('[data-vcard-href]');
3079
3080    for (var i = 0, len = $vcards.length; i < len; i++) {
3081        var $vcard = $vcards[i],
3082            href   = $vcard.getAttribute('data-vcard-href');
3083
3084        if (href) {
3085            $vcard.setAttribute('href', href);
3086            $vcard.removeAttribute('data-vcard-href');
3087        }
3088    }
3089}(document));
3090
3091/* Source common/js/scripts/94_slider.js */
3092
3093// SLIDER HORIZONTAL
3094// Wird verwendet für: steuernews_article_slider
3095// -------------------------------------------------------------------------------------------------
3096
3097(function(document) {
3098    var Slider = function($slider) {
3099        var _this = this;
3100
3101        _this.$slider_wrapper   = $slider;
3102        _this.$slider           = $slider.querySelector('.slider');
3103        _this.$slides           = $slider.querySelectorAll('.slide');
3104        _this.$prev             = $slider.querySelector('.prev_slide');
3105        _this.$next             = $slider.querySelector('.next_slide');
3106        _this.index             = 0;
3107        _this.time              = 4000;
3108        _this.intervall;
3109        _this.touch_start_x;
3110
3111        // Stoppen wenn Maus über Objekt ist
3112        _this.stop_on_hover     = false;
3113    };
3114
3115    Slider.prototype = {
3116        init: function() {
3117            var _this = this;
3118
3119            _this._init_mouse();
3120            _this._init_touch();
3121
3122            if (_this.stop_on_hover) {
3123                _this.$slider.addEventListener('mouseover', function() {
3124                    clearInterval(_this.intervall);
3125                });
3126
3127                _this.$slider.addEventListener('mouseout', function() {
3128                    _this.intervall = setInterval(_this._next_slide.bind(_this), _this.time);
3129                });
3130            }
3131
3132            // Im Skript vergeben, wenn kein javascript aktiviert ist soll Button ausgeblendet sein
3133            _this.$next.classList.add('show');
3134            _this.intervall = setInterval(_this._next_slide.bind(_this), _this.time);
3135
3136            window.addEventListener('resize', function() {
3137                _this._set_height();
3138            });
3139
3140            window.addEventListener('load', function() {
3141                _this._set_height();
3142            });
3143
3144        },
3145
3146        _init_mouse: function() {
3147            var _this = this;
3148
3149            _this.$prev.addEventListener('click', function(event) {
3150                event.preventDefault();
3151                event.stopPropagation();
3152                _this._prev_slide();
3153            });
3154
3155            _this.$next.addEventListener('click', function(event) {
3156                event.preventDefault();
3157                event.stopPropagation();
3158                _this._next_slide();
3159            });
3160        },
3161
3162        _init_touch: function() {
3163            var _this = this
3164
3165            _this.$slider.addEventListener('touchstart', function(event) {
3166                clearInterval(_this.intervall);
3167                _this.touch_start_x = event.changedTouches[0].pageX;
3168            });
3169
3170            _this.$slider.addEventListener('touchmove', function(event) {
3171                var touch   = event.touches[0] || event.changedTouches[0],
3172                    touch_x = touch.pageX;
3173
3174                if ((touch_x - _this.touch_start_x > 50) || (touch_x - _this.touch_start_x < -50)) {
3175                    event.preventDefault();
3176                }
3177            });
3178
3179            _this.$slider.addEventListener('touchend', function(event) {
3180                var touch   = event.touches[0] || event.changedTouches[0],
3181                    touch_x = touch.pageX;
3182
3183                if (touch_x - _this.touch_start_x > 50) {
3184                    if (_this.index > 0) {
3185                        _this._prev_slide();
3186                    } else {
3187                        _this.intervall = setInterval(_this._next_slide.bind(_this), _this.time);
3188                    }
3189                }
3190                else if (touch_x - _this.touch_start_x < -50) {
3191                    if (_this.index < _this.$slides.length - 1) {
3192                        _this._next_slide();
3193                    } else {
3194                        _this.intervall = setInterval(_this._next_slide.bind(_this), _this.time);
3195                    }
3196                }
3197            });
3198        },
3199
3200        _prev_slide: function() {
3201            var _this = this;
3202
3203            _this.index--;
3204            if (_this.index < 0) {
3205                _this.index = _this.$slides.length - 1;
3206            }
3207
3208            _this._slide();
3209        },
3210
3211        _next_slide: function() {
3212            var _this = this;
3213
3214            _this.index++;
3215            if (_this.index >= _this.$slides.length) {
3216                _this.index = 0;
3217            }
3218
3219            _this._slide();
3220        },
3221
3222        _slide: function() {
3223            var _this = this,
3224                value = 'translate(-' + _this.index * 100 / _this.$slides.length + '%)';
3225
3226            clearInterval(_this.intervall);
3227            _this.$slider.style.transform = value;
3228            _this.$slider.style.WebkitTransform = value;
3229            _this.$slider.style.msTransform = value;
3230            _this.intervall = setInterval(_this._next_slide.bind(_this), _this.time);
3231            _this._manage_control();
3232        },
3233
3234        _manage_control: function() {
3235            var _this = this;
3236
3237            if (_this.index >= 0 && _this.index < _this.$slides.length - 1) {
3238                _this.$next.classList.add('show');
3239            } else {
3240                _this.$next.classList.remove('show');
3241            }
3242
3243            if (_this.index > 0 && _this.index < _this.$slides.length) {
3244                _this.$prev.classList.add('show');
3245            } else {
3246                _this.$prev.classList.remove('show');
3247            }
3248        },
3249
3250        _set_height: function() {
3251            var _this   = this,
3252                highest = 0,
3253                height = 0;
3254
3255            // reset height
3256            _this.$slider_wrapper.style.height = 'auto';
3257            _this.$slider.style.height = 'auto';
3258
3259            for (var i = 0; i < _this.$slides.length; i++) {
3260                height = _this.$slides[i].clientHeight;
3261                if (height > highest) {
3262                    highest = height;
3263                }
3264            }
3265
3266            height = height + 10;
3267
3268            _this.$slider_wrapper.style.height = highest + 'px';
3269            _this.$slider.style.height = highest + 'px';
3270        }
3271    };
3272
3273    var $sliders = document.querySelectorAll('.steuernews_article_slider');
3274
3275    for (var i = 0, len = $sliders.length; i < len; i++) {
3276        new Slider($sliders[i]).init();
3277    }
3278
3279})(document);
3280
3281/* Source common/js/scripts/95_checkliste_jahreswechsel.js */
3282
3283// DIALOG
3284// Wird gebraucht für: Checkliste zum Jahreswechsel
3285// -------------------------------------------------------------------------------------------------
3286
3287(function(document) {
3288    var Dialog = function($dialog_wrapper) {
3289        var _this = this;
3290
3291        _this.$dialog_wrapper = $dialog_wrapper;
3292        _this.$close_dialogs  = $dialog_wrapper.querySelectorAll('.close_dialog');
3293        _this.$dialog_focus   = $dialog_wrapper.querySelector('.dialog_focus');
3294        _this.$close          = $dialog_wrapper.querySelector('.close');
3295        _this.$reset_button   = $dialog_wrapper.querySelector('.reset_button');
3296        _this.$submit_button  = $dialog_wrapper.querySelector('.submit_button');
3297        _this.dialog_id       = $dialog_wrapper.getAttribute('id');
3298        _this.$open_dialog    = document.querySelector('[href="#' + _this.dialog_id + '"]');
3299    };
3300
3301    Dialog.prototype = {
3302        init: function() {
3303            var _this = this;
3304
3305            for (var i = 0, $close_dialog; $close_dialog = _this.$close_dialogs[i]; i++) {
3306                $close_dialog.addEventListener('click', _this._hide_dialog.bind(_this, $close_dialog));
3307            }
3308
3309            _this._auto_open_dialog();
3310        },
3311
3312        _hide_dialog: function($close_dialog, event) {
3313            var _this = this;
3314
3315            if ($close_dialog !== _this.$submit_button) {
3316                event.preventDefault();
3317            }
3318
3319            if ($close_dialog === _this.$submit_button) {
3320                return;
3321            }
3322
3323            _this.$dialog_wrapper.classList.remove('show');
3324
3325            _this._expiration_date();
3326        },
3327
3328        _auto_open_dialog: function() {
3329            var _this            = this,
3330                now              = new Date().getTime(),
3331                expiration_date  = localStorage.getItem(domain + '_' + _this.dialog_id + '_expiration_date') || 0,
3332                auto_open_dialog = _this.$dialog_wrapper.getAttribute('data-auto-open-dialog');
3333
3334            if (auto_open_dialog === 'true' && now < expiration_date) {
3335                return;
3336            }
3337
3338            if (location.hash && location.hash.substr(1) === _this.dialog_id || auto_open_dialog === 'true') {
3339                _this.$dialog_wrapper.classList.add('show');
3340            }
3341        },
3342
3343        _expiration_date: function() {
3344            var _this = this,
3345                now   = new Date().getTime(),
3346                days  = parseInt(_this.$dialog_wrapper.getAttribute('data-expiration-date'));
3347
3348            if (days) {
3349                localStorage.setItem(domain + '_' + _this.dialog_id + '_expiration_date', now + days * 24 * 60 * 60 * 1000);
3350            }
3351        }
3352    };
3353
3354    var $dialog_wrappers = document.querySelectorAll('.dialog_wrapper');
3355
3356    for (var i = 0, len = $dialog_wrappers.length; i < len; i++) {
3357        new Dialog($dialog_wrappers[i]).init();
3358    }
3359})(document);
3360
3361/* Source common/js/scripts/95_load_youtube_iframe.js */
3362
3363// YOUTUBE NACHTRÄGLICH LADEN
3364// -------------------------------------------------------------------------------------------------
3365
3366(function(document) {
3367    var YoutubePlayer = function($movies) {
3368        this.$movies   = $movies;
3369    };
3370
3371    YoutubePlayer.prototype = {
3372        init: function() {
3373            if (sessionStorage.getItem('show_youtube')) {
3374                this._show_all_movies();
3375            } else {
3376                this._setup_ui();
3377            }
3378        },
3379
3380        _setup_ui: function() {
3381            var _this = this;
3382
3383            for (var i = 0; i < this.$movies.length; i++) {
3384                this.$movies[i].querySelector('.button').addEventListener('click', function(event) {
3385                    event.preventDefault();
3386                    sessionStorage.setItem('show_youtube', true);
3387                    _this._show_all_movies();
3388                });
3389            }
3390        },
3391
3392        _show_all_movies: function() {
3393            for (var i = 0; i < this.$movies.length; i++) {
3394                var $iframe     = this.$movies[i].querySelector('iframe'),
3395                    $overlay    = this.$movies[i].querySelector('.youtube_wrapper');
3396
3397                $iframe.setAttribute('src', $iframe.getAttribute('data-src'));
3398                $iframe.removeAttribute('data-src');
3399                $overlay.classList.remove('show_message');
3400            }
3401        }
3402    };
3403
3404    var $youtube_player = document.querySelectorAll('.youtube_player');
3405
3406    if ($youtube_player.length > 0) {
3407        new YoutubePlayer($youtube_player).init();
3408    }
3409
3410}(document));
3411
3412/* Source common/js/scripts/96_open_street_map.js */
3413
3414// OPEN STREET MAPS
3415// -------------------------------------------------------------------------------------------------
3416
3417(function(window) {
3418    var OpenStreetMap = function(id, locations, additional_markers, options) {
3419        this.id                         = id;
3420        this.locations                  = locations;
3421        this.additional_markers         = additional_markers;
3422        this.options                    = options;
3423        this.$map_id                    = document.querySelector('#open_street_map_' + this.id);
3424        this.$layer_additional_markers  = [];
3425        this.window_width               = window.innerWidth;
3426        this.$selected_location;
3427        this.$map;
3428    };
3429
3430    OpenStreetMap.prototype = {
3431        init: function() {
3432            var _this = this;
3433
3434            this._init_map();
3435            this._init_locations_markers();
3436            this._init_additional_markers();
3437            this._init_plan_route();
3438
3439            window.addEventListener('resize', function() {
3440
3441                // Manche mobilen Geräte lösen beim vertikalen Scrollen ein resize-Event aus, da die Browserleiste ein-/ausgeblendet wird
3442
3443                if (_this.window_width !== window.innerWidth) {
3444                    _this.window_width = window.innerWidth;
3445                    _this._center_map();
3446                }
3447            });
3448        },
3449
3450        // OpenStreetMap Karte initialisieren
3451
3452        _init_map: function() {
3453            var _this = this;
3454            $view = new ol.View({
3455                center:         ol.proj.fromLonLat([this.options.center_lng, this.options.center_lat]),
3456                zoom:           this.options.zoom,
3457                minZoom:        this.options.min_zoom,
3458                maxZoom:        this.options.max_zoom,
3459                enableRotation: false
3460            });
3461
3462            var url = '/maps/tile/{z}/{x}/{y}.png';
3463
3464            // Anderer Tiles Server für die Verwendung auf der Beta
3465            if (window.location.hostname === 'beta.atikon.io') {
3466                url = 'https://maps.atikon.com/maps/tile/{z}/{x}/{y}.png';
3467            }
3468
3469            var tile = new ol.layer.Tile({
3470                source: new ol.source.OSM({
3471                    url: url
3472                })
3473            });
3474
3475            this.$map = new ol.Map({
3476
3477                // 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.
3478
3479                interactions: ol.interaction.defaults({
3480                    dragPan:        false,  // Lösche die DragPan Standard Funktion
3481                    mouseWheelZoom: false   // Kein Zoomen beim Betätigen des Mausrads
3482                }).extend([new ol.interaction.DragPan({
3483
3484                    // Fügt eine eigene abgeleitete Drag Funktion ein und erweitere die Standardfunktionen um diese
3485
3486                    condition: function(event) {
3487
3488                        // Wenn iOS: return regelt das Aktivieren der Drag-Funktion
3489
3490                        if (document.querySelector('html').classList.contains('ios')) {
3491
3492                            // Chrome hat momentan ein Pointer-Event und kein Touch-Event wie iOS
3493
3494                            if (event.originalEvent.touches) {
3495                                var $map_overlay = _this.$map_id.querySelector('.map_overlay');
3496
3497                                if (event.originalEvent.touches.length > 1) {
3498                                    $map_overlay.classList.remove('show');
3499                                } else {
3500
3501                                    // Blende eine Bedienwarnung "zwei Finger zum Verschieben" ein
3502
3503                                    $map_overlay.classList.add('show');
3504                                    setTimeout(function() {
3505                                        $map_overlay.classList.remove('show');
3506                                    }, 1000);
3507                                    return false;
3508                                }
3509                            }
3510                        }
3511
3512                        return true;
3513                    }
3514                })]),
3515                target: 'map_' + this.id,
3516                layers: [tile],
3517                loadTilesWhileAnimating: true,
3518                view:   $view
3519            });
3520
3521            // Soll Karte nach Graustufen konvertiert werden?
3522
3523            if (this.options.grayscale) {
3524                tile.on('postcompose', function(event) {
3525                    var imageData = _this._convert_map_to_greyscale(event.context)
3526                    event.context.putImageData(imageData, 0, 0);
3527                });
3528            }
3529
3530            this._setup_zoom_buttons();
3531        },
3532
3533        // Zoom Buttons als inaktiv kennzeichnen
3534
3535        _setup_zoom_buttons: function() {
3536            var _this = this,
3537                $zoom_in_button    = this.$map_id.querySelector('.ol-zoom-in'),
3538                $zoom_out_button   = this.$map_id.querySelector('.ol-zoom-out'),
3539                $view              = this.$map.getView();
3540
3541            if ($view.getZoom() >= this.options.max_zoom) {
3542                $zoom_in_button.classList.add('disabled');
3543            }
3544            if ($view.getZoom() <= this.options.min_zoom) {
3545                $zoom_out_button.classList.add('disabled');
3546            }
3547
3548            $view.on('change:resolution', function() {
3549                if ($view.getZoom() >= _this.options.max_zoom) {
3550                    $zoom_in_button.classList.add('disabled');
3551                } else {
3552                    $zoom_in_button.classList.remove('disabled');
3553                }
3554
3555                if ($view.getZoom() <= _this.options.min_zoom) {
3556                    $zoom_out_button.classList.add('disabled');
3557                } else {
3558                    $zoom_out_button.classList.remove('disabled');
3559                }
3560            });
3561        },
3562
3563        // Karte nach Graustufen konvertieren
3564
3565        _convert_map_to_greyscale: function(context) {
3566            var imageData = context.getImageData(0, 0, context.canvas.width, context.canvas.height),
3567                data = imageData.data;
3568
3569            for (i = 0; i < data.length; i = i + 4) {
3570                var red     = data[i],
3571                    green   = data[i + 1],
3572                    blue    = data[i + 2],
3573                    alpha   = data[i + 3];
3574
3575                 var average = (red + green + blue) / 3;
3576
3577                 // Beim Laden der Karte die Transparenz auf Null setzen
3578
3579                 if (average === 0) {
3580                     alpha = 0;
3581                 } else {
3582                     alpha = 255;
3583                 }
3584
3585                 data[i] = average;     // Rot
3586                 data[i + 1] = average; // Grün
3587                 data[i + 2] = average; // Blau
3588                 data[i + 3] = alpha;   // Alpha
3589            }
3590
3591            return imageData;
3592        },
3593
3594        // Marker für Standort positionieren
3595
3596        _init_locations_markers: function() {
3597            for (var i = 0; i < this.locations.length; i++) {
3598
3599                $marker = this._add_marker(
3600                    this.locations[i].lng,
3601                    this.locations[i].lat,
3602                    this.locations[i].marker
3603                );
3604
3605                this.$map.addLayer($marker);
3606                $marker.setZIndex(10);
3607            }
3608
3609            if (this.locations.length === 1) {
3610                this.$selected_location = this.locations[0];
3611            }
3612
3613            this._center_map();
3614        },
3615
3616        // Zusätzlich Marker positionieren
3617
3618        _init_additional_markers: function() {
3619            for (var i = 0; i < this.additional_markers.length; i++) {
3620                $marker = this._add_marker(
3621                    this.additional_markers[i].lng,
3622                    this.additional_markers[i].lat,
3623                    this.additional_markers[i].marker
3624                );
3625
3626                this.$layer_additional_markers.push($marker);
3627                this.$map.addLayer($marker);
3628                $marker.setZIndex(8);
3629                $marker.setVisible(false);
3630            }
3631
3632            if (this.additional_markers.length > 0) {
3633                this._manage_additional_markers_visibility();
3634                var _this = this;
3635
3636                this.$map.getView().on('propertychange', function(event) {
3637                    if (event.key === 'resolution') {
3638                        _this._manage_additional_markers_visibility();
3639                    }
3640                });
3641            }
3642        },
3643
3644        // Zusätzlich Marker Sichtbarkeit anhand der Zoomstufe regulieren
3645
3646        _manage_additional_markers_visibility: function() {
3647            for (var i = 0; i < this.additional_markers.length; i++) {
3648                if (this.$map.getView().getZoom() >= this.additional_markers[i].min_zoom_visible) {
3649                    this.$layer_additional_markers[i].setVisible(true);
3650                } else {
3651                    this.$layer_additional_markers[i].setVisible(false);
3652                }
3653            }
3654        },
3655
3656        // Routenplanung initialisieren
3657
3658        _init_plan_route: function() {
3659            var _this = this,
3660                $destination_select = this.$map_id.querySelector('select'),
3661                $plan_route_form    = this.$map_id.querySelector('form');
3662
3663            if ($plan_route_form) {
3664
3665                // Mehrere Standorte?
3666
3667                if ($destination_select) {
3668                    $destination_select.addEventListener('change', function() {
3669                        if (this.options[this.selectedIndex].value !== '') {
3670                            _this.$selected_location = _this.locations[(this.options[this.selectedIndex].value)];
3671                            _this._update_plan_route_form($plan_route_form);
3672                        } else {
3673
3674                            // Kein Standort ausgewählt
3675                            _this.$selected_location = '';
3676                            $plan_route_form.action = '';
3677                            _this._center_map();
3678                        }
3679                        _this._center_map();
3680                    });
3681                } else {
3682                    _this._update_plan_route_form($plan_route_form);
3683                }
3684            }
3685        },
3686
3687        // Aktion für die Routenplanung via GoogleMaps zusammenbauen
3688
3689        _update_plan_route_form: function($form) {
3690            var $daddr          = this.$map_id.querySelector('[name="daddr"]');
3691
3692            $form.action = 'https://maps.google.de/maps';
3693            $daddr.value = this.$selected_location.postal_code + ' ' + this.$selected_location.locality + ', ' + this.$selected_location.street_address;
3694        },
3695
3696        // Standardaktion für das Setzen von Markierungen (Standort und zusätzliche Markierungen)
3697
3698        _add_marker: function(lng, lat, marker) {
3699            return new ol.layer.Vector({
3700                source: new ol.source.Vector({
3701                    features: [new ol.Feature({
3702                        geometry: new ol.geom.Point(
3703                            ol.proj.transform([lng, lat],
3704                            this.options.dataProjection,
3705                            this.options.featureProjection
3706                        )),
3707                    })]
3708                }),
3709
3710                // Dient zur Ausrichtung der Markierung
3711
3712                style: new ol.style.Style({
3713                    image: new ol.style.Icon({
3714                        anchor:         [0.5, 1],
3715                        anchorXUnits:   'fraction',
3716                        anchorYUnits:   'fraction',
3717                        src:            marker['href'],
3718                        scale:          0.5,
3719                        maxZoom:        1,
3720                    })
3721                })
3722            });
3723        },
3724
3725        // Standardaktion zum Zentrieren der Karte
3726
3727        _center_map: function() {
3728
3729            // Ist eine Zentrierung der Karte gewünscht?
3730
3731            if (this.options.center_lng === 0 && this.options.center_lat === 0) {
3732
3733                // Gibt es nur einen Standort bzw. ist einer ausgewählt?
3734
3735                if (this.locations.length === 1 || this.$selected_location) {
3736                    this._center_map_point(
3737                        this.$selected_location.lng,
3738                        this.$selected_location.lat,
3739                        this.options.zoom
3740                    );
3741                } else {
3742                    // mehrere Standorte anzeigen
3743
3744                    this._center_map_more_locations();
3745                }
3746            } else {
3747                this._center_map_point(
3748                    this.options.center_lng,
3749                    this.options.center_lat,
3750                    this.options.center_zoom
3751                );
3752            }
3753        },
3754
3755        // Karte auf einen Punkt zentrieren
3756
3757        _center_map_point: function(lng, lat, zoom) {
3758            this.$map.getView().animate({
3759                center:     ol.proj.fromLonLat([lng, lat]),
3760                duration:   500,
3761                zoom:       zoom
3762            });
3763        },
3764
3765        // Karte neu zentrieren anhand von mehreren Standorten mit einem Sicherheitsabstand
3766
3767        _center_map_more_locations: function() {
3768            var extent = ol.proj.transformExtent(
3769                this._get_locations_bounds(),
3770                this.options.dataProjection,
3771                this.options.featureProjection
3772            );
3773
3774            this.$map.getView().fit(extent, {
3775                size:                   this.$map.getSize(),
3776                padding:                this._max_marker_padding(),
3777                constrainResolution:    false,
3778                duration:               500
3779            });
3780        },
3781
3782        // Minimale und maximale Grenzen der Standorte als Koordinaten-Array
3783
3784        _get_locations_bounds: function() {
3785            var lng_min = this.locations[0].lng,
3786                lng_max = this.locations[0].lng,
3787                lat_min = this.locations[0].lat,
3788                lat_max = this.locations[0].lat;
3789
3790            for (var i = 1; i < this.locations.length; i++) {
3791                if (this.locations[i].lng > lng_max) {
3792                    lng_max = this.locations[i].lng;
3793                }
3794                if (this.locations[i].lng < lng_min) {
3795                    lng_min = this.locations[i].lng;
3796                }
3797                if (this.locations[i].lat > lat_max) {
3798                    lat_max = this.locations[i].lat;
3799                }
3800                if (this.locations[i].lat < lat_min) {
3801                    lat_min = this.locations[i].lat;
3802                }
3803            }
3804
3805            return [lng_min, lat_min, lng_max, lat_max];
3806        },
3807
3808        // Sicherheitsabstand der Markierungen zum User-Interface und den Kartenrändern
3809
3810        _max_marker_padding: function() {
3811            var max_height      = 0,
3812                max_width       = 0,
3813                default_padding = 30
3814                result          = [];
3815
3816            for (var i = 0; i < this.locations.length; i++) {
3817                if (this.locations[i].marker.width > max_width) {
3818                    max_width = this.locations[i].marker.width;
3819                }
3820                if (this.locations[i].marker.height > max_height) {
3821                    max_height = this.locations[i].marker.height;
3822                }
3823            }
3824
3825            result = [max_height + default_padding, max_width / 2 + default_padding + this.$map_id.querySelector('button').offsetWidth, default_padding, max_width / 2 + default_padding];
3826
3827            return result;
3828        }
3829    };
3830
3831    // Hole von jeder Karte die vorkommt die Daten und lege ein eigenes JavaScript-Objekt an
3832
3833    if (window.$open_street_map_data) {
3834        for (var i = 0, len = window.$open_street_map_data.length; i < len; i++) {
3835            var id                  = window.$open_street_map_data[i].id,
3836                locations           = window.$open_street_map_data[i].locations,
3837                additional_markers  = window.$open_street_map_data[i].additional_markers,
3838                options             = window.$open_street_map_data[i].options;
3839
3840            new OpenStreetMap(id, locations, additional_markers, options).init();
3841        }
3842    }
3843
3844})(window);
3845
3846/* Source common/js/scripts/97_accordion.js */
3847
3848// ACCORDION
3849// Wird verwendet für: infolist_list_content, listfoldercontent, u_online_benefits_1
3850// -------------------------------------------------------------------------------------------------
3851
3852(function(document, window) {
3853    var Accordion = function($accordion) {
3854        this.$accordion     = $accordion;
3855        this.$tabs          = $accordion.querySelectorAll('[role=tab]');
3856        this.one_tab_open   = true; // only one Tab open
3857    }
3858    Accordion.prototype = {
3859        init: function() {
3860            var _this  = this;
3861
3862            window.addEventListener('load', function() {
3863                var interval = setInterval(function() { // Timeout notwendig wegen SmoothScroll (hash)
3864                    clearInterval(interval);
3865                    _this._init_tabs();
3866                    _this._init_location_hash();
3867                    _this._init_keyboard_nav();
3868                    _this._on_window_resize();
3869                }, 300);
3870            });
3871        },
3872
3873        _on_window_resize: function() {
3874            var _this  = this,
3875                window_width = window.innerWidth;
3876
3877            window.addEventListener('resize', function() {
3878                var interval;
3879
3880                if (window_width != window.innerWidth) { // Notwendig damit die Veränderung der Höhe der Seite nicht den Event auslöst
3881                    _this._set_tab_max_height();
3882
3883                    interval = setInterval(function() {  // Macht die Animation sauberer - eliminiert Ruckeln
3884                        clearInterval(interval);
3885                        for (var i = 0; i < _this.$tabs.length; i++) {
3886                            _this.$tabs[i].$tabpanel.classList.add('animated');
3887                        }
3888                    }, 50);
3889                }
3890            });
3891        },
3892
3893        _init_tabs: function() {
3894            var _this  = this;
3895
3896            for (var i = 0; i < _this.$tabs.length; i++) {
3897                _this.$tabs[i].index     = i;
3898                _this.$tabs[i].$tabpanel = document.querySelector('#' + _this.$tabs[i].getAttribute('aria-controls'));
3899
3900                _this.$tabs[i].addEventListener('click', function(event) {
3901                    event.preventDefault();
3902                    _this._toggle_tabpanel(this);
3903                });
3904            }
3905
3906            _this._set_tab_max_height();
3907
3908            for (var i = 0; i < _this.$tabs.length; i++) {
3909                _this.$tabs[i].$tabpanel.classList.add('animated');
3910            }
3911        },
3912
3913        _init_location_hash: function() {
3914            var anchor = location.hash;
3915
3916            if (anchor.length > 0) {
3917                var $accordion_entry = this.$accordion.querySelector(anchor);
3918
3919                if ($accordion_entry) {
3920                    this._open_tabpanel($accordion_entry);
3921                }
3922            }
3923        },
3924
3925        _toggle_tabpanel: function($tab) {
3926            if ($tab.getAttribute('aria-expanded') === 'true') {
3927                this._close_tabpanel($tab);
3928            } else {
3929                this._open_tabpanel($tab);
3930                this._change_hash($tab);
3931
3932                if (this.one_tab_open) {
3933                    this._close_other_tabs($tab);
3934                }
3935            }
3936        },
3937
3938        _close_tabpanel: function($tab) {
3939            $tab.setAttribute('aria-expanded', 'false');
3940            $tab.$tabpanel.setAttribute('aria-hidden', 'true');
3941            $tab.$tabpanel.style.maxHeight = 0;
3942        },
3943
3944        _open_tabpanel: function($tab) {
3945            $tab.setAttribute('aria-expanded', 'true');
3946            $tab.$tabpanel.setAttribute('aria-hidden', 'false');
3947            $tab.$tabpanel.style.maxHeight = $tab.$tabpanel.max_height + 'px';
3948        },
3949
3950        _change_hash: function($tab) {
3951            var scroll_to_x = window.pageXOffset,
3952                scroll_to_y = window.pageYOffset;
3953
3954            window.location.hash = $tab.getAttribute('id');
3955            window.scrollTo(scroll_to_x, scroll_to_y); // Verhindert das Springen vom Browser durch den Hash
3956        },
3957
3958        _close_other_tabs: function($tab) {
3959            for (var i = 0; i < this.$tabs.length; i++) {
3960                if (this.$tabs[i] !== $tab) {
3961                    this._close_tabpanel(this.$tabs[i]);
3962                }
3963            }
3964        },
3965
3966        _set_tab_max_height: function() {
3967            for (var i = 0; i < this.$tabs.length; i++) {
3968                var $tab            = this.$tabs[i],
3969                    is_active_tab   = $tab.getAttribute('aria-expanded');
3970
3971                $tab.$tabpanel.classList.remove('animated');
3972                $tab.$tabpanel.style.maxHeight = 'none';
3973
3974                // Öffne das Element und setzte die Höhe nicht
3975                $tab.setAttribute('aria-expanded', 'true');
3976                $tab.$tabpanel.setAttribute('aria-hidden', 'false');
3977                $tab.$tabpanel.max_height = $tab.$tabpanel.clientHeight;
3978
3979                if (is_active_tab === 'false') {
3980                    this._close_tabpanel($tab);
3981                } else {
3982                    this._open_tabpanel($tab);
3983                }
3984            }
3985        },
3986
3987        _init_keyboard_nav: function() {
3988            var _this = this;
3989
3990            for (var i = 0; i < _this.$tabs.length; i++) {
3991                _this.$tabs[i].addEventListener('keydown', function(event) {
3992                    switch (event.keyCode) {
3993                        case 9: // Tabulator
3994                            if (event.shiftKey) {
3995                                _this._change_focused_tab(event, this.index - 1)
3996                            } else {
3997                                if (this.getAttribute('aria-expanded') === 'false') {
3998                                    _this._change_focused_tab(event, this.index + 1);
3999                                }
4000                            }
4001                            break;
4002                        case 13: // Eingabe
4003                            _this._toggle_tabpanel(this);
4004                            break;
4005                        case 32: // Leertaste
4006                            _this._toggle_tabpanel(this);
4007                            break;
4008                        case 35:  // Pos1
4009                            _this._change_focused_tab(event, _this.$tabs.length - 1);
4010                            break;
4011                        case 36:  // Ende
4012                            _this._change_focused_tab(event, 0);
4013                            break;
4014                        case 37: // Pfeil nach links
4015                            _this._change_focused_tab(event, this.index - 1);
4016                            break;
4017                        case 38: // Pfeil nach oben
4018                            _this._change_focused_tab(event, this.index - 1);
4019                            break;
4020                        case 39: // Pfeil nach rechts
4021                            _this._change_focused_tab(event, this.index + 1);
4022                            break;
4023                        case 40: // Pfeil nach unten
4024                            _this._change_focused_tab(event, this.index + 1);
4025                            break;
4026                    }
4027                });
4028            }
4029        },
4030
4031        _change_focused_tab: function(event, index) {
4032            if (index === this.$tabs.length || index === -1) {
4033                return false;
4034            }
4035
4036            event.preventDefault();
4037            $tab = this.$tabs[index];
4038
4039            for (var i = 0; i < this.$tabs.length; i++) {
4040                this.$tabs[i].setAttribute('aria-selected', 'false');
4041            }
4042
4043            $tab.setAttribute('aria-selected', 'true');
4044            $tab.focus();
4045
4046            return true;
4047        }
4048    };
4049
4050    var $accordions = document.querySelectorAll('.accordion');
4051
4052    for (var i = 0; i < $accordions.length; i++) {
4053        new Accordion($accordions[i]).init();
4054    }
4055
4056})(document, window);
4057
4058/* Source common/js/scripts/98_onlinetool_popup.js */
4059
4060// ONLINETOOL POPUP
4061// Wird verwendet für: download_overview, onlinetools_popup_overview, video_tutorials_overview
4062// -------------------------------------------------------------------------------------------------
4063
4064(function(document, window) {
4065    var OnlinetoolPopup = function($onlinetool) {
4066        var _this = this;
4067
4068        _this.$onlinetool = $onlinetool;
4069
4070        _this.title = $onlinetool.getAttribute('title');
4071        _this.id    = '#' + $onlinetool.getAttribute('data-popup-id');
4072        _this.href  = $onlinetool.getAttribute('href');
4073    },
4074
4075    $body = document.querySelector('body'),
4076    $popup,
4077    $content,
4078    $close,
4079    $iframe;
4080
4081    // Private
4082
4083    function _create_element(html) {
4084        var $div            = document.createElement('div'),
4085            $filtered_nodes = [],
4086            $nodes;
4087
4088        $div.innerHTML = html.trim(); 
4089        $nodes         = $div.childNodes;
4090
4091        for (var i = 0, len = $nodes.length; $nodes !== null && i < len; i++) {
4092            if ($nodes[i].nodeType === 1) {
4093                $filtered_nodes.push($nodes[i]);
4094            }
4095        }
4096
4097        return $filtered_nodes;
4098    }
4099
4100    function _create_popup() {
4101        $popup   = document.querySelector('.popup_overlay');
4102        $content = $popup.querySelector('.popup_content');
4103        $close   = $popup.querySelector('.popup_close');
4104        $iframe  = $popup.querySelector('iframe');
4105
4106        $iframe.addEventListener('load', function() {
4107            if ($iframe.getAttribute('src') && $iframe.getAttribute('src').length && $popup.classList.contains('show')) {
4108                $iframe.classList.add('show');
4109            }
4110        });
4111    }
4112
4113    function _close_popup() {
4114        var _close = function() {
4115            $body.classList.remove('no_scroll');
4116            $content.classList.remove('show');
4117            $iframe.classList.remove('show');
4118
4119            window.history.replaceState(null, document.title, window.location.pathname);
4120        };
4121
4122        $close.addEventListener('click', function(event) {
4123            event.preventDefault();
4124            _close();
4125        });
4126
4127        document.addEventListener('keydown', function(event) {
4128            if ($popup.classList.contains('show') && event.which === 27) {
4129                _close();
4130            }
4131        });
4132
4133        $content.addEventListener('transitionend', function() {
4134            if (!$content.classList.contains('show')) {
4135                $popup.classList.remove('show');
4136            }
4137        });
4138    }
4139
4140    _create_popup();
4141    _close_popup();
4142
4143    // Public
4144
4145    OnlinetoolPopup.prototype = {
4146        init: function() {
4147            var _this = this;
4148
4149            _this.$onlinetool.addEventListener('click', function(event) {
4150                event.preventDefault();
4151                _this.open();
4152            });
4153        },
4154
4155        open: function() {
4156            var _this = this;
4157
4158            $body.classList.add('no_scroll');
4159            $popup.classList.add('show');
4160            $content.classList.add('show');
4161            $iframe.setAttribute('src', _this.href);
4162
4163            window.history.replaceState(null, document.title, _this.id);
4164        }
4165    };
4166
4167    if (window.device.mobile || window.device.tablet) {
4168        return;
4169    }
4170
4171    var $onlinetools = document.querySelectorAll('[data-popup="true"]'),
4172        $onlinetool;
4173
4174    for (var i = 0, len = $onlinetools.length; i < len; i++) {
4175        $onlinetool = new OnlinetoolPopup($onlinetools[i]);
4176
4177        $onlinetool.init();
4178
4179        if ($onlinetool.id === window.location.hash) {
4180            $onlinetool.open();
4181        }
4182    }
4183})(document, window);
4184
4185/* Source common/js/scripts/99_benefit_slide.js */
4186
4187// KARRIEREPAKET VORTEILE SLIDES
4188// -------------------------------------------------------------------------------------------------
4189
4190(function(document) {
4191    var next = document.querySelectorAll('.kpt_benefit_entry .navigation .next'),
4192        prev = document.querySelectorAll('.kpt_benefit_entry .navigation .prev'),
4193        kpt_benefit_entries = document.querySelectorAll('.kpt_benefit_entry');
4194
4195    for (var i = 0, nextbutton; nextbutton = next[i]; i++) {
4196        nextbutton.addEventListener('click', function(event) {
4197            this.parentNode.parentNode.classList.add('show');
4198        });
4199    }
4200
4201    for (var i = 0, prevbutton; prevbutton = prev[i]; i++) {
4202        prevbutton.addEventListener('click', function(event) {
4203            this.parentNode.parentNode.classList.remove('show');
4204        });
4205    }
4206}(document));
4207
4208/* Source common/js/scripts/99_kpt_interview_card.js */
4209
4210(function(document) {
4211
4212    var CardFlipper = function($interview_overview) {
4213        var _this = this;
4214
4215        _this.$overview = $interview_overview;
4216        _this.$interviews = _this.$overview.querySelectorAll('.kpt_interview');
4217    };
4218
4219    CardFlipper.prototype = {
4220        init: function() {
4221            var _this = this;
4222
4223            for (var i = 0; i < _this.$interviews.length; i++) {
4224                var $interview = _this.$interviews[i];
4225
4226                $interview.addEventListener('click', function() {
4227                    _this._flip_element(this);
4228                });
4229
4230                $interview.addEventListener('keydown', function(event) {
4231                    if (event.keyCode == 13) { // Enter
4232                        _this._flip_element(this);
4233                    }
4234                });
4235            }
4236        },
4237
4238        _flip_element: function($element) {
4239            $element.classList.toggle("flip");
4240        }
4241    }
4242
4243    var $interview_overviews = document.querySelectorAll('.kpt_interview_overview.card');
4244
4245    for (var i = 0; i < $interview_overviews.length; i++) {
4246        new CardFlipper($interview_overviews[i]).init();
4247    }
4248}(document));
4249

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.