1// must be loaded at the end of the body element 2;(function () { 3 var addEvent = function (element, events, func) { 4 events = events.split(' ') 5 for (var i = 0; i < events.length; i++) { 6 if (element.addEventListener) { 7 element.addEventListener(events[i], func, false) 8 } else { 9 element.attachEvent('on' + events[i], func) 10 } 11 } 12 }, 13 triggerEvent = function (element, eventName) { 14 var evt = document.createEvent('HTMLEvents') 15 evt.initEvent(eventName, true, true) 16 element.dispatchEvent(evt) 17 }, 18 eventPreventDefault = function (event) { 19 event = event || window.event 20 if (!event) { 21 return 22 } 23 if (event.preventDefault) { 24 event.preventDefault() 25 } else { 26 event.returnValue = false 27 } 28 }, 29 eventStop = function (event) { 30 event = event || window.event 31 if (!event) { 32 return 33 } 34 if (event.stopPropagation) { 35 event.stopPropagation() 36 } else { 37 event.cancelBubble = true 38 } 39 }, 40 elementMatches = function (element, selector) { 41 var methods = [ 42 'matches', 43 'matchesSelector', 44 'msMatchesSelector', 45 'mozMatchesSelector', 46 'webkitMatchesSelector', 47 ] 48 for (var i = 0; i < methods.length; i++) { 49 if (methods[i] in element) { 50 return element[methods[i]](selector) 51 } 52 } 53 return false 54 }, 55 addClass = function (element, className) { 56 var elements = 'length' in element && !('className' in element) ? element : [element] 57 var classNames = typeof className === 'string' ? className.split(' ') : className 58 for (var i = 0; i < elements.length; i++) { 59 for (var j = 0; j < classNames.length; j++) { 60 if (!hasClass(elements[i], classNames[j])) { 61 elements[i].className += ' ' + classNames[j] 62 } 63 } 64 } 65 }, 66 removeClass = function (element, className) { 67 var elements = 'length' in element && !('className' in element) ? element : [element] 68 var classNames = typeof className === 'string' ? className.split(' ') : className 69 for (var i = 0; i < elements.length; i++) { 70 for (var j = 0; j < classNames.length; j++) { 71 if (hasClass(elements[i], classNames[j])) { 72 elements[i].className = elements[i].className.replace( 73 new RegExp('(?:^|\\s+)' + classNames[j] + '(?:$|\\s+)'), 74 ' ', 75 ) 76 } 77 } 78 } 79 }, 80 hasClass = function (element, className) { 81 return !!element.className.match('(?:^|\\s)' + className + '(?:$|\\s)') 82 }, 83 toggleClass = function (element, className) { 84 return hasClass(element, className) 85 ? removeClass(element, className) 86 : addClass(element, className) 87 }, 88 getZoomLevel = function () { 89 if (document.documentElement.clientWidth && window.innerWidth) { 90 return document.documentElement.clientWidth / window.innerWidth 91 } 92 return 1 93 }, 94 each = function (array, callback) { 95 if (!array || !array.length) { 96 return 97 } 98 for (var i = 0; i < array.length; i++) { 99 callback(array[i], i) 100 } 101 }, 102 navMain = document.querySelector('.main-navigation'), 103 navMainLis, 104 i, 105 element, 106 navMainTouched, 107 touchUsed 108 109 // Main navigation search 110 ;(function (elements) { 111 for (var i = 0; i < elements.length; i++) { 112 addEvent(elements[i].getElementsByTagName('input')[0], 'focus', function () { 113 addClass(this.parentNode, 'focus') 114 }) 115 addEvent(elements[i].getElementsByTagName('button')[0], 'focus', function () { 116 addClass(this.parentNode, 'focus') 117 }) 118 addEvent(elements[i].getElementsByTagName('input')[0], 'blur', function () { 119 removeClass(this.parentNode, 'focus') 120 }) 121 addEvent(elements[i].getElementsByTagName('button')[0], 'blur', function () { 122 removeClass(this.parentNode, 'focus') 123 }) 124 } 125 })(document.querySelectorAll && document.querySelectorAll('.main-navigation-search')) 126 127 // Edge dropdown touch fix 128 if (navMain && navMain.getElementsByTagName('ul').length) { 129 navMainLis = navMain.getElementsByTagName('ul')[0].childNodes 130 for (i = 0; i < navMainLis.length; i++) { 131 if ( 132 navMainLis[i].nodeName && 133 navMainLis[i].nodeName.toLowerCase() === 'li' && 134 navMainLis[i].querySelector('ul,.mega-dropdown') 135 ) { 136 element = navMainLis[i].getElementsByTagName('a') 137 if (element && (element = element[0])) { 138 element.setAttribute('aria-haspopup', 'true') 139 } 140 } 141 } 142 } 143 144 // Dropdown fix for all touch devices 145 if (window.Modernizr && Modernizr.touch) { 146 if (navMain && navMain.getElementsByTagName('ul').length) { 147 // devices supporting touch events may not mean touch input is used 148 // e.g. touch enabled laptops running Windows 8 149 addEvent(navMain, 'touchstart', function (event) { 150 touchUsed = true 151 }) 152 navMainLis = navMain.getElementsByTagName('ul')[0].childNodes 153 for (i = 0; i < navMainLis.length; i++) { 154 if ( 155 navMainLis[i].nodeName && 156 navMainLis[i].nodeName.toLowerCase() === 'li' && 157 navMainLis[i].querySelector('ul,.mega-dropdown') 158 ) { 159 element = navMainLis[i].getElementsByTagName('a') 160 if (element && (element = element[0])) { 161 addEvent(element, 'click', function (event) { 162 if (navMainTouched !== this && touchUsed) { 163 navMainTouched = this 164 eventPreventDefault(event) 165 } 166 }) 167 } 168 } 169 } 170 } 171 } 172 173 // Fixed elements 174 ;(function (header) { 175 if (!header) { 176 return 177 } 178 179 var originalHeight 180 var originalPosition 181 182 var resetStyles = function () { 183 removeClass(header, ['is-fixed', 'is-bottom']) 184 header.parentNode.style.paddingBottom = '' 185 } 186 187 var updateOriginalValues = function () { 188 resetStyles() 189 originalHeight = header.offsetHeight 190 originalPosition = header.offsetTop 191 } 192 193 updateOriginalValues() 194 195 var mediaQuery = window.matchMedia && window.matchMedia('(max-width: 900px)') 196 var mediaQueryMatches = function () { 197 if (mediaQuery) { 198 return mediaQuery.matches 199 } 200 return window.Modernizr && Modernizr.mq && Modernizr.mq('(max-width: 900px)') 201 } 202 203 var scroll = function () { 204 if (getZoomLevel() > 1.01 || mediaQueryMatches()) { 205 resetStyles() 206 return 207 } 208 209 var documentHeight = window.innerHeight || document.documentElement.clientHeight 210 var offset = window.pageYOffset || document.documentElement.scrollTop || 0 211 212 // Only allow scroll positions inside the possible range 213 offset = Math.max( 214 0, 215 Math.min(document.documentElement.scrollHeight - documentHeight, offset), 216 ) 217 218 if (offset < originalPosition) { 219 resetStyles() 220 if (offset + documentHeight - 150 < originalPosition) { 221 addClass(header, 'is-bottom') 222 } 223 return 224 } 225 226 addClass(header, 'is-fixed') 227 if (header.parentNode.style.paddingBottom !== originalHeight + 'px') { 228 header.parentNode.style.paddingBottom = originalHeight + 'px' 229 } 230 } 231 232 addEvent(window, 'resize load', updateOriginalValues) 233 addEvent(window, 'scroll resize load', scroll) 234 scroll() 235 })(document.querySelector && document.querySelector('.header-navigation')) 236 237 // Navigation search 238 ;(function (search) { 239 if (!search) { 240 return 241 } 242 var link = search.querySelector('a') 243 var form = search.querySelector('form') 244 var input = form.querySelector('input') 245 if (!link || !form || !input) { 246 return 247 } 248 249 var close = document.createElement('a') 250 close.href = '' 251 close.className = 'main-navigation-search-close' 252 close.innerHTML = 'close' 253 addEvent(close, 'click', function (event) { 254 eventPreventDefault(event) 255 removeClass(form, 'is-active') 256 }) 257 form.appendChild(close) 258 259 addClass(form, 'main-navigation-search-form') 260 document.body.insertBefore(form, document.body.firstChild) 261 262 addEvent(link, 'click', function (event) { 263 eventPreventDefault(event) 264 addClass(form, 'is-pre-active') 265 // Force layout 266 var trash = form.offsetWidth 267 addClass(form, 'is-active') 268 removeClass(form, 'is-pre-active') 269 input.focus() 270 }) 271 })(document.querySelector && document.querySelector('.main-navigation-search')) 272 273 // Mobile navigation 274 ;(function (nav, page) { 275 if (!nav) { 276 return 277 } 278 let kopfzeile = document.querySelector('.kopfzeile') 279 kopfzeile.insertBefore(nav, kopfzeile.firstChild) 280 //document.body.insertBefore(nav, document.body.firstChild); 281 var navLink 282 var isOpened 283 var open, close 284 var updateHeight = function () { 285 if (!isOpened) { 286 return 287 } 288 if (!nav.offsetHeight) { 289 // Close the nav if it is not visible anymore 290 return close() 291 } 292 nav.style.minHeight = 0 293 page.style.height = 294 Math.max( 295 window.innerHeight || document.documentElement.clientHeight, 296 nav.offsetHeight, 297 ) + 'px' 298 page.style.position = 'relative' 299 page.style.overflow = 'hidden' 300 nav.style.minHeight = '' 301 } 302 open = function () { 303 isOpened = true 304 addClass(nav, 'is-active') 305 updateHeight() 306 } 307 close = function () { 308 isOpened = false 309 removeClass(nav, 'is-active') 310 page.style.height = '' 311 page.style.position = '' 312 page.style.overflow = '' 313 } 314 addEvent(window, 'resize', updateHeight) 315 addClass(nav, 'is-enabled') 316 navLink = document.createElement('a') 317 navLink.innerHTML = 'navigation' 318 navLink.href = '' 319 addClass(navLink, 'main-navigation-mobile-open') 320 addEvent(navLink, 'click', function (event) { 321 eventPreventDefault(event) 322 if (hasClass(nav, 'is-active')) { 323 close() 324 } else { 325 open() 326 } 327 }) 328 var logo = document.querySelector('.header-navigation .logo') 329 if (logo) { 330 logo.parentNode.insertBefore(navLink, logo) 331 } else { 332 nav.parentNode.insertBefore(navLink, nav) 333 } 334 closeButton = document.createElement('button') 335 closeButton.innerHTML = 'close' 336 addClass(closeButton, 'main-navigation-mobile-close') 337 addEvent(closeButton, 'click', function (event) { 338 if (isOpened) { 339 close() 340 } 341 eventPreventDefault(event) 342 }) 343 nav.appendChild(closeButton) 344 var uls = nav.querySelectorAll('ul ul') 345 var button 346 var buttonOnClick = function (event) { 347 toggleClass(this.parentNode, 'is-expanded') 348 toggleClass(this.parentNode, 'is-collapsed') 349 updateHeight() 350 } 351 for (var i = 0; i < uls.length; i++) { 352 button = document.createElement('button') 353 button.innerHTML = 'expand' 354 button.className = 'main-navigation-mobile-expand' 355 addEvent(button, 'click', buttonOnClick) 356 uls[i].parentNode.insertBefore(button, uls[i]) 357 if (hasClass(uls[i].parentNode, 'active') || hasClass(uls[i].parentNode, 'trail')) { 358 addClass(uls[i].parentNode, 'is-expanded') 359 } else { 360 addClass(uls[i].parentNode, 'is-collapsed') 361 } 362 } 363 each(nav.querySelectorAll('a[href*="#"]'), function (link) { 364 var href = link.href.split('#') 365 var documentHref = document.location.href.split('#') 366 if (href[0] && documentHref[0].substr(-href[0].length) !== href[0]) { 367 return 368 } 369 addEvent(link, 'click', function () { 370 close() 371 }) 372 }) 373 })( 374 document.querySelector && document.querySelector('.main-navigation-mobile'), 375 document.querySelector && document.querySelector('.page'), 376 ) 377 378 // Animations 379 ;(function () { 380 if (!window.Modernizr || !Modernizr.csstransitions) { 381 return 382 } 383 384 var getCounterValue = function (data, multiplier) { 385 var value = data.number * multiplier 386 return ( 387 data.prefix + 388 value.toFixed(data.precision).split('.').join(data.separator) + 389 data.suffix 390 ) 391 } 392 393 var initCounterAnimation = function (element) { 394 if (!element.counterAnimationData) { 395 var value = element.innerHTML 396 var matches = /^(.*?)(-?[0-9,.]*\d)(.*)$/.exec(value) 397 if (!matches || !matches.length) { 398 return 399 } 400 var separator = matches[2].indexOf(',') > 0 ? ',' : '.' 401 matches[2] = matches[2].split(',').join('.') 402 if (isNaN(matches[2] * 1)) { 403 return 404 } 405 element.counterAnimationData = { 406 original: value, 407 prefix: matches[1], 408 suffix: matches[3], 409 number: matches[2] * 1, 410 precision: Math.max(0, matches[2].length - matches[2].split('.')[0].length - 1), 411 separator: separator, 412 duration: (element.getAttribute('data-animation-duration') || 1000) * 1, 413 } 414 } 415 element.innerHTML = getCounterValue(element.counterAnimationData, 0) 416 } 417 418 var counterAnimations = [] 419 420 var runCounterAnimation = function () { 421 var animations = [] 422 var animation 423 var multiplier 424 for (var i = 0; i < counterAnimations.length; i++) { 425 animation = counterAnimations[i] 426 multiplier = Math.min( 427 1, 428 (new Date().getTime() - animation.start) / animation.data.duration, 429 ) 430 if (multiplier < 1) { 431 animation.element.innerHTML = getCounterValue(animation.data, multiplier) 432 animations.push(animation) 433 } else { 434 animation.element.innerHTML = animation.data.original 435 } 436 } 437 counterAnimations = animations 438 if (window.requestAnimationFrame && counterAnimations.length) { 439 window.requestAnimationFrame(runCounterAnimation) 440 } 441 } 442 443 var startCounterAnimation = function (element) { 444 if (window.requestAnimationFrame && !counterAnimations.length) { 445 window.requestAnimationFrame(runCounterAnimation) 446 } 447 counterAnimations.push({ 448 element: element, 449 data: element.counterAnimationData, 450 start: new Date().getTime(), 451 }) 452 } 453 454 var initTypingAnimation = function (element) { 455 if (!element.typingAnimationData) { 456 var data = { 457 interval: null, 458 elements: [], 459 texts: [], 460 currentElement: 0, 461 currentOffset: 0, 462 } 463 each(element.querySelectorAll('.typing-headline-dummy'), function (dummy) { 464 if (dummy && dummy.textContent) { 465 var text = document.createElement('span') 466 text.className = 'typing-headline-text' 467 text.textContent = dummy.textContent 468 dummy.parentNode.insertBefore(text, dummy) 469 data.elements.push(text) 470 data.texts.push(text.textContent.split(' ').join(' ')) 471 } 472 }) 473 if (!data.elements.length) { 474 return 475 } 476 var type = function () { 477 data.currentOffset++ 478 addClass(data.elements[data.currentElement], 'is-typing') 479 data.elements[data.currentElement].textContent = data.texts[ 480 data.currentElement 481 ].substr(0, data.currentOffset) 482 if (!data.texts[data.currentElement].substr(data.currentOffset)) { 483 removeClass(data.elements[data.currentElement], 'is-typing') 484 data.currentOffset = 0 485 data.currentElement++ 486 if (!data.elements[data.currentElement]) { 487 addClass(data.elements[data.currentElement - 1], 'is-done-typing') 488 clearInterval(data.interval) 489 } 490 } 491 } 492 data.start = function () { 493 data.currentElement = 0 494 data.currentOffset = 0 495 clearInterval(data.interval) 496 data.interval = setInterval(type, 100) 497 } 498 element.typingAnimationData = data 499 } 500 clearInterval(element.typingAnimationData.interval) 501 each(element.typingAnimationData.elements, function (headline) { 502 removeClass(headline, 'is-typing') 503 removeClass(headline, 'is-done-typing') 504 headline.innerHTML = ' ' 505 }) 506 } 507 508 var isHiddenInSlider = function (element) { 509 if (!element.slider) { 510 return false 511 } 512 return !window 513 .jQuery(element.element) 514 .closest('.rsts-slide') 515 .is(element.slider.getSlides()[element.slider.slideIndex].element) 516 } 517 518 var isInView = function (element) { 519 return ( 520 (element.element.offsetWidth || element.element.offsetHeight) && 521 (element.element.getBoundingClientRect().top < 522 (window.innerHeight || document.documentElement.clientHeight) * 0.8 || 523 element.element.getBoundingClientRect().bottom <= 524 (window.innerHeight || document.documentElement.clientHeight)) && 525 !isHiddenInSlider(element) 526 ) 527 } 528 529 var isNotInView = function (element) { 530 return ( 531 (!element.element.offsetWidth && !element.element.offsetHeight) || 532 element.element.getBoundingClientRect().top > 533 (window.innerHeight || document.documentElement.clientHeight) * 1.2 || 534 isHiddenInSlider(element) 535 ) 536 } 537 538 var elements = [] 539 540 var update = function () { 541 var rect 542 each(elements, function (element) { 543 if (isInView(element)) { 544 if ( 545 element.element.counterAnimationData && 546 !hasClass(element.element, 'in-view') 547 ) { 548 if (!hasClass(element.element, 'has-shown') || element.doesRepeat) { 549 startCounterAnimation(element.element) 550 } 551 } 552 if ( 553 element.element.typingAnimationData && 554 !hasClass(element.element, 'in-view') 555 ) { 556 if (!hasClass(element.element, 'has-shown') || element.doesRepeat) { 557 element.element.typingAnimationData.start() 558 } 559 } 560 addClass(element.element, 'in-
560view') 561 addClass(element.element, 'has-shown') 562 removeClass(element.element, 'not-in-view') 563 } else if (isNotInView(element)) { 564 if ( 565 element.element.counterAnimationData && 566 !hasClass(element.element, 'not-in-view') && 567 element.doesRepeat 568 ) { 569 initCounterAnimation(element.element) 570 } 571 if ( 572 element.element.typingAnimationData && 573 !hasClass(element.element, 'not-in-view') && 574 element.doesRepeat 575 ) { 576 initTypingAnimation(element.element) 577 } 578 if (element.doesRepeat) { 579 addClass(element.element, 'not-in-view') 580 removeClass(element.element, 'in-view') 581 } 582 } 583 }) 584 } 585 586 var updateElements = function (wrapper) { 587 wrapper = wrapper || document 588 var newElements = wrapper.querySelectorAll && wrapper.querySelectorAll('.is-animated') 589 if (!newElements) { 590 return 591 } 592 each(newElements, function (element) { 593 if ( 594 !elementMatches(element, '.not-animated *, .not-animated') && 595 elements 596 .map(function (element) { 597 return element.element 598 }) 599 .indexOf(element) === -1 600 ) { 601 elements.push({ 602 element: element, 603 doesRepeat: elementMatches(element, '.does-repeat *, .does-repeat'), 604 slider: 605 window.jQuery && 606 window.jQuery(element).closest('.rsts-main').data('rstSlider'), 607 }) 608 if (hasClass(element, '-counter')) { 609 initCounterAnimation(element) 610 } 611 if (hasClass(element, 'typing-headline')) { 612 initTypingAnimation(element) 613 } 614 addClass(element, 'not-in-view') 615 } 616 }) 617 } 618 619 updateElements() 620 621 addEvent(window, 'scroll resize load', update) 622 if (window.jQuery) { 623 window 624 .jQuery('.rsts-main, .mod_rocksolid_slider') 625 .on('rsts-slidestop rsts-slidestart', function (event) { 626 updateElements(this) 627 if (event.type === 'rsts-slidestop') { 628 update() 629 } 630 }) 631 } 632 setTimeout(update, 0) 633 634 if (window.requestAnimationFrame) { 635 window.requestAnimationFrame(runCounterAnimation) 636 } else { 637 setInterval(runCounterAnimation, 16) 638 } 639 })() 640 641 // Background videos 642 ;(function (elements) { 643 if (!elements || !elements.length || !navigator.userAgent.match(/(iPhone|iPod)/)) { 644 return 645 } 646 for (var i = 0; i < elements.length; i++) { 647 if (elements[i].poster) { 648 elements[i].parentNode.style.backgroundImage = 'url("' + elements[i].poster + '")' 649 } 650 elements[i].parentNode.removeChild(elements[i]) 651 } 652 })( 653 document.querySelectorAll && 654 document.querySelectorAll('.centered-wrapper-background > video'), 655 ) 656 657 // Vertical centered contents 658 ;(function (elements) { 659 var isIE = 'ActiveXObject' in window 660 661 if (!elements[0]) { 662 return 663 } 664 665 // Internet Explorer doesn't handle flexbox right if min-height is set 666 if ( 667 !isIE && 668 ('webkitBoxPack' in elements[0].style || 669 'MozBoxPack' in elements[0].style || 670 'webkitJustifyContent' in elements[0].style || 671 'justifyContent' in elements[0].style) 672 ) { 673 return 674 } 675 676 function center(element) { 677 element.style.marginTop = '' 678 if (element.parentNode.offsetHeight > element.offsetHeight) { 679 element.style.marginTop = 680 Math.round((element.parentNode.offsetHeight - element.offsetHeight) / 2) + 'px' 681 } 682 } 683 684 each(elements, function (element) { 685 center(element) 686 addEvent(window, 'resize load', function () { 687 center(element) 688 }) 689 }) 690 })( 691 document.querySelectorAll && 692 document.querySelectorAll( 693 '.centered-wrapper.-vertical-centered > .centered-wrapper-inner', 694 ), 695 ) 696 697 // Moving backgrounds 698 ;(function (elements) { 699 if (!elements || !elements.length || navigator.userAgent.match(/(iPad|iPhone|iPod)/)) { 700 return 701 } 702 addEvent(window, 'mousemove', function (event) { 703 var percentage 704 for (var i = 0; i < elements.length; i++) { 705 percentage = 706 event.clientX / (window.innerWidth || document.documentElement.clientWidth) 707 if (hasClass(elements[i].parentNode, '-background-mousemove')) { 708 percentage = 1 - percentage 709 } 710 percentage = Math.max(0, Math.min(1, percentage)) 711 elements[i].style.transform = elements[i].style.webkitTransform = 712 'translate3d(' + percentage * -10 + '%, 0, 0)' 713 } 714 }) 715 })( 716 document.querySelectorAll && 717 document.querySelectorAll( 718 '.-background-mousemove-inverted > .centered-wrapper-background, .-background-mousemove > .centered-wrapper-background', 719 ), 720 ) 721 722 // Parallax backgrounds 723 ;(function (elements) { 724 if (!elements || !elements.length || navigator.userAgent.match(/(iPad|iPhone|iPod)/)) { 725 return 726 } 727 728 if (!('transform' in elements[0].style) && !('webkitTransform' in elements[0].style)) { 729 return 730 } 731 732 var imageCache = [] 733 734 var update = function (event) { 735 var windowHeight = window.innerHeight || document.documentElement.clientHeight 736 737 // Get all dimensions from the browser before applying styles for better performance 738 var parentRects = [] 739 for (var i = 0; i < elements.length; i++) { 740 parentRects[i] = elements[i].parentNode.getBoundingClientRect() 741 if (!('width' in parentRects[i]) || !('height' in parentRects[i])) { 742 return 743 } 744 } 745 746 var position, height 747 for (i = 0; i < elements.length; i++) { 748 // Skip invisible elements 749 if (parentRects[i].bottom < 0 || parentRects[i].top > windowHeight) { 750 continue 751 } 752 height = 0 753 if (imageCache[i].width && imageCache[i].height) { 754 height = (imageCache[i].height / imageCache[i].width) * parentRects[i].width 755 } 756 height = Math.round( 757 Math.max(height, Math.min(parentRects[i].height, windowHeight) * 1.1), 758 ) 759 elements[i].style.bottom = 'auto' 760 elements[i].style.height = height + 'px' 761 if ( 762 height < windowHeight || 763 (windowHeight < parentRects[i].height && height < parentRects[i].height) 764 ) { 765 position = 766 (parentRects[i].top / (windowHeight - parentRects[i].height)) * 767 -(height - parentRects[i].height) 768 } else { 769 position = 770 ((windowHeight - parentRects[i].top) / 771 (windowHeight + parentRects[i].height)) * 772 -(height - parentRects[i].height) 773 } 774 elements[i].style.transform = elements[i].style.webkitTransform = 775 'translate3d(0, ' + Math.round(position) + 'px, 0)' 776 } 777 } 778 addEvent(window, 'scroll resize', update) 779 780 for (var i = 0; i < elements.length; i++) { 781 imageCache[i] = new Image() 782 addEvent(imageCache[i], 'load', update) 783 imageCache[i].src = 784 elements[i].getAttribute && elements[i].getAttribute('data-image-url') 785 } 786 })( 787 document.querySelectorAll && 788 document.querySelectorAll('.-background-parallax > .centered-wrapper-background'), 789 ) 790 791 // Rotating boxes touch support 792 ;(function (elements) { 793 if ( 794 (() => { 795 return ( 796 'ontouchstart' in window || 797 navigator.maxTouchPoints > 0 || 798 navigator.msMaxTouchPoints > 0 799 ) 800 })() 801 ) { 802 const $ = window.jQuery 803 for (let i = 0, l = elements.length; i < l; ++i) { 804 $(elements[i]).replaceWith(elements[i].cloneNode(true)) 805 } 806 return 807 } 808 if (!elements || !elements.length) { 809 return 810 } 811 for (var i = 0; i < elements.length; i++) { 812 elements[i].setAttribute('aria-haspopup', 'true') 813 addEvent(elements[i], 'touchend', function (event) { 814 if ( 815 event.target && 816 (hasClass(event.target.parentNode, 'fading-boxes-item-link') || 817 hasClass(event.target, 'portfolio-boxes-item-more')) 818 ) { 819 return 820 } 821 eventPreventDefault(event) 822 // Remove the hover state from the element on iOS 823 if (hasClass(this, 'is-hovered')) { 824 var parent = this.parentNode 825 var next = this.nextSibling 826 parent.removeChild(this) 827 if (next) { 828 parent.insertBefore(this, next) 829 } else { 830 parent.appendChild(this) 831 } 832 this.offsetWidth 833 } 834 toggleClass(this, 'is-hovered') 835 }) 836 } 837 })( 838 document.querySelectorAll && 839 document.querySelectorAll('.fading-boxes-item, .portfolio-boxes-item-text'), 840 ) 841 842 // Tabs 843 ;(function (navigations) { 844 if (!navigations || !navigations.length) { 845 return 846 } 847 848 var documentHref = document.location.href.split('#') 849 850 each(navigations, function (navigation) { 851 var links = navigation.querySelectorAll('a') 852 var targets = [] 853 var clickFirst 854 855 each(links, function (link, i) { 856 var href = link.href.split('#') 857 if (href[0] && documentHref[0].substr(-href[0].length) !== href[0]) { 858 return 859 } 860 var target = document.querySelector('#' + href[1]) 861 if (!target) { 862 return 863 } 864 865 targets.push(target) 866 867 var onclick = function (event) { 868 eventPreventDefault(event) 869 eventStop(event) 870 each(targets, function (target) { 871 target.style.display = 'none' 872 }) 873 removeClass(links, 'is-active') 874 addClass(link, 'is-active') 875 target.style.display = '' 876 link.blur() 877 triggerEvent(window, 'resize') 878 } 879 addEvent(link, 'click', onclick) 880 881 // First element 882 if (!clickFirst) {
883 clickFirst = onclick 884 } 885 }) 886 887 clickFirst() 888 }) 889 })(document.querySelectorAll && document.querySelectorAll('.tab-navigation')) 890 891 // Slider Navigations 892 ;(function ($) { 893 if (!$) { 894 return 895 } 896 897 $('.slider-navigation[data-slider-id]').each(function () { 898 var $this = $(this) 899 900 var slider = $(document.getElementById($this.attr('data-slider-id'))).data('rstSlider') 901 if (!slider) { 902 return 903 } 904 905 $this.find('.slider-navigation-prev').on('click', function (event) { 906 event.preventDefault() 907 slider.prev() 908 }) 909 910 $this.find('.slider-navigation-next').on('click', function (event) { 911 event.preventDefault() 912 slider.next() 913 }) 914 }) 915 })(window.jQuery) 916 917 // Anchor navigation active status 918 ;(function (navigations) { 919 if (!navigations || !navigations.length) { 920 return 921 } 922 923 var documentHref = document.location.href.split('#') 924 925 each(navigations, function (navigation) { 926 var anchors = [] 927 var currentAnchor 928 var prev = navigation.querySelector('a.prev') 929 var next = navigation.querySelector('a.next') 930 931 each(navigation.querySelectorAll('a[href*="#"]'), function (anchor) { 932 var href = anchor.href.split('#') 933 if (href[0] && documentHref[0].substr(-href[0].length) !== href[0]) { 934 return 935 } 936 if (!href[1]) { 937 return 938 } 939 var target = document.getElementById(href[1]) 940 if (!target) { 941 return 942 } 943 anchors.push({ 944 link: anchor, 945 target: target, 946 navigationClass: 947 anchor.getAttribute && anchor.getAttribute('data-navigation-class'), 948 }) 949 }) 950 951 each([prev, next], function (link) { 952 if (!link) { 953 return 954 } 955 addEvent(link, 'click', function (event) { 956 eventPreventDefault(event) 957 var index = anchors.indexOf(currentAnchor) + (hasClass(link, 'next') ? 1 : -1) 958 if (index < 0) { 959 index = 0 960 } 961 if (index >= anchors.length) { 962 index = anchors.length - 1 963 } 964 triggerEvent(anchors[index].link, 'click') 965 }) 966 }) 967 968 var updateAnchors = function () { 969 var windowHeight = window.innerHeight || document.documentElement.clientHeight 970 var activeAnchor 971 each(anchors, function (anchor) { 972 if ( 973 anchor.target.getBoundingClientRect().top < Math.min(windowHeight / 3, 200) 974 ) { 975 activeAnchor = anchor 976 } 977 }) 978 each(anchors, function (anchor) { 979 if (activeAnchor === anchor) { 980 return 981 } 982 removeClass([anchor.link, anchor.link.parentNode], 'active') 983 if (anchor.navigationClass) { 984 removeClass(navigation, anchor.navigationClass) 985 } 986 }) 987 if (prev && next) { 988 removeClass([prev, next], 'is-disabled') 989 } 990 if (activeAnchor) { 991 addClass([activeAnchor.link, activeAnchor.link.parentNode], 'active') 992 if (activeAnchor.navigationClass) { 993 addClass(navigation, activeAnchor.navigationClass) 994 } 995 var index = anchors.indexOf(activeAnchor) 996 if (!index && prev) { 997 addClass(prev, 'is-disabled') 998 } 999 if (index === anchors.length - 1 && next) { 1000 addClass(next, 'is-disabled') 1001 } 1002 if ( 1003 navigation.getAttribute && 1004 navigation.getAttribute('data-change-url') === 'true' && 1005 activeAnchor.link.href.split('#')[1] !== 1006 document.location.href.split('#')[1] && 1007 window.history && 1008 window.history.replaceState 1009 ) { 1010 window.history.replaceState( 1011 '', 1012 document.title, 1013 window.location.href.split('#')[0] + 1014 '#' + 1015 activeAnchor.link.href.split('#')[1], 1016 ) 1017 } 1018 } 1019 currentAnchor = activeAnchor 1020 } 1021 1022 addEvent(window, 'scroll resize load', updateAnchors) 1023 updateAnchors() 1024 }) 1025 })( 1026 document.querySelectorAll && 1027 document.querySelectorAll('.ce_rsce_oneo_anchor_nav, .ce_rsce_oneo_area_nav'), 1028 ) 1029 1030 // Smooth scrolling (only if jQuery is available) 1031 ;(function ($) { 1032 if (!$) { 1033 return 1034 } 1035 1036 if (!$.easing.easeOutCubic) { 1037 $.easing.easeOutCubic = function (p) { 1038 return 1 - Math.pow(1 - p, 3) 1039 } 1040 } 1041 1042 var $window = $(window) 1043 var scrollContainer = $('html,body') 1044 var mediaQuery = window.matchMedia && window.matchMedia('(max-width: 900px)') 1045 1046 $(document.body).on('click', 'a[href*="#"]', function (event) { 1047 var href = $(this).attr('href').split('#') 1048 var documentHref = document.location.href.split('#') 1049 if (href[0] && documentHref[0].substr(-href[0].length) !== href[0]) { 1050 return 1051 } 1052 if (!href[1]) { 1053 return 1054 } 1055 var target = $('#' + href[1]) 1056 if (!target.length || event.metaKey) { 1057 return 1058 } 1059 event.preventDefault() 1060 this.blur() 1061 if (window.history && window.history.pushState) { 1062 window.history.pushState( 1063 '', 1064 document.title, 1065 window.location.href.split('#')[0] + '#' + target.attr('id'), 1066 ) 1067 } else { 1068 var scroll = { 1069 x: $window.scrollLeft(), 1070 y: $window.scrollTop(), 1071 } 1072 window.location.hash = '#' + target.attr('id') 1073 $window.scrollLeft(scroll.x) 1074 $window.scrollTop(scroll.y) 1075 } 1076 scrollContainer.stop(true).animate( 1077 { 1078 scrollTop: Math.ceil( 1079 target.offset().top - 1080 (parseFloat(target.css('margin-top')) || 0) - 1081 (!mediaQuery || mediaQuery.matches 1082 ? 0 1083 : $('.header-navigation').outerHeight() || 0), 1084 ), 1085 }, 1086 { 1087 duration: 300, 1088 easing: 'easeOutCubic', 1089 }, 1090 ) 1091 }) 1092 })(window.jQuery) 1093 1094 // Anchor jumping on page load 1095 ;(function ($) { 1096 if (!$ || !location.hash) { 1097 return 1098 } 1099 1100 // Skip if the page was reloaded or navigated back in history 1101 if ( 1102 window.performance && 1103 performance.navigation && 1104 (performance.navigation.type === 1 || performance.navigation.type === 2) 1105 ) { 1106 return 1107 } 1108 1109 scroll() 1110 $(function () { 1111 setTimeout(scroll) 1112 setTimeout(scroll, 500) 1113 }) 1114 1115 function scroll() { 1116 $(location.hash) 1117 .first() 1118 .each(function () { 1119 $(window).scrollTop( 1120 Math.ceil( 1121 $(this).offset().top - 1122 (parseFloat($(this).css('margin-top')) || 0) - 1123 (!window.matchMedia || 1124 window.matchMedia('(max-width: 900px)').matches 1125 ? 0 1126 : $('.header-navigation').outerHeight() || 0), 1127 ), 1128 ) 1129 }) 1130 } 1131 })(window.jQuery) 1132 1133 var xhr 1134 var lastSearch 1135 1136 /****** SEARCH FAQ NEWS AJAX *****/ 1137 1138 function searchFaq() { 1139 var searchString = $('.suchfeld-hilfe input[type="text"]').val() 1140 let archive = $('.suchfeld-hilfe input[type="hidden"]').val() 1141 1142 if (searchString != '') { 1143 if (lastSearch != searchString) { 1144 if (xhr && xhr.readyState != 4) { 1145 xhr.abort() 1146 } 1147 1148 setTimeout(function () { 1149 xhr = $.ajax({ 1150 type: 'POST', 1151 cache: false, 1152 url: '/ajax_faq_search.php', 1153 //url: "/ajax_search_faq_news", 1154 data: { searchString, archive }, // multiple data sent using ajax 1155 success: function (html) { 1156 if (html !== '' && html !== '--no results--') { 1157 $('h3.faq_no_result').hide() 1158 $('section.ce_rsce_oneo_fading_boxes').hide() 1159 $('section.anfrage-stellen').hide() 1160 $('#contentFAQSearch').html(html) 1161 } else { 1162 $('#contentFAQSearch').html('') 1163 $('h3.faq_no_result').show() 1164 $('h3.faq_no_result span').html(searchString) 1165 $('section.anfrage-stellen').show() 1166 $('[name="betreff"]').val(searchString) 1167 $('section.ce_rsce_oneo_fading_boxes').show() 1168 $('.ce_accordionStart').show() 1169 } 1170 history.replaceState(null, '', '/hilfe?searchString=' + searchString) 1171
1172 // $('.suchfeld-hilfe input[type="text"]').unbind("keyup"); 1173 // $('.suchfeld-hilfe input[type="text"]').on("keyup", function () { 1174 // clearTimeout(); 1175 // searchFaq(); 1176 // }); 1177 }, 1178 }) 1179 }, 100) 1180 1181 lastSearch = searchString 1182 } 1183 } else { 1184 $('#contentFAQSearch').html('') 1185 $('.fading-boxes').show() 1186 $('h3.faq_no_result').hide() 1187 } 1188 } 1189 1190 let initialSearch = new window.URL(document.location).searchParams.get('searchString') 1191 if (initialSearch) { 1192 $('.suchfeld-hilfe input[type="text"]').val(initialSearch) 1193 clearTimeout() 1194 searchFaq() 1195 } 1196 $('h3.faq_no_result').hide() 1197 $('section.anfrage-stellen').removeClass('invisible').hide() 1198 /* 1199 $('.suchfeld-hilfe input[type="text"]').on("keyup", function () { 1200 if (xhr && xhr.readyState !== 4) { 1201 xhr.abort(); 1202 } 1203 clearTimeout(); 1204 searchFaq(); 1205 }); 1206 */ 1207 1208 $('.suchfeld-hilfe').submit(function (e) { 1209 e.preventDefault() 1210 1211 if (xhr && xhr.readyState != 4) { 1212 xhr.abort() 1213 } 1214 1215 clearTimeout() 1216 1217 searchFaq() 1218 }) 1219 1220 /****** SEARCH FAQ NEWS AJAX *****/ 1221 1222 /***** SEARCH NEW AJAX ROUTING *****/ 1223 1224 function searchNews() { 1225 var searchString = $('.suchfeld-news input[type="text"]').val() 1226 1227 if (searchString != '') { 1228 if (lastSearch != searchString) { 1229 $('.ce_form .formbody').prepend( 1230 `<div class='searching'> 1231 <style> 1232 .searching, 1233 .searching:after { 1234 box-sizing: border-box; 1235 } 1236 .searching { 1237 display: inline-block; 1238 width: 48px; 1239 height: 40px; 1240 position: absolute; 1241 transform: translateX(-100%); 1242 } 1243 .searching:after { 1244 content: " "; 1245 display: block; 1246 width: 24px; 1247 height: 24px; 1248 margin: 8px; 1249 border-radius: 50%; 1250 border: 3px solid currentColor; 1251 border-color: currentColor transparent currentColor transparent; 1252 animation: lds-dual-ring 1.2s linear infinite; 1253 } 1254 @keyframes lds-dual-ring { 1255 0% { 1256 transform: rotate(0deg); 1257 } 1258 100% { 1259 transform: rotate(360deg); 1260 } 1261 } 1262 </style> 1263 </div>`, 1264 ) 1265 var parameter = '&searchString=' + searchString 1266 1267 if ($('.suchfeld-news.presse').length == 1) { 1268 if ($('.cityflitzer .suchfeld-news.presse').length == 1) { 1269 parameter = parameter + '&newsArchive=10' 1270 } 1271 if ($('.teilauto .suchfeld-news.presse').length == 1) { 1272 parameter = parameter + '&newsArchive=6' 1273 } 1274 } else { 1275 if ($('.cityflitzer .suchfeld-news').length == 1) { 1276 parameter = parameter + '&newsArchive=9' 1277 } 1278 if ($('.teilauto .suchfeld-news').length == 1) { 1279 parameter = parameter + '&newsArchive=2' 1280 } 1281 if ($('.geno-suche .suchfeld-news').length == 1) { 1282 parameter = parameter + '&newsArchive=13' 1283 } 1284 } 1285 1286 console.log(parameter) 1287 1288 if (xhr && xhr.readyState != 4) { 1289 xhr.abort() 1290 } 1291 1292 setTimeout(function () { 1293 xhr = $.ajax({ 1294 type: 'POST', 1295 cache: false, 1296 url: '/ajax_search_neuigkeiten_news', 1297 data: parameter, // multiple data sent using ajax 1298 success: function (html) { 1299 $('#newsSearch').html(html) 1300 $('.searching').remove() 1301 1302 // $('.suchfeld-news input[type="text"]').unbind("keyup"); 1303 // $('.suchfeld-news input[type="text"]').on("keyup", function () { 1304 // clearTimeout(); 1305 // searchNews(); 1306 // }); 1307 }, 1308 }) 1309 }, 100) 1310 1311 lastSearch = searchString 1312 } else { 1313 // console.log(lastSearch+" / "+searchString); 1314 } 1315 } else { 1316 $('#newsSearch').html('') 1317 $('#newsSearch').hide() 1318 $('.mod_newslist.news-boxed').show() 1319 $('.mod_newslist.news-boxed h2').hide() 1320 $('.mod_newslist.news-boxed').prepend( 1321 `<h2 class="search-heading">Keine Suchergebnisse für "${searchString}"</h2>`, 1322 ) 1323 } 1324 } 1325 1326 /* 1327 $('.suchfeld-news input[type="text"]').on('keyup', function() { 1328 1329 console.log('test'); 1330 1331 if(xhr) { 1332 // console.log(xhr.readyState); 1333 } 1334 1335 if(xhr && xhr.readyState != 4){ 1336 xhr.abort(); 1337 } 1338 1339 clearTimeout(); 1340 1341 var searchString = $('.suchfeld-news input[type="text"]').val(); 1342 1343 if(searchString.length > 2) { 1344 searchNews(); 1345 } 1346 1347 }); 1348 */ 1349
1350 $('.suchfeld-news').submit(function (e) { 1351 e.preventDefault() 1352 1353 if (xhr && xhr.readyState != 4) { 1354 xhr.abort() 1355 } 1356 1357 clearTimeout() 1358 1359 searchNews() 1360 }) 1361 1362 /***** SEARCH NEW AJAX ROUTING *****/ 1363})() 1364 1365/***** HOVER NEWS-TEASER *****/ 1366 1367document.querySelectorAll('.news-boxed-item-image-more').forEach((el) => { 1368 el.addEventListener('mouseenter', (el) => { 1369 let articleBlock = el.target.parentElement.parentElement 1370 articleBlock.querySelector('h3').style = 'color:rgb(117, 180, 43)' 1371 }) 1372 el.addEventListener('mouseleave', (el) => { 1373 let articleBlock = el.target.parentElement.parentElement 1374 articleBlock.querySelector('h3').style = 'color:#2e3080' 1375 }) 1376}) 1377 1378document.querySelectorAll('.news-boxed-item h3').forEach((el) => { 1379 el.addEventListener('mouseenter', (el) => { 1380 let h3 = el.target.parentElement 1381 h3.querySelector('.news-boxed-item-image img').classList.add('blurTenPx') 1382 h3.querySelector('.news-boxed-item-image-more a').style = 'opacity: 1' 1383 }) 1384 el.addEventListener('mouseleave', (el) => { 1385 let h3 = el.target.parentElement 1386 h3.querySelector('.news-boxed-item-image img').classList.remove('blurTenPx') 1387 h3.querySelector('.news-boxed-item-image-more a').style = '' 1388 }) 1389})
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.