1if (typeof(HRJavaScriptIncludesRegistry) != "object") 2{ 3var head = document.getElementsByTagName("head")[0]; 4var script = document.createElement("script"); 5script.innerHTML = "var HRJavaScriptIncludesRegistry = new Array();"; 6head.appendChild(script); 7} 8var HREventNames = { 9ajaxload: 'ajax-load', 10formValueChanged: 'HRFormValueChanged', 11formInputGiven: 'HRFormInputGiven', 12show: 'show', 13hide: 'hide', 14resize: 'resize', 15unlock: 'unlock', 16loadGoogleMaps: 'load-google-maps', 17consentManagerClosed: 'consent-manager-closed', 18collapsableOpen: 'collapsable-open', 19collapsableClose: 'collapsable-close', 20collapsableReady: 'collapsable-ready', 21editInPlaceSaveEdit: 'edit-in-place-save-edit', 22showNavigation: 'show-navigation', 23hideNavigation: 'hide-navigation' 24} 25function HREventManagerClass() 26{ 27this.RegisteredEvents = new Array(); 28this.RegisteredBodyEvents = new Array(); 29} 30HREventManagerClass.prototype = 31{ 32addListener : function(elem, eventNames, eventFunc, callConfig) 33{ 34try 35{ 36if (elem && eventNames && eventFunc) 37{ 38var config = {useStandard: true, notifiedByChildren: true, notifiedBySelf: true, notifiedByParents: false, notifiedByAll: false}; 39if (callConfig != null && typeof(callConfig) == "object") 40{ 41for (prop in callConfig) 42{ 43config[prop] = callConfig[prop]; 44} 45} 46eventNamesArray = eventNames.split(','); 47for (let i = 0; i < eventNamesArray.length; i++) 48{ 49const eventName = eventNamesArray[i].trim(); 50if (eventName) 51{ 52if (!this.RegisteredEvents[eventName]) 53this.RegisteredEvents[eventName] = new Array(); 54else 55{ 56if (eventName && config.unique) 57{ 58var registeredEvents = this.RegisteredEvents[eventName]; 59for (var j = 0; j < registeredEvents.length; j++) 60{ 61if (registeredEvents[j] && registeredEvents[j].Element && registeredEvents[j].Element === elem) 62return; 63} 64} 65} 66this.RegisteredEvents[eventName].push(new HREventEntry(elem, eventName, eventFunc, config)); 67if (config.useStandard && typeof(HRDOM.addEventListener) == "function") 68{ 69let domConfig = {}; 70if (config.once) 71domConfig.once = true; 72HRDOM.addEventListener(elem, eventName, eventFunc, domConfig); 73} 74} 75} 76} 77} 78catch (except) 79{ 80if (typeof(HRLogError) == 'function') 81HRLogError(except); 82} 83}, 84dispatchEvent : function(sender, event, callConfig) 85{ 86try 87{ 88var config = {bubbles: true, useStandard: true, notifySelf: true, notifyChildren: false, notifyParents: true, notifyAll: false}; 89if (callConfig != null && typeof(callConfig) == "object") 90{ 91for (prop in callConfig) 92{ 93config[prop] = callConfig[prop]; 94} 95} 96var eventObj = null; 97if (typeof(event) == "string") 98{ 99var bubbleEvent = false; 100if (config.notifyParents || config.bubbles) 101{ 102bubbleEvent = true; 103} 104try 105{ 106eventObj = new CustomEvent(event, {"bubbles": bubbleEvent, "cancelable": true, "detail": config.detail}); 107} 108catch (e) 109{ 110if (typeof(document.createEvent) == "function") 111{ 112eventObj = document.createEvent("Event"); 113eventObj.initEvent(event, bubbleEvent, true); 114} 115else 116{ 117eventObj = {type : event, bubbles : bubbleEvent, cancelable : true, detail: config.detail}; 118} 119} 120} 121else if (typeof(event) == "object") 122{ 123eventObj = event; 124} 125if (eventObj != null && typeof(eventObj.type) == "string" && typeof(sender) == "object") 126{ 127if (config.useStandard) 128{ 129sender.dispatchEvent(eventObj); 130} 131if (this.RegisteredEvents[eventObj.type]) 132{ 133for (var i = 0; i < this.RegisteredEvents[eventObj.type].length; i++) 134{ 135if (typeof(this.RegisteredEvents[eventObj.type][i]) == "object") 136{ 137if (config.notifySelf == true && this.RegisteredEvents[eventObj.type][i].Config.notifiedBySelf && sender == this.RegisteredEvents[eventObj.type][i].Element) 138{ 139this.RegisteredEvents[eventObj.type][i].EventFunction(eventObj, sender); 140} 141else if (eventObj.bubbles == true && this.RegisteredEvents[eventObj.type][i].Config.notifiedByChildren && HRIsParentElement(sender, this.RegisteredEvents[eventObj.type][i].Element)) 142{ 143this.RegisteredEvents[eventObj.type][i].EventFunction(eventObj, sender); 144} 145else if (config.notifyChildren == true && this.RegisteredEvents[eventObj.type][i].Config.notifiedByParents && HRIsParentElement(this.RegisteredEvents[eventObj.type][i].Element, sender)) 146{ 147this.RegisteredEvents[eventObj.type][i].EventFunction(eventObj, sender); 148} 149else if (config.notifyAll && this.RegisteredEvents[eventObj.type][i].Config.notifiedByAll) 150{ 151this.RegisteredEvents[eventObj.type][i].EventFunction(eventObj, sender); 152} 153const registeredEventConfig = this.RegisteredEvents[eventObj.type][i].Config; 154if (registeredEventConfig && registeredEventConfig.once) 155{ 156this.RegisteredEvents[eventObj.type].splice(i, 1); 157i--; 158} 159} 160} 161} 162} 163} 164catch (except) 165{ 166if (typeof(HRLogError) == 'function') 167HRLogError(except); 168} 169}, 170addBodyListener : function(identifier, eventNames, eventFunc) 171{ 172try 173{ 174if (identifier && eventNames && eventFunc) 175{ 176eventNames.split(',').forEach(eventName => { 177if (eventName) 178{ 179if (!this.RegisteredBodyEvents[eventName]) 180{ 181this.RegisteredBodyEvents[eventName] = new Array(); 182if (typeof(HRAddEventListener) === 'function') 183HRAddEventListener(window.document.body, eventName, this); 184} 185this.RegisteredBodyEvents[eventName].push(new HREventEntry(identifier, eventName, eventFunc, null)); 186} 187}); 188} 189} 190catch (except) 191{ 192if (typeof(HRLogError) === 'function') 193HRLogError(except); 194} 195}, 196addClickListener : function(identifier, eventFunc) 197{ 198this.addBodyListener(identifier, 'click', eventFunc); 199}, 200addChangeListener : function(identifier, eventFunc) 201{ 202this.addBodyListener(identifier, 'change', eventFunc); 203}, 204addInputListener : function(identifier, eventFunc) 205{ 206this.addBodyListener(identifier, 'input', eventFunc); 207}, 208addKeydownListener : function(identifier, eventFunc) 209{ 210this.addBodyListener(identifier, 'keydown', eventFunc); 211}, 212addKeyupListener : function(identifier, eventFunc) 213{ 214this.addBodyListener(identifier, 'keyup', eventFunc); 215}, 216addMousedownListener : function(identifier, eventFunc) 217{ 218this.addBodyListener(identifier, 'mousedown', eventFunc); 219}, 220handleEvent : function(event) 221{ 222const bodyEvents = this.RegisteredBodyEvents[event.type]; 223for (let i = 0; i < bodyEvents.length; i++) 224{ 225if (event.target) 226{ 227let sender = event.target.closest(`[data-action-${event.type}="${bodyEvents[i].Element}"]`); 228if (!sender) 229sender = event.target.closest(`#${bodyEvents[i].Element}`); 230if (sender) 231{ 232bodyEvents[i].EventFunction(event, sender); 233break; 234} 235} 236} 237} 238} 239function HREventEntry(elem, eventName, eventFunc, config) 240{ 241this.Element = elem; 242this.EventName = eventName; 243this.EventFunction = eventFunc; 244this.Config = config; 245} 246var HREventManager = window.HREventManager = (typeof(window.HREventManager) == 'undefined' ? new HREventManagerClass() : window.HREventManager); 247if (!String.trim) 248{ 249String.prototype.trim = function() 250{ 251return this.replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, ''); 252}; 253} 254if (!String.isEmpty) 255{ 256String.prototype.isEmpty = function() 257{ 258return this.length <= 0; 259}; 260} 261function HRSendRequest(url, domDest, config) 262{ 263try 264{ 265var resConfig = mergeSendConfig(config); 266resConfig.url = url; 267resConfig.domDest = domDest; 268if (resConfig.keepAlive && typeof(fetch) === 'function') 269{ 270return fetchImpl(resConfig); 271} 272else 273{ 274return sendRequestImpl(resConfig); 275} 276} 277catch (e) 278{ 279if (typeof(HRLogError) == 'function') 280HRLogError(e); 281} 282return false;
283} 284function HRSendRequestAndInvalidate(url, sender, config) 285{ 286config.sender = sender; 287config.invalidate = true; 288return HRSendRequest(url, null, config); 289} 290function HRSendForm(form, domDest, config) 291{ 292try 293{ 294var resConfig = mergeSendConfig(config); 295resConfig.form = form; 296resConfig.domDest = domDest; 297if (resConfig.keepAlive && typeof(fetch) === 'function') 298{ 299return fetchImpl(resConfig); 300} 301else 302{ 303return sendRequestImpl(resConfig); 304} 305} 306catch (e) 307{ 308if (typeof(HRLogError) == 'function') 309HRLogError(e); 310} 311return false; 312} 313function HRSendFormAndInvalidate(form, sender, config) 314{ 315config.sender = sender; 316config.invalidate = true; 317return HRSendForm(form, null, config); 318} 319function HRQueryStringFromFormdata(aForm) 320{ 321if (!aForm || typeof(aForm) != 'object') 322return ""; 323var queryString = ""; 324try 325{ 326for(var j = 0; j < aForm.elements.length; j++) 327{ 328var element = aForm.elements[j]; 329if (element) 330{ 331var value = null; 332if (element.nodeName && element.name && !element.name.trim().isEmpty()) 333{ 334if (element.type && (element.type.toLowerCase() == "radio" || element.type.toLowerCase() == "checkbox")) 335{ 336if (element.checked && element.value) 337value = element.value; 338} 339else if (element.value) 340value = element.value; 341else 342value = ""; 343if (value != null) 344{ 345if (queryString != "") 346queryString += "&"; 347queryString += element.name + "=" + encodeURIComponent(value); 348} 349} 350} 351} 352} 353catch (e) 354{ 355if (typeof(HRLogError) == 'function') 356HRLogError(e); 357} 358return queryString; 359} 360function sendRequestImpl(config) 361{ 362try 363{ 364var htmlRequest = createAjaxObj(); 365var url = null; 366var sendDaten = null; 367var formQueryString = null; 368if (config.form) 369{ 370var aForm = null; 371if (typeof(config.form) === 'string' || typeof(config.form) === 'number') 372{ 373aForm = document.forms[config.form]; 374if (aForm == null && typeof(config.form) !== 'number') 375aForm = document.getElementById(config.form); 376} 377else if (typeof(config.form) === 'object') 378{ 379aForm = config.form; 380} 381if (aForm) 382{ 383url = aForm.action; 384try 385{ 386if (!config.sendDaten) 387sendDaten = new FormData(aForm); 388} 389catch (e) 390{ 391formQueryString = HRQueryStringFromFormdata(aForm); 392} 393} 394} 395if (config.url) 396url = config.url; 397if (config.sendDaten) 398{ 399sendDaten = config.sendDaten; 400} 401else if (formQueryString) 402{ 403if (url.indexOf("?") >= 0) 404url += "&" + formQueryString; 405else 406url += "?" + formQueryString; 407} 408if (!config.keepAlive) 409{ 410if (htmlRequest.timeout && config.timeout && config.timeout > 0) 411htmlRequest.timeout = config.timeout; 412if (config.onReady || config.callBack || config.domDest) 413{ 414htmlRequest.onreadystatechange = function() 415{ 416retrieveResponse(htmlRequest, config); 417}; 418} 419} 420htmlRequest.open(config.method, url, !config.keepAlive); 421if (sendDaten && sendDaten instanceof FormData && typeof(sendDaten.get) == 'function') 422{ 423try 424{ 425if (!sendDaten.get('IsAjaxCall') && url.trim().startsWith('/') || window.location.hostname === (new URL(url).hostname)) 426sendDaten.set('IsAjaxCall', 'J'); 427} 428catch (e) 429{ 430} 431if (!sendDaten.get('__ENCODING__')) 432sendDaten.set('__ENCODING__', 'UTF-8'); 433const encodedFormData = new FormData(); 434for (let [key, value] of sendDaten.entries()) 435{ 436if (typeof(value) == 'string') 437encodedFormData.append(key, HREncodeToHtmlEntities(value)); 438else 439encodedFormData.append(key, value); 440} 441sendDaten = encodedFormData; 442} 443if (config.invalidate) 444{ 445let sender = config.sender; 446if (sender) 447{ 448if (typeof(config.sender) === 'string') 449{ 450sender = document.getElementById(config.sender); 451if (sender == null && document.querySelector) 452sender = document.querySelector(config.sender); 453} 454if (sender) 455{ 456const invalidatingParent = sender.closest('[data-invalidation-action]'); 457if (invalidatingParent && invalidatingParent.dataset.invalidationAction.length > 0) 458{ 459sendDaten.set('Call.InvalidationAction', invalidatingParent.dataset.invalidationAction); 460config.domDest = invalidatingParent; 461} 462} 463} 464} 465htmlRequest.send(sendDaten); 466if (config.keepAlive) 467return retrieveResponse(htmlRequest, config); 468else 469return true; 470} 471catch (e) 472{ 473if (typeof(HRLogError) == 'function') 474HRLogError(e); 475} 476return false; 477} 478function HREncodeToHtmlEntities(str, blacklist) 479{ 480try 481{ 482if (str) 483{ 484return str.split(/(?:)/u).map(char => { 485if (blacklist && blacklist.includes(char)) 486return char; 487else if (char.codePointAt(0) > 255) 488return '&#' + char.codePointAt(0) + ';'; 489else 490return char; 491}).join(''); 492} 493} 494catch (e) 495{ 496if (typeof(HRLogError) === 'function') 497HRLogError(e); 498} 499return str; 500} 501function fetchImpl(config) 502{ 503try 504{ 505var sendDaten = null; 506var formQueryString = null; 507if (config.form) 508{ 509var aForm = null; 510if (typeof(config.form) == 'string' || typeof(config.form) == 'number') 511{ 512aForm = document.forms[config.form]; 513if (aForm == null && typeof(config.form) != 'number') 514aForm = document.getElementById(config.form); 515} 516else if (typeof(config.form) == 'object') 517{ 518aForm = config.form; 519} 520if (aForm) 521{ 522url = aForm.action; 523try 524{ 525sendDaten = new FormData(aForm); 526} 527catch (e) 528{ 529formQueryString = HRQueryStringFromFormdata(aForm); 530} 531} 532} 533if (config.url) 534url = config.url; 535if (config.sendDaten) 536{ 537sendDaten = config.sendDaten; 538} 539else if (formQueryString) 540{ 541if (url.indexOf("?") >= 0) 542url += "&" + formQueryString; 543else 544url += "?" + formQueryString; 545} 546if (sendDaten && sendDaten instanceof FormData && typeof(sendDaten.get) == 'function' && !sendDaten.get('__ENCODING__')) 547sendDaten.set('__ENCODING__', 'UTF-8');
548if (config.invalidate) 549{ 550let sender = config.sender; 551if (sender) 552{ 553if (typeof(config.sender) === 'string') 554{ 555sender = document.getElementById(config.sender); 556if (sender == null && document.querySelector) 557sender = document.querySelector(config.sender); 558} 559if (sender) 560{ 561const invalidatingParent = sender.closest('[data-invalidation-action]'); 562if (invalidatingParent && invalidatingParent.dataset.invalidationAction.length > 0) 563{ 564sendDaten.set('Call.InvalidationAction', invalidatingParent.dataset.invalidationAction); 565config.domDest = invalidatingParent; 566} 567} 568} 569} 570fetch(url, { 571method: config.method, 572body: sendDaten, 573keepalive: config.keepAlive 574}).then(function (response) { 575if (response.ok) 576retrieveFetchResponse(response, config); 577return Promise.resolve(response); 578}).catch(function(response) { 579if (typeof(HRLogError) == 'function') 580HRLogError(response); 581Promise.reject(response); 582}); 583return true; 584} 585catch (e) 586{ 587if (typeof(HRLogError) == 'function') 588HRLogError(e); 589} 590return false; 591} 592function mergeSendConfig(userConfig) 593{ 594var defaultConfig = {keepAlive: false, execJS: true, onReady: null, callBack: null, method: 'POST', domDest: null, form: null, timeout: 0, url: null, sendDaten: null}; 595var config = defaultConfig; 596if (userConfig) 597{ 598for(key in userConfig) 599{ 600config[key] = userConfig[key]; 601} 602} 603return config; 604} 605function retrieveResponse(htmlRequest, config) 606{ 607var content = ""; 608try 609{ 610if (htmlRequest.readyState == htmlRequest.HEADERS_RECEIVED) 611{ 612const errorHeaderLine = htmlRequest.getResponseHeader('ErrorResponseHeader'); 613if (errorHeaderLine) 614window.HRResponseHeaderErrors = errorHeaderLine.split(',').map(header => atob(header)); 615const warningHeaderLine = htmlRequest.getResponseHeader('WarningResponseHeader'); 616if (warningHeaderLine) 617window.HRResponseHeaderWarnings = warningHeaderLine.split(',').map(header => atob(header)); 618const infoHeaderLine = htmlRequest.getResponseHeader('InfoResponseHeader'); 619if (infoHeaderLine) 620window.HRResponseHeaderInfos = infoHeaderLine.split(',').map(header => atob(header)); 621if (config.onHeadersReceived && typeof(config.onHeadersReceived) === 'function') 622{ 623config.onHeadersReceived((name, decodeBase64) => { 624if (htmlRequest.getResponseHeader(name)) 625{ 626const headerLine = htmlRequest.getResponseHeader(name); 627if (headerLine) 628return headerLine.split(',').map(header => decodeBase64 ? atob(header) : header); 629} 630return []; 631}); 632} 633} 634else if (htmlRequest.readyState == htmlRequest.DONE) 635{ 636if (!config.onReady) 637{ 638if (htmlRequest.status == 200) 639{ 640content = htmlRequest.responseText; 641var destElement = null; 642if (config.domDest) 643{ 644if (typeof(config.domDest) === 'string') 645{ 646destElement = document.getElementById(config.domDest); 647if (destElement == null && document.querySelector) 648destElement = document.querySelector(config.domDest); 649} 650else if (typeof(config.domDest) === 'object') 651{ 652destElement = config.domDest; 653} 654} 655if (destElement != null) 656{ 657destElement.innerHTML = content; 658if (config.execJS) 659execJS(destElement); 660} 661if (config.callBack) 662config.callBack(content); 663if (HREventManager && typeof(HREventManager.dispatchEvent) === 'function') 664{ 665var sender = window; 666if (config.domDest) 667{ 668sender = config.domDest; 669if (typeof(config.domDest) === 'string') 670sender = document.getElementById(config.domDest); 671} 672var eventConfig = {notifyChildren: true, notifyAll: true, bubbles: true, useStandard: false}; 673if (config.event) 674{ 675for (prop in config.event) 676{ 677eventConfig[prop] = config.event[prop]; 678} 679} 680HREventManager.dispatchEvent(sender, HREventNames.ajaxload, eventConfig); 681} 682if (config.onErrors && typeof(config.onErrors) === 'function' && window.HRResponseHeaderErrors) 683{ 684config.onErrors(window.HRResponseHeaderErrors); 685window.HRResponseHeaderErrors = undefined; 686} 687if (config.onWarnings && typeof(config.onWarnings) === 'function' && window.HRResponseHeaderWarnings) 688{ 689config.onWarnings(window.HRResponseHeaderWarnings); 690window.HRResponseHeaderWarnings = undefined; 691} 692if (config.onInfos && typeof(config.onInfos) === 'function' && window.HRResponseHeaderInfos) 693{ 694config.onInfos(window.HRResponseHeaderInfos); 695window.HRResponseHeaderInfos = undefined; 696} 697} 698else if (htmlRequest.status >= 400 && config.onRequestError) 699config.onRequestError(htmlRequest.status, htmlRequest.getResponseHeader('FehlerId'), htmlRequest.getResponseHeader('Fehlertext')); 700} 701else 702config.onReady(htmlRequest); 703} 704} 705catch (e) 706{ 707if (typeof(HRLogError) == 'function') 708HRLogError(e); 709} 710return content; 711} 712function retrieveFetchResponse(response, config) 713{ 714var content = ""; 715try 716{ 717if (!config.onReady) 718{ 719if (response.status == 200) 720{ 721content = response.text(); 722var destElement = null; 723if (config.domDest) 724{ 725if (typeof(config.domDest) == 'string') 726{ 727destElement = document.getElementById(config.domDest); 728if (destElement == null && document.querySelector) 729destElement = document.querySelector(config.domDest); 730} 731else if (typeof(config.domDest) == 'object') 732{ 733destElement = config.domDest; 734} 735} 736if (destElement != null) 737{ 738destElement.innerHTML = content; 739if (config.execJS) 740execJS(destElement); 741} 742if (config.callBack) 743config.callBack(content); 744if (HREventManager && typeof(HREventManager.dispatchEvent) === 'function') 745{ 746var sender = window; 747if (config.domDest && document.getElementById(config.domDest)) 748sender = document.getElementById(config.domDest); 749var eventConfig = {notifyChildren: true, notifyAll: true, bubbles: true, useStandard: false}; 750if (config.event) 751{ 752for (prop in config.event) 753{ 754eventConfig[prop] = config.event[prop]; 755} 756} 757HREventManager.dispatchEvent(sender, HREventNames.ajaxload, eventConfig); 758} 759} 760} 761else 762config.onReady(response); 763} 764catch (e) 765{ 766if (typeof(HRLogError) == 'function') 767HRLogError(e); 768} 769return content; 770} 771function sendRequest(url, objId, JSCodePath, executeJavaScript, eventConfig) 772{ 773var htmlRequest = createAjaxObj(); 774if (htmlRequest != null) 775{ 776htmlRequest.onreadystatechange = function() 777{ 778if (htmlRequest.readyState == this.DONE) 779{ 780if (htmlRequest.status != 200 && htmlRequest.status != 0) 781{ 782return false;
783} 784if (objId != null) 785{ 786updateDom(objId, htmlRequest); 787if (executeJavaScript == true) 788execJS(objId); 789} 790if (JSCodePath != null && JSCodePath != "") 791{ 792var oScript = document.createElement("script"); 793oScript.src = JSCodePath; 794document.body.appendChild(oScript); 795} 796if (HREventManager && typeof(HREventManager.dispatchEvent) === 'function') 797{ 798var sender = window; 799if (objId && document.getElementById(objId)) 800sender = document.getElementById(objId); 801var config = {notifyChildren: true, notifyAll: true, bubbles: true, useStandard: false}; 802if (eventConfig) 803{ 804for (prop in config.event) 805{ 806config[prop] = eventConfig[prop]; 807} 808} 809HREventManager.dispatchEvent(sender, HREventNames.ajaxload, config); 810} 811} 812} 813htmlRequest.open('POST', url, true); 814htmlRequest.send(null); 815} 816} 817function sendRequestAndCallBack(url, objId, callBackFunction, executeJavaScript) 818{ 819var htmlRequest = createAjaxObj(); 820if (htmlRequest != null) 821{ 822htmlRequest.onreadystatechange = function () 823{ 824if (htmlRequest.readyState == 4) 825{ 826if (htmlRequest.status != 200 && htmlRequest.status != 0) 827{ 828return false; 829}
830if (objId != null) 831{ 832updateDom(objId, htmlRequest); 833if (executeJavaScript == true) 834execJS(objId); 835} 836if (callBackFunction != null && callBackFunction != "") 837{ 838callBackFunction(htmlRequest.responseText); 839} 840} 841} 842htmlRequest.open('POST', url, true); 843htmlRequest.send(null); 844} 845} 846function sendRequestSynchron(url, objId, executeJavaScript) 847{ 848var htmlRequest = createAjaxObj(); 849if (htmlRequest != null) 850{ 851htmlRequest.open('POST', url, false); 852htmlRequest.send(null); 853if (htmlRequest.readyState == 4) 854{ 855if (objId != null) 856{ 857updateDom(objId, htmlRequest); 858if (executeJavaScript == true) 859execJS(objId); 860} 861return htmlRequest.responseText; 862} 863} 864return ""; 865} 866function sendRequestAndGetResponse(url) 867{ 868var rueckgabe = null; 869try 870{ 871var htmlRequest = createAjaxObj(); 872if (htmlRequest != null) 873{ 874htmlRequest.open('POST', url, false); 875htmlRequest.send(null); 876if (htmlRequest.readyState == 4) 877{ 878rueckgabe = htmlRequest.responseText; 879} 880} 881} 882catch (e) 883{ 884if (typeof(HRLogError) == 'function') 885HRLogError(e); 886} 887return rueckgabe; 888} 889function updateDom(objId, htmlRequest) 890{ 891var result = null; 892if (htmlRequest == null || typeof(htmlRequest) != 'object') 893{ 894return; 895} 896try 897{ 898result = htmlRequest.responseText; 899obj = document.getElementById(objId); 900if (obj) 901obj.innerHTML = result; 902} 903catch (e) 904{ 905if (typeof(HRLogError) == 'function') 906HRLogError(e); 907} 908} 909function createAjaxObj() 910{ 911var htmlRequest = null; 912try 913{ 914htmlRequest = new XMLHttpRequest(); 915} 916catch (w3c) 917{ 918try 919{ 920htmlRequest = new ActiveXObject("Msxml2.XMLHTTP"); 921} 922catch (msie) 923{ 924try 925{ 926htmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); 927} 928catch (msie_old) 929{ 930return null; 931} 932} 933} 934return htmlRequest; 935} 936function HREval(jsString) 937{ 938try 939{ 940if (jsString) 941{ 942var tmp = jsString; 943var firstIdx = tmp.indexOf('function'); 944var idx = firstIdx + 8; 945while (idx >= 8) 946{ 947if (idx <= tmp.length - 1 && tmp.substring(idx, idx + 1).trim() === '') 948{ 949var l = tmp.length - idx; 950if (l > 500) 951l = 500; 952var bezeichner = ''; 953var inBezeichner = false; 954var params = ''; 955var inParam = false; 956var lastIdx = -1; 957for (var i = 0; i < l; i++) 958{ 959var char = tmp.substring(idx + i, idx + i + 1); 960if (inParam) 961{ 962if (char === ')') 963{ 964inParam = false; 965lastIdx = idx + i + 1; 966jsString = jsString.replace(tmp.substring(firstIdx, lastIdx), bezeichner + ' = function (' + params + ')'); 967break; 968} 969else 970params += char; 971} 972else if (!inBezeichner) 973{ 974if (char.trim() !== '') 975{ 976inBezeichner = true; 977bezeichner += char; 978} 979} 980else if (inBezeichner) 981{ 982if (char === '(') 983{ 984bezeichner = bezeichner.trim(); 985if (bezeichner.length > 0 && bezeichner.match('^[A-Za-z0-9]+$')) 986{ 987inBezeichner = false; 988inParam = true; 989} 990else 991break; 992} 993else 994bezeichner += char; 995} 996} 997} 998tmp = tmp.substring(idx); 999firstIdx = tmp.indexOf('function'); 1000idx = firstIdx + 8; 1001} 1002} 1003return eval(jsString); 1004} 1005catch (e) 1006{ 1007if (jsString) 1008e.ajaxStr = jsString; 1009if (typeof(HRLogError) === 'function') 1010HRLogError(e); 1011} 1012return null; 1013} 1014function execJS(objId) 1015{ 1016var obj = objId; 1017if (obj && typeof(objId) === 'string') 1018obj = document.getElementById(objId); 1019if (obj) 1020{ 1021var objScripts = obj.getElementsByTagName('script'); 1022for (var execJSIdx = 0; execJSIdx < objScripts.length; execJSIdx++) 1023{ 1024try 1025{ 1026const type = objScripts[execJSIdx].getAttribute('type'); 1027if (type && (type.toLowerCase() === 'application/json' || type.toLowerCase() === 'module')) 1028continue; 1029var scriptInnerHTML = ""; 1030if (objScripts[execJSIdx].src && objScripts[execJSIdx].src.length > 0) 1031{ 1032if (typeof(HRJavaScriptIncludesRegistry) === "object") 1033{ 1034var head = document.getElementsByTagName("head")[0]; 1035var found = false; 1036var headScripts = head.getElementsByTagName('script'); 1037for (var execJSIdx2 = 0; execJSIdx2 < headScripts.length && !found; execJSIdx2++) 1038{ 1039if (headScripts[execJSIdx2].src && headScripts[execJSIdx2].src.length > 0 && objScripts[execJSIdx].src.indexOf(headScripts[execJSIdx2].src) >= 0) 1040{ 1041found = true; 1042break; 1043} 1044} 1045if (!found) 1046{ 1047for (var execJSIdx2 = 0; execJSIdx2 < HRJavaScriptIncludesRegistry.length && !found; execJSIdx2++) 1048{ 1049if (objScripts[execJSIdx].src.indexOf(HRJavaScriptIncludesRegistry[execJSIdx2]) >= 0) 1050found = true; 1051} 1052} 1053if (!found) 1054{ 1055var script=document.createElement("script"); 1056script.src=objScripts[execJSIdx].src; 1057head.appendChild(script); 1058} 1059} 1060else if (HRAppendScriptIncludeToHead && typeof(HRAppendScriptIncludeToHead) === 'function') 1061{ 1062HRAppendScriptIncludeToHead(objScripts[execJSIdx].src, null, true); 1063} 1064else 1065{ 1066var scripts = document.getElementsByTagName('script'); 1067if (scripts) 1068{ 1069var i = 0; 1070var l = scripts.length; 1071for (i = 0; i < scripts.length && !found; i++) 1072{ 1073if (scripts[i].src && scripts[i].src.length > 0 && url.indexOf(scripts[i].src) >= 0) 1074found = true; 1075} 1076if (!found) 1077{ 1078var newScript = document.createElement('script'); 1079newScript.async = true; 1080newScript.src = url; 1081document.getElementsByTagName('head')[0].appendChild(newScript); 1082} 1083} 1084} 1085} 1086else if(objScripts[execJSIdx].innerHTML) 1087scriptInnerHTML = objScripts[execJSIdx].innerHTML; 1088else if(objScripts[execJSIdx].textContent) 1089scriptInnerHTML = objScripts[execJSIdx].textContent; 1090else if(objScripts[execJSIdx].text) 1091scriptInnerHTML = objScripts[execJSIdx].text; 1092if (scriptInnerHTML != null && scriptInnerHTML.length > 0) 1093{ 1094var htmlKommentar = "<!--"; 1095var indexOfKommentar = scriptInnerHTML.indexOf(htmlKommentar); 1096if (indexOfKommentar >= 0) 1097scriptInnerHTML = scriptInnerHTML.substring(indexOfKommentar + htmlKommentar.length); 1098} 1099HREval(scriptInnerHTML); 1100} 1101catch(e) 1102{ 1103if (typeof(HRLogError) == 'function') 1104HRLogError(e); 1105} 1106} 1107} 1108} 1109class HRHttpClient 1110{ 1111static async doGet(url, config = {}) 1112{ 1113config.method = 'GET'; 1114return this.#sendRequest(url, config); 1115} 1116static async doGetPlainText(url, config = {}) 1117{ 1118const response = await this.doGet(url, config); 1119if (!response) 1120return null; 1121const buffer = await response.arrayBuffer(); 1122const decoder = new TextDecoder('iso-8859-1'); 1123return decoder.decode(buffer); 1124} 1125static async doGetJson(url, config = {}) 1126{ 1127const text = await this.doGetPlainText(url); 1128try 1129{ 1130return JSON.parse(text); 1131} 1132catch (e) 1133{ 1134HRLogError(e); 1135return null; 1136} 1137return response ? await response.json() : null; 1138} 1139static async doPost(url, config = {}) 1140{ 1141config.method = 'POST'; 1142return this.#sendRequest(url, config); 1143} 1144static async replaceHtml(url, domDest, config = {}) 1145{ 1146if (domDest) 1147config.domDest = domDest; 1148try 1149{ 1150return this.#sendRequest(url, config); 1151} 1152catch (e) 1153{ 1154HRLogError(e); 1155return null; 1156} 1157} 1158static async sendForm(form, config = {}) 1159{ 1160if (!form) 1161{ 1162HRLogError(new Error('Es wurde kein zu sendendes Formular übergeben.')); 1163return null; 1164} 1165let formObj = form; 1166if (typeof(form) === 'string' || typeof(form) === 'number') 1167{ 1168formObj = document.forms[form]; 1169if (form == null && typeof(form) !== 'number') 1170formObj = document.querySelector(form); 1171} 1172if (!formObj) 1173{ 1174HRLogError(new Error(`Das zu versendende Formular zum ${typeof(form) === 'number' ? 'Selektor' : Index} '${form}' konnte nicht gefunden werden.`)); 1175return null; 1176} 1177let url = formObj.action; 1178try 1179{ 1180config.body = new FormData(form); 1181} 1182catch (e) 1183{ 1184if (url) 1185{ 1186url += (url.indexOf('?') >= 0 ? '&' : '?') 1187url += HRQueryStringFromFormdata(form) 1188} 1189} 1190return this.#sendRequest(url, config); 1191} 1192static async sendFormData(formData, url, config = {}) 1193{ 1194if (!(formData instanceof FormData)) 1195{ 1196HRLogError(new Error('Das übergebene Objekt ist kein gültiges FormData-Objekt.')); 1197return null; 1198} 1199if (!url) 1200{ 1201HRLogError(new Error('Es wurde keine URL zum Senden des FormData angegeben.')); 1202return null; 1203} 1204config.body = formData; 1205if (!config.method) 1206config.method = 'POST'; 1207try 1208{ 1209return this.#sendRequest(url, config); 1210} 1211catch (e) 1212{ 1213HRLogError(e); 1214return null; 1215} 1216} 1217static async #sendRequest(url, config = {}) 1218{ 1219try 1220{ 1221if (!url) 1222return null; 1223config = this.#mergeSendConfig(config); 1224const body = config.body; 1225if (body) 1226{ 1227if (body instanceof FormData && typeof(body.get) === 'function' && !body.get('__ENCODING__')) 1228body.set('__ENCODING__', 'UTF-8'); 1229} 1230else if (url.indexOf('__ENCODING__') < 0) 1231{ 1232const urlObj = new URL(url, window.location.origin); 1233urlObj.searchParams.set('__ENCODING__', 'UTF-8'); 1234url = urlObj.toString(); 1235}
1236if (config.invalidate) 1237{ 1238let sender = config.sender; 1239if (sender) 1240{ 1241if (typeof(config.sender) === 'string') 1242{ 1243sender = document.getElementById(config.sender); 1244if (sender == null && document.querySelector) 1245sender = document.querySelector(config.sender); 1246} 1247if (sender) 1248{ 1249const invalidatingParent = sender.closest('[data-invalidation-action]'); 1250if (invalidatingParent && invalidatingParent.dataset.invalidationAction.length > 0) 1251{ 1252body.set('Call.InvalidationAction', invalidatingParent.dataset.invalidationAction); 1253config.domDest = invalidatingParent; 1254} 1255} 1256} 1257} 1258const response = await fetch(url, { 1259method: config.method, 1260body: body, 1261keepalive: config.keepAlive 1262}); 1263if (!response.ok && typeof(HRLogError) === 'function') 1264{ 1265HRLogError(new Error(`HTTP-Fehler mit Status ${response.status}. Aufruf: ${url}.`)); 1266return response; 1267} 1268if (config.domDest) 1269{ 1270const buffer = await response.arrayBuffer(); 1271const decoder = new TextDecoder('iso-8859-1'); 1272if (config.domDest && typeof(config.domDest) === 'string') 1273{ 1274let domDest = document.getElementById(config.domDest); 1275if (domDest == null && document.querySelector) 1276domDest = document.querySelector(config.domDest); 1277config.domDest = domDest; 1278} 1279this.injectHtml(config.domDest, decoder.decode(buffer)); 1280if (HREventManager && typeof(HREventManager.dispatchEvent) === 'function') 1281{ 1282const eventConfig = {notifyChildren: true, notifyAll: true, bubbles: true, useStandard: false}; 1283if (config.event) 1284{ 1285for (prop in config.event) 1286{ 1287eventConfig[prop] = config.event[prop]; 1288} 1289} 1290HREventManager.dispatchEvent(config.domDest, HREventNames.ajaxload, eventConfig); 1291} 1292} 1293return response; 1294} 1295catch (e) 1296{ 1297if (typeof(HRLogError) === 'function') 1298HRLogError(e); 1299} 1300} 1301static #mergeSendConfig(userConfig) 1302{ 1303return { ... { 1304method: 'POST', 1305body: null, 1306keepAlive: false, 1307execJS: true, 1308domDest: null, 1309timeout: 0, 1310invalidate: false, 1311sender: null, 1312form: null, 1313error: null, 1314}, ...userConfig}; 1315} 1316static injectHtml(domDest, content) 1317{ 1318if (domDest != undefined && domDest != null) 1319{ 1320domDest.innerHTML = content; 1321if (execJS) 1322execJS(domDest); 1323} 1324} 1325static executeScriptElement(scriptEl) 1326{ 1327const newScript = document.createElement('script'); 1328for (const attr of scriptEl.attributes) 1329{ 1330newScript.setAttribute(attr.name, attr.value); 1331} 1332if (scriptEl.src) 1333{ 1334newScript.src = scriptEl.src; 1335document.head.appendChild(newScript); 1336} 1337else 1338{ 1339newScript.textContent = scriptEl.textContent || scriptEl.innerHTML; 1340document.body.appendChild(newScript); 1341} 1342} 1343static executeJS(container) 1344{ 1345if (!container) 1346return; 1347if (typeof container === 'string') 1348container = document.getElementById(container); 1349const scripts = container.querySelectorAll('script'); 1350scripts.forEach((script, idx) => { 1351const type = (script.getAttribute('type') || '').toLowerCase(); 1352if (type === 'application/json' || type === 'module') 1353return; 1354if (idx == scripts.length - 1) 1355console.log(script.textContent || script.innerHTML); 1356this.executeScriptElement(script); 1357}); 1358} 1359} 1360"use strict"; 1361class HRTextClipper 1362{ 1363static VOID_ELEMENTS = [ 1364"area", 1365"base", 1366"br", 1367"col", 1368"command", 1369"embed", 1370"hr", 1371"img", 1372"input", 1373"keygen", 1374"link", 1375"meta", 1376"param", 1377"source", 1378"track", 1379"wbr", 1380]; 1381static BLOCK_ELEMENTS = [ 1382"address", 1383"article", 1384"aside", 1385"blockquote", 1386"canvas", 1387"dd", 1388"div", 1389"dl", 1390"dt", 1391"fieldset", 1392"figcaption", 1393"figure", 1394"footer", 1395"form", 1396"h1", 1397"h2", 1398"h3", 1399"h4", 1400"h5", 1401"h6", 1402"header", 1403"hgroup", 1404"hr", 1405"li", 1406"main", 1407"nav", 1408"noscript", 1409"ol", 1410"output", 1411"p", 1412"pre", 1413"section", 1414"table", 1415"tbody", 1416"tfoot", 1417"thead", 1418"tr", 1419"ul", 1420"video", 1421]; 1422static UNBREAKABLE_ELEMENTS = ["audio", "math", "svg", "video"]; 1423static NEWLINE_CHAR_CODE = 10; 1424static EXCLAMATION_CHAR_CODE = 33; 1425static DOUBLE_QUOTE_CHAR_CODE = 34; 1426static AMPERSAND_CHAR_CODE = 38; 1427static SINGLE_QUOTE_CHAR_CODE = 39; 1428static FORWARD_SLASH_CHAR_CODE = 47; 1429static SEMICOLON_CHAR_CODE = 59; 1430static TAG_OPEN_CHAR_CODE = 60; 1431static EQUAL_SIGN_CHAR_CODE = 61; 1432static TAG_CLOSE_CHAR_CODE = 62; 1433static CHAR_OF_INTEREST_REGEX = /[<&\n\ud800-\udbff]/; 1434static CHAR_OF_INTEREST_NO_NEWLINE_REGEX = /[<&\ud800-\udbff]/; 1435static SIMPLIFY_WHITESPACE_REGEX = /\s+/g; 1436static clip(string, maxLength, options) 1437{ 1438if (options === void 0) { options = {}; } 1439if (!string) { 1440return ""; 1441} 1442string = string.toString(); 1443return options.html 1444? this.clipHtml(string, maxLength, options) 1445: this.clipPlainText(string, maxLength, options); 1446} 1447static clipHtml(string, maxLength, options) 1448{ 1449var _a = options.imageWeight, imageWeight = _a === void 0 ? 2 : _a, _b = options.indicator, indicator = _b === void 0 ? "\u2026" : _b, _c = options.maxLines, maxLines = _c === void 0 ? Infinity : _c, _d = options.stripTags, stripTags = _d === void 0 ? false : _d; 1450var numChars = indicator.length; 1451var numLines = 1; 1452var shouldStrip = typeof stripTags === "boolean" 1453? function () { return stripTags; } 1454: function (tagName) { return stripTags.includes(tagName); }; 1455var tagStack = []; 1456var popTagStack = function (result) { 1457var tagName; 1458while (((tagName = tagStack.pop()), tagName !== undefined)) { 1459if (!shouldStrip(tagName)) { 1460result += "</".concat(tagName, ">"); 1461} 1462} 1463return result; 1464}; 1465var i = 0; 1466var unbreakableElementIndex = -1; 1467var length = string.length; 1468for (; i < length; i++) { 1469var rest = i ? string.slice(i) : string; 1470var willSimplifyWhiteSpace = this.shouldSimplifyWhiteSpace(tagStack); 1471var regex = unbreakableElementIndex > -1 || willSimplifyWhiteSpace 1472? this.CHAR_OF_INTEREST_NO_NEWLINE_REGEX 1473: this.CHAR_OF_INTEREST_REGEX; 1474var nextIndex = rest.search(regex); 1475var nextBlockSize = nextIndex > -1 ? nextIndex : rest.length; 1476if (unbreakableElementIndex === -1) { 1477if (willSimplifyWhiteSpace) { 1478var simplifiedBlock = this.simplifyWhiteSpace(nextBlockSize === rest.length ? rest : rest.slice(0, nextIndex)); 1479if (shouldStrip(tagStack[tagStack.length - 1])) { 1480var insertSpaceBefore = i > 0 && !this.isWhiteSpace(string.charCodeAt(i - 1)); 1481var insertSpaceAfter = !this.isWhiteSpace(string.charCodeAt(i + nextBlockSize)); 1482if (simplifiedBlock.length > 0) { 1483simplifiedBlock = 1484(insertSpaceBefore ? " " : "") + 1485simplifiedBlock + 1486(insertSpaceAfter ? " " : ""); 1487} 1488else if (insertSpaceBefore && insertSpaceAfter) { 1489simplifiedBlock = " "; 1490} 1491string = string.slice(0, i) + simplifiedBlock + string.slice(i + nextBlockSize); 1492nextBlockSize = simplifiedBlock.length; 1493} 1494numChars += simplifiedBlock.length; 1495if (numChars > maxLength) { 1496break; 1497} 1498} 1499else { 1500numChars += nextBlockSize; 1501if (numChars > maxLength) { 1502i = Math.max(i + nextBlockSize - numChars + maxLength, 0); 1503break; 1504} 1505} 1506} 1507i += nextBlockSize; 1508if (nextIndex === -1) { 1509break; 1510}
1511var charCode = string.charCodeAt(i); 1512if (charCode === this.TAG_OPEN_CHAR_CODE) { 1513var nextCharCode = string.charCodeAt(i + 1); 1514var isSpecialTag = nextCharCode === this.EXCLAMATION_CHAR_CODE; 1515if (isSpecialTag && string.substr(i + 2, 2) === "--") { 1516var commentEndIndex = string.indexOf("-->", i + 4) + 3; 1517i = commentEndIndex - 1; 1518} 1519else if (isSpecialTag && string.substr(i + 2, 7) === "[CDATA[") { 1520var cdataEndIndex = string.indexOf("]]>", i + 9) + 3; 1521i = cdataEndIndex - 1; 1522} 1523else { 1524var isEndTag = nextCharCode === this.FORWARD_SLASH_CHAR_CODE; 1525if (numChars === maxLength && !isEndTag) { 1526numChars++; 1527break; 1528} 1529var attributeQuoteCharCode = 0; 1530var endIndex = i; 1531var isAttributeValue = false; 1532while (true ) { 1533endIndex++; 1534if (endIndex >= length) { 1535throw new Error("Invalid HTML: ".concat(string)); 1536} 1537var charCode_1 = string.charCodeAt(endIndex); 1538if (isAttributeValue) { 1539if (attributeQuoteCharCode) { 1540if (charCode_1 === attributeQuoteCharCode) { 1541isAttributeValue = false; 1542} 1543} 1544else { 1545if (this.isWhiteSpace(charCode_1)) { 1546isAttributeValue = false; 1547} 1548else if (charCode_1 === this.TAG_CLOSE_CHAR_CODE) { 1549isAttributeValue = false; 1550endIndex--; 1551} 1552} 1553} 1554else if (charCode_1 === this.EQUAL_SIGN_CHAR_CODE) { 1555while (this.isWhiteSpace(string.charCodeAt(endIndex + 1))) { 1556endIndex++; 1557} 1558isAttributeValue = true; 1559var firstAttributeCharCode = string.charCodeAt(endIndex + 1); 1560if (firstAttributeCharCode === this.DOUBLE_QUOTE_CHAR_CODE || 1561firstAttributeCharCode === this.SINGLE_QUOTE_CHAR_CODE) { 1562attributeQuoteCharCode = firstAttributeCharCode; 1563endIndex++; 1564} 1565else { 1566attributeQuoteCharCode = 0; 1567} 1568} 1569else if (charCode_1 === this.TAG_CLOSE_CHAR_CODE) { 1570var tagNameStartIndex = i + (isEndTag ? 2 : 1); 1571var tagNameEndIndex = Math.min(this.indexOfWhiteSpace(string, tagNameStartIndex), endIndex); 1572var tagName = string 1573.slice(tagNameStartIndex, tagNameEndIndex) 1574.toLowerCase(); 1575if (tagName.charCodeAt(tagName.length - 1) === this.FORWARD_SLASH_CHAR_CODE) { 1576tagName = tagName.slice(0, tagName.length - 1); 1577} 1578var strip = shouldStrip(tagName); 1579if (isEndTag) { 1580var currentTagName = tagStack.pop(); 1581if (currentTagName !== tagName) { 1582throw new Error("Invalid HTML: ".concat(string)); 1583} 1584if (this.UNBREAKABLE_ELEMENTS.includes(tagName)) { 1585if (this.UNBREAKABLE_ELEMENTS.some(function (tagName) { 1586return tagStack.includes(tagName); 1587})) { 1588} 1589else if (strip) { 1590i = unbreakableElementIndex; 1591unbreakableElementIndex = -1; 1592} 1593else { 1594unbreakableElementIndex = -1; 1595numChars += imageWeight; 1596if (numChars > maxLength) { 1597break; 1598} 1599} 1600} 1601var isBlockElement = this.BLOCK_ELEMENTS.includes(tagName); 1602if (isBlockElement && unbreakableElementIndex === -1 && !strip) { 1603numLines++; 1604if (numLines > maxLines) { 1605tagStack.push(tagName); 1606break; 1607} 1608} 1609} 1610else if (this.VOID_ELEMENTS.includes(tagName) || 1611string.charCodeAt(endIndex - 1) === this.FORWARD_SLASH_CHAR_CODE) { 1612if (strip) { 1613} 1614else if (tagName === "br") { 1615numLines++; 1616if (numLines > maxLines) { 1617break; 1618} 1619} 1620else if (tagName === "img") { 1621numChars += imageWeight; 1622if (numChars > maxLength) { 1623break; 1624} 1625} 1626} 1627else { 1628if (this.UNBREAKABLE_ELEMENTS.some(function (tagName) { return tagStack.includes(tagName); })) { 1629} 1630else if (this.UNBREAKABLE_ELEMENTS.includes(tagName)) { 1631unbreakableElementIndex = i; 1632} 1633tagStack.push(tagName); 1634} 1635if (strip && unbreakableElementIndex === -1) { 1636string = string.slice(0, i) + string.slice(endIndex + 1); 1637i--; 1638} 1639else { 1640i = endIndex; 1641} 1642break; 1643} 1644} 1645if (numChars > maxLength || numLines > maxLines) { 1646break; 1647} 1648} 1649} 1650else if (charCode === this.AMPERSAND_CHAR_CODE) { 1651var endIndex = i + 1; 1652var isCharacterReference = true; 1653while (true ) { 1654var charCode_2 = string.charCodeAt(endIndex); 1655if (this.isCharacterReferenceCharacter(charCode_2)) { 1656endIndex++; 1657} 1658else if (charCode_2 === this.SEMICOLON_CHAR_CODE) { 1659break; 1660} 1661else { 1662isCharacterReference = false; 1663break; 1664} 1665} 1666if (unbreakableElementIndex === -1) { 1667numChars++; 1668if (numChars > maxLength) { 1669break; 1670} 1671} 1672if (isCharacterReference) { 1673i = endIndex; 1674} 1675} 1676else if (charCode === this.NEWLINE_CHAR_CODE) { 1677numChars++; 1678if (numChars > maxLength) { 1679break; 1680} 1681numLines++; 1682if (numLines > maxLines) { 1683break; 1684} 1685} 1686else { 1687if (unbreakableElementIndex === -1) { 1688numChars++; 1689if (numChars > maxLength) { 1690break; 1691} 1692} 1693if ((charCode & 0xfc00) === 0xd800) { 1694var nextCharCode = string.charCodeAt(i + 1); 1695if ((nextCharCode & 0xfc00) === 0xdc00) { 1696i++; 1697} 1698} 1699} 1700} 1701if (numChars > maxLength) { 1702var nextChar = this.takeHtmlCharAt(string, i); 1703if (indicator) { 1704var peekIndex = i + nextChar.length; 1705while (string.charCodeAt(peekIndex) === this.TAG_OPEN_CHAR_CODE && 1706string.charCodeAt(peekIndex + 1) === this.FORWARD_SLASH_CHAR_CODE) { 1707var nextPeekIndex = string.indexOf(">", peekIndex + 2) + 1; 1708if (nextPeekIndex) { 1709peekIndex = nextPeekIndex; 1710} 1711else { 1712break; 1713} 1714} 1715if (peekIndex && (peekIndex === string.length || this.isLineBreak(string, peekIndex))) { 1716i += nextChar.length; 1717nextChar = string.charAt(i); 1718} 1719} 1720while (nextChar === "<" && string.charCodeAt(i + 1) === this.FORWARD_SLASH_CHAR_CODE) { 1721var tagName = tagStack.pop(); 1722if (!tagName) { 1723break; 1724} 1725var tagEndIndex = string.indexOf(">", i + 2);
1726if (tagEndIndex === -1 || string.slice(i + 2, tagEndIndex).trim() !== tagName) { 1727throw new Error("Invalid HTML: ".concat(string)); 1728} 1729if (shouldStrip(tagName)) { 1730string = string.slice(0, i) + string.slice(tagEndIndex + 1); 1731} 1732else { 1733i = tagEndIndex + 1; 1734} 1735nextChar = string.charAt(i); 1736} 1737if (i < string.length) { 1738if (!options.breakWords) { 1739for (var j = i - indicator.length; j >= 0; j--) { 1740var charCode = string.charCodeAt(j); 1741if (charCode === this.TAG_CLOSE_CHAR_CODE || charCode === this.SEMICOLON_CHAR_CODE) { 1742break; 1743} 1744else if (charCode === this.NEWLINE_CHAR_CODE || charCode === this.TAG_OPEN_CHAR_CODE) { 1745i = j; 1746break; 1747} 1748else if (this.isWhiteSpace(charCode)) { 1749i = j + (indicator ? 1 : 0); 1750break; 1751} 1752} 1753} 1754var result = string.slice(0, i); 1755if (!this.isLineBreak(string, i)) { 1756result += indicator; 1757} 1758return popTagStack(result); 1759} 1760} 1761else if (numLines > maxLines) { 1762return popTagStack(string.slice(0, i)); 1763} 1764return string; 1765}; 1766static clipPlainText(string, maxLength, options) 1767{ 1768var _a = options.indicator, indicator = _a === void 0 ? "\u2026" : _a, _b = options.maxLines, maxLines = _b === void 0 ? Infinity : _b; 1769var numChars = indicator.length; 1770var numLines = 1; 1771var i = 0; 1772var length = string.length; 1773for (; i < length; i++) { 1774numChars++; 1775if (numChars > maxLength) { 1776break; 1777} 1778var charCode = string.charCodeAt(i); 1779if (charCode === this.NEWLINE_CHAR_CODE) { 1780numLines++; 1781if (numLines > maxLines) { 1782break; 1783} 1784} 1785else if ((charCode & 0xfc00) === 0xd800) { 1786var nextCharCode = string.charCodeAt(i + 1); 1787if ((nextCharCode & 0xfc00) === 0xdc00) { 1788i++; 1789} 1790} 1791} 1792if (numChars > maxLength) { 1793var nextChar = this.takeCharAt(string, i); 1794if (indicator) { 1795var peekIndex = i + nextChar.length; 1796if (peekIndex === string.length) { 1797return string; 1798} 1799else if (string.charCodeAt(peekIndex) === this.NEWLINE_CHAR_CODE) { 1800return string.slice(0, i + nextChar.length); 1801} 1802} 1803if (!options.breakWords) { 1804for (var j = i - indicator.length; j >= 0; j--) { 1805var charCode = string.charCodeAt(j); 1806if (charCode === this.NEWLINE_CHAR_CODE) { 1807i = j; 1808nextChar = "\n"; 1809break; 1810} 1811else if (this.isWhiteSpace(charCode)) { 1812i = j + (indicator ? 1 : 0); 1813break; 1814} 1815} 1816} 1817return string.slice(0, i) + (nextChar === "\n" ? "" : indicator); 1818} 1819else if (numLines > maxLines) { 1820return string.slice(0, i); 1821} 1822return string; 1823}; 1824static indexOfWhiteSpace(string, fromIndex) 1825{ 1826var length = string.length; 1827for (var i = fromIndex; i < length; i++) { 1828if (this.isWhiteSpace(string.charCodeAt(i))) { 1829return i; 1830} 1831} 1832return length; 1833}; 1834static isCharacterReferenceCharacter(charCode) 1835{ 1836return ((charCode >= 48 && charCode <= 57) || 1837(charCode >= 65 && charCode <= 90) || 1838(charCode >= 97 && charCode <= 122)); 1839}; 1840static isLineBreak(string, index) 1841{ 1842var firstCharCode = string.charCodeAt(index); 1843if (firstCharCode === this.NEWLINE_CHAR_CODE) { 1844return true; 1845} 1846else if (firstCharCode === this.TAG_OPEN_CHAR_CODE) { 1847var newlineElements = "(".concat(this.BLOCK_ELEMENTS.join("|"), "|br)"); 1848var newlineRegExp = new RegExp("^<".concat(newlineElements, "[\t\n\f\r ]*" + "/?>"), "i"); 1849return newlineRegExp.test(string.slice(index)); 1850} 1851else { 1852return false; 1853} 1854} 1855static isWhiteSpace(charCode) 1856{ 1857return (charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32); 1858}; 1859static shouldSimplifyWhiteSpace(tagStack) { 1860for (var i = tagStack.length - 1; i >= 0; i--) { 1861var tagName = tagStack[i]; 1862if (tagName === "li" || tagName === "td") { 1863return false; 1864} 1865if (tagName === "ol" || tagName === "table" || tagName === "ul") { 1866return true; 1867} 1868} 1869return false; 1870}; 1871static simplifyWhiteSpace(string) 1872{ 1873return string.trim().replace(this.SIMPLIFY_WHITESPACE_REGEX, " "); 1874}; 1875static takeCharAt(string, index) 1876{ 1877var charCode = string.charCodeAt(index); 1878if ((charCode & 0xfc00) === 0xd800) { 1879var nextCharCode = string.charCodeAt(index + 1); 1880if ((nextCharCode & 0xfc00) === 0xdc00) { 1881return String.fromCharCode(charCode, nextCharCode); 1882} 1883} 1884return String.fromCharCode(charCode); 1885}; 1886static takeHtmlCharAt(string, index) 1887{ 1888var char = this.takeCharAt(string, index); 1889if (char === "&") { 1890while (true ) { 1891index++; 1892var nextCharCode = string.charCodeAt(index); 1893if (this.isCharacterReferenceCharacter(nextCharCode)) { 1894char += String.fromCharCode(nextCharCode); 1895} 1896else if (nextCharCode === this.SEMICOLON_CHAR_CODE) { 1897char += String.fromCharCode(nextCharCode); 1898break; 1899} 1900else { 1901break; 1902} 1903} 1904} 1905return char; 1906}; 1907} 1908if (typeof String.prototype.replaceAll !== 'function') 1909{ 1910String.prototype.replaceAll = function(search, replacement) 1911{ 1912try 1913{ 1914var target = this; 1915return target.split(search).join(replacement); 1916} 1917catch (e) 1918{ 1919if (typeof(HRLogError) === 'function') 1920HRLogError(e); 1921} 1922return this; 1923} 1924} 1925if (typeof String.prototype.endsWith !== 'function') 1926{ 1927String.prototype.endsWith = function(suffix) 1928{ 1929try 1930{ 1931return this.indexOf(suffix, this.length - suffix.length) !== -1; 1932} 1933catch (e) 1934{ 1935if (typeof(HRLogError) === 'function') 1936HRLogError(e); 1937} 1938return false;
1939} 1940} 1941if (typeof String.prototype.startsWith !== 'function') 1942{ 1943String.prototype.startsWith = function(prefix) 1944{ 1945try 1946{ 1947return this.lastIndexOf(prefix, 0) === 0; 1948} 1949catch (e) 1950{ 1951if (typeof(HRLogError) === 'function') 1952HRLogError(e); 1953} 1954return false; 1955} 1956} 1957if (typeof String.prototype.isEmpty !== 'function') 1958{ 1959String.prototype.isEmpty = function() 1960{ 1961try 1962{ 1963return this.length <= 0; 1964} 1965catch (e) 1966{ 1967if (typeof(HRLogError) === 'function') 1968HRLogError(e); 1969} 1970return true; 1971} 1972} 1973if (typeof String.prototype.contains !== 'function') 1974{ 1975String.prototype.contains = function(str) 1976{ 1977try 1978{ 1979return this.indexOf(str) >= 0; 1980} 1981catch (e) 1982{ 1983if (typeof(HRLogError) === 'function') 1984HRLogError(e); 1985} 1986return true; 1987} 1988} 1989if (typeof String.prototype.equalsIgnoreCase !== 'function') 1990{ 1991String.prototype.equalsIgnoreCase = function(str) 1992{ 1993try 1994{ 1995if (typeof(str) === "string") 1996return (this.toUpperCase() === str.toUpperCase()); 1997} 1998catch (e) 1999{ 2000if (typeof(HRLogError) === 'function') 2001HRLogError(e); 2002} 2003return false; 2004} 2005} 2006if (typeof String.prototype.truncate !== 'function') 2007{ 2008String.prototype.truncate = function(maxLength) 2009{ 2010try 2011{ 2012if (this) 2013{ 2014const el = document.createElement("div"); 2015el.innerHTML = this.trim(); 2016const match = el.textContent.trim().length; 2017el.remove(); 2018return match ? HRTextClipper.clip(this, maxLength, {html: true}) : this; 2019} 2020} 2021catch (e) 2022{ 2023if (typeof(HRLogError) === 'function') 2024HRLogError(e); 2025} 2026return null; 2027} 2028} 2029if (typeof String.prototype.hashCode !== 'function') 2030{ 2031String.prototype.hashCode = function() 2032{ 2033let hash = 0, i, c; 2034if (this.length === 0) 2035return hash; 2036for (i = 0; i < this.length; i++) 2037{ 2038c = this.charCodeAt(i); 2039hash = ((hash << 5) - hash) + c; 2040hash |= 0; 2041} 2042return hash; 2043} 2044} 2045if (typeof String.prototype.countWords !== 'function') 2046{ 2047String.prototype.countWords = function() 2048{ 2049try 2050{ 2051if (this) 2052{ 2053if (!this.isEmpty()) 2054return this.trim().split(/\s+/).length; 2055} 2056} 2057catch (e) 2058{ 2059if (typeof(HRLogError) === 'function') 2060HRLogError(e); 2061} 2062return 0; 2063}; 2064} 2065if (typeof String.prototype.encodeToNumericCharReferences !== 'function') 2066{ 2067String.prototype.encodeToNumericCharReferences = function(blacklist, onlyNonIso) 2068{ 2069try 2070{ 2071if (this) 2072{ 2073return this.split(/(?:)/u).map(char => { 2074if (blacklist && blacklist.includes(char)) 2075return char; 2076else if (!onlyNonIso || char.codePointAt(0) > 255) 2077return '&#' + char.codePointAt(0) + ';'; 2078else 2079return char; 2080}).join(''); 2081} 2082} 2083catch (e) 2084{ 2085if (typeof(HRLogError) === 'function') 2086HRLogError(e); 2087} 2088return this; 2089}; 2090} 2091if (typeof String.prototype.encodeToHtmlEntities !== 'function') 2092{ 2093String.prototype.encodeToHtmlEntities = function(blacklist) 2094{ 2095try 2096{ 2097if (this) 2098{ 2099return this.split('').map(char => { 2100if (blacklist && blacklist.includes(char)) 2101return char; 2102else 2103{ 2104const code = char.charCodeAt(0); 2105if (code > 127 || ['&', '<', '>', '"', "'"].includes(char)) 2106return `&#${code};`; 2107return char; 2108} 2109}).join(''); 2110} 2111} 2112catch (e) 2113{ 2114if (typeof(HRLogError) === 'function') 2115HRLogError(e); 2116} 2117return this; 2118}; 2119} 2120if (typeof String.prototype.decodeFromHtmlEntities !== 'function') 2121{ 2122String.prototype.decodeFromHtmlEntities = function() 2123{ 2124try 2125{ 2126if (this) 2127{ 2128const txt = document.createElement("textarea"); 2129txt.innerHTML = this; 2130return txt.value; 2131} 2132} 2133catch (e) 2134{ 2135if (typeof(HRLogError) === 'function') 2136HRLogError(e); 2137} 2138return this; 2139}; 2140} 2141if (typeof String.prototype.removeHtmlTags !== 'function') 2142{ 2143String.prototype.removeHtmlTags = function() 2144{ 2145try 2146{ 2147if (this) 2148{ 2149const parser = new DOMParser(); 2150const doc = parser.parseFromString(this, 'text/html'); 2151const textContent = doc.body.textContent || ''; 2152return new DOMParser().parseFromString(textContent, 'text/html').documentElement.textContent; 2153} 2154} 2155catch (e) 2156{ 2157if (typeof(HRLogError) === 'function') 2158HRLogError(e); 2159} 2160return this; 2161}; 2162} 2163if (typeof String.prototype.sanitizeURLParameter !== 'function') 2164{ 2165String.prototype.sanitizeURLParameter = function() 2166{ 2167try 2168{ 2169if (this) 2170{ 2171return encodeURIComponent(this) 2172.replace(/'/g, '%27') 2173.replace(/\(/g, '%28') 2174.replace(/\)/g, '%29'); 2175} 2176} 2177catch (e) 2178{ 2179if (typeof(HRLogError) === 'function') 2180HRLogError(e); 2181} 2182return this; 2183}; 2184} 2185if (typeof String.prototype.isValidCSSName !== 'function') 2186{ 2187String.prototype.isValidCSSName = function() 2188{ 2189try 2190{ 2191if (!this) 2192return false;
2193const regexClassInput = /^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/; 2194return regexClassInput.test(this); 2195} 2196catch (e) 2197{ 2198if (typeof(HRLogError) === 'function') 2199HRLogError(e); 2200} 2201return false; 2202}; 2203} 2204if (typeof String.prototype.isValidXMLName !== 'function') 2205{ 2206String.prototype.isValidXMLName = function() 2207{ 2208try 2209{ 2210if (!this) 2211return false; 2212const xmlNameStartChar = /^[A-Za-z_][A-Za-z0-9._-]*$/; 2213const startsWithXML = /^xml/i; 2214return xmlNameStartChar.test(this) && !startsWithXML.test(name); 2215} 2216catch (e) 2217{ 2218if (typeof(HRLogError) === 'function') 2219HRLogError(e); 2220} 2221return false; 2222}; 2223} 2224"use strict"; 2225const SecurityLevel = { 2226Low: "low", 2227Normal: "normal", 2228High: "high" 2229} 2230"use strict"; 2231class HRParam 2232{ 2233static convertHTMLUnicodeEntitaeten(value) 2234{ 2235if (!value) 2236return value; 2237return value.replaceAll("′", "′"); 2238} 2239static disarmHttpInput(value, level) 2240{ 2241if (!value || value.trim() === '') 2242return ''; 2243if (!level) 2244level = SecurityLevel.Normal; 2245let result = ''; 2246value = this.convertHTMLUnicodeEntitaeten(value); 2247const length = value.length; 2248for (let i = 0; i < length; i++) 2249{ 2250const c = value.charAt(i); 2251const code = value.charCodeAt(i); 2252switch (c) 2253{ 2254case '\\': 2255if (level === SecurityLevel.Normal) 2256result += '\\\\'; 2257else if (level === SecurityLevel.Low) 2258result += '\\'; 2259break; 2260case '\'': 2261if (level === SecurityLevel.Normal) 2262result += "\\'"; 2263else if (level === SecurityLevel.Low) 2264result += "'"; 2265break; 2266case '"': 2267if (level === SecurityLevel.Normal) 2268result += '\\"'; 2269else if (level === SecurityLevel.Low) 2270result += '"'; 2271break; 2272case '#': 2273if (level === SecurityLevel.Low) 2274result += '#'; 2275break; 2276case '\t': 2277if (level === SecurityLevel.Low) 2278result += '\t'; 2279break; 2280case '&': 2281case '!': 2282case '§': 2283case '$': 2284case '/': 2285case '(': 2286case ')': 2287case '=': 2288case '?': 2289case '`': 2290case '*': 2291case '~': 2292case '_': 2293case ':': 2294case ';': 2295case '<': 2296case '|': 2297case '{': 2298case '}': 2299case '[': 2300case ']': 2301case '>': 2302case '-': 2303case '.': 2304case ',': 2305case '+': 2306case '@': 2307case ' ': 2308case '²': 2309case '³': 2310case '°': 2311case '': 2312case '\n': 2313case '%': 2314case '^': 2315case '»': 2316case '«': 2317result += c; 2318break; 2319default: 2320switch (code) 2321{ 2322case 150: 2323result += '-'; 2324break; 2325case 164: 2326result += c; 2327break; 2328case 128: 2329result += '€'; 2330break; 2331case 132: 2332result += '„'; 2333break; 2334case 147: 2335result += '“'; 2336break; 2337case 148: 2338result += '”'; 2339break; 2340default: 2341if (/^[a-zA-Z0-9]$/.test(c)) 2342result += c; 2343} 2344} 2345} 2346return result; 2347} 2348static disarmHtmlOutput(html, level) 2349{ 2350if (!html || html.trim() === '') 2351return ''; 2352if (!level) 2353level = SecurityLevel.Normal; 2354if (level !== SecurityLevel.Low) 2355{ 2356html = html.replaceAll('\\\\\'', '"'); 2357html = html.replaceAll('\\\\"', '′'); 2358} 2359let result = ''; 2360const length = html.length; 2361for (let i = 0; i < length; i++) 2362{ 2363const c = html.charAt(i); 2364const code = html.charCodeAt(i); 2365switch (code) 2366{ 2367case 128: 2368case 8364: 2369result += '€'; 2370break; 2371case 132: 2372case 8222: 2373result += '„'; 2374break; 2375case 147: 2376case 8220: 2377result += '“'; 2378break; 2379case 148: 2380case 8221: 2381result += '”'; 2382break; 2383case 8216: 2384result += '‘'; 2385break; 2386case 8217: 2387result += '’'; 2388break; 2389case 8218: 2390result += '‚'; 2391break; 2392case 8211: 2393result += '–'; 2394break; 2395case 8212: 2396result += '—'; 2397break; 2398case 180: 2399result += '´'; 2400break; 2401case 8242: 2402result += '′'; 2403break; 2404default: 2405switch (c) 2406{ 2407case 'ä': 2408result += 'ä'; 2409break; 2410case 'ö': 2411result += 'ö'; 2412break; 2413case 'ü': 2414result += 'ü'; 2415break; 2416case 'Ä': 2417result += 'Ä'; 2418break; 2419case 'Ö': 2420result += 'Ö'; 2421break; 2422case 'Ü': 2423result += 'Ü'; 2424break; 2425case 'ß': 2426result += 'ß'; 2427break; 2428case '»': 2429result += '»'; 2430break; 2431case '«': 2432result += '«'; 2433break; 2434case '\u00A0': 2435result += ' '; 2436break; 2437case "'": 2438if (level !== SecurityLevel.Low) 2439result += '′'; 2440else 2441result += c; 2442break; 2443case '"': 2444if (level !== SecurityLevel.Low) 2445result += '"'; 2446else 2447result += c; 2448break; 2449case '<': 2450if (level !== SecurityLevel.Low) 2451result += '<'; 2452else 2453result += c; 2454break; 2455case '>': 2456if (level !== SecurityLevel.Low) 2457result += '>'; 2458else 2459result += c; 2460break; 2461default: 2462result += c; 2463} 2464} 2465} 2466return result; 2467} 2468} 2469"use strict"; 2470class HRCrypt 2471{ 2472static PasswordSpecialCharacters = '[`~!@#$%^&*()\\-_=+|\[{\\]}};:\'\",<.>\/?]'; 2473static hrEncrypt(message) 2474{ 2475let reversedString = ''; 2476for (let i = message.length - 1; i >= 0; i--) 2477{ 2478reversedString += message.charAt(i); 2479} 2480let tempBytes = new Uint8Array(reversedString.length); 2481for (let i = 0; i < reversedString.length; i++) 2482{ 2483tempBytes[i] = 255 - reversedString.charCodeAt(i); 2484} 2485let binaryString = ''; 2486for (let byte of tempBytes) 2487{ 2488binaryString += String.fromCharCode(byte); 2489} 2490return btoa(binaryString).trim(); 2491} 2492static hrDecrypt(message) 2493{ 2494const temp = window.atob(message); 2495let decrypted = ''; 2496for (let i = temp.length - 1; i >= 0; i--) 2497{ 2498decrypted += temp.charAt(i); 2499} 2500let encoder = []; 2501for (let i = 0; i < decrypted.length; i++) 2502{ 2503encoder[i] = 255 - decrypted.charCodeAt(i); 2504} 2505decrypted = ''; 2506for (let i = 0; i < encoder.length; i++) 2507{ 2508decrypted += String.fromCharCode(encoder[i]); 2509} 2510return decrypted; 2511}; 2512static hrEncryptFibonacciShift(message) 2513{ 2514let prev = 3; 2515let next = 5; 2516let result = ''; 2517for (let curr of message) 2518{ 2519result += String.fromCharCode(((curr.charCodeAt(0) + next) % 93) + 33); 2520let temp = prev + next; 2521prev = next; 2522next = temp; 2523} 2524return result.trim(); 2525} 2526static hrEncryptAlternateBitShift(message) 2527{ 2528let result = ''; 2529let shiftLeft = true; 2530for (let curr of message) 2531{ 2532let shiftedChar; 2533if (shiftLeft) 2534shiftedChar = (curr.charCodeAt(0) << 1) & 0x7F; 2535else 2536shiftedChar = (curr.charCodeAt(0) >> 1) & 0x7F; 2537result += String.fromCharCode((shiftedChar % 93) + 33); 2538shiftLeft = !shiftLeft; 2539} 2540return result.trim(); 2541} 2542static validatePassword(password, min, caseSensitive, specials, numbers) 2543{ 2544let result = null; 2545try 2546{ 2547if (password != null && password != undefined && typeof(password) === 'string') 2548{ 2549result = {}; 2550password = password.trim(); 2551if (min > 0) 2552result.min = (password.length >= min); 2553if (caseSensitive) 2554result.caseSensitive = (/(?=.*[a-z])(?=.*[A-Z])/.exec(password) != null); 2555if (specials)
2556result.specials = (new RegExp(this.PasswordSpecialCharacters).exec(password) != null); 2557if (numbers) 2558result.numbers = (/\d/.exec(password) != null); 2559} 2560} 2561catch (e) 2562{ 2563if (typeof(HRLogError) === 'function') 2564HRLogError(e); 2565} 2566return result; 2567} 2568static decryptMailAddresses() 2569{ 2570Array.from(document.querySelectorAll("a[data-encrypted]")).forEach(match => { 2571if (match.href.indexOf('mailto:') >= 0) 2572{ 2573const mailaddress = match.href.substring(match.href.indexOf('mailto:') + 7, match.href.length).trim(); 2574const decryptedMailaddress = this.hrDecrypt(mailaddress); 2575match.href = `mailto:${decryptedMailaddress}`; 2576match.removeAttribute('data-encrypted'); 2577if (mailaddress == match.innerHTML.trim()) 2578match.innerHTML = decryptedMailaddress; 2579} 2580}); 2581Array.from(document.querySelectorAll("hrencrypted")).forEach(match => { 2582const mailaddress = match.innerHTML.trim(); 2583const decryptedMailaddress = this.hrDecrypt(mailaddress); 2584match.parentNode.replaceChild(document.createTextNode(decryptedMailaddress), match); 2585}); 2586} 2587static getUUID() 2588{ 2589try 2590{ 2591if (typeof(Crypto.randomUUID) === 'function') 2592return Crypto.randomUUID(); 2593else 2594{ 2595return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => 2596(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) 2597); 2598} 2599} 2600catch (e) 2601{ 2602if (typeof(HRLogError) === 'function') 2603HRLogError(e); 2604return Math.floor(Math.random() * 1000) + '-' + new Date().getTime(); 2605} 2606return null; 2607} 2608} 2609class HRDOM 2610{ 2611static addEventListener(elementOrId, eventName, listener, config={capture: false}) 2612{ 2613try 2614{ 2615if (eventName == null || typeof(eventName) != "string" || !listener || (typeof(listener) !== 'function' && typeof(listener.handleEvent) !== 'function')) 2616return; 2617var targetElement = null; 2618if (elementOrId != null && typeof(elementOrId) == "string") 2619targetElement = document.getElementById(elementOrId); 2620else if (elementOrId != null && typeof(elementOrId) == "object") 2621targetElement = elementOrId; 2622else if (elementOrId == null) 2623targetElement = window; 2624if (targetElement == null) 2625return; 2626if (targetElement.addEventListener) 2627{ 2628targetElement.addEventListener(eventName, listener, config); 2629} 2630else if (targetElement.attachEvent) 2631{ 2632targetElement.attachEvent("on" + eventName, listener); 2633} 2634} 2635catch (e) 2636{ 2637if (typeof(HRLogError) === 'function') 2638HRLogError(e); 2639} 2640} 2641static removeEventListener(elementOrId, eventName, listener) 2642{ 2643try 2644{ 2645if (eventName == null || typeof(eventName) != "string" || !listener || (typeof(listener) !== 'function' && typeof(listener.handleEvent) !== 'function')) 2646return; 2647var targetElement = null; 2648if (elementOrId != null && typeof(elementOrId) == "string") 2649targetElement = document.getElementById(elementOrId); 2650else if (elementOrId != null && typeof(elementOrId) == "object") 2651targetElement = elementOrId; 2652else if (elementOrId == null) 2653targetElement = window; 2654if (targetElement == null) 2655return; 2656if (targetElement.removeEventListener) 2657{ 2658targetElement.removeEventListener(eventName, listener, false); 2659} 2660else if (targetElement.attachEvent) 2661{ 2662targetElement.detachEvent("on" + eventName, listener); 2663} 2664} 2665catch (e) 2666{ 2667if (typeof(HRLogError) === 'function') 2668HRLogError(e); 2669} 2670} 2671static addOnLoad(onLoadFunction) 2672{ 2673if (window.addEventListener) 2674{ 2675window.addEventListener("load", onLoadFunction, false); 2676} 2677else if (window.attachEvent) 2678{ 2679window.attachEvent("onload", onLoadFunction); 2680} 2681else 2682window.onload = onLoadFunction; 2683} 2684static addOnAjaxLoad(sender, onLoadFunction) 2685{ 2686try 2687{ 2688if (sender && typeof(sender) === 'string') 2689{ 2690sender = document.getElementById(sender); 2691} 2692if (sender && HREventManager && typeof(HREventManager.addListener) === 'function') 2693HREventManager.addListener(sender, 'ajax-load', onLoadFunction, {useStandard: false, notifiedByParents: true}); 2694} 2695catch (e) 2696{ 2697if (typeof(HRLogError) === 'function') 2698HRLogError(e); 2699} 2700} 2701static wrap(element, wrapper) 2702{ 2703try 2704{ 2705if (element && wrapper && element.parentNode) 2706{ 2707element.parentNode.insertBefore(wrapper, element); 2708wrapper.appendChild(element); 2709} 2710} 2711catch (e) 2712{ 2713if (typeof(HRLogError) === 'function') 2714HRLogError(e); 2715} 2716} 2717static insertAfter(element, referenceElement) 2718{ 2719try 2720{ 2721if (referenceElement.parentNode) 2722referenceElement.parentNode.insertBefore(element, referenceElement.nextSibling); 2723} 2724catch (e) 2725{ 2726if (typeof(HRLogError) === 'function') 2727HRLogError(e); 2728} 2729} 2730static insertAsFirstChild(element, parent) 2731{ 2732try 2733{ 2734if (parent.firstChild) 2735parent.insertBefore(element, parent.firstChild); 2736else 2737parent.appendChild(element); 2738} 2739catch (e) 2740{ 2741if (typeof(HRLogError) === 'function') 2742HRLogError(e); 2743} 2744} 2745static removeAllChildren(element) 2746{ 2747try 2748{ 2749if (element) 2750{ 2751while (element.firstChild) 2752{ 2753element.removeChild(element.lastChild); 2754} 2755} 2756} 2757catch (e) 2758{ 2759if (typeof(HRLogError) === 'function') 2760HRLogError(e); 2761} 2762} 2763static copyToClipboard(txt) 2764{ 2765try 2766{ 2767if (!txt) 2768txt = ''; 2769if (navigator.clipboard && typeof(navigator.clipboard.writeText) === 'function') 2770navigator.clipboard.writeText(txt); 2771else 2772{ 2773window.prompt("Bitte kopieren Sie folgenden Text in die Zwischenablage (Strg+C):", txt); 2774} 2775} 2776catch (e) 2777{ 2778if (typeof(HRLogError) === 'function') 2779HRLogError(e); 2780} 2781} 2782static isFocusable(el) 2783{ 2784if (el) 2785{ 2786if (el.style.display !== 'none' && el.style.visibility !== 'hidden' && !el.disabled && el.offsetParent !== null) 2787{ 2788if (parseInt(el.tabIndex) >= 0) 2789{ 2790if ((el.tagName === 'A' && (el.rel === 'ignore' || !el.href)) || (el.tagName === 'INPUT' && el.type === 'hidden')) 2791return false;
2792return true; 2793} 2794} 2795} 2796return false; 2797} 2798static getFirstFocusableDescendant(el) 2799{ 2800let focusableDescendant = null; 2801try 2802{ 2803if (el) 2804{ 2805for (let i = 0; i < el.children.length; i++) 2806{ 2807if (!focusableDescendant) 2808{ 2809if (this.isFocusable(el.children[i])) 2810return el.children[i]; 2811else 2812focusableDescendant = this.getFirstFocusableDescendant(el.children[i]); 2813} 2814} 2815} 2816} 2817catch (e) 2818{ 2819if (typeof(HRLogError) === 'function') 2820HRLogError(e); 2821} 2822return focusableDescendant; 2823} 2824static getLastFocusableDescendant(el) 2825{ 2826let focusableDescendant = null; 2827try 2828{ 2829if (el) 2830{ 2831for (let i = el.children.length-1; i >= 0 ; i--) 2832{ 2833if (!focusableDescendant) 2834{ 2835if (this.isFocusable(el.children[i])) 2836return el.children[i]; 2837else 2838focusableDescendant = this.getLastFocusableDescendant(el.children[i]); 2839} 2840} 2841} 2842} 2843catch (e) 2844{ 2845if (typeof(HRLogError) === 'function') 2846HRLogError(e); 2847} 2848return focusableDescendant; 2849} 2850static trapFocus(el) 2851{ 2852try 2853{ 2854const firstEl = this.getFirstFocusableDescendant(el); 2855const lastEl = this.getLastFocusableDescendant(el); 2856if (firstEl && lastEl) 2857{ 2858if (lastEl !== firstEl) 2859{ 2860this.addEventListener(firstEl, 'keydown', (event) => { 2861if (event.shiftKey && event.key === 'Tab') 2862{ 2863lastEl.focus(); 2864event.preventDefault(); 2865} 2866}); 2867this.addEventListener(lastEl, 'keydown', (event) => { 2868if (!event.shiftKey && event.key === 'Tab') 2869{ 2870firstEl.focus(); 2871event.preventDefault(); 2872} 2873}); 2874} 2875else 2876{ 2877this.addEventListener(firstEl, 'keydown', (event) => { 2878if (event.key === 'Tab') 2879{ 2880firstEl.focus(); 2881event.preventDefault(); 2882} 2883}); 2884} 2885} 2886} 2887catch (e) 2888{ 2889if (typeof(HRLogError) === 'function') 2890HRLogError(e); 2891} 2892} 2893static inIframe() 2894{ 2895try 2896{ 2897return window.self !== window.top; 2898} 2899catch (e) 2900{ 2901return true; 2902} 2903} 2904static uniqueID() 2905{ 2906return Math.floor(Math.random() * Date.now()); 2907} 2908static addTransitionEndedEventListener(element, onTransitionEndedFunction) 2909{ 2910try 2911{ 2912const transitions = { 2913"transition" : "transitionend", 2914"OTransition" : "oTransitionEnd", 2915"MozTransition" : "transitionend", 2916"WebkitTransition": "webkitTransitionEnd" 2917}; 2918let eventName; 2919for (let transition in transitions) 2920{ 2921if (document.body.style[transition] != undefined) 2922eventName = transitions[transition]; 2923} 2924if (eventName) 2925HREventManager.addListener(element, eventName, onTransitionEndedFunction, {unique: true}); 2926} 2927catch (e) 2928{ 2929if (typeof(HRLogError) === 'function') 2930HRLogError(e); 2931} 2932} 2933static containsScriptInclude(url, searchDOM) 2934{ 2935var found = false; 2936try 2937{ 2938if (url) 2939{ 2940var scripts; 2941if (searchDOM) 2942scripts = document.getElementsByTagName('script'); 2943else 2944{ 2945var head = document.getElementsByTagName('head')[0]; 2946scripts = head.getElementsByTagName('script'); 2947} 2948if (scripts) 2949{ 2950var l = scripts.length; 2951for (let i = 0; i < l && !found; i++) 2952{ 2953if (scripts[i].src && scripts[i].src.length > 0 && url.indexOf(scripts[i].src) >= 0) 2954{ 2955found = true; 2956break; 2957} 2958} 2959} 2960} 2961} 2962catch (e) 2963{ 2964if (typeof(HRLogError) === 'function') 2965HRLogError(e); 2966} 2967return found; 2968} 2969static appendScriptIncludeToHead(url, onLoadFunction, searchDOM) 2970{ 2971var found = this.containsScriptInclude(url, searchDOM); 2972if (url) 2973{ 2974var head = document.getElementsByTagName('head')[0]; 2975if (!found) 2976{ 2977var script = document.createElement('script'); 2978script.async = true; 2979script.src = url; 2980if (onLoadFunction && typeof(onLoadFunction) === 'function') 2981{ 2982script.onload = function() { 2983try 2984{ 2985onLoadFunction(); 2986} 2987catch(e) 2988{ 2989if (typeof(HRLogError) === 'function') 2990HRLogError(e); 2991} 2992}; 2993} 2994head.appendChild(script); 2995} 2996else if (onLoadFunction && typeof(onLoadFunction) === 'function') 2997onLoadFunction(); 2998} 2999return !found; 3000} 3001static containsCSSLinkInclude(url, searchDOM) 3002{ 3003let found = false; 3004try 3005{ 3006if (url) 3007{ 3008let links; 3009if (searchDOM) 3010links = document.getElementsByTagName('link'); 3011else 3012{ 3013const head = document.getElementsByTagName('head')[0]; 3014links = head.getElementsByTagName('link'); 3015} 3016if (links) 3017{ 3018let i = 0; 3019const l = links.length; 3020for (i = 0; i < l && !found; i++) 3021{ 3022if (links[i].href && links[i].href.length > 0 && url.indexOf(links[i].href) >= 0) 3023{ 3024found = true; 3025break; 3026} 3027} 3028} 3029} 3030} 3031catch (e) 3032{ 3033if (typeof(HRLogError) === 'function') 3034HRLogError(e); 3035} 3036return found; 3037} 3038static appendCSSLinkIncludeToHead(url, searchDOM) 3039{ 3040let found = this.containsCSSLinkInclude(url, searchDOM); 3041if (url) 3042{ 3043const head = document.getElementsByTagName('head')[0]; 3044if (!found) 3045{ 3046const link = document.createElement('link'); 3047link.rel = 'stylesheet'; 3048link.href = url; 3049head.appendChild(link); 3050} 3051} 3052return !found; 3053} 3054static mergeConfigs(defaultConfig, userConfig) 3055{ 3056const config = defaultConfig; 3057try 3058{ 3059if (userConfig == null) 3060{ 3061return defaultConfig; 3062} 3063else if (defaultConfig == null) 3064{ 3065return userConfig; 3066} 3067else 3068{ 3069for (let key in userConfig) 3070{ 3071config[key] = userConfig[key]; 3072} 3073} 3074} 3075catch(error) 3076{ 3077return null; 3078} 3079return config; 3080} 3081static getScrollPercent(maxValue) 3082{ 3083try 3084{ 3085if (maxValue == null) 3086maxValue = 0; 3087var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; 3088var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || document.body.offsetHeight; 3089var pageHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); 3090var scrollBottom = windowHeight + scrollTop; 3091var scrollPercent = Math.round(scrollBottom * 100 / pageHeight); 3092if (scrollPercent > maxValue && scrollPercent <= 100) 3093return scrollPercent; 3094return maxValue; 3095} 3096catch (e) 3097{ 3098if (typeof(HRLogError) == 'function') 3099HRLogError(e); 3100} 3101return 0; 3102} 3103static getParentElementById(startElement, idToFind) 3104{ 3105if (startElement && idToFind && typeof(idToFind) === 'string' && idToFind.length > 0) 3106return startElement.closest(`#${idToFind}`); 3107return null; 3108} 3109static isParentElement(startElement, parentToFind) 3110{ 3111let elemFound = null; 3112if (startElement && parentToFind) 3113{ 3114let parentElem = startElement.parentNode; 3115let saveCount = 0; 3116while (elemFound == null && parentElem != null && parentElem.tagName && parentElem.tagName.toLowerCase() != "html" && saveCount < 100) 3117{ 3118saveCount++; 3119if (parentElem == parentToFind) 3120elemFound = parentElem; 3121else 3122parentElem = parentElem.parentNode; 3123} 3124} 3125return elemFound; 3126} 3127static checkRadioByValue(radiobuttons, value) 3128{ 3129try 3130{ 3131if (radiobuttons) 3132{ 3133const radioLength = radiobuttons.length; 3134if (radioLength) 3135{ 3136for (let i = 0; i < radioLength; i++) 3137{ 3138radiobuttons[i].checked = false;
3139if (radiobuttons[i].value == value.toString()) 3140radiobuttons[i].checked = true; 3141} 3142} 3143else 3144radiobuttons.checked = (radiobuttons.value == value.toString()); 3145} 3146} 3147catch (e) 3148{ 3149if (typeof(HRLogError) === 'function') 3150HRLogError(e); 3151} 3152} 3153static getCheckedValue(radioObj) 3154{ 3155try 3156{ 3157if (radioObj) 3158{ 3159var radioLength = radioObj.length; 3160if (radioLength) 3161{ 3162for (let i = 0; i < radioLength; i++) 3163{ 3164if (radioObj[i].checked) 3165return radioObj[i].value; 3166} 3167} 3168else if (radioObj.checked) 3169return radioObj.value; 3170} 3171} 3172catch (e) 3173{ 3174if (typeof(HRLogError) === 'function') 3175HRLogError(e); 3176} 3177return null; 3178} 3179static getSelectedRadioboxValue(name) 3180{ 3181return getCheckedValue(document.getElementsByName(name)); 3182} 3183static printToBody(string) 3184{ 3185let tmpDiv = document.getElementById('hr_tmp_div'); 3186if (!tmpDiv) 3187{ 3188tmpDiv = document.createElement('div'); 3189document.body.appendChild(tmpDiv); 3190tmpDiv.id = 'hr_tmp_div'; 3191} 3192tmpDiv.appendChild(document.createTextNode(string)); 3193tmpDiv.appendChild(document.createElement('br')); 3194return tmpDiv; 3195} 3196static getFormValueByName(elementName, formname) 3197{ 3198try 3199{ 3200var theForm = null; 3201if (!elementName || elementName == "") 3202return ""; 3203if (document.forms.length > 0) 3204{ 3205if (formname && formname != "") 3206theForm = document.forms[formname]; 3207if (theForm == null) 3208theForm = document.forms[0]; 3209var element = theForm.elements[elementName]; 3210if (!element) 3211element = document.getElementById(element); 3212if (!element) 3213return ""; 3214if (element.length && element.length > 0) 3215{ 3216if (element[0] == null || typeof(element[0].type) != "string" || (element[0].type.toLowerCase() != "hidden" && element[0].type.toLowerCase() != "text")) 3217{ 3218for (let i = 0; element[i]; i++) 3219{ 3220if (element[i].checked || element[i].selected) 3221return element[i].value; 3222} 3223} 3224else 3225{ 3226return element[0].value; 3227} 3228} 3229else if (element.type.toLowerCase() == "radio" || element.type.toLowerCase() == "checkbox") 3230{ 3231if (element.checked && element.value) 3232return element.value; 3233} 3234else if (element.value) 3235{ 3236return element.value; 3237} 3238} 3239} 3240catch (except) 3241{ 3242} 3243return ""; 3244} 3245static copyAttributes(source, target) 3246{ 3247Array.from(source.attributes).forEach(attr => { 3248target.setAttribute(attr.name, attr.value); 3249}); 3250} 3251static isEqual(obj1, obj2) 3252{ 3253if (obj1 === obj2) 3254return true; 3255if (!obj1 || !obj2) 3256return false; 3257const entries1 = Object.entries(obj1); 3258const entries2 = Object.entries(obj2); 3259if (entries1.length !== entries2.length) 3260return false; 3261return entries1.every(([key, value]) => 3262obj2.hasOwnProperty(key) && obj2[key] === value); 3263}; 3264static setValue(el, value) 3265{ 3266if (typeof el === "string") 3267el = document.querySelector(el); 3268if (!el) 3269return; 3270if (!("value" in el)) 3271return; 3272el.value = value; 3273const outputSpan = el.parentNode.querySelector('.edit-in-place-plain-text'); 3274if (outputSpan) 3275outputSpan.textContent = value; 3276}; 3277} 3278function HRAddEventListener(elementOrId, eventName, listener) 3279{ 3280HRDOM.addEventListener(elementOrId, eventName, listener); 3281} 3282function HRRemoveEventListener(elementOrId, eventName, listener) 3283{ 3284HRDOM.removeEventListener(elementOrId, eventName, listener); 3285} 3286function HRAddOnLoad(onLoadFunction) 3287{ 3288HRDOM.addOnLoad(onLoadFunction); 3289} 3290const HRAddOnAjaxLoad = function(sender, onLoadFunction) 3291{ 3292HRDOM.addOnAjaxLoad(sender, onLoadFunction); 3293} 3294function HRAddTransitionEnded(element, onTransitionEndedFunction) 3295{ 3296HRDOM.addTransitionEndedEventListener(element, onTransitionEndedFunction); 3297} 3298function HRGetCookieValue(name) 3299{ 3300return HRDOM.getCookieValue(name); 3301} 3302function HRGetScrollPercent(maxValue) 3303{ 3304return HRDOM.getScrollPercent(maxValue); 3305} 3306function HRMergeConfigs(defaultConfig, userConfig) 3307{ 3308return HRDOM.mergeConfigs(defaultConfig, userConfig); 3309} 3310function HRWrap(element, wrapper) 3311{ 3312HRDOM.wrap(element, wrapper); 3313} 3314function HRInsertAfter(element, referenceElement) 3315{ 3316HRDOM.insertAfter(element, referenceElement); 3317} 3318function HRInsertAsFirstChild(element, parent) 3319{ 3320HRDOM.insertAsFirstChild(element, parent); 3321} 3322function HRRemoveAllChildren(element) 3323{ 3324HRDOM.removeAllChildren(element); 3325} 3326function HRContainsScriptInclude(url, searchDOM) 3327{ 3328return HRDOM.containsScriptInclude(url, searchDOM); 3329} 3330function HRAppendScriptIncludeToHead(url, onLoadFunction, searchDOM) 3331{ 3332return HRDOM.appendScriptIncludeToHead(url, onLoadFunction, searchDOM); 3333} 3334function HRGetParentElementById(startElement, idToFind) 3335{ 3336return HRDOM.getParentElementById(startElement, idToFind); 3337} 3338function HRIsParentElement(startElement, parentToFind) 3339{ 3340return HRDOM.isParentElement(startElement, parentToFind); 3341} 3342function HRGetSelectedRadioboxValue(name) 3343{ 3344return HRDOM.getSelectedRadioboxValue(name); 3345} 3346function HRGetFormValueByName(elementName, formname) 3347{ 3348return HRDOM.getFormValueByName(elementName, formname) 3349} 3350function HRLogError(errorObj) 3351{ 3352if (errorObj) 3353{ 3354try 3355{ 3356let errorGetParams = `__JSErrorFile__${encodeURIComponent(errorObj.fileName)}`; 3357errorGetParams += `__JSErrorLine__${encodeURIComponent(errorObj.lineNumber)}`; 3358errorGetParams += `__JSErrorMessage__${encodeURIComponent(errorObj.message)}`; 3359if (typeof(HRSendRequest) === 'function') 3360HRSendRequest(`/?${errorGetParams}`); 3361} 3362catch (e) 3363{ 3364} 3365try 3366{ 3367console.groupCollapsed('HR-Error') 3368console.error('message', errorObj.message); 3369console.log('file:', errorObj.fileName); 3370console.log('line-number:', errorObj.lineNumber); 3371if (typeof(errorObj.ajaxStr)) 3372console.log('Nachgeladener js-Code:', errorObj.ajaxStr); 3373console.trace(errorObj); 3374console.groupEnd() 3375} 3376catch (e) 3377{ 3378} 3379} 3380} 3381HRBrowserClass = function() 3382{ 3383this.KennungFirefox = 'firefox'; 3384this.KennungIE = 'msie'; 3385this.KennungIE11 = 'trident'; 3386this.KennungEdge = 'edge'; 3387this.KennungWebkit = 'applewebkit';
3388this.KennungSafari = 'safari'; 3389this.KennungChrome = 'chrome'; 3390this.KennungOpera = 'opera'; 3391this.KennungKonqueror = 'konqueror'; 3392this.KennungVersion = 'version'; 3393this.KennungMobilePlattformiPhone = 'iphone'; 3394this.KennungMobilePlattformiPod = 'ipod'; 3395this.KennungMobilePlattformiPad = 'ipad'; 3396this.KennungMobilePlattformAndroid = 'android'; 3397this.KennungMobilePlattformBlackBerry = 'blackberry'; 3398this.KennungMobilePlattformWindows = 'iemobile'; 3399this.m_UserAgentLowerCase = navigator.userAgent.toLowerCase(); 3400} 3401HRBrowserClass.prototype.checkName = function(name) 3402{ 3403try 3404{ 3405var agent = this.m_UserAgentLowerCase; 3406if (agent.indexOf(name.toLowerCase())>-1) 3407{ 3408return true; 3409} 3410} 3411catch(e) 3412{} 3413return false; 3414} 3415HRBrowserClass.prototype.isFirefox = function() 3416{ 3417return this.checkName(this.KennungFirefox); 3418} 3419HRBrowserClass.prototype.isIE = function() 3420{ 3421return this.checkName(this.KennungIE) || this.checkName(this.KennungIE11); 3422} 3423HRBrowserClass.prototype.isEdge = function() 3424{ 3425return this.checkName(this.KennungEdge); 3426} 3427HRBrowserClass.prototype.isMicrosoft = function() 3428{ 3429return this.isIE() || this.isEdge(); 3430} 3431HRBrowserClass.prototype.isWebkit = function() 3432{ 3433return this.checkName(this.KennungWebkit); 3434} 3435HRBrowserClass.prototype.isSafari = function() 3436{ 3437return this.checkName(this.KennungSafari); 3438} 3439HRBrowserClass.prototype.isChrome = function() 3440{ 3441return this.checkName(this.KennungChrome); 3442} 3443HRBrowserClass.prototype.isOpera = function() 3444{ 3445return this.checkName(this.KennungOpera); 3446} 3447HRBrowserClass.prototype.isMobile = function() 3448{ 3449if ( this.checkName(this.KennungMobilePlattformiPhone) 3450|| this.checkName(this.KennungMobilePlattformiPod) 3451|| this.checkName(this.KennungMobilePlattformiPad) 3452|| this.checkName(this.KennungMobilePlattformAndroid) 3453|| this.checkName(this.KennungMobilePlattformBlackBerry) 3454|| this.checkName(this.KennungMobilePlattformWindows)) 3455{ 3456return true; 3457} 3458return false; 3459} 3460HRBrowserClass.prototype.isAndroid = function() 3461{ 3462if (this.checkName(this.KennungMobilePlattformAndroid)) 3463{ 3464return true; 3465} 3466return false; 3467} 3468HRBrowserClass.prototype.isiOS = function() 3469{ 3470if (this.checkName(this.KennungMobilePlattformiPhone) || this.checkName(this.KennungMobilePlattformiPod) || this.checkName(this.KennungMobilePlattformiPad)) 3471{ 3472return true; 3473} 3474return false; 3475} 3476HRBrowserClass.prototype.isiPhone = function() 3477{ 3478if (this.checkName(this.KennungMobilePlattformiPhone) || this.checkName(this.KennungMobilePlattformiPod)) 3479{ 3480return true; 3481} 3482return false; 3483} 3484HRBrowserClass.prototype.getVersionsNr = function() 3485{ 3486var versionsNr = -1; 3487try 3488{ 3489if (this.isFirefox()) 3490return this.getVersionsNrHinterKennung(this.KennungFirefox); 3491else if (this.isIE()) 3492return this.getIEVersionsNr(); 3493else if (this.isChrome()) 3494return this.getVersionsNrHinterKennung(this.KennungChrome); 3495else if (this.isSafari()) 3496return this.getVersionsNrHinterKennung(this.KennungVersion); 3497else if (this.isWebkit()) 3498return this.getVersionsNrHinterKennung(this.KennungWebkit); 3499else if (this.isOpera()) 3500return this.getVersionsNrHinterKennung(this.KennungVersion); 3501else 3502return this.getVersionsNrHinterKennung(this.KennungVersion); 3503} 3504catch (e) 3505{ 3506} 3507return versionsNr; 3508} 3509HRBrowserClass.prototype.getIEVersionsNr = function() 3510{ 3511var versionsNr = -1; 3512if (this.checkName(this.KennungIE)) 3513{ 3514versionsNr = this.getVersionsNrHinterKennung(this.KennungIE); 3515} 3516else if (this.checkName(this.KennungIE11)) 3517{ 3518versionsNr = this.getVersionsNrHinterKennung(this.KennungIE11); 3519if (versionsNr <= 5) 3520versionsNr = 9.0; 3521else if (versionsNr <= 6) 3522versionsNr = 10.0; 3523else if (versionsNr > 6) 3524versionsNr = 11.0; 3525} 3526return versionsNr; 3527} 3528HRBrowserClass.prototype.getWebkitVersionsNr = function() 3529{ 3530var versionsNr = -1; 3531if (this.isWebkit()) 3532versionsNr = this.getVersionsNrHinterKennung(this.KennungWebkit); 3533return versionsNr; 3534} 3535HRBrowserClass.prototype.getVersionsNrHinterKennung = function(kennung) 3536{ 3537var versionsNr = -1; 3538try 3539{ 3540var agentStr = this.m_UserAgentLowerCase; 3541var startIndex = agentStr.indexOf(kennung.toLowerCase()); 3542if (startIndex >= 0) 3543{ 3544startIndex += kennung.length; 3545while (isNaN(agentStr.charAt(startIndex)) && startIndex < agentStr.length) 3546startIndex++; 3547if (startIndex < agentStr.length) 3548{ 3549agentStr = agentStr.substring(startIndex); 3550versionsNr = parseFloat(agentStr); 3551} 3552} 3553} 3554catch (e) 3555{} 3556return versionsNr; 3557} 3558HRBrowserClass.prototype.addToFavorites = function(name, url) 3559{ 3560try 3561{ 3562if (name && url) 3563{ 3564if (window.sidebar) 3565{
3566window.sidebar.addPanel(name, url, ''); 3567} 3568if (window.external && typeof (window.external.AddFavorite) !== "undefined") 3569{ 3570window.external.AddFavorite(url, name); 3571} 3572} 3573} 3574catch (e) 3575{} 3576} 3577HRBrowserClass.prototype.setAsDefaultHome = function(homepage) 3578{ 3579try 3580{ 3581if (this.isIE()) 3582{ 3583document.body.style.behavior = 'url(#default#homepage)'; 3584document.body.setHomePage(homepage); 3585} 3586} 3587catch (e) 3588{} 3589} 3590HRBrowserClass.prototype.isDoNotTrackActive = function() 3591{ 3592try 3593{ 3594if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack) 3595return (window.doNotTrack == "1" || navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1"); 3596else 3597{ 3598return false; 3599} 3600} 3601catch (e) 3602{ 3603if (typeof(HRLogError) == 'function') 3604HRLogError(e); 3605} 3606} 3607var HRBrowser = new HRBrowserClass(); 3608'use strict'; 3609const isWindowsOS = () => { 3610return (navigator.appVersion.indexOf('Win') != -1); 3611} 3612const isMacOS = () => { 3613return (navigator.appVersion.indexOf('Mac') != -1); 3614} 3615const isUnixOS = () => { 3616return (navigator.appVersion.indexOf('X11') != -1); 3617} 3618const isLinuxOS = () => { 3619return (navigator.appVersion.indexOf('Linux') != -1); 3620} 3621function getPosition(element) 3622{ 3623try 3624{ 3625var elem=element,tagname="",x=0,y=0; 3626if (!element) 3627{ 3628var position = new Object(); 3629position.x = getScrollPosition().x; 3630position.y = getScrollPosition().y; 3631return position; 3632} 3633if(element.getBoundingClientRect) 3634{ 3635var position = new Object(); 3636position.x = element.getBoundingClientRect().left + getScrollPosition().x; 3637position.y = element.getBoundingClientRect().top + getScrollPosition().y; 3638return position; 3639} 3640while ( elem != null && (typeof(elem) == "object") && (typeof(elem.tagName) != "undefined")) 3641{ 3642y += elem.offsetTop; 3643x += elem.offsetLeft; 3644tagname = elem.tagName.toUpperCase(); 3645if ((navigator.userAgent.indexOf('MSIE 6.0') > -1) || (navigator.userAgent.indexOf('MSIE 7.0') > -1)) 3646{ 3647if (elem.id == "col3") 3648{ 3649x -= elem.offsetLeft; 3650} 3651} 3652if (tagname == "BODY") 3653{ 3654elem = 0; 3655} 3656if (typeof(elem) == "object") 3657{ 3658if (typeof(elem.offsetParent) == "object") 3659{ 3660elem = elem.offsetParent; 3661} 3662} 3663} 3664position=new Object(); 3665position.x=x; 3666position.y=y; 3667return position; 3668} 3669catch(error) 3670{ 3671return null; 3672} 3673} 3674function getMouseCoords(event, config) 3675{ 3676var position = new Object(); 3677event = event || window.event; 3678if(event.pageX || event.pageY) 3679{ 3680position.x = event.pageX; 3681position.y = event.pageY; 3682} 3683else 3684{ 3685position.x = event.clientX + getScrollPosition().x - document.body.clientLeft; 3686position.y = event.clientY + getScrollPosition().y - document.body.clientTop; 3687}; 3688if (config) 3689{ 3690if (config.parent) 3691{ 3692var positionParent = getPosition(config.parent); 3693position.x -= positionParent.x; 3694position.y -= positionParent.y; 3695} 3696} 3697return position; 3698} 3699function HRGetTouchCoords(event) 3700{ 3701var position = new Object(); 3702if (event && event.touches && event.touches.length && event.touches.length > 0) 3703{ 3704position.x = event.touches[0].pageX; 3705position.y = event.touches[0].pageY; 3706} 3707else if (event && event.changedTouches && event.changedTouches.length && event.changedTouches.length > 0) 3708{ 3709position.x = event.changedTouches[0].pageX; 3710position.y = event.changedTouches[0].pageY; 3711} 3712else 3713{ 3714position = getMouseCoords(event); 3715} 3716return position; 3717} 3718function isMouseOverElement(element,event) 3719{ 3720if (!element || !event) 3721return false; 3722var mousePos = getMouseCoords(event); 3723var targPos = getPosition(element); 3724var targWidth = parseInt(element.offsetWidth); 3725var targHeight = parseInt(element.offsetHeight); 3726if( (mousePos.x >= targPos.x) && 3727(mousePos.x <= (targPos.x + targWidth)) && 3728(mousePos.y >= targPos.y) && 3729(mousePos.y <= (targPos.y + targHeight))) 3730{ 3731return true; 3732} 3733else 3734{ 3735return false; 3736} 3737} 3738function adjustFloatingElementToFixedElement(floatingElement, fixedElement,offset) 3739{ 3740var suchfeldHoehe = 20; 3741if(window.getComputedStyle) 3742{ 3743suchfeldHoehe = parseInt(window.getComputedStyle(fixedElement, "").getPropertyValue("height")); 3744} 3745else if(fixedElement.currentStyle ) 3746{ 3747if (parseInt(fixedElement.currentStyle["height"])) 3748suchfeldHoehe = parseInt(fixedElement.currentStyle["height"]); 3749} 3750var pos = getPosition(fixedElement); 3751floatingElement.style.visibility = "visible"; 3752floatingElement.style.left = pos.x + "px"; 3753floatingElement.style.top = pos.y + suchfeldHoehe + offset + "px"; 3754floatingElement.style.visibility = "hidden"; 3755} 3756function getScrollPosition() 3757{ 3758var scrOfX = 0, scrOfY = 0; 3759if( typeof( window.pageYOffset ) == 'number' ) 3760{ 3761scrOfY = window.pageYOffset; 3762scrOfX = window.pageXOffset; 3763} 3764else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 3765{ 3766scrOfY = document.body.scrollTop; 3767scrOfX = document.body.scrollLeft; 3768} 3769else if( document.documentElement ) 3770{ 3771scrOfY = document.documentElement.scrollTop; 3772scrOfX = document.documentElement.scrollLeft; 3773} 3774var scrollPosition = new Object(); 3775scrollPosition.x = scrOfX; 3776scrollPosition.y = scrOfY; 3777return scrollPosition; 3778} 3779function setScrollPosition(x,y) 3780{ 3781window.scrollTo(x,y); 3782} 3783function getWindowWidth(win) 3784{ 3785if (win == undefined) 3786win = window; 3787if (win.innerWidth) 3788{ 3789return win.innerWidth; 3790} 3791else 3792{ 3793if (win.document.documentElement && 3794win.document.documentElement.clientWidth) 3795{ 3796return win.document.documentElement.clientWidth; 3797} 3798return win.document.body.offsetWidth; 3799} 3800} 3801function getWindowHeight(win) 3802{ 3803if (win == undefined) 3804win = window; 3805if (win.innerHeight) 3806{ 3807return win.innerHeight; 3808} 3809else 3810{ 3811if (win.document.documentElement 3812&& win.document.documentElement.clientHeight) 3813{ 3814return win.document.documentElement.clientHeight; 3815} 3816return win.document.body.offsetHeight; 3817} 3818} 3819function getStyleValue (element, cssProperty) 3820{ 3821var value = ""; 3822if (window.getComputedStyle) 3823{ 3824var styles = window.getComputedStyle(element, null); 3825value = window.getComputedStyle(element, null)[cssProperty]; 3826} 3827else if (element.currentStyle) 3828{ 3829value = element.currentStyle[cssProperty]; 3830} 3831return value; 3832} 3833function getElementHeightValue(element) 3834{ 3835if (!element) 3836return 0; 3837if(element.getBoundingClientRect) 3838{ 3839return element.getBoundingClientRect().bottom - element.getBoundingClientRect().top; 3840} 3841else 3842{ 3843return getStyleMeasureValue(getStyleValue(element, "height")); 3844} 3845} 3846function getElementWidthValue(element) 3847{ 3848if (!element) 3849return 0; 3850if(element.getBoundingClientRect) 3851{ 3852return element.getBoundingClientRect().right - element.getBoundingClientRect().left; 3853} 3854else 3855{ 3856return getStyleMeasureValue(getStyleValue(element, "width")); 3857} 3858} 3859function getElementLeftValue(element) 3860{ 3861if (!element) 3862return 0; 3863if(element.getBoundingClientRect) 3864{ 3865return element.getBoundingClientRect().left+getScrollPosition().x; 3866} 3867else 3868{ 3869return getStyleMeasureValue(getStyleValue(element, "left")); 3870} 3871} 3872function getElementTopValue(element) 3873{ 3874if (!element) 3875return 0; 3876if(element.getBoundingClientRect) 3877{ 3878return element.getBoundingClientRect().top+getScrollPosition().y; 3879} 3880else 3881{ 3882return getStyleMeasureValue(getStyleValue(element, "top")); 3883} 3884} 3885function getElementRightValue(element) 3886{ 3887if (!element) 3888return 0; 3889if(element.getBoundingClientRect) 3890{ 3891return element.getBoundingClientRect().right + getScrollPosition().x; 3892} 3893else 3894{ 3895return getStyleMeasureValue(getStyleValue(element, "right")); 3896} 3897} 3898function getElementBottomValue(element) 3899{ 3900if (!element) 3901return 0; 3902if(element.getBoundingClientRect) 3903{ 3904return element.getBoundingClientRect().bottom + getScrollPosition().y; 3905} 3906else 3907{ 3908return getStyleMeasureValue(getStyleValue(element, "bottom")); 3909} 3910} 3911function getStyleMeasureValue(measureValue) 3912{ 3913var ergebnis = 0; 3914if (measureValue == null || measureValue == "") 3915return 0; 3916if (isNaN(measureValue)) 3917{ 3918var numberEnd = false;
3919var numberString = ""; 3920for (var i = 0; i < measureValue.length && !numberEnd; i++) 3921{ 3922if (!isNaN(measureValue[i]) || measureValue[i] == '.' || measureValue[i] == '-' || measureValue[i] == '+') 3923numberString += measureValue[i]; 3924else 3925numberEnd = true; 3926} 3927ergebnis = Number(numberString); 3928} 3929else 3930ergebnis = measureValue; 3931return ergebnis; 3932} 3933function getStyleMeasureUnit(measureValue) 3934{ 3935var ergebnis = ""; 3936if (isNaN(measureValue)) 3937{ 3938var unitEnd = false; 3939for (var i = measureValue.length - 1; i >=0 && !unitEnd; i--) 3940{ 3941if (!isNaN(measureValue[i]) || measureValue[i] == '.' || measureValue[i] == '-' || measureValue[i] == '+') 3942unitEnd = true; 3943else 3944ergebnis = measureValue[i] + ergebnis; 3945} 3946if (!unitEnd) 3947ergebnis = ""; 3948} 3949return ergebnis; 3950} 3951var HRGetDocumentWidth = function() 3952{ 3953var widthValue = -1; 3954if (document.documentElement.scrollWidth) 3955{ 3956widthValue = document.documentElement.scrollWidth; 3957} 3958if (document.documentElement.offsetWidth) 3959{ 3960widthValue = Math.max(widthValue, document.documentElement.offsetWidth); 3961} 3962if (document.documentElement.clientWidth) 3963{ 3964widthValue = Math.max(widthValue, document.documentElement.clientWidth); 3965} 3966if (widthValue < 0) 3967{ 3968widthValue = HRGetBodyWidth(); 3969} 3970return Math.ceil(widthValue); 3971} 3972var HRGetDocumentHeight = function() 3973{ 3974var heightValue = -1; 3975if (document.documentElement.scrollHeight) 3976{ 3977heightValue = document.documentElement.scrollHeight; 3978} 3979if (document.documentElement.offsetHeight) 3980{ 3981heightValue = Math.max(heightValue, document.documentElement.offsetHeight); 3982} 3983if (document.documentElement.clientHeight) 3984{ 3985heightValue = Math.max(heightValue, document.documentElement.clientHeight); 3986} 3987if (heightValue < 0) 3988{ 3989heightValue = HRGetBodyHeight(); 3990} 3991else 3992{ 3993heightValue = heightValue - 1; 3994} 3995return Math.ceil(heightValue); 3996} 3997var HRGetUsedWidth = function(element) 3998{ 3999var widthValue = -1; 4000if (element == null) 4001{ 4002try 4003{ 4004var maxRight = 0; 4005var alleElemente = document.querySelectorAll('body *'); 4006for (var i = 0; i < alleElemente.length; i++) 4007{ 4008maxRight = Math.max(maxRight, alleElemente[i].getBoundingClientRect().right + getScrollPosition().x + getStyleMeasureValue(getStyleValue(alleElemente[i], "margin-right"))); 4009} 4010widthValue = maxRight; 4011} 4012catch (except) 4013{ 4014} 4015try 4016{ 4017if (widthValue < 0) 4018{ 4019widthValue = HRGetDocumentWidth(); 4020} 4021} 4022catch (except) 4023{ 4024} 4025} 4026else 4027{ 4028widthValue = getElementWidthValue(element) + getStyleMeasureValue(getStyleValue(element, "margin-left")) + getStyleMeasureValue(getStyleValue(element, "margin-right")); 4029} 4030return widthValue; 4031} 4032var HRGetUsedHeight = function(element) 4033{ 4034var heightValue = -1; 4035if (element == null) 4036{ 4037try 4038{ 4039var maxBottom = 0; 4040var alleElemente = document.querySelectorAll('body *'); 4041for (var i = 0; i < alleElemente.length; i++) 4042{ 4043if (alleElemente[i] != null && alleElemente[i].nodeName && alleElemente[i].nodeName.toLowerCase() != 'option') 4044{ 4045maxBottom = Math.max(maxBottom, alleElemente[i].getBoundingClientRect().bottom + getScrollPosition().y + getStyleMeasureValue(getStyleValue(alleElemente[i], "margin-bottom"))); 4046} 4047} 4048var theBody = document.getElementsByTagName("BODY")[0]; 4049maxBottom = Math.max(maxBottom, theBody.getBoundingClientRect().bottom + getScrollPosition().y + getStyleMeasureValue(getStyleValue(theBody, "margin-bottom"))); 4050heightValue = maxBottom; 4051} 4052catch (except) 4053{ 4054} 4055try 4056{ 4057if (heightValue < 0) 4058{ 4059heightValue = HRGetDocumentHeight(); 4060} 4061} 4062catch (except) 4063{ 4064} 4065} 4066else 4067{ 4068heightValue = getElementHeightValue(element) + getStyleMeasureValue(getStyleValue(element, "margin-top")) + getStyleMeasureValue(getStyleValue(element, "margin-bottom")); 4069} 4070return heightValue; 4071} 4072function HRGetBodyWidth() 4073{ 4074var theBody = document.getElementsByTagName("BODY")[0]; 4075var widthValue = getElementWidthValue(theBody); 4076return Math.ceil(widthValue); 4077} 4078function HRGetBodyHeight() 4079{ 4080var theBody = document.getElementsByTagName("BODY")[0]; 4081var heightValue = getElementHeightValue(theBody); 4082return Math.ceil(heightValue); 4083} 4084function HRGetViewPortWidth() 4085{ 4086return Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 4087} 4088function HRGetViewPortHeight() 4089{ 4090return Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 4091} 4092function addCSSClass(element, newCSSClass) 4093{ 4094try 4095{ 4096if (element && newCSSClass) 4097{ 4098if (typeof element == "string") 4099element = document.getElementById(element); 4100if (element.className && element.className.length > 0) 4101{ 4102var indexOfClass = element.className.indexOf(newCSSClass); 4103if ( indexOfClass < 0 4104|| (indexOfClass + newCSSClass.length < element.className.length && element.className.charAt(indexOfClass + newCSSClass.length) != ' ') 4105|| (indexOfClass > 0 && element.className.charAt(indexOfClass - 1) != ' ')) 4106{ 4107element.className += ' ' + newCSSClass; 4108} 4109} 4110else 4111element.className = newCSSClass; 4112} 4113} 4114catch (e) 4115{} 4116} 4117function HRAddBodyCSSClass(newCSSClass) 4118{ 4119addCSSClass(document.getElementsByTagName('body')[0], newCSSClass); 4120} 4121function removeCSSClass(element, cssClassToRemove) 4122{ 4123HRCSS.removeCSSClass(element, cssClassToRemove); 4124} 4125function HRContainsCSSClass(element, cssClass) 4126{ 4127return HRCSS.containsCSSClass(element, cssClass); 4128} 4129function HRRemoveBodyCSSClass(cssClassToRemove) 4130{ 4131removeCSSClass(document.getElementsByTagName('body')[0], cssClassToRemove); 4132} 4133function replaceCSSClass(element, oldCSSClass, newCSSClass) 4134{ 4135try 4136{ 4137if (element && oldCSSClass && newCSSClass) 4138{ 4139if (typeof element == "string") 4140element = document.getElementById(element); 4141if (element.className && element.className.length > 0) 4142{ 4143var newClass = ""; 4144var containsElementOldClass = false;
4145var splitedClassNames = element.className.split(" "); 4146for (var index = 0; index < splitedClassNames.length; index++) 4147{ 4148if (splitedClassNames[index] == oldCSSClass) 4149{ 4150newClass = newClass + newCSSClass +" "; 4151containsElementOldClass = true; 4152} 4153else 4154{ 4155newClass = newClass + splitedClassNames[index] +" "; 4156} 4157} 4158if(!containsElementOldClass) 4159{ 4160newClass = newClass + newCSSClass; 4161} 4162element.className = newClass; 4163} 4164else 4165{ 4166element.className = newCSSClass; 4167} 4168} 4169} 4170catch (e) 4171{} 4172} 4173function toggleCSSClass(element, cssClassToToggle) 4174{ 4175try 4176{ 4177if (element && cssClassToToggle && cssClassToToggle.length > 0) 4178{ 4179if (typeof element == "string") 4180element = document.getElementById(element); 4181if (element.className && element.className.length > 0 && element.className.indexOf(cssClassToToggle) >= 0) 4182removeCSSClass(element, cssClassToToggle); 4183else 4184addCSSClass(element, cssClassToToggle); 4185} 4186} 4187catch (e) 4188{} 4189} 4190function HRShow(element, displayType) 4191{ 4192try 4193{ 4194if (element) 4195{ 4196if (typeof element == "string") 4197element = document.getElementById(element); 4198if (element) 4199{ 4200if (displayType != null) 4201{ 4202element.style.display = displayType; 4203} 4204else 4205{ 4206element.style.display = ''; 4207} 4208} 4209} 4210} 4211catch (e) 4212{} 4213} 4214function HRHide(element) 4215{ 4216if (element) 4217{ 4218try 4219{ 4220if (typeof element == "string") 4221element = document.getElementById(element); 4222if (element) 4223{ 4224element.style.display = 'none'; 4225} 4226} 4227catch (e) 4228{ 4229if (typeof(HRLogError) === 'function') 4230HRLogError(e); 4231} 4232} 4233} 4234function getParentByStyleValue(element, property, value, recursive) 4235{ 4236var result = null; 4237try 4238{ 4239if (element && element.tagName !== 'HTML' && element.parentNode) 4240{ 4241if (getStyleValue(element.parentNode, property) === value) 4242result = element.parentNode; 4243else if (recursive) 4244return getParentByStyleValue(element.parentNode, property, value, recursive); 4245} 4246} 4247catch (e) 4248{ 4249if (typeof(HRLogError) === 'function') 4250HRLogError(e); 4251} 4252return result; 4253} 4254function equalizeHeight(array) 4255{ 4256try 4257{ 4258if (array) 4259{ 4260array = Array.from(array); 4261var maxHeight = 0; 4262Array.from(array).forEach(el => { 4263maxHeight = Math.max(getElementHeightValue(el), maxHeight); 4264}); 4265Array.from(array).forEach(el => { 4266el.style.height = maxHeight + "px"; 4267}); 4268} 4269} 4270catch (e) 4271{ 4272if (typeof(HRLogError) === 'function') 4273HRLogError(e); 4274} 4275} 4276function doCountAnimation(el, start, end, durationSec) 4277{ 4278try 4279{ 4280let already = false; 4281let duration = 10000; 4282if(durationSec){ 4283duration = durationSec * 1000; 4284} 4285if (isInViewport(el)) 4286{ 4287calcCountAnimation(el, start, end, duration); 4288} 4289else 4290{ 4291window.addEventListener('scroll', function () { 4292if (isInViewport(el)) 4293{ 4294if (!already) 4295{ 4296calcCountAnimation(el, start, end, duration); 4297already = true; 4298} 4299} 4300}); 4301} 4302} 4303catch (e) 4304{ 4305if (typeof(HRLogError) === 'function') 4306HRLogError(e); 4307} 4308} 4309function calcCountAnimation(el, start, end, duration, onStep) 4310{ 4311try 4312{ 4313let startTimestamp = null; 4314const step = (timestamp) => { 4315if (!startTimestamp) 4316{ 4317startTimestamp = timestamp; 4318} 4319const progress = Math.min((timestamp - startTimestamp) / duration, 1); 4320el.innerHTML = Math.floor(progress * (end - start) + start).toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); 4321if (onStep && typeof(onStep) === 'function') 4322onStep(Math.floor(progress * (end - start) + start)); 4323if (progress < 1) { 4324window.requestAnimationFrame(step); 4325} 4326}; 4327window.requestAnimationFrame(step); 4328} 4329catch (e) 4330{ 4331if (typeof(HRLogError) === 'function') 4332HRLogError(e); 4333} 4334} 4335function isInViewport(el) 4336{ 4337return HRCSS.isInViewport(el); 4338} 4339"use strict"; 4340class HRCSS 4341{ 4342static openOverlays = []; 4343static removeCSSClass(element, cssClassToRemove) 4344{ 4345try 4346{ 4347if (!element || !cssClassToRemove) 4348return; 4349if (typeof element === 'string') 4350element = document.getElementById(element); 4351if (element) 4352{ 4353if (element.classList.contains(cssClassToRemove)) 4354element.classList.remove(cssClassToRemove); 4355if (element.classList.length === 0) 4356element.removeAttribute('class'); 4357} 4358} 4359catch (e) 4360{ 4361} 4362} 4363static containsCSSClass(element, cssClass) 4364{ 4365try 4366{ 4367if (element && cssClass && cssClass.length > 0) 4368{ 4369if (typeof element == "string") 4370element = document.getElementById(element); 4371if (element) 4372return element.classList.contains(cssClass); 4373} 4374} 4375catch (e) 4376{ 4377} 4378return false; 4379} 4380static getClasses(node) 4381{ 4382if (node && node.className) 4383return node.className.trim().split(' ').filter(className => !className.trim().isEmpty()).map(classname => classname.trim()); 4384return []; 4385} 4386static isInViewport(el) 4387{ 4388const rect = el.getBoundingClientRect(); 4389return (rect.top >= 0 4390&& rect.left >= 0 4391&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) 4392&& rect.right <= (window.innerWidth || document.documentElement.clientWidth)); 4393} 4394static intersectsViewport(el) 4395{ 4396const rect = el.getBoundingClientRect(); 4397return (rect.top >= -el.offsetHeight 4398&& rect.left >= -el.offsetWidth 4399&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) + el.offsetHeight 4400&& rect.right <= (window.innerWidth || document.documentElement.clientWidth) + el.offsetWidth); 4401} 4402static isHidden(el) 4403{ 4404try 4405{ 4406for (let current = el; current; current = current.parentElement) 4407{ 4408const style = window.getComputedStyle(current); 4409if (style.display === 'none' || style.visibility === 'hidden') 4410return true; 4411} 4412return false;
4413} 4414catch (e) 4415{ 4416if (typeof(HRLogError) === 'function') 4417HRLogError(e); 4418} 4419return true; 4420} 4421static getUnit(expression) 4422{ 4423try 4424{ 4425const unitMatch = expression.match(/[a-zA-Z%]+/); 4426return unitMatch ? unitMatch[0].trim() : null; 4427} 4428catch (e) 4429{ 4430if (typeof(HRLogError) === 'function') 4431HRLogError(e); 4432} 4433} 4434static toggleVisibility(element, isVisible) 4435{ 4436if (element) 4437element.classList.toggle('hide', !isVisible); 4438} 4439static toggleOverlay(toggleButton, overlayElement, optionalCloseButton, optionalDisableBodyScroll, allowMultipleOverlays, allowFocusEscape) 4440{ 4441const getFocusableElements = (element = document) => 4442[...element.querySelectorAll( 4443'a[href], button:not([disabled]), input:not([type="hidden"]):not([disabled]), textarea, select, details, [tabindex]:not([tabindex="-1"])' 4444)].filter(el => 4445!el.hasAttribute('aria-hidden') && !HRCSS.isHidden(el) 4446); 4447const handleButtonFocusTrap = function(e) { 4448const focusableElements = getFocusableElements(overlayElement); 4449const first = focusableElements[0]; 4450const last = focusableElements[focusableElements.length - 1]; 4451if (e.key === 'Tab') 4452{ 4453e.preventDefault(); 4454e.shiftKey ? last.focus() : first.focus(); 4455} 4456}; 4457const handleFocusTrap = function(e) { 4458if (e.key !== 'Tab') 4459return; 4460const focusableElements = getFocusableElements(overlayElement); 4461const first = focusableElements[0]; 4462const last = focusableElements[focusableElements.length - 1]; 4463const focusTarget = optionalCloseButton || toggleButton; 4464if ((e.shiftKey && document.activeElement === first) || (!e.shiftKey && document.activeElement === last)) 4465{ 4466if (focusTarget === document.activeElement) 4467{ 4468if (!allowFocusEscape) 4469{ 4470e.preventDefault(); 4471e.shiftKey ? last.focus(): first.focus(); 4472} 4473else if (HRCSS.openOverlays.length > 0) 4474closeOverlay(HRCSS.openOverlays.at(-1).overlayElement); 4475} 4476else if (!allowFocusEscape) 4477{ 4478if (!HRCSS.isHidden(focusTarget)) 4479{ 4480e.preventDefault(); 4481focusTarget.focus(); 4482} 4483else if (!HRCSS.isHidden(toggleButton)) 4484{ 4485e.preventDefault(); 4486toggleButton.focus(); 4487} 4488} 4489} 4490}; 4491const toggle = () => { 4492const isOpen = overlayElement.classList.toggle('overlay-open'); 4493if (isOpen) 4494{ 4495if (!allowMultipleOverlays) 4496{ 4497while (HRCSS.openOverlays.length > 0) 4498{ 4499const lastOverlay = HRCSS.openOverlays.at(-1); 4500if (lastOverlay?.toggleButton && lastOverlay.overlayElement && lastOverlay.overlayElement.classList.contains('overlay-open')) 4501lastOverlay.toggleButton.click(); 4502else 4503{ 4504if (lastOverlay?.handlers) 4505closeOverlay(lastOverlay.overlayElement); 4506else 4507HRCSS.openOverlays.pop(); 4508} 4509lastOverlay?.toggleButton.blur(); 4510} 4511} 4512if (optionalCloseButton) 4513setTimeout(() => optionalCloseButton.focus(), 200); 4514setTimeout(() => { 4515const focusableElements = getFocusableElements(overlayElement); 4516focusableElements.forEach(el => { 4517el.addEventListener('keydown', handleFocusTrap); 4518}); 4519}, 200); 4520toggleButton.addEventListener('keydown', handleButtonFocusTrap); 4521if (optionalCloseButton) 4522{ 4523optionalCloseButton.addEventListener('keydown', handleFocusTrap); 4524optionalCloseButton.addEventListener('click', () => { 4525closeOverlay(overlayElement); 4526}); 4527} 4528if (!optionalDisableBodyScroll) 4529document.body.classList.add('no-scroll'); 4530toggleButton.classList.add('open'); 4531toggleButton.setAttribute('aria-expanded', 'true'); 4532addCSSClass(overlayElement, 'overlay-open') 4533HRCSS.openOverlays.push({ 4534overlayElement, 4535toggleButton, 4536optionalCloseButton, 4537optionalDisableBodyScroll, 4538allowFocusEscape, 4539handlers: { 4540focusTrap: handleFocusTrap, 4541buttonTrap: handleButtonFocusTrap 4542} 4543}); 4544} 4545else 4546{ 4547closeOverlay(overlayElement); 4548} 4549}; 4550const closeOverlay = (overlayElement) => { 4551const overlay = HRCSS.openOverlays.find(o => o.overlayElement === overlayElement); 4552if (!overlay) 4553return; 4554const { toggleButton, optionalCloseButton, optionalDisableBodyScroll, handlers } = overlay; 4555const { focusTrap, buttonTrap } = handlers || {}; 4556const focusableElements = overlayElement.querySelectorAll( 4557'a[href], button:not([disabled]), input:not([type="hidden"]):not([disabled]), textarea, select, details, [tabindex]:not([tabindex="-1"])' 4558); 4559if (typeof focusTrap === 'function') 4560focusableElements.forEach(el => el.removeEventListener('keydown', focusTrap)); 4561if (typeof buttonTrap === 'function') 4562toggleButton.removeEventListener('keydown', buttonTrap); 4563if (optionalCloseButton) 4564optionalCloseButton.removeEventListener('keydown', focusTrap); 4565overlayElement.classList.remove('overlay-open'); 4566toggleButton.classList.remove('open'); 4567toggleButton.setAttribute('aria-expanded', 'false'); 4568toggleButton.focus(); 4569if (!optionalDisableBodyScroll) 4570document.body.classList.remove('no-scroll'); 4571HRCSS.openOverlays = HRCSS.openOverlays.filter(o => o.overlayElement !== overlayElement); 4572}; 4573toggleButton?.addEventListener('click', toggle); 4574if (!HRCSS._escapeHandlerRegistered) { 4575window.addEventListener('keydown', (e) => { 4576if (e.key === 'Escape' && HRCSS.openOverlays.length > 0) 4577{ 4578let lastOverlay = HRCSS.openOverlays[HRCSS.openOverlays.length - 1]; 4579if (lastOverlay?.allowFocusEscape) 4580{ 4581while (lastOverlay?.allowFocusEscape) 4582{ 4583if (lastOverlay.optionalCloseButton) 4584lastOverlay.optionalCloseButton.click(); 4585else if (lastOverlay.toggleButton) 4586lastOverlay.toggleButton.click(); 4587lastOverlay = HRCSS.openOverlays[HRCSS.openOverlays.length - 1]; 4588} 4589} 4590else 4591{ 4592if (lastOverlay?.optionalCloseButton) 4593lastOverlay.optionalCloseButton.click(); 4594else if (lastOverlay?.toggleButton) 4595lastOverlay.toggleButton.click(); 4596} 4597} 4598}); 4599HRCSS._escapeHandlerRegistered = true; 4600} 4601} 4602} 4603function extend(subClass, superClass) 4604{ 4605var F = function() {}; 4606F.prototype = superClass.prototype; 4607subClass.prototype = new F(); 4608subClass.prototype.constructor = subClass; 4609subClass.superclass = superClass.prototype; 4610if(superClass.prototype.constructor == Object.prototype.constructor) { 4611superClass.prototype.constructor = superClass; 4612} 4613}; 4614Array.prototype.remove = function(from, to) 4615{ 4616try 4617{ 4618var rest = this.slice((to || from) + 1 || this.length); 4619this.length = from < 0 ? this.length + from : from; 4620return this.push.apply(this, rest); 4621} 4622catch (e) 4623{ 4624return null; 4625} 4626}; 4627Array.prototype.removeObject = function (object) 4628{ 4629this.removeAt(this.indexOf(object)); 4630return object; 4631}; 4632Array.prototype.removeAt = function (index) 4633{ 4634var object = this[index]; 4635if (object) 4636{ 4637this.splice(index, 1); 4638} 4639return object; 4640}; 4641Array.prototype.insertBefore = function(elementToInsertBefore, element) 4642{ 4643var index = this.indexOf(elementToInsertBefore); 4644if(index > -1) 4645this.insertAt(index,element); 4646} 4647Array.prototype.insertAfter = function(elementToInsertAfter, element) 4648{ 4649var index = this.indexOf(elementToInsertAfter); 4650if(index > -1) 4651this.insertAt(index+1,element); 4652} 4653Array.prototype.insertAt = function (index, element) 4654{ 4655this.splice(index, 0, element); 4656}; 4657if(!Array.indexOf) 4658{ 4659Array.prototype.indexOf = function(object , startIndex ) 4660{ 4661if(startIndex == null) 4662{ 4663startIndex = 0; 4664} 4665for(var i=startIndex, l=this.length; i < l; i++) 4666{ 4667if(this[i] == object) 4668{ 4669return i; 4670} 4671} 4672return -1; 4673}; 4674}; 4675function HRGetCookie(name) 4676{ 4677var wert = ''; 4678try 4679{ 4680if (!name || typeof(name) != 'string' || name.length <= 0) 4681return wert; 4682var cookies = document.cookie.split(';');
4683var len = cookies.length; 4684for(var i = 0; i < len; i++) 4685{ 4686var cookie = cookies[i]; 4687var pair = cookie.split('='); 4688if (pair && pair.length > 1) 4689{ 4690var key = pair[0]; 4691var val = pair[1]; 4692try 4693{ 4694key = key.trim(); 4695val = val.trim(); 4696} 4697catch(e) 4698{} 4699if (key == name) 4700{ 4701wert = val; 4702} 4703} 4704} 4705} 4706catch (e) 4707{ 4708if (typeof(HRLogError) == 'function') 4709HRLogError(e); 4710} 4711return wert; 4712} 4713function HRSetCookie(name, wert, config) 4714{ 4715if (!name || !wert) 4716return; 4717try 4718{ 4719var cookieStr = name + '=' + wert; 4720if (config) 4721{ 4722if (typeof(config.expires) == 'number' || typeof(config.expires) == 'string') 4723{ 4724var expires = (typeof(config.expires) == 'number' ? config.expires : parseInt(config.expires)); 4725var expireDate = new Date(); 4726if (typeof(config.expiresUnit) == 'string' && config.expiresUnit.length > 0) 4727{ 4728switch(config.expiresUnit) 4729{ 4730case 'days': 4731expireDate.setTime(expireDate.getTime() + (expires * 24 * 60 * 60 * 1000)); 4732break; 4733case 'hours': 4734expireDate.setTime(expireDate.getTime() + (expires * 60 * 60 * 1000)); 4735break; 4736case 'minutes': 4737expireDate.setTime(expireDate.getTime() + (expires * 60 * 1000)); 4738break; 4739case 'seconds': 4740expireDate.setTime(expireDate.getTime() + (expires * 1000)); 4741break; 4742default: 4743expireDate.setTime(expireDate.getTime() + expires); 4744break; 4745} 4746} 4747else 4748{ 4749expireDate.setTime(expireDate.getTime() + expires); 4750} 4751cookieStr = cookieStr + '; expires=' + expireDate.toGMTString(); 4752} 4753if (typeof(config.path) == 'string' && config.path.length > 0) 4754{ 4755cookieStr = cookieStr + '; path=' + config.path; 4756} 4757if (typeof(config.domain) == 'string' && config.domain.length > 0) 4758{ 4759cookieStr = cookieStr + '; domain=' + config.domain; 4760} 4761if (typeof(config.secure) === 'boolean' && config.secure) 4762{ 4763cookieStr = cookieStr + '; secure'; 4764} 4765} 4766document.cookie = cookieStr; 4767} 4768catch (e) 4769{ 4770if (typeof(HRLogError) == 'function') 4771HRLogError(e); 4772} 4773} 4774function HRGetAllCookies() 4775{ 4776var cookiesArray = null; 4777try 4778{ 4779var cookiesLine = document.cookie;
4780if (cookiesLine) 4781{ 4782cookiesArray = cookiesLine.split(';') 4783} 4784} 4785catch (e) 4786{ 4787if (typeof(HRLogError) === 'function') 4788HRLogError(e); 4789} 4790return cookiesArray; 4791} 4792function HRRemoveCookie(name, domain, path) 4793{ 4794try 4795{ 4796if (!name || typeof(name) !== 'string' || name.length <= 0) 4797return; 4798if (!domain || typeof(domain) !== 'string' || domain.length <= 0) 4799return; 4800if (!path || typeof(path) !== 'string' || path.length <= 0) 4801return; 4802document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=' + path + ';domain=' + domain; 4803} 4804catch (e) 4805{ 4806if (typeof(HRLogError) === 'function') 4807HRLogError(e); 4808} 4809} 4810function HRRemoveAllCookies(domain, path) 4811{ 4812try 4813{ 4814if (!domain || typeof(domain) !== 'string' || domain.length <= 0) 4815return; 4816if (!path || typeof(path) !== 'string' || path.length <= 0) 4817return; 4818var cookies = HRGetAllCookies(); 4819if (cookies) 4820{ 4821var i; 4822var l = cookies.length; 4823for (i = 0; i < l; i++) 4824{ 4825if (cookies[i]) 4826{ 4827document.cookie = cookies[i].split('=')[0] + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=' + path; 4828HRRemoveCookie(cookies[i].split('=')[0], domain, path); 4829} 4830} 4831} 4832} 4833catch (e) 4834{ 4835if (typeof(HRLogError) === 'function') 4836HRLogError(e); 4837} 4838} 4839function HRGetCookieValue(name) 4840{ 4841try 4842{ 4843var a = document.cookie; 4844var alleCookies = document.cookie.split(";"); 4845var i = 0; 4846for (var i = 0; i < alleCookies.length; i++) 4847{ 4848var keyValue = alleCookies[i].split("="); 4849if (keyValue.length > 1 && keyValue[0].trim() === name) 4850{ 4851return keyValue[1].trim(); 4852} 4853} 4854} 4855catch (e) 4856{ 4857if (typeof(HRLogError) === 'function') 4858HRLogError(e); 4859} 4860return ""; 4861} 4862function HRFehlerAusblenden(element) 4863{ 4864try 4865{ 4866if (typeof element == "string") 4867element = document.getElementById(element); 4868if (element) 4869{ 4870var replaced = element.name.replace('.', '_'); 4871if(element.type == "radio") 4872{ 4873var rahmenDivs = document.querySelectorAll('.'+ replaced + '_Rahmen'); 4874for (var idx = 0; idx < rahmenDivs.length; idx++) 4875{ 4876removeCSSClass(rahmenDivs.item(idx), 'formElementError'); 4877} 4878} 4879HRHide(replaced + '_ErrorTextHint'); 4880removeCSSClass(replaced +'_Rahmen', 'formElementError'); 4881} 4882var errorDiv = document.querySelector('.formElementError'); 4883if (errorDiv == null) 4884HRHide('idMarkedErrorsHintMessage'); 4885} 4886catch(e) 4887{ 4888} 4889} 4890function HRSetElementValue(element, value) 4891{ 4892try 4893{ 4894if (typeof element == "string") 4895element = document.getElementById(element); 4896if (element) 4897{ 4898element.value = value; 4899} 4900} 4901catch(e) 4902{ 4903} 4904} 4905function HRGetElementValue(element) 4906{ 4907try 4908{ 4909if (typeof element == "string") 4910{ 4911return document.getElementById(element).value; 4912} 4913if (element) 4914{ 4915return element.value; 4916} 4917} 4918catch(e) 4919{ 4920} 4921return ""; 4922} 4923'use strict'; 4924class HRFiles 4925{ 4926static printFileSize(filesizeInByte, decimalPlaces = 1) 4927{ 4928let result = ""; 4929try 4930{ 4931let selectedSize = 0; 4932let selectedUnit = "B"; 4933if (filesizeInByte > 0) 4934{ 4935const units = ["TB", "GB", "MB", "KB", "B"]; 4936for (let i = 0; i < units.length; i++) 4937{ 4938const unit = units[i]; 4939const cutoff = Math.pow(1000, 4 - i) / 10; 4940if (filesizeInByte >= cutoff) 4941{ 4942selectedSize = filesizeInByte / Math.pow(1000, 4 - i); 4943selectedUnit = unit; 4944break; 4945} 4946} 4947selectedSize = Math.round(selectedSize * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces); 4948} 4949result = selectedSize + selectedUnit; 4950} 4951catch (e) 4952{ 4953if (typeof(HRLogError) === 'function') 4954HRLogError(e); 4955} 4956return result; 4957} 4958} 4959!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))}
4959,m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w})); 4960!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_customParseFormat=e()}(this,function(){"use strict";var t,e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,o=/\d*[^\s\d-:/()]+/;var i=function(t){return function(e){this[t]=+e}},s=[/[+-]\d\d:?\d\d/,function(t){var e,n;(this.zone||(this.zone={})).offset=(e=t.match(/([+-]|\d\d)/g),0===(n=60*e[1]+ +e[2])?0:"+"===e[0]?-n:n)}],a=function(e){var n=t[e];return n&&(n.indexOf?n:n.s.concat(n.f))},h={A:[/[AP]M/,function(t){this.afternoon="PM"===t}],a:[/[ap]m/,function(t){this.afternoon="pm"===t}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,i("seconds")],ss:[r,i("seconds")],m:[r,i("minutes")],mm:[r,i("minutes")],H:[r,i("hours")],h:[r,i("hours")],HH:[r,i("hours")],hh:[r,i("hours")],D:[r,i("day")],DD:[n,i("day")],Do:[o,function(e){var n=t.ordinal,r=e.match(/\d+/);if(this.day=r[0],n)for(var o=1;o<=31;o+=1)n(o).replace(/\[|\]/g,"")===e&&(this.day=o)}],M:[r,i("month")],MM:[n,i("month")],MMM:[o,function(t){var e=a("months"),n=(a("monthsShort")||e.map(function(t){return t.substr(0,3)})).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(t){var e=a("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,i("year")],YY:[n,function(t){t=+t,this.year=t+(t>68?1900:2e3)}],YYYY:[/\d{4}/,i("year")],Z:s,ZZ:s};var f=function(t,n,r){try{var o=function(t){for(var n=t.match(e),r=n.length,o=0;o<r;o+=1){var i=n[o],s=h[i],a=s&&s[0],f=s&&s[1];n[o]=f?{regex:a,parser:f}:i.replace(/^\[|\]$/g,"")}return function(t){for(var e={},o=0,i=0;o<r;o+=1){var s=n[o];if("string"==typeof s)i+=s.length;else{var a=s.regex,h=s.parser,f=t.substr(i),u=a.exec(f)[0];h.call(e,u),t=t.replace(u,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon}}(e),e}}(n)(t),i=o.year,s=o.month,a=o.day,f=o.hours,u=o.minutes,d=o.seconds,c=o.milliseconds,l=o.zone,m=new Date,v=a||(i||s?1:m.getDate()),p=i||m.getFullYear(),y=0;i&&!s||(y=s>0?s-1:m.getMonth());var D=f||0,M=u||0,g=d||0,Y=c||0;return l?new Date(Date.UTC(p,y,v,D,M,g,Y+60*l.offset*1e3)):r?new Date(Date.UTC(p,y,v,D,M,g,Y)):new Date(p,y,v,D,M,g,Y)}catch(t){return new Date("")}};return function(e,n,r){var o=n.prototype,i=o.parse;o.parse=function(e){var n=e.date,o=e.utc,s=e.args;this.$u=o;var a=s[1];if("string"==typeof a){var h=!0===s[2],u=!0===s[3],d=h||u,c=s[2];u&&(c=s[2]),h||(t=c?r.Ls[c]:this.$locale()),this.$d=f(n,a,o),this.init(),c&&!0!==c&&(this.$L=this.locale(c).$L),d&&n!==this.format(a)&&(this.$d=new Date(""))}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var v=r.apply(this,s);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}m===l&&(this.$d=new Date(""))}else i.call(this,e)}}}); 4961"use strict"; 4962class HRDate 4963{ 4964static MonthNames = new Array("Januar","Februar","März","April","Mai","Juni","Juli", "August", "September", "Oktober", "
4964November", "Dezember"); 4965static DayNames = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"); 4966static DaysInMs = 864e5; 4967static WeeksInMs = this.DaysInMs * 7; 4968static MonthsInMs = this.WeeksInMs * 4; 4969static YearsInMs = this.MonthsInMs * 12; 4970static NumberDaysInMonths = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); 4971static getTimeComponentsFromMs(time) 4972{ 4973let timeObj = {days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0}; 4974if (time > 0) 4975{ 4976timeObj.days = Math.floor((time / (1000 * 60 * 60 * 24)) % 365) 4977timeObj.hours = Math.floor((time / (1000 * 60 * 60)) % 24); 4978timeObj.minutes = Math.floor((time / (1000 * 60)) % 60); 4979timeObj.seconds = Math.floor((time / 1000) % 60); 4980timeObj.milliseconds = Math.floor((time % 1000) / 100); 4981} 4982return timeObj; 4983} 4984static getGaussianEaster(jahr) 4985{ 4986let easterSunday = ""; 4987try 4988{ 4989if (jahr && typeof(jahr) == "number") 4990{ 4991const k = Math.floor(jahr / 100); 4992const tmp = Math.floor((3 * k + 3) / 4); 4993const m = Math.floor(15 + tmp - Math.floor((8 * k + 13) / 25)); 4994const s = 2 - tmp; 4995const a = jahr % 19; 4996const d = (19 * a + m) % 30; 4997const r = Math.floor((d / 29) + (d / 28 - d / 29) * (a / 11)); 4998const og = 21 + d - r; 4999const sz = Math.floor(7 - (jahr + Math.floor(jahr / 4) + s) % 7); 5000const oe = 7 - (og - sz) % 7; 5001const os = og + oe; 5002if (os > 31) 5003easterSunday = new Date((new Date(jahr, 3, os - 31).getTime())); 5004else 5005easterSunday = new Date((new Date(jahr, 2, os).getTime())); 5006} 5007} 5008catch (e) 5009{ 5010if (typeof(HRLogError) === 'function') 5011HRLogError(e); 5012} 5013return easterSunday; 5014} 5015static checkFeiertag(datum, bl) 5016{ 5017if (datum != null && bl != null) 5018{ 5019const jahr = datum.getFullYear(); 5020const monat = datum.getMonth(); 5021const tag = datum.getDate(); 5022const eintagInMs = 24*60*60*1000; 5023if (monat === 0) 5024{ 5025if (tag == 1) 5026{ 5027return "Neujahr"; 5028} 5029else if (tag == 6 && (bl.equalsIgnoreCase("BW") || bl.equalsIgnoreCase("BY") || bl.equalsIgnoreCase("ST"))) 5030{ 5031return "Heilige 3 Koenige"; 5032} 5033} 5034else if (monat == 4 && tag == 1) 5035return "Maifeiertag"; 5036else if (monat == 7 && tag == 15 && (bl.equalsIgnoreCase("BY") || bl.equalsIgnoreCase("SL"))) 5037return "Mariae Himmelfahrt"; 5038else if (monat == 9) 5039{ 5040if (tag == 3) 5041return "T. d. dt. Einheit"; 5042else if (tag == 31) 5043{ 5044if (bl.equalsIgnoreCase("BB") || bl.equalsIgnoreCase("MV") || bl.equalsIgnoreCase("SN") 5045|| bl.equalsIgnoreCase("ST") || bl.equalsIgnoreCase("TH") || (jahr == 2017 && (bl.equalsIgnoreCase("HE") 5046|| bl.equalsIgnoreCase("NW") || bl.equalsIgnoreCase("SL")))) 5047{ 5048return "Reformationstag"; 5049} 5050} 5051} 5052else if (monat == 10 && tag == 1) 5053{ 5054if (bl.equalsIgnoreCase("BW") || bl.equalsIgnoreCase("BY") || bl.equalsIgnoreCase("NW") || bl.equalsIgnoreCase("RP") || bl.equalsIgnoreCase("SL")) 5055return "Allerheiligen"; 5056} 5057else if (monat == 11) 5058{ 5059if (tag == 25) 5060return "1. Weihnachtstag"; 5061else if (tag == 26) 5062return "2. Weihnachtstag"; 5063} 5064const ostersonntag = this.getGaussianEaster(jahr); 5065if (this.isSameDay(datum, ostersonntag) && bl.equalsIgnoreCase("BB")) 5066return "Ostersonntag"; 5067const karfreitag = new Date(ostersonntag.getTime() - 2 * eintagInMs); 5068if (this.isSameDay(datum, karfreitag)) 5069return "Karfreitag"; 5070const ostermontag = new Date(ostersonntag.getTime() + eintagInMs); 5071if (this.isSameDay(datum, ostermontag)) 5072return "Ostermontag"; 5073const christiHimmelfahrt = new Date(ostersonntag.getTime() + 39 * eintagInMs); 5074if (this.isSameDay(datum, christiHimmelfahrt)) 5075return "Christi Himmelfahrt"; 5076if (bl.equalsIgnoreCase("BB") || bl.equalsIgnoreCase("HE")) 5077{ 5078const pfingstSonntag = new Date(ostersonntag.getTime() + 49 * eintagInMs); 5079if (this.isSameDay(datum, pfingstSonntag)) 5080return "Pfingstsonntag"; 5081} 5082const pfingstMontag = new Date(ostersonntag.getTime() + 50 * eintagInMs); 5083if (this.isSameDay(datum, pfingstMontag)) 5084return "Pfingstmontag"; 5085if (bl.equalsIgnoreCase("BW") || bl.equalsIgnoreCase("BY") 5086|| bl.equalsIgnoreCase("HE") || bl.equalsIgnoreCase("NW") 5087|| bl.equalsIgnoreCase("RP") || bl.equalsIgnoreCase("SL")) 5088{ 5089const fronleichnam = new Date(ostersonntag.getTime() + 60 * eintagInMs); 5090if (this.isSameDay(datum, fronleichnam)) 5091return "Fronleichnam"; 5092} 5093if (bl.equalsIgnoreCase("SN")) 5094{ 5095const bussUndBettag = new Date(jahr, 10, 22); 5096bussUndBettag = new Date(jahr, 10, 22 - ((bussUndBettag.getDay() + 4) % 7)); 5097if (this.isSameDay(datum, bussUndBettag)) 5098return "Buss- und Bettag"; 5099} 5100} 5101return ""; 5102} 5103static isSameDay(datum1, datum2) 5104{ 5105if (datum1 != null && datum2 != null && typeof(datum1.getFullYear) == 'function' && typeof(datum2.getFullYear) == 'function') 5106return (datum1.getFullYear() == datum2.getFullYear() && datum1.getMonth() == datum2.getMonth() && datum1.getDate() == datum2.getDate()) 5107return false;
5108} 5109static getDayOfWeek(datum) 5110{ 5111if (datum && datum instanceof Date) 5112{ 5113let dayOfWeek = datum.getDay(); 5114if (dayOfWeek === 0) 5115dayOfWeek = 7; 5116return dayOfWeek; 5117} 5118return 0; 5119} 5120static isInPast(datum) 5121{ 5122return (datum && datum < new Date()); 5123} 5124static isInFuture(datum) 5125{ 5126return (datum && datum > new Date()); 5127} 5128static getMidnight(datum) 5129{ 5130const dateCopy = datum; 5131dateCopy.setHours(0, 0, 0, 0); 5132return dateCopy; 5133} 5134static setMidnight(datum) 5135{ 5136datum.setHours(0, 0, 0, 0); 5137} 5138static parseDate(dateString, format) 5139{ 5140try 5141{ 5142const date = dayjs(dateString, this.transformToDayJsFormat(format)); 5143if (date && date.isValid()) 5144return date.toDate(); 5145} 5146catch (e) 5147{ 5148if (typeof(HRLogError) === 'function') 5149HRLogError(e); 5150} 5151return null; 5152} 5153static transformToDayJsFormat(simpleDateFormat) 5154{ 5155let newDayJsFormat = ""; 5156if (!simpleDateFormat) 5157{ 5158return newDayJsFormat; 5159} 5160for (let i = 0; i < simpleDateFormat.length; i++) 5161{ 5162switch (simpleDateFormat.charAt(i)) 5163{ 5164case "y": newDayJsFormat += "Y"; 5165break; 5166case "d": newDayJsFormat += "D"; 5167break; 5168case "u": 5169case "E": newDayJsFormat += "d"; 5170break; 5171case "z": newDayJsFormat += "Z"; 5172break; 5173case "a": newDayJsFormat += "A"; 5174break; 5175case ".": 5176case "-": 5177case ":": 5178case " ": 5179case "M": 5180case "H": 5181case "h": 5182case "m": 5183case "s": 5184case "S": newDayJsFormat += simpleDateFormat.charAt(i); 5185break; 5186} 5187} 5188return newDayJsFormat; 5189} 5190static parseDefaultFormatDate(dateString) 5191{ 5192if (dateString) 5193{ 5194try 5195{ 5196const date = dayjs(dateString.trim(), ['DD.MM.YYYY', 'DD.MM.YYYY HH:mm:ss', 'DD.MM.YYYY HH:mm', 'DD.MM.YYYY HH'], 'de', true); 5197if (date && date.isValid()) 5198return date.toDate(); 5199} 5200catch (e) 5201{ 5202if (typeof(HRLogError) === 'function') 5203HRLogError(e); 5204} 5205} 5206return null; 5207} 5208static parseDefaultFormatDateTime(dateString) 5209{ 5210return this.parseDate(dateString, 'dd.MM.yyyy hh:mm:ss'); 5211} 5212static print(date, format) 5213{ 5214try 5215{ 5216if (date) 5217return dayjs(date).format(this.transformToDayJsFormat(format)); 5218} 5219catch (e) 5220{ 5221if (typeof(HRLogError) === 'function') 5222HRLogError(e); 5223} 5224return ""; 5225} 5226static getNow() 5227{ 5228return new Date(); 5229} 5230static getDifferenceInMs(start, ende) 5231{ 5232try 5233{ 5234return new Date(this.parseDefaultFormatDate(ende) - this.parseDefaultFormatDate(start)).getTime(); 5235} 5236catch(e) 5237{ 5238if (typeof(HRLogError) === 'function') 5239HRLogError(e); 5240} 5241} 5242static msToMin(millis) 5243{ 5244return (millis/(1000*60)); 5245} 5246static toMs(datum) 5247{ 5248try 5249{ 5250var dateParts = datum.replace(/\s/g, ".").replace(/:/g, ".").split("."); 5251return new Date(dateParts[2], dateParts[1]-1, dateParts[0], dateParts[3], dateParts[4]).getTime(); 5252} 5253catch(e) 5254{ 5255if (typeof(HRLogError) === 'function') 5256HRLogError(e); 5257} 5258return 0; 5259} 5260static getDayOfWeekStr(datum) 5261{ 5262try 5263{ 5264var dayOfWeek = datum.getDay(); 5265return this.DayNames[dayOfWeek]; 5266} 5267catch (e) 5268{ 5269if (typeof(HRLogError) === 'function') 5270HRLogError(e); 5271} 5272return ""; 5273} 5274static getMonthName(datum, length) 5275{ 5276let ausgabe = ""; 5277try 5278{ 5279if (datum) 5280{ 5281ausgabe = this.MonthNames[datum.getMonth()]; 5282if (length && length > 0 && length < ausgabe.length) 5283ausgabe = ausgabe.substring(0, length); 5284} 5285} 5286catch (e) 5287{ 5288if (typeof(HRLogError) === 'function') 5289HRLogError(e); 5290} 5291return ausgabe; 5292} 5293static isSameMinute(datum1, datum2) 5294{ 5295try 5296{ 5297return (datum1.getFullYear() == datum2.getFullYear() && datum1.getMonth() == datum2.getMonth() && datum1.getDate() == datum2.getDate() && datum1.getHours() == datum2.getHours() && datum1.getMinutes() == datum2.getMinutes()); 5298} 5299catch (e) 5300{ 5301if (typeof(HRLogError) === 'function') 5302HRLogError(e); 5303} 5304} 5305static getNumberDaysOfMonth(month, year) 5306{ 5307if (typeof(month) != "number" || month <= 0 || month > 12 || typeof(year) != "number") 5308return -1; 5309try 5310{ 5311if (this.isLeapYear(year) && month == 2) 5312return 29; 5313return this.NumberDaysInMonths[month]; 5314} 5315catch (e) 5316{ 5317if (typeof(HRLogError) === 'function') 5318HRLogError(e); 5319} 5320} 5321static getDayOfYear(datum) 5322{ 5323try 5324{ 5325const todayInMs = (new Date(datum.getFullYear(), datum.getMonth(), datum.getDate(), 0, 0, 0)).getTime(); 5326const yearStartInMs = (new Date(datum.getFullYear(), 0, 0, 0, 0, 0)).getTime(); 5327return Math.floor((todayInMs - yearStartInMs)/todayInMs); 5328} 5329catch (e) 5330{ 5331if (typeof(HRLogError) === 'function') 5332HRLogError(e); 5333} 5334} 5335static isLeapYear(year) 5336{ 5337if (typeof(year) === 'integer') 5338return ((year % 400 == 0 || year % 100 != 0) && year % 4 == 0); 5339return false;
5340} 5341static getNumberOfWeeks(datum) 5342{ 5343const d = new Date(datum.getFullYear(), datum.getMonth(), datum.getDate(), 0, 0, 0); 5344d.setDate(d.getDate() - (d.getDay() + 6) % 7 + 3); 5345const ms = d.valueOf(); 5346d.setMonth(0); 5347d.setDate(4); 5348return Math.round((ms - d.valueOf()) / (7 * this.DaysInMs)) + 1; 5349} 5350static getTimeDifference(date1, date2, unit, floatingNumber) 5351{ 5352return dayjs(date1).diff(dayJsDate2, 'day', floatingNumber); 5353} 5354static getTimeDifferenceInDays(date1, date2) 5355{ 5356this.getTimeDifference(date1, date2, 'day', floatingNumber); 5357} 5358static getTimeDifferenceInWeeks(date1, date2) 5359{ 5360this.getTimeDifference(date1, date2, 'week', floatingNumber); 5361} 5362static getTimeDifferenceInMonths(date1, date2) 5363{ 5364this.getTimeDifference(date1, date2, 'month', floatingNumber); 5365} 5366static getTimeDifferenceInYears(date1, date2) 5367{ 5368this.getTimeDifference(date1, date2, 'year', floatingNumber); 5369} 5370static isValidDateObject(date) 5371{ 5372try 5373{ 5374return date instanceof Date && !isNaN(date) ? true : false; 5375} 5376catch (e) 5377{ 5378if (typeof(HRLogError) === 'function') 5379HRLogError(new Error("HRDate.isValidDateObject: Prüfung, ob das übergebene Datum valide ist, ist fehlgeschlagen.")); 5380} 5381return false; 5382} 5383static isPeriodOverlappingPeriod(startPeriod1, endPeriod1, startPeriod2, endPeriod2) 5384{ 5385try 5386{ 5387if (!startPeriod1 || !endPeriod1 || !startPeriod2 || !endPeriod2) 5388return false; 5389if (startPeriod1 <= endPeriod2 && startPeriod2 <= endPeriod1) 5390return true; 5391} 5392catch(e) 5393{ 5394if (typeof(HRLogError) === 'function') 5395HRLogError(new Error("HRDate.isPeriodOverlappingPeriod: Prüfung, ob sich zwei gegebene Zeitspannen überlappen, ist fehlgeschlagen.")); 5396} 5397return false; 5398} 5399static isDateInPeriod(startPeriod, endPeriod, day, month, year) 5400{ 5401try 5402{ 5403if (startPeriod == null || endPeriod == null || startPeriod > endPeriod) 5404return false; 5405const zeitpunkt = new Date(new Date(year, month, day).getTime()); 5406return (startPeriod <= zeitpunkt && endPeriod >= zeitpunkt); 5407} 5408catch(e) 5409{ 5410if (typeof(HRLogError) === 'function') 5411HRLogError(new Error("HRIsDateInPeriod: Prüfung, ob sich ein Datum in einer gegebenen Zeitspanne befindet, ist fehlgeschlagen.")); 5412} 5413return false; 5414} 5415static isSameDay(date1, date2) 5416{ 5417try 5418{ 5419return (date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate()); 5420} 5421catch (e) 5422{ 5423if (typeof(HRLogError) === 'function') 5424HRLogError(new Error("isSameDay: Prüfung auf den selben Tag fehlgeschlagen.")); 5425} 5426return false; 5427} 5428static toDate(dateValue) 5429{ 5430let datum = null; 5431try 5432{ 5433if (dateValue != null) 5434{ 5435if (typeof(dateValue) == 'object') 5436{ 5437if (dateValue instanceof Date) 5438datum = dateValue; 5439else if (dateValue instanceof Array && dateValue.length > 0) 5440datum = this.toDate(dateValue[0]); 5441} 5442else if (typeof(dateValue) == 'string') 5443datum = this.parseDate(dateValue); 5444else if (typeof(dateValue) == 'number') 5445datum = new Date(dateValue); 5446} 5447} 5448catch (e) 5449{ 5450if (typeof(HRLogError) === 'function') 5451HRLogError(e); 5452} 5453return datum; 5454} 5455static addDays(date1, days) 5456{ 5457try 5458{ 5459const datum = this.toDate(date1); 5460if (datum != null) 5461return new Date(datum.getFullYear(), datum.getMonth(), datum.getDate() + days, datum.getHours(), datum.getMinutes(), datum.getSeconds()); 5462} 5463catch (e) 5464{ 5465if (typeof(HRLogError) === 'function') 5466HRLogError(e); 5467} 5468return date1; 5469} 5470static addMonths(date1, months) 5471{ 5472try 5473{ 5474const datum = this.toDate(date1); 5475if (datum != null) 5476return new Date(datum.getFullYear(), datum.getMonth() + months, datum.getDate(), datum.getHours(), datum.getMinutes(), datum.getSeconds()); 5477} 5478catch (e) 5479{ 5480if (typeof(HRLogError) === 'function') 5481HRLogError(e); 5482} 5483return date1; 5484} 5485static addYears(date1, years) 5486{ 5487try 5488{ 5489const datum = this.toDate(date1); 5490if (datum != null) 5491return new Date(datum.getFullYear() + years, datum.getMonth(), datum.getDate(), datum.getHours(), datum.getMinutes(), datum.getSeconds()); 5492} 5493catch (e) 5494{ 5495if (typeof(HRLogError) === 'function') 5496HRLogError(e); 5497} 5498return date1; 5499} 5500static addHours(date1, hours) 5501{ 5502try 5503{ 5504const datum = this.toDate(date1); 5505if (datum != null) 5506return new Date(datum.getFullYear(), datum.getMonth(), datum.getDate(), datum.getHours() + hours, datum.getMinutes(), datum.getSeconds()); 5507} 5508catch (e) 5509{ 5510if (typeof(HRLogError) === 'function') 5511HRLogError(e); 5512} 5513return date1; 5514} 5515static addMinutes(date1, minutes) 5516{ 5517try 5518{ 5519const datum = this.toDate(date1); 5520if (datum != null) 5521return new Date(datum.getFullYear(), datum.getMonth(), datum.getDate(), datum.getHours(), datum.getMinutes() + minutes, datum.getSeconds()); 5522} 5523catch (e) 5524{ 5525if (typeof(HRLogError) === 'function') 5526HRLogError(e); 5527} 5528return date1; 5529} 5530static addSeconds(date1, seconds) 5531{ 5532try 5533{ 5534const datum = this.toDate(date1); 5535if (datum != null) 5536return new Date(datum.getFullYear(), datum.getMonth(), datum.getDate(), datum.getHours(), datum.getMinutes(), datum.getSeconds() + seconds); 5537} 5538catch (e) 5539{ 5540if (typeof(HRLogError) === 'function') 5541HRLogError(e); 5542} 5543return date1; 5544} 5545static getNextDay(date) 5546{ 5547try 5548{ 5549if (date) 5550{ 5551const nextDay = new Date(date.getTime()); 5552nextDay.setDate(nextDay.getDate()+1); 5553return nextDay; 5554} 5555} 5556catch (e) 5557{ 5558if (typeof(HRLogError) === 'function') 5559HRLogError(e); 5560} 5561return null; 5562} 5563static isTomorrow(date) 5564{ 5565try 5566{ 5567if (date) 5568{ 5569const tomorrow = this.getNextDay(new Date()); 5570if (tomorrow) 5571return (tomorrow && tomorrow.getFullYear() == date.getFullYear() && tomorrow.getMonth() == date.getMonth() && tomorrow.getDate() == date.getDate()) 5572} 5573} 5574catch (e) 5575{ 5576if (typeof(HRLogError) === 'function') 5577HRLogError(e); 5578} 5579return false;
5580} 5581static computeRemainingTime(targetDate) 5582{ 5583const timeDiff = { 5584days: -1, 5585hours: -1, 5586minutes: -1, 5587seconds: -1 5588}; 5589try 5590{ 5591if (targetDate) 5592{ 5593const now = new Date(); 5594const difference = targetDate - now; 5595timeDiff.days = Math.floor(difference / (1000 * 60 * 60 * 24)); 5596timeDiff.hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 5597timeDiff.minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); 5598timeDiff.seconds = Math.floor((difference % (1000 * 60)) / 1000); 5599} 5600} 5601catch (e) 5602{ 5603if (typeof(HRLogError) === 'function') 5604HRLogError(e); 5605} 5606return timeDiff; 5607} 5608} 5609function HRCheckFeiertag(datum, bl) 5610{ 5611return HRDate.checkFeiertag(datum, bl); 5612} 5613function HRParseDate(dateString) 5614{ 5615return HRDate.parseDefaultFormatDate(dateString); 5616} 5617function HRFormatDate(dateString) 5618{ 5619return HRDate.print(dateString, 'dd.MM.yyyy'); 5620} 5621dayjs.extend(window.dayjs_plugin_customParseFormat); 5622var HRScrollMode = { 5623Top: 'top', 5624Bottom: 'bottom' 5625} 5626function HRScrollTo(element, config) 5627{ 5628try 5629{ 5630var scrollMode = HRScrollMode.Top; 5631if (config) 5632{ 5633if (config.scrollMode) 5634scrollMode = config.scrollMode; 5635} 5636if (element) 5637{ 5638if (typeof(element) === 'string') 5639element = document.getElementById(element); 5640var scrollMargin = getStyleMeasureValue(getStyleValue(element, 'scroll-margin-top')); 5641if (scrollMargin <= 0) 5642{ 5643scrollMargin = getStyleMeasureValue(getStyleValue(element, 'scroll-snap-margin-top')); 5644} 5645if (typeof(HRBrowser) === 'object' && !HRBrowser.isIE()) 5646{ 5647var topPos = getElementTopValue(element); 5648if (topPos >= 0) 5649{ 5650topPos = topPos - scrollMargin; 5651if (scrollMode === HRScrollMode.Bottom) 5652topPos = topPos + getElementHeightValue(element); 5653window.scrollTo({ top: parseInt(topPos), behavior: 'smooth' }); 5654} 5655} 5656else 5657{ 5658var parent = element.parentNode; 5659while (parent && parent.style && parent.style.overflow != 'scroll') 5660parent = parent.parentNode; 5661if (!parent || parent == document) 5662parent = window; 5663var current = parseInt(parent.scrollTop); 5664if (parent == window) 5665{ 5666if (typeof(window.pageYOffset) === 'number') 5667{ 5668current = window.pageYOffset; 5669} 5670else if (document.body && document.body.scrollTop) 5671{ 5672current = document.body.scrollTop; 5673} 5674} 5675var helper = document.createElement('DIV'); 5676helper.style.height = '0px'; 5677helper.style.width = current; 5678helper.style.borderWidth = '0px'; 5679helper.style.position = 'absolute'; 5680document.body.appendChild(helper); 5681var animator = new Animator({ 5682onStep: function() 5683{ 5684var temp = helper.style.width; 5685if (temp.substr(temp.length - 2, temp.length) === 'px') 5686temp = temp.substr(0,temp.length-2); 5687if (parent != window) 5688{ 5689parent.scrollTop = temp; 5690} 5691else 5692{ 5693window.scrollTo(0, temp); 5694} 5695}, 5696onComplete: function() 5697{ 5698document.body.removeChild(helper); 5699} 5700}); 5701var topPos = getPosition(element).y - scrollMargin; 5702if (parent != window) 5703topPos = topPos - getPosition(parent).y; 5704if (scrollMode === HRScrollMode.Bottom) 5705topPos = topPos + getElementHeightValue(element); 5706animator.addSubject(new NumericalStyleSubject(helper, 'width', current, parseInt(topPos))); 5707animator.play(); 5708} 5709} 5710} 5711catch (e) 5712{ 5713if (typeof(HRLogError) === 'function') 5714HRLogError(new Error('HRScrollTo.HRScrollTo: Fehler beim Scrollen.' + e)); 5715} 5716} 5717HRUrl = function(url) 5718{ 5719try 5720{ 5721this.m_Url = ''; 5722this.m_BaseUrl = ''; 5723this.m_IsAbsolut = false;
5724this.m_UrlParameter = ''; 5725this.m_KeyValueArray = []; 5726this.m_Fragment = ''; 5727if (url && typeof(url) === 'string') 5728{ 5729this.m_Url = url; 5730var startParameter = this.m_Url.indexOf('?'); 5731this.m_BaseUrl = (startParameter >= 0 ? this.m_Url.substring(0, startParameter) : this.m_Url); 5732if (this.m_Url.toLowerCase().indexOf('http:') >= 0 || this.m_Url.toLowerCase().indexOf('https:') >= 0) 5733this.m_IsAbsolut = true; 5734var startFragment = this.m_Url.indexOf('#'); 5735if (startFragment >= 0) 5736this.m_Fragment = this.m_Url.substring(startFragment + 1); 5737if (startParameter >= 0 && startParameter + 1 < this.m_Url.length) 5738{ 5739this.m_UrlParameter = this.m_Url.substring(startParameter + 1); 5740if (startFragment >= 0) 5741{ 5742this.m_UrlParameter = this.m_Url.substring(startParameter + 1, startFragment); 5743} 5744this.m_UrlParameterLowerCase = this.m_UrlParameter.toLowerCase(); 5745this.m_KeyValueArray = this.m_UrlParameter.split('&'); 5746} 5747} 5748} 5749catch (e) 5750{ 5751if (typeof(HRLogError) === 'function') HRLogError(e); 5752} 5753} 5754HRUrl.prototype.getAllParameter = function(name, ignoreCase) 5755{ 5756try 5757{ 5758if (!name || typeof(name) !== 'string') 5759return null; 5760var parameterArray = new Array(); 5761for (let i = 0; i < this.m_KeyValueArray.length; i++) 5762{ 5763if ((ignoreCase && this.m_KeyValueArray[i].toLowerCase().indexOf(name.toLowerCase() + '=') >= 0) || this.m_KeyValueArray[i].indexOf(name + '=') >= 0) 5764{ 5765var ablage = this.m_KeyValueArray[i].split('='); 5766if (ablage.length > 1) 5767parameterArray.push(ablage[1]); 5768} 5769} 5770if (parameterArray.length > 0) 5771return parameterArray; 5772} 5773catch (e) 5774{ 5775if (typeof(HRLogError) === 'function') HRLogError(e); 5776} 5777return null; 5778} 5779HRUrl.prototype.getParameter = function(name, ignoreCase) 5780{ 5781var parameterArray = this.getAllParameter(name, ignoreCase); 5782if (!parameterArray) 5783return null; 5784return (parameterArray.length > 0 ? parameterArray[0] : ''); 5785} 5786HRUrl.prototype.isAbsolut = function() 5787{ 5788return this.m_IsAbsolut; 5789} 5790HRUrl.prototype.addParameter = function(name, value) 5791{ 5792try 5793{ 5794if (!name || typeof(name) !== 'string' || !value || (typeof(value) !== 'string' && typeof(value) !== 'number')) 5795return false; 5796this.m_KeyValueArray.push(name + '=' + value); 5797return true; 5798} 5799catch (e) 5800{ 5801if (typeof(HRLogError) === 'function') HRLogError(e); 5802} 5803return false; 5804} 5805HRUrl.prototype.removeParameter = function(name, ignoreCase) 5806{ 5807try 5808{ 5809var numberDeleted = 0; 5810if (!name || typeof(name) != 'string') 5811return false; 5812for (let i = 0; i < this.m_KeyValueArray.length; i++) 5813{ 5814if ((ignoreCase && this.m_KeyValueArray[i].toLowerCase().indexOf(name.toLowerCase() + '=') >= 0) || this.m_KeyValueArray[i].indexOf(name + '=') >= 0) 5815{ 5816this.m_KeyValueArray.splice(i, 1); 5817numberDeleted += 1; 5818} 5819} 5820return (numberDeleted > 0 ? true : false); 5821} 5822catch (e) 5823{ 5824if (typeof(HRLogError) == 'function') HRLogError(e); 5825} 5826return false; 5827} 5828HRUrl.prototype.setParameter = function(name, value, ignoreCase) 5829{ 5830try 5831{ 5832if (!name || typeof(name) != 'string') 5833return false; 5834for (let i = 0; i < this.m_KeyValueArray.length; i++) 5835{ 5836if ((ignoreCase && this.m_KeyValueArray[i].toLowerCase().indexOf(name.toLowerCase() + '=') >= 0) || this.m_KeyValueArray[i].indexOf(name + '=') >= 0) 5837{ 5838let key = this.m_KeyValueArray[i].substring(0, this.m_KeyValueArray[i].toLowerCase().indexOf('=')); 5839this.m_KeyValueArray[i] = `${key}=${value}`; 5840return; 5841} 5842} 5843this.addParameter(name, value); 5844} 5845catch (e) 5846{ 5847if (typeof(HRLogError) == 'function') HRLogError(e); 5848} 5849} 5850HRUrl.prototype.containsParameter = function(name, ignoreCase) 5851{ 5852if (!name || typeof(name) != 'string') 5853return false; 5854for (let i = 0; i < this.m_KeyValueArray.length; i++) 5855{ 5856if ((ignoreCase && this.m_KeyValueArray[i].toLowerCase().indexOf(name.toLowerCase() + '=') >= 0) || this.m_KeyValueArray[i].indexOf(name + '=') >= 0) 5857{ 5858return true; 5859} 5860} 5861return false; 5862} 5863HRUrl.prototype.containsParameterValue = function(name, value, ignoreCase) 5864{ 5865if (!value || typeof(value) != 'string') 5866return false; 5867const values = this.getAllParameter(name, ignoreCase); 5868if (values) 5869{ 5870for (let i = 0; i < values.length; i++) 5871{ 5872if ((ignoreCase && values[i].equalsIgnoreCase(value)) || (!ignoreCase && values[i] == value)) 5873return true; 5874} 5875} 5876return false; 5877} 5878HRUrl.prototype.toString = function() 5879{ 5880if (this.m_BaseUrl.length <= 0) 5881return ''; 5882var url = this.m_BaseUrl; 5883if (this.m_KeyValueArray.length > 0) 5884{ 5885url += '?'; 5886} 5887for (i = 0; i < this.m_KeyValueArray.length; i++) 5888{ 5889url += (this.m_KeyValueArray[i] + (i < this.m_KeyValueArray.length -1 ? '&' : '')); 5890} 5891if (this.m_Fragment) 5892url += '#' + this.m_Fragment; 5893return url; 5894} 5895"use strict"; 5896const HRMessageLevel = { 5897Info: "info", 5898Warning: "warning", 5899Error: "error" 5900} 5901const SourceTypes = { 5902Unknown: "unknown", 5903Attribut: "attribut",
5904Anwendung: "anwendung" 5905} 5906const HRMessageDisplayTypes = { 5907Inline: "inline", 5908Toast: "toast", 5909IBox: "ibox", 5910Alert: "alert", 5911Tooltip: "tooltip" 5912} 5913var HRDefaultTextTypeError = { 5914RequiredCheckFailed: 'Bitte füllen Sie alle Pflichtfelder aus.' 5915} 5916class HRMessageHandler 5917{ 5918defaultDisplayType = HRMessageDisplayTypes.Inline; 5919#debugMode = false; 5920defaultFieldDisplayType = HRMessageDisplayTypes.Inline; 5921defaultParentElement; 5922messages = new Map(); 5923#toastFactory; 5924constructor(displayType, debugMode) 5925{ 5926if (displayType) 5927this.defaultDisplayType = displayType; 5928this.#debugMode = debugMode; 5929} 5930static createDefaultHandler(debugMode) 5931{ 5932if (!window.HRMessageHandler || !(window.HRMessageHandler instanceof HRMessageHandler)) 5933window.HRMessageHandler = new HRMessageHandler(null, debugMode); 5934} 5935#showMessage(txt, messageLevel, config) 5936{ 5937try 5938{ 5939config = config || {}; 5940if (config.processingFunction) 5941config.processingFunction(txt, config); 5942else 5943{ 5944let displayType = this.defaultDisplayType; 5945if (config.displayType && config.displayType.length > 0) 5946displayType = config.displayType; 5947if (!config.parent && this.defaultParentElement) 5948config.parent = this.defaultParentElement; 5949if (config.parent) 5950{ 5951if (typeof(config.parent) === 'string') 5952config.parent = document.querySelector(config.parent); 5953if (config.markParentElement && !config.parent.hasAttribute('data-field-frame')) 5954{ 5955if (messageLevel === HRMessageLevel.Error) 5956addCSSClass(config.parent, 'error-parent'); 5957else if (messageLevel === HRMessageLevel.Warning) 5958addCSSClass(config.parent, 'warning-parent'); 5959else 5960addCSSClass(config.parent, 'info-parent'); 5961} 5962} 5963if (txt && typeof(txt) === 'string') 5964{ 5965if (displayType === HRMessageDisplayTypes.Inline) 5966this.#showMessageInline(txt, messageLevel, config); 5967else if (displayType === HRMessageDisplayTypes.Tooltip) 5968this.#showMessageTooltip(txt, messageLevel, config); 5969else if (displayType === HRMessageDisplayTypes.IBox && typeof(HROpenNoteInIBox) === 'function') 5970HROpenNoteInIBox(txt, messageLevel.toLowerCase()); 5971else if (displayType === HRMessageDisplayTypes.Alert) 5972alert(txt); 5973else 5974{ 5975this.#showMessageToast(txt, messageLevel, false, config); 5976if (displayType !== HRMessageDisplayTypes.Toast && typeof(HRLogError) === 'function') 5977HRLogError(new Error('Die Darstellungsform "' + displayType + '" ist unbekannt.')); 5978} 5979if (config.type && messageLevel === HRMessageLevel.Error && displayType !== HRMessageDisplayTypes.Toast) 5980{ 5981if (config.type === 'RequiredCheckFailed') 5982{ 5983this.#showMessageToast(HRDefaultTextTypeError.RequiredCheckFailed, HRMessageLevel.Error, true, { 5984closeOnClick: false, 5985scrollOnClick: `[data-message-type="${config.type.toLowerCase()}"]`, 5986messageType: config.type 5987}); 5988} 5989} 5990} 5991} 5992} 5993catch (e) 5994{ 5995if (typeof(HRLogError) === 'function') 5996HRLogError(e); 5997} 5998} 5999#showMessageInline(txt, messageLevel, config) 6000{ 6001if (config.parent) 6002{ 6003const messageHashcode = this.hashCodeMessage(txt, messageLevel, config.type, config.parent); 6004if (config.parent.hasAttribute('data-field-frame')) 6005{ 6006let messageContainerCssClassname; 6007if (messageLevel === HRMessageLevel.Error) 6008messageContainerCssClassname = 'formElementErrorTextHint'; 6009else if (messageLevel === HRMessageLevel.Warning) 6010messageContainerCssClassname = 'formElementWarnTextHint'; 6011else 6012messageContainerCssClassname = 'formElementInfoTextHint'; 6013let messageContainer = config.parent.getElementsByClassName(messageContainerCssClassname)[0]; 6014if (!messageContainer) 6015{ 6016messageContainer = document.createElement('div'); 6017messageContainer.className = messageContainerCssClassname; 6018config.parent.appendChild(messageContainer); 6019} 6020const messageElement = document.createElement('span'); 6021messageElement.textContent = txt; 6022messageElement.className = messageLevel + (config.className ? ' ' + config.className : ''); 6023if (config.id) 6024messageElement.id = config.id; 6025if (config.type) 6026messageElement.dataset.messageType = config.type.trim().toLowerCase(); 6027messageElement.dataset.message = ''; 6028messageElement.dataset.messageId = messageHashcode;
6029messageContainer.appendChild(messageElement); 6030this.messages.set(messageHashcode, messageElement); 6031} 6032else 6033{ 6034const messageElement = document.createElement('p'); 6035messageElement.innerHTML = txt; 6036if (config.id) 6037messageElement.id = config.id; 6038messageElement.className = messageLevel + (config.className ? ' ' + config.className : ''); 6039if (config.type) 6040messageElement.dataset.messageType = config.type.trim().toLowerCase(); 6041messageElement.dataset.message = ''; 6042config.parent.appendChild(messageElement); 6043this.messages.set(messageHashcode, messageElement); 6044} 6045} 6046else 6047{ 6048if (typeof(HRLogError) === 'function') 6049HRLogError(new Error('Eine Inline-Darstellung ohne ein parent-Element, an welches man den Fehler hängen kann, wird nicht unterstützt.')); 6050} 6051} 6052removeFieldMessagesIfExist(field) 6053{ 6054this.removeFieldErrorsIfExist(field); 6055this.removeFieldWarningsIfExist(field); 6056} 6057removeFieldErrorsIfExist(field) 6058{ 6059try 6060{ 6061if (field && field.hasAttribute('data-error')) 6062{ 6063if (field.parentElement && field.parentElement.hasAttribute('data-field-frame')) 6064removeCSSClass(field.parentElement, 'formElementError'); 6065const errorDiv = field.parentElement.getElementsByClassName("formElementErrorTextHint")[0]; 6066if (errorDiv) 6067{ 6068Array.from(errorDiv.querySelectorAll('.error')).forEach((error) => { 6069if (error.dataset.messageId && !this.messages.delete(parseInt(error.dataset.messageId)) && this.messages.length > 0 && typeof(HRLogError) === 'function') 6070HRLogError(new Error(`Fehler beim Entfernen einer Nachricht (message-id: ${parseInt(error.dataset.messageId)}). Message-Objekt konnte nicht in messages-Verwaltung gefunden werden.`)); 6071error.remove(); 6072this.messages.forEach((obj, id) => { 6073if (obj && typeof(HRToast) === 'function' && obj instanceof HRToast && error.hasAttribute('data-message-type') && obj.m_MessageType === error.dataset.messageType) 6074{ 6075if (document.querySelectorAll(`.error[data-message-type="${obj.m_MessageType}"]`).length <= 0) 6076obj.close(); 6077} 6078}); 6079}); 6080errorDiv.remove(); 6081} 6082field.removeAttribute('data-error'); 6083} 6084} 6085catch (e) 6086{ 6087if (typeof(HRLogError) === 'function') 6088HRLogError(new Error('Fehler beim Entfernen einer Nachricht.')); 6089} 6090} 6091removeFieldWarningsIfExist(field) 6092{ 6093try 6094{ 6095if (field && field.hasAttribute('data-warning')) 6096{ 6097if (field.parentElement && field.parentElement.hasAttribute('data-field-frame')) 6098removeCSSClass(field.parentElement, 'formElementWarning'); 6099const warningDiv = field.parentElement.getElementsByClassName("formElementWarnTextHint")[0]; 6100if (warningDiv) 6101{
6102Array.from(warningDiv.querySelectorAll('.warning')).forEach((warning) => { 6103if (warning.dataset.messageId && !this.messages.delete(parseInt(warning.dataset.messageId)) && this.messages.length > 0 && typeof(HRLogError) === 'function') 6104HRLogError(new Error(`Fehler beim Entfernen einer Nachricht (message-id: ${parseInt(warning.dataset.messageId)}). Message-Objekt konnte nicht in messages-Verwaltung gefunden werden.`)); 6105warning.remove(); 6106this.messages.forEach((obj, id) => { 6107if (obj && typeof(HRToast) === 'function' && obj instanceof HRToast && warning.hasAttribute('data-message-type') && obj.m_MessageType === warning.dataset.messageType) 6108{ 6109if (document.querySelectorAll(`.warning[data-message-type="${obj.m_MessageType}"]`).length <= 0) 6110obj.close(); 6111} 6112}); 6113}); 6114warningDiv.remove(); 6115} 6116} 6117} 6118catch (e) 6119{ 6120if (typeof(HRLogError) === 'function') 6121HRLogError(new Error('Fehler beim Entfernen einer Nachricht.')); 6122} 6123} 6124#showMessageToast(txt, messageLevel, singleton, config) 6125{ 6126if (typeof(HRToastFactory) === 'function') 6127{ 6128const messageHashcode = this.hashCodeMessage(txt, messageLevel, config.type, config.parent); 6129if (messageHashcode && (!this.messages || !singleton || !this.messages.get(messageHashcode))) 6130{ 6131const _this = this; 6132if (!this.#toastFactory) 6133{ 6134this.#toastFactory = new HRToastFactory({ 6135duration: 3750, 6136limit: 3, 6137progressbar: false, 6138position: { 6139x: 'right', 6140y: 'bottom' 6141}, 6142sortMode: HRToastContainerSortMode.logLevelPrioritized, 6143closeOnClick: config.closeOnClick, 6144parent: config.parent, 6145scrollOnClick: config.scrollOnClick, 6146messageType: (config.messageType ? config.messageType.toLowerCase() : ''), 6147}); 6148} 6149let toastConfig = { 6150className: config.type, 6151onShow: (toast) => { 6152toast.m_Toast.dataset.id = messageHashcode; 6153_this.messages.set(messageHashcode, toast); 6154}, 6155onClose: (toast) => { 6156if (!_this.messages.delete(parseInt(messageHashcode)) && _this.messages.length > 0 && typeof(HRLogError) === 'function') 6157HRLogError(new Error(`Fehler beim Entfernen einer Nachricht (message-id: ${parseInt(messageHashcode)}). Message-Objekt konnte nicht in messages-Verwaltung gefunden werden.`)); 6158} 6159}; 6160let toast; 6161if (messageLevel === HRMessageLevel.Error) 6162{ 6163toastConfig.duration = config.duration ? config.duration : -1, 6164toastConfig.closeOnClick = false; 6165this.#toastFactory.error(txt, toastConfig); 6166} 6167else if (messageLevel === HRMessageLevel.Warning) 6168{ 6169toastConfig.duration = config.duration ? config.duration : -1, 6170this.#toastFactory.warn(txt, toastConfig); 6171} 6172else 6173{ 6174toastConfig.duration = config.duration ? config.duration : 3750, 6175this.#toastFactory.info(txt, toastConfig); 6176} 6177} 6178} 6179} 6180#showMessageTooltip(txt, messageLevel, config) 6181{ 6182if (config.parent) 6183{ 6184const messageHashcode = this.hashCodeMessage(txt, messageLevel, config.type, config.parent); 6185if (messageHashcode) 6186{ 6187let messageContainerCssClassname; 6188if (messageLevel === HRMessageLevel.Error) 6189messageContainerCssClassname = 'formElementErrorTextHint'; 6190else if (messageLevel === HRMessageLevel.Warning) 6191messageContainerCssClassname = 'formElementWarnTextHint'; 6192else 6193messageContainerCssClassname = 'formElementInfoTextHint'; 6194let messageContainer = config.parent.getElementsByClassName(messageContainerCssClassname)[0]; 6195if (!messageContainer) 6196{ 6197messageContainer = document.createElement('span'); 6198messageContainer.className = `tooltip ${messageContainerCssClassname}`; 6199config.parent.appendChild(messageContainer); 6200} 6201const messageElement = document.createElement('span'); 6202messageElement.textContent = txt; 6203messageElement.className = `${messageLevel} data-content ${config.className ? ' ' + config.className : ''}`; 6204if (config.id) 6205messageElement.id = config.id; 6206if (config.type) 6207messageElement.dataset.messageType = config.type.trim().toLowerCase(); 6208messageElement.dataset.messageId = messageHashcode;
6209messageContainer.appendChild(messageElement); 6210this.messages.set(messageHashcode, messageElement); 6211} 6212} 6213else 6214{ 6215if (typeof(HRLogError) === 'function') 6216HRLogError(new Error('Eine Tooltip-Darstellung ohne ein parent-Element, an welches man den Text hängen kann, wird nicht unterstützt.')); 6217} 6218} 6219info(txt, config) 6220{ 6221this.#showMessage(txt, HRMessageLevel.Info, config); 6222} 6223warn(txt, config) 6224{ 6225this.#showMessage(txt, HRMessageLevel.Warning, config); 6226} 6227error(txt, config) 6228{ 6229this.#showMessage(txt, HRMessageLevel.Error, config); 6230} 6231errorAtField(field, txt, config) 6232{ 6233this.#showMessageAtField(field, txt, HRMessageLevel.Error, config); 6234} 6235warnAtField(field, txt, config) 6236{ 6237this.#showMessageAtField(field, txt, HRMessageLevel.Warning, config); 6238} 6239infoAtField(field, txt, config) 6240{ 6241this.#showMessageAtField(field, txt, HRMessageLevel.Info, config); 6242} 6243#showMessageAtField(field, txt, messageLevel, config) 6244{ 6245if (field) 6246{ 6247config = config || {}; 6248let inputEl = field; 6249if (typeof(field) === 'string') 6250{ 6251let form = document.forms.submit; 6252if (config.formName) 6253form = document.forms[formName]; 6254inputEl = form.elements[field]; 6255} 6256if (inputEl) 6257{ 6258if (inputEl.parentElement && !inputEl.parentElement.hasAttribute('data-field-frame')) 6259{ 6260this.#createFeldrahmen(field); 6261if (this.#debugMode) 6262console.warn('Für Messagehandling an Formularfeldern muss ein Feldrahmen gesetzt sein. Bitte ergänzen Sie diesen noch:', field); 6263} 6264if (messageLevel === HRMessageLevel.Error) 6265{ 6266inputEl.dataset.error = ""; 6267addCSSClass(inputEl.parentElement, 'formElementError'); 6268} 6269else if (messageLevel === HRMessageLevel.Warning) 6270{ 6271inputEl.dataset.warning = ""; 6272addCSSClass(inputEl.parentElement, 'formElementWarning'); 6273} 6274else 6275addCSSClass(inputEl.parentElement, 'formelementInfo'); 6276config.parent = inputEl.parentElement; 6277if (config.displayType && config.displayType.length > 0) 6278config.displayType = config.displayType; 6279else 6280config.displayType = this.defaultFieldDisplayType; 6281this.#showMessage(txt, messageLevel, config); 6282} 6283} 6284else 6285{ 6286if (this.#debugMode) 6287{ 6288console.error('Fehler beim Ausgeben der Nachricht: "', txt.trim(), '"'); 6289console.error('Das Feld konnte nicht gefunden werden. Prüfen Sie bitte: (a) Wird das Formularfeld angezeigt? (b) Hat es ein data-Attribut data-instance-id? (c) Wurde der korrekte Feldname angegeben?'); 6290} 6291this.#showMessageToast(txt, messageLevel, false, config); 6292} 6293} 6294#createFeldrahmen(field) 6295{ 6296if (field) 6297{ 6298const feldrahmen = document.createElement('div'); 6299feldrahmen.id = `${field.id}_Rahmen`; 6300feldrahmen.className = 'Feldrahmen'; 6301feldrahmen.dataset.fieldFrame = ''; 6302HRWrap(field, feldrahmen); 6303let beforeInput = true; 6304Array.from(feldrahmen.parentElement.children).forEach(child => { 6305if (child.tagName === 'LABEL' && (child.htmlFor == field.id || child.htmlFor == field.name)) 6306{ 6307if (beforeInput) 6308field.before(child); 6309else 6310field.after(child); 6311} 6312else if (child === field) 6313beforeInput = false; 6314}); 6315} 6316} 6317hashCodeMessage(txt, messageLevel, type, parent) 6318{ 6319if (txt && typeof(String.prototype.hashCode) === 'function') 6320{ 6321let message = txt; 6322if (messageLevel) 6323message += messageLevel; 6324if (type) 6325message += type; 6326if (parent) 6327{ 6328if (typeof(parent) === 'string') 6329message += parent; 6330else 6331{
6332if (parent.id) 6333message += parent.id; 6334if (parent.name) 6335message += parent.name; 6336if (parent.type) 6337message += parent.type; 6338if (typeof(parent.hasAttribute) === 'function' && parent.hasAttribute('data-instance-id')) 6339message += parent.dataset.instanceId; 6340} 6341} 6342return message.hashCode(); 6343} 6344return ''; 6345} 6346#showMessageFromJSON(jsonTxt, messageLevel) 6347{ 6348if (jsonTxt) 6349{ 6350try 6351{ 6352const json = JSON.parse(jsonTxt); 6353if (json) 6354{ 6355if (!json.messageLevel || json.messageLevel === messageLevel) 6356{ 6357let parent; 6358if (json.source && json.sourceType && json.sourceType === SourceTypes.Anwendung) 6359parent = '[data-instance-id="' + json.source + '"]'; 6360const config = { 6361parent: parent, 6362type : json.type ? json.type : '' 6363}; 6364if (json.sourceType === SourceTypes.Attribut) 6365{ 6366let field = document.querySelector(`[data-instance-id="${json.source}"]`); 6367if (!field && this.#debugMode) 6368console.error(`Fehler beim Ausgeben einer Nachricht am Attribut mit dem Hashcode "${json.source}". Bitte prüfen, ob das zugehörige HTML-Eingabefeld ein data-Attribut "data-instance-id" hat.`); 6369this.#showMessageAtField(field, json.message, messageLevel, config); 6370} 6371else 6372this.#showMessage(json.message, messageLevel, config); 6373} 6374else 6375{ 6376if (typeof(HRLogError) === 'function') 6377HRLogError(new Error('Das im JSON transportiert Message-Level "' + json.messageLevel + '" stimmt nicht mit dem Level der aufgerufenen Funktion überein.')); 6378} 6379} 6380} 6381catch (e) 6382{ 6383if (typeof(HRLogError) === 'function') 6384HRLogError(e); 6385} 6386} 6387} 6388infoFromJSON(jsonTxt) 6389{ 6390this.#showMessageFromJSON(jsonTxt, HRMessageLevel.Info); 6391} 6392warnFromJSON(jsonTxt) 6393{ 6394this.#showMessageFromJSON(jsonTxt, HRMessageLevel.Warning); 6395} 6396errorFromJSON(jsonTxt) 6397{ 6398this.#showMessageFromJSON(jsonTxt, HRMessageLevel.Error); 6399} 6400setDefaultDisplayType(newDefaultDisplayType) 6401{ 6402this.defaultDisplayType = newDefaultDisplayType; 6403} 6404setDefaultFieldDisplayType(newDefaultFieldDisplayType) 6405{ 6406this.defaultFieldDisplayType = newDefaultFieldDisplayType; 6407} 6408setParentDefault(newParent) 6409{ 6410this.defaultParentElement = newParent; 6411} 6412resetToasts() 6413{ 6414if (this.#toastFactory) 6415{ 6416this.#toastFactory.closeAll(); 6417this.#toastFactory.destroy(); 6418} 6419} 6420} 6421HRMessageHandler.createDefaultHandler(); 6422function Animator(options) 6423{ 6424try 6425{ 6426this.setOptions(options); 6427var _this = this; 6428this.timerDelegate = function() 6429{ 6430_this.onTimerEvent() 6431} 6432try 6433{ 6434this.animFrameStart = null; 6435this.animFrameActive = false; 6436this.animFrameRequestID = null; 6437this.animFrameDelegate = function(timestamp) 6438{ 6439var progress; 6440if (_this.animFrameStart === null) 6441_this.animFrameStart = timestamp; 6442progress = timestamp - _this.animFrameStart; 6443{ 6444_this.animFrameStart = null; 6445_this.onTimerEvent(); 6446} 6447if (_this.animFrameActive) 6448{ 6449if (window.requestAnimationFrame != null) 6450_this.animFrameRequestID = window.requestAnimationFrame(_this.animFrameDelegate); 6451else if (window.mozRequestAnimationFrame != null) 6452_this.animFrameRequestID = window.mozRequestAnimationFrame(_this.animFrameDelegate); 6453else if (window.webkitRequestAnimationFrame != null) 6454_this.animFrameRequestID = window.webkitRequestAnimationFrame(_this.animFrameDelegate); 6455else if (window.msRequestAnimationFrame != null) 6456_this.animFrameRequestID = window.msRequestAnimationFrame(_this.animFrameDelegate); 6457} 6458} 6459} 6460catch (e) 6461{ 6462if (typeof(HRLogError) == 'function') 6463HRLogError(e); 6464} 6465this.subjects = []; 6466this.target = 0; 6467this.state = 0; 6468this.lastTime = null; 6469} 6470catch (e) 6471{ 6472if (typeof(HRLogError) == 'function') 6473HRLogError(e); 6474} 6475}; 6476Animator.prototype = 6477{ 6478setOptions : function(options) 6479{ 6480this.options = Animator.applyDefaults( 6481{ 6482interval : 20, 6483duration : 400, 6484onComplete : function() 6485{ 6486}, 6487onStep : function() 6488{ 6489}, 6490transition : Animator.tx.easeInOut 6491}, options); 6492}, 6493seekTo : function(to) 6494{ 6495this.seekFromTo(this.state, to); 6496}, 6497seekFromTo : function(from, to) 6498{ 6499this.target = Math.max(0, Math.min(1, to)); 6500this.state = Math.max(0, Math.min(1, from)); 6501this.lastTime = new Date().getTime(); 6502if (window.requestAnimationFrame == null && window.mozRequestAnimationFrame == null && window.webkitRequestAnimationFrame == null && window.msRequestAnimationFrame == null) 6503{ 6504if (!this.intervalId) 6505{ 6506this.intervalId = window.setInterval(this.timerDelegate, this.options.interval); 6507} 6508} 6509else 6510{ 6511if (!this.animFrameActive) 6512{ 6513this.animFrameActive = true; 6514if (window.requestAnimationFrame != null) 6515this.animFrameRequestID = window.requestAnimationFrame(this.animFrameDelegate); 6516else if (window.mozRequestAnimationFrame != null) 6517this.animFrameRequestID = window.mozRequestAnimationFrame(this.animFrameDelegate); 6518else if (window.webkitRequestAnimationFrame != null) 6519this.animFrameRequestID = window.webkitRequestAnimationFrame(this.animFrameDelegate); 6520else if (window.msRequestAnimationFrame != null) 6521this.animFrameRequestID = window.msRequestAnimationFrame(this.animFrameDelegate); 6522} 6523} 6524}, 6525jumpTo : function(to) 6526{ 6527this.target = this.state = Math.max(0, Math.min(1, to));
6528this.propagate(); 6529}, 6530toggle : function() 6531{ 6532this.seekTo(1 - this.target); 6533}, 6534addSubject : function(subject) 6535{ 6536this.subjects[this.subjects.length] = subject; 6537return this; 6538}, 6539clearSubjects : function() 6540{ 6541this.subjects = []; 6542}, 6543propagate : function() 6544{ 6545var value = this.options.transition(this.state); 6546for ( var i = 0; i < this.subjects.length; i++) 6547{ 6548if (this.subjects[i].setState) 6549{ 6550this.subjects[i].setState(value); 6551} 6552else 6553{ 6554this.subjects[i](value); 6555} 6556} 6557}, 6558onTimerEvent : function() 6559{ 6560var now = new Date().getTime(); 6561var timePassed = now - this.lastTime; 6562this.lastTime = now; 6563var movement = (timePassed / this.options.duration) * (this.state < this.target ? 1 : -1); 6564if (Math.abs(movement) >= Math.abs(this.state - this.target)) 6565{ 6566this.state = this.target; 6567} 6568else 6569{ 6570this.state += movement; 6571} 6572try 6573{ 6574this.propagate(); 6575} 6576finally 6577{ 6578this.options.onStep.call(this); 6579if (this.target == this.state) 6580{ 6581this.stop(); 6582} 6583} 6584}, 6585stop : function() 6586{ 6587if (window.requestAnimationFrame == null && window.mozRequestAnimationFrame == null && window.webkitRequestAnimationFrame == null && window.msRequestAnimationFrame == null) 6588{ 6589if (this.intervalId) 6590{ 6591window.clearInterval(this.intervalId); 6592this.intervalId = null; 6593this.options.onComplete.call(this); 6594} 6595} 6596else 6597{ 6598if (this.animFrameActive) 6599{ 6600this.animFrameActive = false; 6601if (this.animFrameRequestID != null) 6602{ 6603if (window.cancelAnimationFrame != null) 6604window.cancelAnimationFrame(this.animFrameRequestID); 6605else if (window.mozCancelAnimationFrame != null) 6606window.mozCancelAnimationFrame(this.animFrameRequestID); 6607} 6608this.animFrameRequestID = null; 6609this.options.onComplete.call(this); 6610} 6611} 6612}, 6613play : function() 6614{ 6615this.seekFromTo(0, 1) 6616}, 6617reverse : function() 6618{ 6619this.seekFromTo(1, 0) 6620}, 6621inspect : function() 6622{ 6623var str = "#<Animator:\n"; 6624for ( var i = 0; i < this.subjects.length; i++) 6625{ 6626str += this.subjects[i].inspect(); 6627} 6628str += ">"; 6629return str; 6630} 6631} 6632Animator.applyDefaults = function(defaults, prefs) 6633{ 6634prefs = prefs || {}; 6635var prop, result = {}; 6636for (prop in defaults) 6637result[prop] = prefs[prop] !== undefined ? prefs[prop] : defaults[prop]; 6638return result; 6639} 6640Animator.makeArrayOfElements = function(o) 6641{ 6642if (o == null) 6643return []; 6644if ("string" == typeof o) 6645{ 6646return [ document.getElementById(o) ]; 6647} 6648if (!o.length) 6649return [ o ]; 6650var result = []; 6651for ( var i = 0; i < o.length; i++) 6652{ 6653if ("string" == typeof o[i]) 6654{ 6655result[i] = document.getElementById(o[i]); 6656} 6657else 6658{ 6659result[i] = o[i]; 6660} 6661} 6662return result; 6663} 6664Animator.camelize = function(string) 6665{ 6666var oStringList = string.split('-'); 6667if (oStringList.length == 1) 6668return oStringList[0]; 6669var camelizedString = string.indexOf('-') == 0 ? 6670oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) : 6671oStringList[0]; 6672for ( var i = 1, len = oStringList.length; i < len; i++) 6673{ 6674var s = oStringList[i]; 6675camelizedString += s.charAt(0).toUpperCase() + s.substring(1); 6676} 6677return camelizedString; 6678} 6679Animator.apply = function(el, style, options) 6680{ 6681if (style instanceof Array) 6682{ 6683return new Animator(options).addSubject(new CSSStyleSubject(el, style[0], style[1])); 6684} 6685return new Animator(options).addSubject(new CSSStyleSubject(el, style)); 6686} 6687Animator.makeEaseIn = function(a) 6688{ 6689return function(state) 6690{ 6691return Math.pow(state, a * 2); 6692} 6693} 6694Animator.makeEaseOut = function(a) 6695{ 6696return function(state) 6697{ 6698return 1 - Math.pow(1 - state, a * 2); 6699} 6700} 6701Animator.makeElastic = function(bounces) 6702{ 6703return function(state) 6704{ 6705state = Animator.tx.easeInOut(state); 6706return ((1 - Math.cos(state * Math.PI * bounces)) * (1 - state)) + state; 6707} 6708} 6709Animator.makeADSR = function(attackEnd, decayEnd, sustainEnd, sustainLevel) 6710{ 6711if (sustainLevel == null) 6712sustainLevel = 0.5; 6713return function(state) 6714{ 6715if (state < attackEnd) 6716{ 6717return state / attackEnd; 6718} 6719if (state < decayEnd) 6720{ 6721return 1 - ((state - attackEnd) / (decayEnd - attackEnd) * (1 - sustainLevel)); 6722} 6723if (state < sustainEnd) 6724{ 6725return sustainLevel; 6726} 6727return sustainLevel * (1 - ((state - sustainEnd) / (1 - sustainEnd))); 6728} 6729} 6730Animator.makeBounce = function(bounces) 6731{ 6732var fn = Animator.makeElastic(bounces); 6733return function(state) 6734{ 6735state = fn(state); 6736return state <= 1 ? state : 2 - state; 6737} 6738} 6739Animator.tx = 6740{ 6741easeInOut : function(pos) 6742{ 6743return ((-Math.cos(pos * Math.PI) / 2) + 0.5); 6744}, 6745linear : function(x) 6746{ 6747return x; 6748}, 6749easeInOutQuad : function(pos) 6750{ 6751if ((pos /= 0.5) < 1) 6752return 0.5 * pos * pos + 0; 6753return -0.5 * ((--pos) * (pos - 2) - 1) + 0; 6754}, 6755easeInOutCubic : function(pos) 6756{ 6757if ((pos /= 0.5) < 1) 6758return 0.5 * pos * pos * pos + 0; 6759return 0.5 * ((pos -= 2) * pos * pos + 2) + 0; 6760}, 6761easeInOutQuart : function(pos) 6762{ 6763if ((pos /= 0.5) < 1) 6764return 0.5 * pos * pos * pos * pos + 0; 6765return -0.5 * ((pos -= 2) * pos * pos * pos - 2) + 0; 6766}, 6767easeInOutQuint : function(pos) 6768{ 6769if ((pos /= 0.5) < 1) 6770return 0.5 * pos * pos * pos * pos * pos + 0; 6771return 0.5 * ((pos -= 2) * pos * pos * pos * pos + 2) + 0; 6772}, 6773easeIn : Animator.makeEaseIn(1.5), 6774easeOut : Animator.makeEaseOut(1.5), 6775strongEaseIn : Animator.makeEaseIn(2.5), 6776strongEaseOut : Animator.makeEaseOut(2.5), 6777elastic : Animator.makeElastic(1), 6778veryElastic : Animator.makeElastic(3), 6779bouncy : Animator.makeBounce(1), 6780veryBouncy : Animator.makeBounce(3) 6781} 6782function NumericalStyleSubject(els, property, from, to, units) 6783{ 6784this.els = Animator.makeArrayOfElements(els); 6785var ieVersion = getIEVersionNr(); 6786if (property == 'opacity' && window.ActiveXObject && ieVersion <= 9 && ieVersion > 0) 6787{ 6788this.property = 'filter'; 6789} 6790else 6791{ 6792this.property = Animator.camelize(property); 6793} 6794this.from = parseFloat(from); 6795this.to = parseFloat(to); 6796this.units = units != null ? units : 'px'; 6797} 6798NumericalStyleSubject.prototype = 6799{ 6800setState : function(state) 6801{
6802var style = this.getStyle(state); 6803var visibility = (this.property == 'opacity' && state == 0) ? 'hidden' : ''; 6804var j = 0; 6805for ( var i = 0; i < this.els.length; i++) 6806{ 6807try 6808{ 6809this.els[i].style[this.property] = style; 6810} 6811catch (e) 6812{ 6813if (this.property != 'fontWeight') 6814throw e; 6815} 6816if (j++ > 20) 6817return; 6818} 6819}, 6820getStyle : function(state) 6821{ 6822state = this.from + ((this.to - this.from) * state); 6823if (this.property == 'filter') 6824return "alpha(opacity=" + Math.round(state * 100) + ")"; 6825if (this.property == 'opacity') 6826return state; 6827return Math.round(state) + this.units; 6828}, 6829inspect : function() 6830{ 6831return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units 6832+ ")\n"; 6833} 6834} 6835function ColorStyleSubject(els, property, from, to) 6836{ 6837this.els = Animator.makeArrayOfElements(els); 6838this.property = Animator.camelize(property); 6839this.to = this.expandColor(to); 6840this.from = this.expandColor(from); 6841this.origFrom = from; 6842this.origTo = to; 6843} 6844ColorStyleSubject.prototype = { 6845expandColor: function(color) { 6846var hexColor, red, green, blue; 6847hexColor = ColorStyleSubject.parseColor(color); 6848if (hexColor) { 6849red = parseInt(hexColor.slice(1, 3), 16); 6850green = parseInt(hexColor.slice(3, 5), 16); 6851blue = parseInt(hexColor.slice(5, 7), 16); 6852return [red,green,blue] 6853} 6854if (window.ANIMATOR_DEBUG) { 6855alert("Invalid colour: '" + color + "'"); 6856} 6857}, 6858getValueForState: function(color, state) { 6859return Math.round(this.from[color] + ((this.to[color] - this.from[color]) * state)); 6860}, 6861setState: function(state) { 6862var color = '#' 6863+ ColorStyleSubject.toColorPart(this.getValueForState(0, state)) 6864+ ColorStyleSubject.toColorPart(this.getValueForState(1, state)) 6865+ ColorStyleSubject.toColorPart(this.getValueForState(2, state)); 6866for (var i=0; i<this.els.length; i++) { 6867this.els[i].style[this.property] = color; 6868} 6869}, 6870inspect: function() { 6871return "\t" + this.property + "(" + this.origFrom + " to " + this.origTo + ")\n"; 6872} 6873} 6874ColorStyleSubject.parseColor = function(string) 6875{ 6876var color = '#', match; 6877if (match = ColorStyleSubject.parseColor.rgbRe.exec(string)) 6878{ 6879var part; 6880for ( var i = 1; i <= 3; i++) 6881{ 6882part = Math.max(0, Math.min(255, parseInt(match[i]))); 6883color += ColorStyleSubject.toColorPart(part); 6884} 6885return color; 6886} 6887if (match = ColorStyleSubject.parseColor.hexRe.exec(string)) 6888{ 6889if (match[1].length == 3) 6890{ 6891for ( var i = 0; i < 3; i++) 6892{ 6893color += match[1].charAt(i) + match[1].charAt(i); 6894} 6895return color; 6896} 6897return '#' + match[1]; 6898} 6899return false; 6900} 6901ColorStyleSubject.toColorPart = function(number) 6902{ 6903if (number > 255) 6904number = 255; 6905var digits = number.toString(16); 6906if (number < 16) 6907return '0' + digits; 6908return digits; 6909} 6910ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i; 6911ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; 6912function DiscreteStyleSubject(els, property, from, to, threshold) 6913{ 6914this.els = Animator.makeArrayOfElements(els); 6915this.property = Animator.camelize(property); 6916this.from = from; 6917this.to = to; 6918this.threshold = threshold || 0.5; 6919} 6920DiscreteStyleSubject.prototype = 6921{ 6922setState : function(state) 6923{ 6924var j = 0; 6925for ( var i = 0; i < this.els.length; i++) 6926{ 6927this.els[i].style[this.property] = state <= this.threshold ? this.from : this.to; 6928} 6929}, 6930inspect : function() 6931{ 6932return "\t" + this.property + "(" + this.from + " to " + this.to + " @ " + this.threshold + ")\n"; 6933} 6934} 6935function NumericalPropertySubject(els, property, from, to) 6936{ 6937this.els = Animator.makeArrayOfElements(els); 6938this.property = Animator.camelize(property); 6939this.from = parseFloat(from); 6940this.to = parseFloat(to); 6941} 6942NumericalPropertySubject.prototype = 6943{ 6944setState : function(state) 6945{ 6946var j = 0; 6947state = this.from + ((this.to - this.from) * state); 6948for ( var i = 0; i < this.els.length; i++) 6949{ 6950this.els[i][this.property] = Math.round(state); 6951} 6952}, 6953inspect : function() 6954{ 6955return "\t" + this.property + "(" + this.from + " to " + this.to + ")\n"; 6956} 6957} 6958function CSSStyleSubject(els, style1, style2) 6959{ 6960els = Animator.makeArrayOfElements(els); 6961this.subjects = []; 6962if (els.length == 0) 6963return; 6964var prop, toStyle, fromStyle; 6965if (style2) 6966{ 6967fromStyle = this.parseStyle(style1, els[0]); 6968toStyle = this.parseStyle(style2, els[0]); 6969} 6970else 6971{ 6972toStyle = this.parseStyle(style1, els[0]); 6973fromStyle = 6974{}; 6975for (prop in toStyle) 6976{ 6977fromStyle[prop] = CSSStyleSubject.getStyle(els[0], prop); 6978} 6979} 6980var prop; 6981for (prop in fromStyle) 6982{ 6983if (fromStyle[prop] == toStyle[prop]) 6984{ 6985delete fromStyle[prop]; 6986delete toStyle[prop]; 6987} 6988} 6989var prop, units, match, type, from, to; 6990for (prop in fromStyle) 6991{ 6992var fromProp = String(fromStyle[prop]); 6993var toProp = String(toStyle[prop]); 6994if (toStyle[prop] == null) 6995{ 6996if (window.ANIMATOR_DEBUG) 6997alert("No to style provided for '" + prop + '"'); 6998continue; 6999} 7000if (from = ColorStyleSubject.parseColor(fromProp)) 7001{ 7002to = ColorStyleSubject.parseColor(toProp); 7003type = ColorStyleSubject; 7004} 7005else if (fromProp.match(CSSStyleSubject.numericalRe) 7006&& toProp.match(CSSStyleSubject.numericalRe)) 7007{ 7008from = parseFloat(fromProp); 7009to = parseFloat(toProp); 7010type = NumericalStyleSubject; 7011match = CSSStyleSubject.numericalRe.exec(fromProp); 7012var reResult = CSSStyleSubject.numericalRe.exec(toProp); 7013if (match[1] != null) 7014{ 7015units = match[1]; 7016} 7017else if (reResult[1] != null) 7018{ 7019units = reResult[1]; 7020} 7021else 7022{ 7023units = reResult; 7024} 7025} 7026else if ( fromProp.match(CSSStyleSubject.discreteRe) 7027&& toProp.match(CSSStyleSubject.discreteRe)) 7028{ 7029from = fromProp; 7030to = toProp; 7031type = DiscreteStyleSubject; 7032units = 0; 7033} 7034else 7035{ 7036if (window.ANIMATOR_DEBUG) 7037{ 7038alert("Unrecognised format for value of " + prop + ": '" + fromStyle[prop] + "'"); 7039} 7040continue; 7041} 7042this.subjects[this.subjects.length] = new type(els, prop, from, to, units); 7043} 7044} 7045CSSStyleSubject.prototype = 7046{ 7047parseStyle : function(style, el) 7048{ 7049var rtn = 7050{}; 7051if (style.indexOf(":") != -1) 7052{ 7053var styles = style.split(";"); 7054for ( var i = 0; i < styles.length; i++) 7055{ 7056var parts = CSSStyleSubject.ruleRe.exec(styles[i]); 7057if (parts) 7058{ 7059rtn[parts[1]] = parts[2]; 7060} 7061} 7062} 7063else 7064{ 7065var prop, value, oldClass; 7066oldClass = el.className; 7067el.className = style; 7068for ( var i = 0; i < CSSStyleSubject.cssProperties.length; i++) 7069{ 7070prop = CSSStyleSubject.cssProperties[i]; 7071value = CSSStyleSubject.getStyle(el, prop); 7072if (value != null) 7073{ 7074rtn[prop] = value; 7075} 7076} 7077el.className = oldClass; 7078} 7079return rtn; 7080}, 7081setState : function(state) 7082{ 7083for ( var i = 0; i < this.subjects.length; i++) 7084{ 7085this.subjects[i].setState(state); 7086} 7087}, 7088inspect : function() 7089{ 7090var str = ""; 7091for ( var i = 0; i < this.subjects.length; i++) 7092{ 7093str += this.subjects[i].inspect(); 7094} 7095return str; 7096} 7097} 7098CSSStyleSubject.getStyle = function(el, property) 7099{ 7100var style; 7101if (document.defaultView && document.defaultView.getComputedStyle) 7102{ 7103style = document.defaultView.getComputedStyle(el, "").getPropertyValue(property); 7104if (style) 7105{ 7106return style; 7107} 7108} 7109property = Animator.camelize(property); 7110if (el.currentStyle) 7111{ 7112style = el.currentStyle[property]; 7113} 7114return style || el.style[property] 7115} 7116CSSStyleSubject.ruleRe = /^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/; 7117CSSStyleSubject.numericalRe = /^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/; 7118CSSStyleSubject.discreteRe = /^\w+$/; 7119CSSStyleSubject.cssProperties = ['azimuth','background','background-attachment','background-color','background-image','background-position','background-repeat','border-collapse','border-color','border-spacing','border-style','border-top','border-top-color','border-right-color','border-bottom-color','border-left-color','border-top-style','border-right-style','border-bottom-style','border-left-style','border-top-width','border-right-width','border-bottom-width','border-left-width','border-width','bottom','clear','clip','color','content','cursor','direction','display','elevation','empty-cells','css-float','font','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','height','left','letter-spacing','line-height','list-style','list-style-image','list-style-position','list-style-type','margin','margin-top','margin-right','margin-bottom','margin-left','max-height','max-width','min-height','min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding','padding-top','padding-right','padding-bottom','padding-left','pause','position','right','size','table-layout','text-align','text-decoration','text-indent','text-shadow','text-transform','top','vertical-align','visibility','white-space','width','word-spacing','z-index','o
7119pacity','outline-offset','overflow-x','overflow-y']; 7120function AnimatorChain(animators, options) 7121{ 7122this.animators = animators; 7123this.setOptions(options); 7124for ( var i = 0; i < this.animators.length; i++) 7125{ 7126this.listenTo(this.animators[i]); 7127} 7128this.forwards = false; 7129this.current = 0; 7130} 7131AnimatorChain.prototype = 7132{ 7133setOptions : function(options) 7134{ 7135this.options = Animator.applyDefaults( 7136{ 7137resetOnPlay : true 7138}, options); 7139}, 7140play : function() 7141{ 7142this.forwards = true; 7143this.current = -1; 7144if (this.options.resetOnPlay) 7145{ 7146for ( var i = 0; i < this.animators.length; i++) 7147{ 7148this.animators[i].jumpTo(0); 7149} 7150} 7151this.advance(); 7152}, 7153reverse : function() 7154{ 7155this.forwards = false; 7156this.current = this.animators.length; 7157if (this.options.resetOnPlay) 7158{ 7159for ( var i = 0; i < this.animators.length; i++) 7160{ 7161this.animators[i].jumpTo(1); 7162} 7163} 7164this.advance(); 7165}, 7166toggle : function() 7167{ 7168if (this.forwards) 7169{ 7170this.seekTo(0); 7171} 7172else 7173{ 7174this.seekTo(1); 7175} 7176}, 7177listenTo : function(animator) 7178{ 7179var oldOnComplete = animator.options.onComplete; 7180var _this = this; 7181animator.options.onComplete = function() 7182{ 7183if (oldOnComplete) 7184oldOnComplete.call(animator); 7185_this.advance(); 7186} 7187}, 7188advance : function() 7189{ 7190if (this.forwards) 7191{ 7192if (this.animators[this.current + 1] == null) 7193return; 7194this.current++; 7195this.animators[this.current].play(); 7196} 7197else 7198{ 7199if (this.animators[this.current - 1] == null) 7200return; 7201this.current--; 7202this.animators[this.current].reverse(); 7203} 7204}, 7205seekTo : function(target) 7206{ 7207if (target <= 0) 7208{ 7209this.forwards = false; 7210this.animators[this.current].seekTo(0); 7211} 7212else 7213{ 7214this.forwards = true; 7215this.animators[this.current].seekTo(1); 7216} 7217} 7218} 7219function Accordion(options) 7220{ 7221this.setOptions(options); 7222var selected = this.options.initialSection, current; 7223if (this.options.rememberance) 7224{ 7225current = document.location.hash.substring(1); 7226} 7227this.rememberanceTexts = []; 7228this.ans = []; 7229var _this = this; 7230for ( var i = 0; i < this.options.sections.length; i++) 7231{ 7232var el = this.options.sections[i]; 7233var an = new Animator(this.options.animatorOptions); 7234var from = this.options.from + (this.options.shift * i); 7235var to = this.options.to + (this.options.shift * i); 7236an.addSubject(new NumericalStyleSubject(el, this.options.property, from, to, 7237this.options.units)); 7238an.jumpTo(0); 7239var activator = this.options.getActivator(el); 7240activator.index = i; 7241activator.onclick = function() 7242{ 7243_this.show(this.index) 7244}; 7245this.ans[this.ans.length] = an; 7246this.rememberanceTexts[i] = activator.innerHTML.replace(/\s/g, ""); 7247if (this.rememberanceTexts[i] === current) 7248{ 7249selected = i; 7250} 7251} 7252this.show(selected); 7253} 7254Accordion.prototype = 7255{ 7256setOptions : function(options) 7257{ 7258this.options = Object.extend( 7259{ 7260sections : null, 7261getActivator : function(el) 7262{ 7263return document.getElementById(el.getAttribute("activator")) 7264}, 7265shift : 0, 7266initialSection : 0, 7267rememberance : true, 7268animatorOptions : 7269{} 7270}, options || 7271{}); 7272}, 7273show : function(section) 7274{ 7275for ( var i = 0; i < this.ans.length; i++) 7276{ 7277this.ans[i].seekTo(i > section ? 1 : 0); 7278} 7279if (this.options.rememberance) 7280{ 7281document.location.hash = this.rememberanceTexts[section]; 7282} 7283} 7284} 7285function getIEVersionNr() 7286{ 7287var ieVersion = -1; 7288try 7289{ 7290if (typeof(HRBrowser) != 'undefined' && typeof(HRBrowser.getIEVersionsNr) == 'function') 7291return HRBrowser.getIEVersionsNr(); 7292var agentStr = navigator.userAgent.toLowerCase(); 7293var ieKennung = 'msie'; 7294var indexOfIE = agentStr.indexOf(ieKennung); 7295if (indexOfIE >= 0) 7296{ 7297agentStr = agentStr.substring(indexOfIE + ieKennung.length); 7298ieVersion = parseFloat(agentStr); 7299} 7300} 7301catch (e) 7302{} 7303return ieVersion; 7304} 7305HRNavigationControl = function(idTopUL, configuration) 7306{ 7307HRNavigationControlsInit(); 7308HRNavigationControls.push(this); 7309this.IdTopUL = idTopUL; 7310this.DesktopNavigation = null; 7311this.ActiveNavigation = null; 7312this.MobileNavigations = new Array(); 7313if (configuration) 7314{ 7315} 7316} 7317HRNavigationControl.prototype.onResize = function(neueBreite, neueHoehe) 7318{ 7319if (this.DesktopNavigation == null && this.MobileNavigations.length <= 0) 7320return; 7321this.chooseNavigation(neueBreite, neueHoehe); 7322if (this.ActiveNavigation != null) 7323return this.ActiveNavigation.onResize(neueBreite, neueHoehe); 7324} 7325HRNavigationControl.prototype.chooseNavigation = function(breite, hoehe) 7326{ 7327var neueNavigation = null; 7328for (var i = 0; i < this.MobileNavigations.length; i++) 7329{ 7330if (this.MobileNavigations[i].checkDimensions(breite, hoehe)) 7331neueNavigation = this.MobileNavigations[i]; 7332} 7333if (neueNavigation == null) 7334neueNavigation = this.DesktopNavigation; 7335if (this.ActiveNavigation != null && this.ActiveNavigation != neueNavigation) 7336this.ActiveNavigation.deactivate(); 7337if (neueNavigation != null && this.ActiveNavigation != neueNavigation) 7338neueNavigation.activate(); 7339this.ActiveNavigation = neueNavigation; 7340} 7341HRNavigationControl.prototype.addMobileNavFolderpageLink = function(linkElement, ebene) 7342{ 7343for (var i = 0; i < this.MobileNavigations.length; i++) 7344{ 7345this.MobileNavigations[i].addMobileNavFolderpageLink(linkElement, ebene); 7346} 7347} 7348HRNavigationControl.prototype.addMobileNavZurueckLinks = function(linkElement, ebene) 7349{ 7350for (var i = 0; i < this.MobileNavigations.length; i++) 7351{ 7352this.MobileNavigations[i].addMobileNavZurueckLinks(linkElement, ebene); 7353} 7354} 7355HRNavigationControl.prototype.addInitialSelectedEbene = function(linkElement, ebene) 7356{ 7357for (var i = 0; i < this.MobileNavigations.length; i++) 7358{ 7359this.MobileNavigations[i].onInitialSelectedEbene(linkElement, ebene); 7360} 7361} 7362HRNavigationControl.prototype.addMobileNavigation = function(navigation) 7363{ 7364if (navigation != null) 7365{ 7366this.MobileNavigations.push(navigation); 7367navigation.setNavigationControl(this); 7368} 7369} 7370HRNavigationControl.prototype.setDesktopNavigation = function(navigation) 7371{ 7372this.DesktopNavigation = navigation; 7373if (navigation != null) 7374{ 7375navigation.setNavigationControl(this); 7376} 7377} 7378HRNavigationControl.prototype.onEntryClicked = function(clickElement, ebene) 7379{ 7380if (this.ActiveNavigation == null) 7381return true; 7382return this.ActiveNavigation.onEntryClicked(clickElement, ebene); 7383} 7384HRNavigationControl.prototype.onTouchEnd = function(clickElement, ebene) 7385{ 7386if (this.ActiveNavigation == null) 7387return true; 7388return this.ActiveNavigation.onTouchEnd(clickElement, ebene); 7389} 7390HRNavigationControl.prototype.onZurueckClicked = function(clickElement, ebene) 7391{ 7392if (this.ActiveNavigation == null) 7393return true; 7394return this.ActiveNavigation.onZurueckClicked(clickElement, ebene); 7395} 7396HRNavigationControl.prototype.getIdTopUL = function() 7397{ 7398return this.IdTopUL 7399} 7400HRNavigationControl.prototype.unSelectEntries = function() 7401{ 7402if (this.ActiveNavigation != null) 7403this.ActiveNavigation.unSelectEntries(); 7404} 7405HRNavigationControl.prototype.resetActiveNavigation = function() 7406{ 7407this.ActiveNavigation = null; 7408} 7409HRBaseNavigation = function(minWidth, maxWidth, configuration) 7410{ 7411this.NavigationControl = null; 7412this.MobileNavFolderpageLinks = new Array(); 7413this.MobileNavZurueckLinks = new Array(); 7414this.MinWidth = 0; 7415this.MaxWidth = 999999; 7416this.MinHeight = 0; 7417this.MaxHeight = 999999; 7418this.Duration = 500; 7419this.LastClickElements = new Array(); 7420this.AdditionalCompleteFunction = null; 7421this.InitialIdentionCount = 0; 7422this.KeepInitialIdention = false;
7423this.MinEbene = -1; 7424this.MaxEbene = -1; 7425if (minWidth != null && minWidth > 0) 7426this.MinWidth = minWidth; 7427if (maxWidth != null && maxWidth > 0) 7428this.MaxWidth = maxWidth; 7429if (configuration) 7430{ 7431if (configuration.minHeight && configuration.minHeight > 0) 7432this.MinHeight = configuration.minHeight; 7433if (configuration.maxHeight && configuration.maxHeight > 0) 7434this.MaxHeight = configuration.maxHeight; 7435if (configuration.duration) 7436this.Duration = configuration.duration; 7437if (configuration.keepInitialIdention) 7438this.KeepInitialIdention = configuration.keepInitialIdention; 7439if (configuration.minEbene) 7440this.MinEbene = configuration.minEbene; 7441if (configuration.maxEbene) 7442this.MaxEbene = configuration.maxEbene; 7443} 7444} 7445HRBaseNavigation.prototype.setNavigationControl = function(naviControl) 7446{ 7447this.NavigationControl = naviControl; 7448} 7449HRBaseNavigation.prototype.addMobileNavFolderpageLink = function(linkElement, ebene) 7450{ 7451if (linkElement != null && this.checkEbene(ebene)) 7452{ 7453this.MobileNavFolderpageLinks.push(linkElement); 7454} 7455} 7456HRBaseNavigation.prototype.addMobileNavZurueckLinks = function(linkElement, ebene) 7457{ 7458if (linkElement != null && this.checkEbene(ebene)) 7459{ 7460this.MobileNavZurueckLinks.push(linkElement); 7461if (this.isActivated) 7462{ 7463if (!this.isTimeout) 7464{ 7465setTimeout(function() { HRNavigationControlsResetActiveNavigation(); HRNavigationControlsOnLoad(); }, 1000); 7466this.isTimeout = true; 7467} 7468} 7469} 7470} 7471HRBaseNavigation.prototype.activateMobileNavFolderpageLinks = function() 7472{ 7473this.isActivated = true; 7474this.isTimeout = false; 7475for (var i = 0; i < this.MobileNavFolderpageLinks.length; i++) 7476{ 7477this.MobileNavFolderpageLinks[i].style.display = 'block'; 7478} 7479} 7480HRBaseNavigation.prototype.activateMobileNavZurueckLinks = function() 7481{ 7482for (var i = 0; i < this.MobileNavZurueckLinks.length; i++) 7483{ 7484this.MobileNavZurueckLinks[i].style.display = 'block'; 7485} 7486} 7487HRBaseNavigation.prototype.deactivateMobileNavFolderpageLinks = function() 7488{ 7489for (var i = 0; i < this.MobileNavFolderpageLinks.length; i++) 7490{ 7491this.MobileNavFolderpageLinks[i].style.display = 'none'; 7492} 7493} 7494HRBaseNavigation.prototype.deactivateMobileNavZurueckLinks = function() 7495{ 7496for (var i = 0; i < this.MobileNavZurueckLinks.length; i++) 7497{ 7498this.MobileNavZurueckLinks[i].style.display = 'none'; 7499} 7500} 7501HRBaseNavigation.prototype.getMinWidth = function() 7502{ 7503return this.MinWidth; 7504} 7505HRBaseNavigation.prototype.getMaxWidth = function() 7506{ 7507return this.MaxWidth; 7508} 7509HRBaseNavigation.prototype.getMinHeight = function() 7510{ 7511return this.MinHeight; 7512} 7513HRBaseNavigation.prototype.getMaxHeight = function() 7514{ 7515return this.MaxHeight; 7516} 7517HRBaseNavigation.prototype.checkDimensions = function(breite, hoehe) 7518{ 7519if ( this.MinWidth <= breite && this.MaxWidth >= breite 7520&& this.MinHeight <= hoehe && this.MaxHeight >= hoehe) 7521{ 7522return true; 7523} 7524else 7525{ 7526return false; 7527} 7528} 7529HRBaseNavigation.prototype.activate = function() 7530{ 7531} 7532HRBaseNavigation.prototype.deactivate = function() 7533{ 7534if (this.NavigationControl != null) 7535{ 7536this.deactivateMobileNavFolderpageLinks(); 7537this.deactivateMobileNavZurueckLinks(); 7538} 7539} 7540HRBaseNavigation.prototype.onResize = function(neueBreite, neueHoehe) 7541{ 7542return true; 7543} 7544HRBaseNavigation.prototype.onEntryClicked = function(clickElement, ebene) 7545{ 7546if (!this.checkEbene(ebene)) 7547return true; 7548this.LastClickElements.push(clickElement); 7549return true; 7550} 7551HRBaseNavigation.prototype.onTouchEnd = function(clickElement, ebene) 7552{ 7553return this.onEntryClicked(clickElement, ebene); 7554} 7555HRBaseNavigation.prototype.onZurueckClicked = function(clickElement, ebene) 7556{ 7557if (!this.checkEbene(ebene)) 7558return true; 7559this.LastClickElements.pop(); 7560return true; 7561} 7562HRBaseNavigation.prototype.onInitialSelectedEbene = function(clickElement, ebene) 7563{ 7564if (!this.checkEbene(ebene)) 7565return true; 7566if (this.KeepInitialIdention) 7567{ 7568this.LastClickElements.unshift(clickElement); 7569this.InitialIdentionCount++; 7570} 7571return true; 7572} 7573HRBaseNavigation.prototype.checkEbene = function(ebene) 7574{ 7575if ((this.MinEbene == -1 || this.MinEbene <= ebene) && (this.MaxEbene == -1 || this.MaxEbene >= ebene)) 7576return true; 7577return false; 7578} 7579HRBaseNavigation.prototype.unSelectEntries = function() 7580{ 7581this.LastClickElements = new Array(); 7582this.InitialIdentionCount = 0; 7583} 7584HROffCanvasNavigation = function(minWidth, maxWidth, configuration) 7585{ 7586HRBaseNavigation.call(this, minWidth, maxWidth, configuration); 7587this.IdElementToMove = null; 7588this.ElementToMove = null; 7589this.ElementToMoveLeft = 0; 7590this.ElementToMoveLeftInitial = 0; 7591this.EigenerFolderpageLink = true; 7592if (configuration) 7593{ 7594if (configuration.idElementToMove) 7595this.IdElementToMove = configuration.idElementToMove; 7596if (configuration.keinFolderpageLink) 7597this.EigenerFolderpageLink = false;
7598} 7599if (this.IdElementToMove) 7600this.ElementToMove = document.getElementById(this.IdElementToMove); 7601if (this.ElementToMove) 7602{ 7603this.ElementToMoveLeft = getElementLeftValue(this.ElementToMove); 7604this.ElementToMoveLeftInitial = this.ElementToMoveLeft; 7605} 7606} 7607extend(HROffCanvasNavigation, HRBaseNavigation); 7608HROffCanvasNavigation.prototype.onEntryClicked = function(clickElement, ebene) 7609{ 7610if (!this.checkEbene(ebene)) 7611return true; 7612HROffCanvasNavigation.superclass.onEntryClicked.call(this, clickElement, ebene); 7613if (clickElement != null && clickElement.parentNode != null) 7614addCSSClass(clickElement.parentNode, "hr-MobileNavClicked"); 7615this.moveElement(-100); 7616return false; 7617} 7618HROffCanvasNavigation.prototype.onZurueckClicked = function(clickElement, ebene) 7619{ 7620if (!this.checkEbene(ebene)) 7621return true; 7622if (this.LastClickElements.length > 0 && this.LastClickElements[this.LastClickElements.length - 1] != null) 7623{ 7624if (this.IdElementToMove && !this.ElementToMove) 7625{ 7626this.ElementToMove = document.getElementById(this.IdElementToMove); 7627} 7628var index = this.LastClickElements.length - 1; 7629while (this.LastClickElements.length - 1 > 0 && this.ElementToMove != null && !HRIsParentElement(this.LastClickElements[this.LastClickElements.length - 1].parentNode, this.ElementToMove)) 7630{ 7631this.LastClickElements.pop(); 7632} 7633var parent = this.LastClickElements[this.LastClickElements.length - 1].parentNode; 7634if (parent != null) 7635{ 7636this.AdditionalCompleteFunction = function(){ removeCSSClass(parent, "hr-MobileNavClicked"); } 7637} 7638} 7639HROffCanvasNavigation.superclass.onZurueckClicked.call(this, clickElement, ebene); 7640this.moveElement(100); 7641return false; 7642} 7643HROffCanvasNavigation.prototype.moveElement = function(amount) 7644{ 7645if (this.IdElementToMove && !this.ElementToMove) 7646{ 7647this.ElementToMove = document.getElementById(this.IdElementToMove); 7648if (this.ElementToMove) 7649{ 7650this.ElementToMoveLeft = getStyleMeasureValue(this.ElementToMove.style.left); 7651this.ElementToMoveLeftInitial = this.ElementToMoveLeft; 7652} 7653} 7654if (this.ElementToMove) 7655{ 7656this.ElementToMove.scrollTop = 0; 7657if (this.ElementToMove.parentNode) 7658this.ElementToMove.parentNode.scrollTop = 0; 7659var _this = this; 7660var animator = new Animator({duration : this.Duration, 7661onComplete : function() { 7662_this.ElementToMoveLeft = getStyleMeasureValue(_this.ElementToMove.style.left); 7663if (_this.AdditionalCompleteFunction != null) 7664{ 7665_this.AdditionalCompleteFunction(); 7666_this.AdditionalCompleteFunction = null; 7667} 7668} 7669}); 7670animator.addSubject(new NumericalStyleSubject(this.ElementToMove, 'left', this.ElementToMoveLeft, this.ElementToMoveLeft + amount, '%')); 7671animator.play(); 7672} 7673} 7674HROffCanvasNavigation.prototype.activate = function() 7675{ 7676HROffCanvasNavigation.superclass.activate.call(this); 7677if (this.NavigationControl != null) 7678{ 7679if (this.EigenerFolderpageLink) 7680this.activateMobileNavFolderpageLinks(); 7681this.activateMobileNavZurueckLinks(); 7682} 7683if (this.KeepInitialIdention) 7684{ 7685if (this.IdElementToMove && !this.ElementToMove) 7686{ 7687this.ElementToMove = document.getElementById(this.IdElementToMove); 7688} 7689var indentionCount = 0; 7690for (var i = 0; i < this.LastClickElements.length; i++) 7691{ 7692var parentElement = this.LastClickElements[i].parentNode; 7693if (parentElement != null && (this.ElementToMove == null || HRIsParentElement(parentElement, this.ElementToMove))) 7694{ 7695addCSSClass(parentElement, "hr-MobileNavClicked"); 7696indentionCount++; 7697} 7698} 7699this.moveElement(-100 * indentionCount); 7700} 7701} 7702HROffCanvasNavigation.prototype.deactivate = function() 7703{ 7704HROffCanvasNavigation.superclass.deactivate.call(this); 7705if (this.ElementToMove) 7706{ 7707this.ElementToMove.style.left = this.ElementToMoveLeftInitial + '%'; 7708this.ElementToMoveLeft = this.ElementToMoveLeftInitial; 7709} 7710if (this.LastClickElements != null && this.LastClickElements.length > 0) 7711{ 7712for (var i = 0; i < this.LastClickElements.length; i++) 7713{ 7714var parentElement = this.LastClickElements[i].parentNode; 7715if (parentElement != null) 7716removeCSSClass(parentElement, "hr-MobileNavClicked"); 7717} 7718} 7719if (!this.KeepInitialIdention) 7720{ 7721this.LastClickElements = new Array(); 7722} 7723this.InitialIdentionCount = this.LastClickElements.length; 7724} 7725HROnClickOpenNavigation = function(minWidth, maxWidth, configuration) 7726{ 7727HRBaseNavigation.call(this, minWidth, maxWidth, configuration); 7728this.MobileOnly = false;
7729this.HasTouchStart = false; 7730this.EigenerFolderpageLink = true; 7731if (configuration) 7732{ 7733if (configuration.mobileOnly) 7734this.MobileOnly = configuration.mobileOnly; 7735if (configuration.keinFolderpageLink) 7736this.EigenerFolderpageLink = false; 7737} 7738var _this = this; 7739this.OutOfNavigationClicked = function(eventObj) 7740{ 7741eventObj = eventObj || window.event; 7742var target = eventObj.target || eventObj.srcElement; 7743if (HRGetParentElementById(target, _this.NavigationControl.getIdTopUL()) == null) 7744{ 7745_this.unSelectEntries(); 7746} 7747}; 7748this.OnTouchStart = function(eventObj) 7749{ 7750_this.HasTouchStart = true; 7751HRRemoveEventListener(null, "touchstart", this.OnTouchStart); 7752} 7753if (this.MobileOnly) 7754{ 7755HRAddEventListener(null, "touchstart", this.OnTouchStart); 7756} 7757} 7758extend(HROnClickOpenNavigation, HRBaseNavigation); 7759HROnClickOpenNavigation.prototype.onEntryClicked = function(clickElement, ebene) 7760{ 7761if (!this.checkEbene(ebene)) 7762return true; 7763if (!this.MobileOnly || this.isMobilePlattform()) 7764{ 7765var continueEvent = false; 7766if (clickElement != null && clickElement.parentNode != null) 7767{ 7768if (clickElement.parentNode.className.indexOf("hr-MobileNavClicked") < 0) 7769{ 7770addCSSClass(clickElement.parentNode, "hr-MobileNavClicked"); 7771var parentFound = false; 7772while (this.LastClickElements.length > 0 && !parentFound) 7773{ 7774var parentElement = this.LastClickElements[this.LastClickElements.length - 1].parentNode; 7775if (parentElement != null && !HRIsParentElement(clickElement, parentElement)) 7776{ 7777removeCSSClass(parentElement, "hr-MobileNavClicked"); 7778this.LastClickElements.pop(); 7779} 7780else 7781{ 7782parentFound = true; 7783} 7784} 7785} 7786else 7787{ 7788if (!this.EigenerFolderpageLink) 7789{ 7790continueEvent = true; 7791} 7792removeCSSClass(clickElement.parentNode, "hr-MobileNavClicked"); 7793} 7794HROnClickOpenNavigation.superclass.onEntryClicked.call(this, clickElement, ebene); 7795HRAddEventListener(null, "mousedown", this.OutOfNavigationClicked); 7796HRAddEventListener(null, "touchstart", this.OutOfNavigationClicked); 7797} 7798return continueEvent; 7799} 7800return true; 7801} 7802HROnClickOpenNavigation.prototype.onTouchEnd = function(clickElement, ebene) 7803{ 7804return true; 7805} 7806HROnClickOpenNavigation.prototype.onZurueckClicked = function(clickElement, ebene) 7807{ 7808if (!this.checkEbene(ebene)) 7809return true; 7810if (!this.MobileOnly || this.isMobilePlattform()) 7811{ 7812if (this.LastClickElements.length > 0 && this.LastClickElements[this.LastClickElements.length - 1] != null) 7813{ 7814var parent = this.LastClickElements[this.LastClickElements.length - 1].parentNode; 7815if (parent != null) 7816{ 7817removeCSSClass(parent, "hr-MobileNavClicked"); 7818} 7819} 7820HROnClickOpenNavigation.superclass.onZurueckClicked.call(this, clickElement, ebene); 7821return false; 7822} 7823return true; 7824} 7825HROnClickOpenNavigation.prototype.activate = function() 7826{ 7827if (!this.MobileOnly || this.isMobilePlattform()) 7828{ 7829HROnClickOpenNavigation.superclass.activate.call(this); 7830if (this.NavigationControl != null && this.EigenerFolderpageLink) 7831{ 7832this.activateMobileNavFolderpageLinks(); 7833} 7834if (this.KeepInitialIdention) 7835{ 7836for (var i = 0; i < this.LastClickElements.length; i++) 7837{ 7838var parentElement = this.LastClickElements[i].parentNode; 7839if (parentElement != null) 7840addCSSClass(parentElement, "hr-MobileNavClicked"); 7841} 7842} 7843} 7844} 7845HROnClickOpenNavigation.prototype.deactivate = function() 7846{ 7847if (!this.MobileOnly || this.isMobilePlattform()) 7848{ 7849HROnClickOpenNavigation.superclass.deactivate.call(this); 7850this.unSelectEntries(); 7851} 7852} 7853HROnClickOpenNavigation.prototype.unSelectEntries = function() 7854{ 7855if (this.LastClickElements != null && this.LastClickElements.length > 0) 7856{ 7857for (var i = 0; i < this.LastClickElements.length; i++) 7858{ 7859var parentElement = this.LastClickElements[i].parentNode; 7860if (parentElement != null) 7861removeCSSClass(parentElement, "hr-MobileNavClicked"); 7862} 7863} 7864HROnClickOpenNavigation.superclass.unSelectEntries.call(this); 7865HRRemoveEventListener(null, "mousedown", this.OutOfNavigationClicked); 7866HRRemoveEventListener(null, "touchstart", this.OutOfNavigationClicked); 7867} 7868HROnClickOpenNavigation.prototype.isMobilePlattform = function() 7869{ 7870if (HRBrowser.isMobile() || this.HasTouchStart) 7871return true; 7872else 7873return false; 7874} 7875HRNavigationButton = function(idButton, minWidth, maxWidth, configuration) 7876{ 7877HRNavigationControlsInit(); 7878HRNavigationButtons.push(this); 7879this.Buttons = new Array(); 7880var elementAblage = null; 7881if (typeof(idButton) == 'string') 7882{ 7883elementAblage = document.getElementById(idButton); 7884if (elementAblage != null) 7885this.Buttons.push(elementAblage); 7886} 7887else if (typeof(idButton) == 'object') 7888{ 7889if (idButton instanceof Array) 7890{ 7891for (var i = 0; i < idButton.length; i++) 7892{ 7893elementAblage = document.getElementById(idButton[i]); 7894if (elementAblage != null) 7895this.Buttons.push(elementAblage); 7896} 7897} 7898else if (idButton instanceof Element) 7899{ 7900this.Buttons.push(idButton); 7901} 7902} 7903this.MinWidth = minWidth; 7904this.MaxWidth = maxWidth; 7905this.NavigationAktiv = false;
7906this.IdOverlay = null; 7907this.Overlay = null; 7908this.IdElementChangeId = null; 7909this.ElementChangeId = null; 7910this.IdToChangeTo = null; 7911this.IdElementToShow = null; 7912this.ElementToShow = null; 7913this.IdElementToSlide = null; 7914this.ElementToSlide = null; 7915this.Duration = 500; 7916this.Animator = null; 7917this.Direction = "left"; 7918this.CSSClass = ""; 7919this.Amount = 100; 7920this.AnimationType = 'fade'; 7921this.UseEventManager = typeof(HREventManager) == "object"; 7922if (configuration) 7923{ 7924if (configuration.idOverlay) 7925this.IdOverlay = configuration.idOverlay; 7926if (configuration.duration) 7927this.Duration = configuration.duration; 7928if (configuration.idElementChangeId) 7929this.IdElementChangeId = configuration.idElementChangeId; 7930if (configuration.idToChangeTo) 7931this.IdToChangeTo = configuration.idToChangeTo; 7932if (configuration.idElementToShow) 7933this.IdElementToShow = configuration.idElementToShow; 7934if (configuration.idElementToSlide) 7935{ 7936this.IdElementToSlide = configuration.idElementToSlide; 7937this.AnimationType = 'slide'; 7938} 7939if (configuration.animationType) 7940this.AnimationType = configuration.animationType; 7941if (configuration.amount) 7942this.Direction = configuration.amount; 7943if (configuration.direction) 7944this.Direction = configuration.direction; 7945if (configuration.cssClass) 7946this.CSSClass = configuration.cssClass; 7947} 7948this.readElemente(); 7949var _this = this; 7950if(this.Buttons.length > 1){ 7951let button = this.Buttons[0]; 7952let closeButton = this.Buttons[1]; 7953if (!HRCSS.isHidden(button) && _this.IdElementToShow) 7954{ 7955HRAddOnLoad(function(){ 7956HRCSS.toggleOverlay(button, document.getElementById(_this.IdElementToShow), closeButton, false, false); 7957}); 7958} 7959HRAddEventListener(closeButton, "click", function(){ 7960_this.buttonClicked(); 7961}); 7962HRAddEventListener(button, "click", function(){ 7963_this.buttonClicked(); 7964}); 7965} else { 7966let button = this.Buttons[0]; 7967if (!HRCSS.isHidden(button) && button && _this.IdElementToShow) 7968{ 7969HRAddOnLoad(function(){ 7970HRCSS.toggleOverlay(button, document.getElementById(_this.IdElementToShow), null, false, false); 7971}); 7972} 7973HRAddEventListener(button, "click", function(){ 7974_this.buttonClicked(); 7975}); 7976} 7977if (this.UseEventManager) 7978HREventManager.addListener(this.ElementToShow, "HRMenuOpen", function() {_this.deactivateNavigationNoAnimation();}, {useStandard: false, notifiedBySelf: false, notifiedByAll: true}); 7979} 7980HRNavigationButton.prototype.readElemente = function() 7981{ 7982if (this.IdOverlay && this.Overlay == null) 7983this.Overlay = document.getElementById(this.IdOverlay); 7984if (this.IdElementChangeId && this.ElementChangeId == null) 7985this.ElementChangeId = document.getElementById(this.IdElementChangeId); 7986if (this.IdElementToShow && this.ElementToShow == null) 7987this.ElementToShow = document.getElementById(this.IdElementToShow); 7988if (this.IdElementToSlide && this.ElementToSlide == null) 7989this.ElementToSlide = document.getElementById(this.IdElementToSlide); 7990} 7991HRNavigationButton.prototype.buttonClicked = function() 7992{ 7993this.readElemente(); 7994if (this.NavigationAktiv) 7995this.deactivateNavigation(); 7996else 7997this.activateNavigation(); 7998} 7999HRNavigationButton.prototype.onResize = function(neueBreite, neueHoehe) 8000{ 8001this.readElemente(); 8002if ((neueBreite < this.MinWidth || neueBreite > this.MaxWidth) && this.NavigationAktiv) 8003{ 8004const button = Array.from(this.Buttons).find(btn => !HRCSS.isHidden(btn)); 8005if (button && this.ElementToShow.classList.contains('overlay-open')) 8006button.click(); 8007else if (button.classList.contains('open')) 8008this.deactivateNavigation(); 8009} 8010} 8011HRNavigationButton.prototype.activateNavigation = function() 8012{ 8013var _this = this; 8014if (this.UseEventManager) 8015HREventManager.dispatchEvent(_this.ElementToShow, 'HRMenuOpen', {'notifySelf': false, 'bubbles': true, 'useStandard': false, 'notifyAll' : true}); 8016if (typeof(this.CSSClass) == 'string' && this.CSSClass.length > 0) 8017{ 8018for (var i = 0; i < this.Buttons.length; i++) 8019{ 8020addCSSClass(this.Buttons[i], this.CSSClass); 8021} 8022} 8023if (this.Animator == null) 8024{ 8025this.Animator = new Animator({duration : this.Duration, 8026onComplete : function() { 8027_this.NavigationAktiv = !_this.NavigationAktiv; 8028if (!_this.NavigationAktiv && _this.ElementToShow) 8029{ 8030_this.ElementToShow.style.display = null; 8031if (_this.ElementToSlide) 8032_this.ElementToShow.style.left = null; 8033else 8034_this.ElementToShow.style.opacity = null; 8035} 8036if (!_this.NavigationAktiv && _this.ElementChangeId) 8037{ 8038_this.ElementChangeId.id = _this.IdElementChangeId; 8039} 8040} 8041}); 8042if (this.ElementToShow) 8043{ 8044this.Animator.addSubject(new DiscreteStyleSubject(this.ElementToShow, 'dis
8044play', "none", "block", 0.01)); 8045if (this.AnimationType == 'slide') 8046{ 8047if (this.Direction == 'right') 8048{ 8049this.Animator.addSubject(new NumericalStyleSubject(this.ElementToShow, 'left', 100, 100 - this.Amount, '%')); 8050} 8051else 8052{ 8053this.Animator.addSubject(new NumericalStyleSubject(this.ElementToShow, 'left', -1 * this.Amount, 0, '%')); 8054} 8055} 8056else 8057this.Animator.addSubject(new NumericalStyleSubject(this.ElementToShow, 'opacity', 0, 1)); 8058} 8059if (this.Overlay) 8060{ 8061this.Animator.addSubject(new DiscreteStyleSubject(this.Overlay, 'display', "none", "block", 0.01)); 8062this.Animator.addSubject(new NumericalStyleSubject(this.Overlay, 'opacity', 0, 1)); 8063} 8064if (this.ElementToSlide) 8065{ 8066if (this.Direction == 'right') 8067{ 8068this.Animator.addSubject(new NumericalStyleSubject(this.ElementToSlide, 'left', 0, -1 * this.Amount, '%')); 8069} 8070else 8071{ 8072this.Animator.addSubject(new NumericalStyleSubject(this.ElementToSlide, 'right', -1 * this.Amount, 0, '%')); 8073} 8074} 8075} 8076if (this.ElementChangeId) 8077this.ElementChangeId.id = this.IdToChangeTo; 8078this.Animator.play(); 8079} 8080HRNavigationButton.prototype.removeButtonCSS = function() 8081{ 8082if (typeof(this.CSSClass) == 'string' && this.CSSClass.length > 0) 8083{ 8084for (var i = 0; i < this.Buttons.length; i++) 8085{ 8086removeCSSClass(this.Buttons[i], this.CSSClass); 8087} 8088} 8089} 8090HRNavigationButton.prototype.deactivateNavigation = function() 8091{ 8092this.removeButtonCSS(); 8093if (this.Animator != null) 8094this.Animator.reverse(); 8095if (this.UseEventManager) 8096HREventManager.dispatchEvent(this.ElementToShow, 'HRMenuClose', {'notifySelf': false, 'useStandard': false, 'notifyAll' : true}); 8097} 8098HRNavigationButton.prototype.deactivateNavigationNoAnimation = function() 8099{ 8100if (this.NavigationAktiv) 8101{ 8102this.removeButtonCSS(); 8103if (this.Animator != null) 8104{ 8105this.Animator.stop(); 8106this.Animator = null; 8107} 8108this.NavigationAktiv = false;
8109if (this.ElementToShow) 8110{ 8111this.ElementToShow.style.display = null; 8112if (this.ElementToSlide) 8113this.ElementToShow.style.left = null; 8114else 8115this.ElementToShow.style.opacity = null; 8116} 8117if (this.ElementChangeId) 8118{ 8119this.ElementChangeId.id = this.IdElementChangeId; 8120} 8121if (this.UseEventManager) 8122HREventManager.dispatchEvent(this.ElementToShow, 'HRMenuClose', {'notifySelf': false, 'useStandard': false, 'notifyAll' : true}); 8123} 8124} 8125var HRNavigationControls = null; 8126var HRNavigationButtons = null; 8127var HRNavigationControlsTouchMoved = false; 8128function HRNavigationControlsInit() 8129{ 8130if (HRNavigationControls == null) 8131{ 8132HRNavigationControls = new Array(); 8133if (HRNavigationButtons == null) 8134HRNavigationButtons = new Array(); 8135if (window.addEventListener) 8136{ 8137window.addEventListener("resize", HRNavigationControlsOnResize, false); 8138} 8139else if (window.attachEvent) 8140{ 8141window.attachEvent("onresize", HRNavigationControlsOnResize); 8142} 8143else 8144window.onresize = HRNavigationControlsOnResize; 8145HRAddOnLoad(HRNavigationControlsOnLoad); 8146} 8147} 8148function HRNavigationControlsOnResize() 8149{ 8150if (HRNavigationControls != null) 8151{ 8152var neueBreite = getWindowWidth(); 8153var neueHoehe = getWindowHeight(); 8154for (var i = 0; i < HRNavigationControls.length; i++) 8155HRNavigationControls[i].onResize(neueBreite, neueHoehe); 8156for (var i = 0; i < HRNavigationButtons.length; i++) 8157{ 8158if (HRNavigationButtons[i] != null && typeof HRNavigationButtons[i].onResize == 'function') 8159HRNavigationButtons[i].onResize(neueBreite, neueHoehe); 8160} 8161} 8162} 8163function HRGetNavigation(idTopUL) 8164{ 8165var navigation = null; 8166if (HRNavigationControls != null && idTopUL != null) 8167{ 8168for (var i = 0; i < HRNavigationControls.length && navigation == null; i++) 8169{ 8170if (HRNavigationControls[i].getIdTopUL() == idTopUL) 8171navigation = HRNavigationControls[i]; 8172} 8173} 8174return navigation; 8175} 8176function HRNavigationControlsOnTouchMove() 8177{ 8178HRNavigationControlsTouchMoved = true; 8179} 8180function HRNavigationControlsOnTouchEnd(event, clickElement, ebene) 8181{ 8182var continueEvent = true; 8183if (HRBrowser.isiOS() && !HRNavigationControlsTouchMoved && clickElement) 8184{ 8185var element = HRNavigationGetElement(clickElement); 8186if (HRNavigationControls != null && element != null) 8187{ 8188for (var i = 0; i < HRNavigationControls.length; i++) 8189{ 8190if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8191{ 8192if (!HRNavigationControls[i].onTouchEnd(element, ebene)) 8193continueEvent = false; 8194} 8195} 8196} 8197} 8198HRNavigationControlsTouchMoved = false; 8199return continueEvent; 8200} 8201function HRNavigationControlsOnEntryClicked(clickElement, ebene) 8202{ 8203var continueEvent = true; 8204var element = HRNavigationGetElement(clickElement); 8205if (HRNavigationControls != null && element != null) 8206{ 8207for (var i = 0; i < HRNavigationControls.length; i++) 8208{ 8209if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8210{ 8211if (!HRNavigationControls[i].onEntryClicked(element, ebene)) 8212continueEvent = false; 8213} 8214} 8215} 8216return continueEvent; 8217} 8218function HRNavigationControlsOnZurueckClicked(clickElement, ebene) 8219{ 8220var continueEvent = true; 8221var element = HRNavigationGetElement(clickElement); 8222if (HRNavigationControls != null && element != null) 8223{ 8224for (var i = 0; i < HRNavigationControls.length; i++) 8225{ 8226if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8227{ 8228if (!HRNavigationControls[i].onZurueckClicked(element, ebene)) 8229continueEvent = false; 8230} 8231} 8232} 8233return continueEvent; 8234} 8235function HRNavigationControlsAddInitialSelectedEbene(clickElement, ebene) 8236{ 8237var continueEvent = true; 8238var element = HRNavigationGetElement(clickElement); 8239if (HRNavigationControls != null && element != null) 8240{ 8241for (var i = 0; i < HRNavigationControls.length; i++) 8242{ 8243if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8244{ 8245if (!HRNavigationControls[i].addInitialSelectedEbene(element, ebene)) 8246continueEvent = false; 8247} 8248} 8249} 8250return continueEvent; 8251} 8252function HRNavigationControlsAddMobileNavFolderpageLink(linkElement, ebene) 8253{ 8254var element = HRNavigationGetElement(linkElement); 8255if (HRNavigationControls != null && element != null) 8256{ 8257for (var i = 0; i < HRNavigationControls.length; i++) 8258{ 8259if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8260HRNavigationControls[i].addMobileNavFolderpageLink(element, ebene); 8261} 8262} 8263} 8264function HRNavigationControlsAddMobileNavZurueckLinks(linkElement, ebene) 8265{ 8266var element = HRNavigationGetElement(linkElement); 8267if (HRNavigationControls != null && element != null) 8268{ 8269for (var i = 0; i < HRNavigationControls.length; i++) 8270{ 8271if (HRGetParentElementById(element, HRNavigationControls[i].getIdTopUL()) != null) 8272{ 8273HRNavigationControls[i].addMobileNavZurueckLinks(element, ebene); 8274} 8275} 8276} 8277} 8278function HRNavigationControlsOnLoad() 8279{ 8280if (HRNavigationControls != null) 8281{ 8282var breite = getWindowWidth(); 8283var hoehe = getWindowHeight(); 8284for (var i = 0; i < HRNavigationControls.length; i++) 8285{ 8286HRNavigationControls[i].chooseNavigation(breite, hoehe); 8287} 8288} 8289} 8290function HRNavigationControlsResetActiveNavigation() 8291{ 8292if (HRNavigationControls != null) 8293{ 8294for (var i = 0; i < HRNavigationControls.length; i++) 8295{ 8296HRNavigationControls[i].resetActiveNavigation(); 8297} 8298} 8299} 8300function HRNavigationGetElement(elemOrId) 8301{ 8302var element = null; 8303if (elemOrId) 8304{ 8305if (typeof elemOrId == "string") 8306{ 8307if (elemOrId.length > 0) 8308element = document.getElementById(elemOrId); 8309} 8310else 8311element = elemOrId; 8312} 8313return element; 8314} 8315<!-- 8316var EinzugTag = new Date(AktuelleZeitMillisekunden); 8317EinzugTag.setFullYear(2012); 8318EinzugTag.setMonth(0); 8319EinzugTag.setDate(1); 8320var RueckwTage = 42; 8321if (AktuelleZeitMillisekunden - EinzugTag.getTime() > ((RueckwTage-1) * 86400000)) EinzugTag = new Date(AktuelleZeitMillisekunden - RueckwTage * 86400000); 8322var LieferBTag = new Date(AktuelleZeitMillisekunden); 8323LieferBTag.setFullYear(2017); 8324LieferBTag.setMonth(0); 8325LieferBTag.setDate(1); 8326var LfristTage = 21; 8327if ((AktuelleZeitMillisekunden > LieferBTag.getTime()) || (Math.abs(AktuelleZeitMillisekunden - LieferBTag.getTime()) / 86400000 < LfristTage)) LieferBTag = new Date(AktuelleZeitMillisekunden + LfristTage * 86400000); 8328var LfristEingeschraenkt = false;
8329var FehlerTextLieferbeginn = "Der gewünschte Belieferungszeitpunkt muss mindestens drei Wochen und kann maximal 7 Monate in der Zukunft liegen."; 8330var FehlerTextEinzug = "Bitte geben Sie einen gültigen Einzugstermin an. Der Liefertermin kann dabei höchstens 6 Wochen in der Vergangenheit liegen." 8331var FehlerHTMLBelieferung = '<p>Es scheint aktuell ein technisches Problem zu geben. <br>Bitte schreiben Sie eine E-Mail an <a href="mailto:[email protected]">[email protected]</a> oder rufen Sie uns an unter 02631 - 851400.</p>'; 8332var ApplName = "neuwiedGips"; 8333var ApplMand = "Neuwied"; 8334var SWName = "Stadtwerke Neuwied GmbH"; 8335var TRGasAdressverz = "AdressverzeichnisGas2021Vertrieb"; 8336var TRStromAdressverz = "AdressverzeichnisStrom2021Vertrieb"; 8337var TRHeizstromAdressverz = "AdressverzeichnisStromHeizstrom2021Vertrieb"; 8338var TRWaermestromAdressverz = "AdressverzeichnisStromHeizstrom2021Vertrieb"; 8339var OptGebDatumPflicht = false; 8340var OptTarifsortierung = false; 8341var OptVorversorger = true; 8342var OptPostverzeichnis = true; 8343var OptCrossSelling = true; 8344var ForbiddenIban = []; 8345function selectWert(sObj) { 8346with (sObj) return options[selectedIndex].value; 8347} 8348function showPost() { 8349if (document.getElementsByName("AbweichendeAnschrift")[0].checked == true) { 8350document.getElementById("post").style.display = ""; 8351} 8352else { 8353document.getElementById("post").style.display = "none"; 8354} 8355} 8356function showLdatum() { 8357if (document.getElementById("Umzug").checked == true) { 8358document.getElementById("edatum").style.display = ""; 8359document.getElementById("ldatum").style.display = "none"; 8360} 8361else { 8362if (document.getElementById("termin_spaeter").checked == true) { 8363document.getElementById("ldatum").style.display = ""; 8364document.getElementById("edatum").style.display = "none"; 8365} 8366else { 8367document.getElementById("ldatum").style.display = "none"; 8368document.getElementById("edatum").style.display = "none"; 8369document.getElementById("LieferbeginnDatum").value = ""; 8370setzeLieferbeginndatum(); 8371} 8372} 8373} 8374function setzeLiefertermin() { 8375if (document.getElementById('Umzug').checked==false) var lieferdatum = document.Inhaltsform.LieferbeginnDatum.value; 8376else var lieferdatum = document.Inhaltsform.EinzugsDatum.value; 8377var datum = lieferdatum.split("."); 8378if (datum.length==3) { 8379var tag = datum[0]; 8380var monat = datum[1]; 8381var jahr = datum[2]; 8382} 8383else return false; 8384var EinzugTermin = new Date(AktuelleZeitMillisekunden); 8385EinzugTermin.setFullYear(jahr); 8386EinzugTermin.setMonth(monat-1); 8387EinzugTermin.setDate(tag); 8388if (tag.length < 2) tag = "0" + tag; 8389if (monat.length < 2) monat = "0" + monat; 8390var datum = tag + "." + monat + "." + jahr; 8391if (document.getElementById('Umzug').checked==false) { 8392datum_ok = istGueltigesLieferDatumIndividuell(datum); 8393if (datum_ok && (EinzugTermin.getTime() < LieferBTag.getTime())) datum_ok = false; 8394else document.Inhaltsform.LieferbeginnDatum.value=datum; 8395} 8396else { 8397datum_ok = istGueltigesEinzugsDatum(datum, RueckwTage, 31*7); 8398if (datum_ok && (EinzugTermin.getTime() < EinzugTag.getTime())) datum_ok = false; 8399else document.Inhaltsform.EinzugsDatum.value=datum; 8400} 8401if (tag!="" && monat!="" && jahr!="" && datum_ok) return true; 8402else return false; 8403} 8404function aktiviereVwzweck(aktiv) { 8405if (aktiv) { 8406document.getElementById("vwzweck").style.display = "inline"; 8407} 8408else { 8409document.getElementById("vwzweck").style.display = "none"; 8410} 8411} 8412function formBack(step) { 8413document.Inhaltsform.Seitenzahl.value=step; 8414document.Inhaltsform.Methode.value="SeiteZurueckWechseln"; 8415document.forms['Inhaltsform'].submit(); 8416} 8417function AusfuellenUnterbrechen(step) { 8418document.Inhaltsform.Seitenzahl.value=step; 8419document.Inhaltsform.Methode.value="AusfuellenUnterbrechen"; 8420document.Inhaltsform.AusfuellenUnterbrechenHTMLMail.value="J"; 8421document.Inhaltsform.AusfuellenUnterbrechenBetreff.value=""; 8422document.forms['Inhaltsform'].submit(); 8423} 8424function show2VP() { 8425if (document.getElementsByName("Anrede")[2].checked == true || document.getElementsByName("Anrede")[3].checked == true) { 8426$(".ZweiterVP").fadeIn(); 8427} 8428else { 8429$(".ZweiterVP").fadeOut() 8430} 8431} 8432function scrollTop() { 8433var ziel = "#FehlermeldungRahmen"; 8434$('html').animate({ 8435scrollTop: $(ziel).offset().top 8436}, 2000 , function (){location.hash = ziel;}) 8437} 8438function clearFehler() { 8439$("#FehlermeldungTREingabe").html(""); 8440$("#FehlermeldungTREingabe").fadeOut(); 8441} 8442function showFehler(html) { 8443console.log("fehler"); 8444$("#FehlermeldungTREingabe").html(html); 8445$("#FehlermeldungTREingabe").fadeIn(500); 8446if($(window).width() < 768){ 8447$([document.documentElement, document.body]).animate({ 8448scrollTop: $("#FehlermeldungTREingabe").offset().top - 150 8449}, 2000); 8450} 8451} 8452function checkOrt(Ort) { 8453clearFehler(); 8454$("#troverlay").show(""); 8455$("option").removeClass("selected"); 8456document.getElementById("Ort_Eingabe").options[document.getElementById("Ort_Eingabe").selectedIndex].className="selected"; 8457if($("#Ort_Eingabe").val()!="") { 8458$("#EingabeSelectGas").removeClass("eingabefehler"); 8459$("#EingabeSelectGas").addClass("eingabeok");
8460$("#Ortschluessel").val($("#Ort_Eingabe").val()); 8461$('#Ort_Heizstrom').val(Ort); 8462$('#Ort_Gas').val(Ort); 8463$('#Ort_Strom').val(Ort); 8464checkStromPLZ(); 8465$("#troverlay").hide(""); 8466} 8467else { 8468$("#EingabeSelectGas").removeClass("eingabeok"); 8469$("#EingabeSelectGas").addClass("eingabefehler"); 8470showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 8471$("#PLZOrtEingabe").val(""); 8472} 8473} 8474function setzePLZAutocomplete(){ 8475$("#PLZ_Eingabe").autocomplete( 8476{ 8477source: function(request, response) 8478{ 8479var plzTerm = request.term.substring(0,5); 8480if (!isNaN(plzTerm)) 8481{ 8482$.ajax( 8483{ 8484url: "/" + ApplName + "/Gips?SessionMandant=" + ApplMand + "&Anwendung=AdressVerzeichnis&Verzeichnis=" + TRGasAdressverz + "&QueryMode=StartsWithNoCase&AusgabeMode=PlzOrt&SuchEingabe=" + escape(plzTerm) + "&__AufrufArt__=JSON", 8485dataType: "json", 8486success: function(data) 8487{ 8488$("body").css("cursor", ""); 8489$("#PLZ_Eingabe").css("cursor", ""); 8490if (data.length == 0) 8491{ 8492$("#FehlermeldungTREingabe").show(""); 8493$("#FehlermeldungTREingabe").html(FehlerHTMLBelieferung); 8494} 8495else if (data.length == 1) 8496{ 8497clearFehler(); 8498response(data); 8499var ortschluessel = data[0].id; 8500var plzort = data[0].value; 8501var plz = plzort.substr(0, 5); 8502var ende = plzort.length - 5; 8503if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8504var ort = plzort.substr(6, ende); 8505$("#PLZ_Gas").val(plz); 8506$("#Ort_Gas").val(ort); 8507$("#Ortschluessel").val(ortschluessel); 8508setzeCrossSellingID("strom", plzort, plz); 8509$("#PLZ_Eingabe").val(data[0].value); 8510$("body").css("cursor", ""); 8511$("#PLZ_Eingabe").css("cursor", ""); 8512$("#PLZ_Eingabe").autocomplete("close"); 8513} 8514else 8515{ 8516clearFehler(); 8517response(data); 8518} 8519} 8520}); 8521} 8522else 8523{ 8524$("#EingabeCheckGas").addClass("eingabefehler"); 8525$("#EingabeCheckGas").removeClass("eingabeok"); 8526$("#troverlay").show(""); 8527$("#Ortschluessel").val(""); 8528$("#Ort_Gas").val(""); 8529clearFehler(); 8530} 8531}, 8532minLength: 2, 8533select: function(event, ui) 8534{ 8535var ortschluessel = ui.item.id; 8536var plzort = ui.item.value; 8537var plz = plzort.substr(0, 5); 8538var ende = plzort.length - 5; 8539if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8540var ort = plzort.substr(6, ende); 8541$("#Ort_Gas").val(ort); 8542$("#Ortschluessel").val(ortschluessel); 8543$("body").css("cursor", ""); 8544$("#PLZ_Eingabe").css("cursor", ""); 8545setzeCrossSellingID("strom", plzort, plz); 8546} 8547}); 8548$("#PLZ_Eingabe_Strom").autocomplete( 8549{ 8550source: function(request, response) 8551{ 8552var plzTerm = request.term.substring(0,5); 8553if (!isNaN(plzTerm)) 8554{ 8555$.ajax( 8556{ 8557url: "/" + ApplName + "/Gips?SessionMandant=" + ApplMand + "&Anwendung=AdressVerzeichnis&Verzeichnis=" + TRStromAdressverz + "&QueryMode=StartsWithNoCase&AusgabeMode=PlzOrt&SuchEingabe=" + escape(plzTerm) + "&__AufrufArt__=JSON", 8558dataType: "json", 8559success: function(data) 8560{ 8561$("body").css("cursor", ""); 8562$("#PLZ_Eingabe_Strom").css("cursor", ""); 8563if (data.length == 0) 8564{ 8565$("#FehlermeldungTREingabe").show(""); 8566$("#FehlermeldungTREingabe").html(FehlerHTMLBelieferung); 8567} 8568else if (data.length == 1) 8569{ 8570clearFehler(); 8571response(data); 8572var ortschluessel = data[0].id; 8573var plzort = data[0].value; 8574var plz = plzort.substr(0, 5); 8575var ende = plzort.length - 5; 8576if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8577var ort = plzort.substr(6, ende); 8578$("#Ort_Strom").val(ort); 8579$("#Ortschluessel_Strom").val(ortschluessel); 8580$("#Ortschluessel_Ladestrom").val(ortschluessel); 8581$("#Ortschluessel_Waermestrom").val(ortschluessel); 8582setzeCrossSellingID("gas", plzort, plz); 8583$("#PLZ_Eingabe_Strom").val(plzort); 8584$("body").css("cursor", ""); 8585$("#PLZ_Eingabe_Strom").css("cursor", ""); 8586$("#PLZ_Eingabe_Strom").autocomplete("close"); 8587} 8588else 8589{ 8590clearFehler(); 8591response(data); 8592} 8593} 8594}); 8595} 8596else 8597{ 8598$("#EingabeCheckStrom").addClass("eingabefehler"); 8599$("#EingabeCheckStrom").removeClass("eingabeok"); 8600$("#troverlay_Strom").show(""); 8601$("#Ortschluessel_Strom").val(""); 8602$("#Ort_Strom").val(""); 8603clearFehler(); 8604} 8605}, 8606minLength: 2, 8607select: function(event, ui) 8608{ 8609var ortschluessel = ui.item.id; 8610var plzort = ui.item.value; 8611var plz = plzort.substr(0, 5); 8612var ende = plzort.length - 5; 8613if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8614var ort = plzort.substr(6, ende); 8615$("#PLZ_Eingabe_Strom").delay(100).val(plz); 8616$("#Ortschluessel_Strom").val(ortschluessel); 8617$("#Ortschluessel_Ladestrom").val(ortschluessel); 8618$("#Ortschluessel_Waermestrom").val(ortschluessel); 8619$("body").css("cursor", ""); 8620$("#PLZ_Eingabe_Strom").css("cursor", ""); 8621setzeCrossSellingID("gas", plzort, plz); 8622} 8623}); 8624$("#PLZ_Eingabe_Waermestrom").autocomplete( 8625{ 8626source: function(request, response) 8627{ 8628var plzTerm = request.term.substring(0,5); 8629if (!isNaN(plzTerm)) 8630{ 8631$.ajax( 8632{ 8633url: "/" + ApplName + "/Gips?SessionMandant=" + ApplMand + "&Anwendung=AdressVerzeichnis&Verzeichnis=" + TRWaermestromAdressverz + "&QueryMode=StartsWithNoCase&AusgabeMode=PlzOrt&SuchEingabe=" + escape(plzTerm) + "&__AufrufArt__=JSON", 8634dataType: "json", 8635success: function(data) 8636{ 8637$("body").css("cursor", ""); 8638$("#PLZ_Eingabe_Waermestrom").css("cursor", ""); 8639if (data.length == 0) 8640{ 8641$("#FehlermeldungTREingabe").show(""); 8642$("#FehlermeldungTREingabe").html(FehlerHTMLBelieferung); 8643} 8644else if (data.length == 1) 8645{ 8646clearFehler(); 8647response(data); 8648var ortschluessel = data[0].id; 8649var plzort = data[0].value; 8650var plz = plzort.substr(0, 5); 8651var ende = plzort.length - 5; 8652if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8653var ort = plzort.substr(6, ende); 8654$("#PLZ_Waermestrom").val(plz); 8655$("#Ort_Waermestrom").val(ort); 8656$("#Ortschluessel_Waermestrom").val(ortschluessel); 8657$("#Ortschluessel_Strom").val(ortschluessel); 8658$("#Ortschluessel_Ladestrom").val(ortschluessel); 8659setzeCrossSellingID("gas", plzort, plz); 8660$("#PLZ_Eingabe_Waermestrom").val(plzort); 8661$("body").css("cursor", ""); 8662$("#PLZ_Eingabe_Waermestrom").css("cursor", ""); 8663$("#PLZ_Eingabe_Waermestrom").autocomplete("close"); 8664} 8665else 8666{ 8667clearFehler(); 8668response(data); 8669} 8670} 8671}); 8672} 8673else 8674{ 8675$("#EingabeCheckWaermestrom").addClass("eingabefehler"); 8676$("#EingabeCheckWaermestrom").removeClass("eingabeok");
8677$("#troverlay_Waermestrom").show(""); 8678$("#Ortschluessel_Waermestrom").val(""); 8679$("#Ort_Waermestrom").val(""); 8680clearFehler(); 8681} 8682}, 8683minLength: 2, 8684select: function(event, ui) 8685{ 8686var ortschluessel = ui.item.id; 8687var plzort = ui.item.value; 8688var plz = plzort.substr(0, 5); 8689var ende = plzort.length - 5; 8690if (plzort.indexOf(" - ") > 5) ende = plzort.indexOf(" - ") - 6; 8691var ort = plzort.substr(6, ende); 8692$("#PLZ_Eingabe_Waermestrom").delay(100).val(plz); 8693$("#PLZ_Waermestrom").val(plz); 8694$("#Ort_Waermestrom").val(ort); 8695$("#Ortschluessel_Waermestrom").val(ortschluessel); 8696$("#Ortschluessel_Strom").val(ortschluessel); 8697$("#Ortschluessel_Ladestrom").val(ortschluessel); 8698setzeCrossSellingID("gas", plzort, plz); 8699$("body").css("cursor", ""); 8700} 8701}); 8702$("#PLZ_Eingabe_Ladestrom").autocomplete({ 8703source: function(request, response) { 8704$.ajax({ 8705url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Verzeichnis="+TRStromAdressverz+"&QueryMode=StartsWithNoCase&AusgabeMode=PlzOrt&SuchEingabe="+escape(request.term)+"&__AufrufArt__=JSON", 8706dataType: "json", 8707success: function(data) { 8708$("body").css("cursor",""); 8709$("#PLZ_Eingabe_Ladestrom").css("cursor",""); 8710if(data.length==0){ 8711$("#FehlermeldungTREingabe").removeClass("hidden"); 8712$("#FehlermeldungTREingabe").html(FehlerHTMLBelieferung); 8713console.log("Keinen Ort gefunden!"); 8714} 8715else if(data.length==1){ 8716clearFehler(); 8717console.log(data.length+" Ort gefunden!"); 8718response(data); 8719var ortschluessel = data[0].id; 8720var plzort = data[0].value; 8721var plz = plzort.substr(0, 5); 8722var ende = plzort.length - 5; 8723if(plzort.indexOf(" - ")>5) ende = plzort.indexOf(" - ") - 6; 8724var ort = plzort.substr(6, ende); 8725$("#PLZ_Ladestrom").val(plz); 8726$("#Ort_Ladestrom").val(ort); 8727$("#Ortschluessel_Ladestrom").val(ortschluessel); 8728$("#Ortschluessel_Strom").val(ortschluessel); 8729$("#Ortschluessel_Waermestrom").val(ortschluessel); 8730setzeCrossSellingID("strom", plzort, plz); 8731$("#PLZ_Eingabe").val(plzort); 8732$("#PLZ_Eingabe_Ladestrom").val(plzort); 8733$("#PLZ_Eingabe_Waermestrom").val(plzort); 8734$("#PLZ_Eingabe_Strom").val(plzort); 8735$("body").css("cursor",""); 8736$("#PLZ_Eingabe_Ladestrom").css("cursor",""); 8737$("#PLZ_Eingabe_Ladestrom").autocomplete( "close" ); 8738} 8739else { 8740clearFehler(); 8741console.log(data.length+" Ort(e) gefunden!"); 8742response(data); 8743} 8744} 8745}); 8746}, 8747minLength: 2, 8748select: function(event, ui) { 8749var ortschluessel = ui.item.id; 8750var plzort = ui.item.value; 8751var plz = plzort.substr(0, 5); 8752var ende = plzort.length - 5; 8753if(plzort.indexOf(" - ")>5) ende = plzort.indexOf(" - ") - 6; 8754var ort = plzort.substr(6, ende); 8755$("#PLZ_Eingabe_Ladestrom").delay(100).val(plz); 8756$("#PLZ_Ladestrom").val(plz); 8757$("#Ort_Ladestrom").val(ort); 8758$("#Ortschluessel_Ladestrom").val(ortschluessel); 8759$("#Ortschluessel_Strom").val(ortschluessel); 8760$("#Ortschluessel_Waermestrom").val(ortschluessel); 8761setzeCrossSellingID("strom", plzort, plz); 8762$("body").css("cursor",""); 8763$("#PLZ_Eingabe_Strom").css("cursor",""); 8764$("#PLZ_Eingabe_Strom").val(plzort); 8765$("#PLZ_Eingabe").val(plzort); 8766$("#PLZ_Eingabe_Waermestrom").val(plzort); 8767$(".PLZ_Eingabe").selectedIndex = "1"; 8768checkLadestromPLZ(); 8769} 8770}); 8771} 8772function checkPLZ() { 8773var plz = $("#PLZ_Eingabe").val(); 8774if (!isNaN(plz) && plz.length==5) { 8775$.ajax({ 8776type: "GET", 8777url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis="+TRGasAdressverz+"&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 8778data: "", 8779dataType: "json", 8780beforeSend: function(){ 8781$("body").css("cursor","wait");$("#PLZ_Eingabe").css("cursor","wait"); 8782$('#Gasrechnerform .tr-submit').text('').attr('disabled',true); 8783$('#Gasrechnerform .tr-submit').append('<span class="loading-anim"><span></span><span></span><span></span><span></span></span>'); 8784}, 8785success: function(data){ 8786$("body").css("cursor",""); 8787$("#PLZ_Eingabe").css("cursor",""); 8788if(data.length==1) { 8789$("#EingabeCheckGas").removeClass("eingabefehler"); 8790$("#EingabeCheckGas").addClass("eingabeok"); 8791clearFehler(); 8792$('#Ort_Eingabe').children().remove().end().append($('<option></option>').val(data[0].schluessel).html(data[0].ort)); 8793$('#Ortschluessel').val(data[0].id); 8794$('#Ort_Gas').val(data[0].ort); 8795$("#troverlay").hide(""); 8796$('#Gasrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8797} 8798else if(data.length>1) { 8799$("#EingabeCheckGas").removeClass("eingabefehler"); 8800$("#EingabeCheckGas").addClass("eingabeok");
8801$('#Ort_Eingabe').children().remove().end().append('<option value="">Bitte Ort auswählen!</option>'); 8802$("#ortbox").fadeIn(); 8803$("#EingabeSelectGas").addClass("eingabefehler"); 8804$("#EingabeSelectGas").removeClass("eingabeok"); 8805for(var i = 0; i<data.length; i++) { 8806if($('#Ort_Gas').val()==data[i].ort) { 8807$('#Ort_Eingabe').append($('<option></option>').val(data[i].id).html(data[i].ort).attr('selected','selected')); 8808$('#Ort_Gas').val(data[i].ort); 8809$('#Ortschluessel').val(data[i].id); 8810} 8811else $('#Ort_Eingabe').append($('<option></option>').val(data[i].id).html(data[i].ort)); 8812} 8813if($('#Ort_Eingabe').selectedIndex==0) showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 8814$('#Gasrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8815} 8816else { 8817$('#Ortschluessel').val(""); 8818showFehler(FehlerHTMLBelieferung); 8819if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Gas&Versorgung=N'); 8820$('#Gasrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8821} 8822}, 8823error: function(){ 8824$("body").css("cursor",""); 8825$("#PLZ_Eingabe").css("cursor",""); 8826showFehler(FehlerHTMLBelieferung); 8827if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Gas&Versorgung=N'); 8828} 8829}); 8830} 8831else { 8832$("#EingabeCheckGas").addClass("eingabefehler"); 8833$("#EingabeCheckGas").removeClass("eingabeok"); 8834$("#troverlay").show(""); 8835$("#Ortschluessel").val(""); 8836$("#Ort_Gas").val(""); 8837clearFehler(); 8838} 8839} 8840function checkStromOrt(Ort) { 8841clearFehler(); 8842$("#troverlay_Strom").show(""); 8843$("option").removeClass("selected"); 8844document.getElementById("Ort_Eingabe_Strom").options[document.getElementById("Ort_Eingabe_Strom").selectedIndex].className="selected"; 8845if($("#Ort_Eingabe_Strom").val()!="") { 8846$("#EingabeSelectStrom").removeClass("eingabefehler"); 8847$("#EingabeSelectStrom").addClass("eingabeok"); 8848$("#Ortschluessel_Strom").val($("#Ort_Eingabe_Strom").val()); 8849$('#Ort_Heizstrom').val(Ort); 8850$('#Ort_Strom').val(Ort); 8851$('#Ort_Gas').val(Ort); 8852checkPLZ(); 8853$("#troverlay_Strom").hide(""); 8854} 8855else { 8856$("#EingabeSelectStrom").removeClass("eingabeok"); 8857$("#EingabeSelectStrom").addClass("eingabefehler"); 8858showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 8859$("#PLZOrtEingabe_Strom").val(""); 8860} 8861} 8862function checkStromPLZ() { 8863var plz = $("#PLZ_Eingabe_Strom").val(); 8864if (!isNaN(plz) && plz.length==5) { 8865$.ajax({ 8866type: "GET", 8867url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis="+TRStromAdressverz+"&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 8868data: "", 8869dataType: "json", 8870beforeSend: function(){ 8871$("body").css("cursor","wait");$("#PLZ_Eingabe_Strom").css("cursor","wait"); 8872$('#Stromrechnerform .tr-submit').text('').attr('disabled',true); 8873$('#Stromrechnerform .tr-submit').append('<span class="loading-anim"><span></span><span></span><span></span><span></span></span>'); 8874}, 8875success: function(data){ 8876$("body").css("cursor",""); 8877$("#PLZ_Eingabe_Strom").css("cursor",""); 8878if(data.length==1) { 8879$("#EingabeCheckStrom").removeClass("eingabefehler"); 8880$("#EingabeCheckStrom").addClass("eingabeok"); 8881clearFehler(); 8882$('#Ort_Eingabe_Strom').children().remove().end().append($('<option></option>').val(data[0].schluessel).html(data[0].ort)); 8883$('#Ortschluessel_Strom').val(data[0].id); 8884$('#Ort_Strom').val(data[0].ort); 8885$("#troverlay_Strom").hide(""); 8886$('#Stromrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8887} 8888else if(data.length>1) { 8889$("#EingabeCheckStrom").removeClass("eingabefehler"); 8890$("#EingabeCheckStrom").addClass("eingabeok"); 8891$('#Ort_Eingabe_Strom').children().remove().end().append('<option value="">Bitte Ort auswählen!</option>'); 8892$("#ortbox_Strom").fadeIn(); 8893$("#EingabeSelectStrom").addClass("eingabefehler"); 8894$("#EingabeSelectStrom").removeClass("eingabeok"); 8895$('#Stromrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8896for(var i = 0; i<data.length; i++) { 8897if($('#Ort_Strom').val()==data[i].ort) { 8898$('#Ort_Eingabe_Strom').append($('<option></option>').val(data[i].id).html(data[i].ort).attr('selected','selected')); 8899$('#Ort_Strom').val(data[i].ort); 8900$('#Ortschluessel_Strom').val(data[i].id); 8901} 8902else $('#Ort_Eingabe_Strom').append($('<option></option>').val(data[i].id).html(data[i].ort)); 8903} 8904if($('#Ort_Eingabe_Strom').selectedIndex==0) showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 8905} 8906else { 8907$('#Ortschluessel_Strom').val(""); 8908showFehler(FehlerHTMLBelieferung); 8909if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Strom&Versorgung=N'); 8910$('#Stromrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8911} 8912}, 8913error: function(){ 8914$("body").css("cursor",""); 8915$("#PLZ_Eingabe_Strom").css("cursor",""); 8916showFehler(FehlerHTMLBelieferung); 8917if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Strom&Versorgung=N'); 8918} 8919}
8919); 8920} 8921else { 8922$("#EingabeCheckStrom").addClass("eingabefehler"); 8923$("#EingabeCheckStrom").removeClass("eingabeok"); 8924$("#troverlay_Strom").show(""); 8925$("#Ortschluessel_Strom").val(""); 8926$("#Ort_Strom").val(""); 8927clearFehler(); 8928} 8929} 8930function checkWaermestromOrt(Ort) { 8931clearFehler(); 8932$("#troverlay_Waermestrom").show(""); 8933$("option").removeClass("selected"); 8934document.getElementById("Ort_Eingabe_Waermestrom").options[document.getElementById("Ort_Eingabe_Waermestrom").selectedIndex].className="selected"; 8935if($("#Ort_Eingabe_Waermestrom").val()!="") { 8936$("#EingabeSelectWaermestrom").removeClass("eingabefehler"); 8937$("#EingabeSelectWaermestrom").addClass("eingabeok"); 8938$("#Ortschluessel_Waermestrom").val($("#Ort_Eingabe_Waermestrom").val()); 8939$('#Ort_Waermestrom').val(Ort); 8940$('#Ort_Strom').val(Ort); 8941$('#Ort_Gas').val(Ort); 8942checkPLZ(); 8943$("#troverlay_Waermestrom").hide(""); 8944} 8945else { 8946$("#EingabeSelectWaermestrom").removeClass("eingabeok"); 8947$("#EingabeSelectWaermestrom").addClass("eingabefehler"); 8948showFehler("<p>Bitte geben Sie folgende Beispiel-Postleitzahl ein: 12345!</p>"); 8949$("#PLZOrtEingabe_Waermestrom").val(""); 8950} 8951} 8952function checkWaermestromPLZ() { 8953var plz = $("#PLZ_Eingabe_Waermestrom").val(); 8954if (!isNaN(plz) && plz.length==5) { 8955$.ajax({ 8956type: "GET", 8957url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis="+TRWaermestromAdressverz+"&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 8958data: "", 8959dataType: "json", 8960beforeSend: function(){ 8961$("body").css("cursor","wait");$("#PLZ_Eingabe_Waermestrom").css("cursor","wait"); 8962$('#waermestromrechnerform .tr-submit').text('').attr('disabled',true); 8963$('#waermestromrechnerform .tr-submit').append('<span class="loading-anim"><span></span><span></span><span></span><span></span></span>'); 8964}, 8965success: function(data){ 8966$("body").css("cursor",""); 8967$("#PLZ_Eingabe_Waermestrom").css("cursor",""); 8968if(data.length==1) { 8969$("#EingabeCheckWaermestrom").removeClass("eingabefehler"); 8970$("#EingabeCheckWaermestrom").addClass("eingabeok"); 8971clearFehler(); 8972$('#Ort_Eingabe_Waermestrom').children().remove().end().append('<option value="">Bitte Ort auswählen!</option>'); 8973$('#Ort_Eingabe_Waermestrom').append($('<option></option>').val(data[0].schluessel).html(data[0].ort).attr('selected','selected')); 8974$('#Ortschluessel_Waermestrom').val(data[0].id); 8975$('#Ort_Waermestrom').val(data[0].ort); 8976$("#troverlay_Waermestrom").hide(""); 8977$('#waermestromrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 8978} 8979else if(data.length>1) { 8980$("#EingabeCheckWaermestrom").removeClass("eingabefehler"); 8981$("#EingabeCheckWaermestrom").addClass("eingabeok"); 8982$('#Ort_Eingabe_Waermestrom').children().remove().end().append('<option value="">Bitte Ort auswählen!</option>'); 8983$("#ortbox_Waermestrom").fadeIn(); 8984$("#EingabeSelectWaermestrom").addClass("eingabefehler"); 8985$("#EingabeSelectWaermestrom").removeClass("eingabeok"); 8986for(var i = 0; i<data.length; i++) { 8987if($('#Ort_Waermestrom').val()==data[i].ort) { 8988$('#Ort_Eingabe_Waermestrom').append($('<option></option>').val(data[i].id).html(data[i].ort).attr('selected','selected')); 8989$('#Ort_Waermestrom').val(data[i].ort); 8990$('#Ortschluessel_Waermestrom').val(data[i].id); 8991} 8992else $('#Ort_Eingabe_Waermestrom').append($('<option></option>').val(data[i].id).html(data[i].ort)); 8993} 8994if($('#Ort_Eingabe_Waermestrom').selectedIndex==0) showFehler("<p>Bitte geben Sie folgende Beispiel-Postleitzahl ein: 12345!</p>"); 8995} 8996else { 8997$('#Ortschluessel_Waermestrom').val(""); 8998showFehler(FehlerHTMLBelieferung); 8999if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Waermestrom&Versorgung=N'); 9000$('#waermestromrechnerform .tr-submit').text('Preis berechnen').attr('disabled',false); 9001} 9002}, 9003error: function(){ 9004$("body").css("cursor",""); 9005$("#PLZ_Eingabe_Waermestrom").css("cursor",""); 9006showFehler(FehlerHTMLBelieferung); 9007if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Waermestrom&Versorgung=N'); 9008} 9009}); 9010} 9011else { 9012$("#EingabeCheckWaermestrom").addClass("eingabefehler"); 9013$("#EingabeCheckWaermestrom").removeClass("eingabeok");
9014$("#troverlay_Waermestrom").show(""); 9015$("#Ortschluessel_Waermestrom").val(""); 9016$("#Ort_Waermestrom").val(""); 9017clearFehler(); 9018} 9019} 9020function checkHeizstromOrt(Ort) { 9021clearFehler(); 9022$("#troverlay_Heizstrom").show(""); 9023$("option").removeClass("selected"); 9024document.getElementById("Ort_Eingabe_Heizstrom").options[document.getElementById("Ort_Eingabe_Heizstrom").selectedIndex].className="selected"; 9025if($("#Ort_Eingabe_Heizstrom").val()!="") { 9026$("#EingabeSelectHeizstrom").removeClass("eingabefehler"); 9027$("#EingabeSelectHeizstrom").addClass("eingabeok"); 9028$("#Ortschluessel_Heizstrom").val($("#Ort_Eingabe_Heizstrom").val()); 9029$('#Ort_Heizstrom').val(Ort); 9030$('#Ort_Strom').val(Ort); 9031$('#Ort_Gas').val(Ort); 9032checkPLZ(); 9033$("#troverlay_Heizstrom").hide(""); 9034} 9035else { 9036$("#EingabeSelectHeizstrom").removeClass("eingabeok"); 9037$("#EingabeSelectHeizstrom").addClass("eingabefehler"); 9038showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 9039$("#PLZOrtEingabe_Heizstrom").val(""); 9040} 9041} 9042function checkHeizstromPLZ() { 9043var plz = $("#PLZ_Eingabe_Heizstrom").val(); 9044if (!isNaN(plz) && plz.length==5) { 9045$.ajax({ 9046type: "GET", 9047url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis="+TRHeizstromAdressverz+"&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 9048data: "", 9049dataType: "json", 9050beforeSend: function(){ 9051$("body").css("cursor","wait");$("#PLZ_Eingabe_Heizstrom").css("cursor","wait"); 9052$('#heizstrompreisrechner .tr-submit').text('').attr('disabled',true); 9053$('#heizstrompreisrechner .tr-submit').append('<span class="loading-anim"><span></span><span></span><span></span><span></span></span>'); 9054}, 9055success: function(data){ 9056$("body").css("cursor",""); 9057$("#PLZ_Eingabe_Heizstrom").css("cursor",""); 9058if(data.length==1) { 9059$("#EingabeCheckHeizstrom").removeClass("eingabefehler"); 9060$("#EingabeCheckHeizstrom").addClass("eingabeok"); 9061clearFehler(); 9062$('#Ort_Eingabe_Heizstrom').children().remove().end().append($('<option></option>').val(data[0].schluessel).html(data[0].ort)); 9063$('#Ortschluessel_Heizstrom').val(data[0].id); 9064$('#Ort_Heizstrom').val(data[0].ort); 9065$("#troverlay_Heizstrom").hide(""); 9066$('#heizstrompreisrechner .tr-submit').text('Preis berechnen').attr('disabled',false); 9067} 9068else if(data.length>1) { 9069$("#EingabeCheckHeizstrom").removeClass("eingabefehler"); 9070$("#EingabeCheckHeizstrom").addClass("eingabeok"); 9071$('#Ort_Eingabe_Heizstrom').children().remove().end().append('<option value="">Bitte Ort auswählen!</option>'); 9072$("#ortbox_Heizstrom").fadeIn(); 9073$("#EingabeSelectHeizstrom").addClass("eingabefehler"); 9074$("#EingabeSelectHeizstrom").removeClass("eingabeok"); 9075$('#heizstrompreisrechner .tr-submit').text('Preis berechnen').attr('disabled',false); 9076for(var i = 0; i<data.length; i++) { 9077if($('#Ort_Heizstrom').val()==data[i].ort) { 9078$('#Ort_Eingabe_Heizstrom').append($('<option></option>').val(data[i].id).html(data[i].ort).attr('selected','selected')); 9079$('#Ort_Heizstrom').val(data[i].ort); 9080$('#Ortschluessel_Heizstrom').val(data[i].id); 9081} 9082else $('#Ort_Eingabe_Heizstrom').append($('<option></option>').val(data[i].id).html(data[i].ort)); 9083} 9084if($('#Ort_Eingabe_Heizstrom').selectedIndex==0) showFehler("<p>Bitte wählen Sie Ihren Ort aus!</p>"); 9085} 9086else { 9087$('#Ortschluessel_Heizstrom').val(""); 9088showFehler(FehlerHTMLBelieferung); 9089if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Heizstrom&Versorgung=N'); 9090$('#heizstrompreisrechner .tr-submit').text('Preis berechnen').attr('disabled',false); 9091} 9092if(OptCrossSelling) 9093{ 9094$.ajax({ 9095type: "POST", 9096url: "/"+ApplName+"/Gips?SessionMandant="+ApplMand+"&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis="+TRGasAdressverz+"&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 9097dataType: "json", 9098beforeSend: function(){$("body").css("cursor","wait");$("#PLZ_Eingabe_Heizstrom").css("cursor","wait");}, 9099success: function(data){ 9100$("body").css("cursor",""); 9101$("#PLZ_Eingabe_Heizstrom").css("cursor",""); 9102if(data.length>0) { 9103$('#CrossSellingID_Heizstrom').val(data[0].plzort); 9104if($("#PLZ_Eingabe").val()=="") { 9105$("#PLZ_Eingabe").val(plz); 9106checkPLZ(); 9107} 9108} 9109} 9110}); 9111} 9112}, 9113error: function(){ 9114$("body").css("cursor",""); 9115$("#PLZ_Eingabe_Heizstrom").css("cursor",""); 9116showFehler(FehlerHTMLBelieferung); 9117if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Heizstrom&Versorgung=N'); 9118} 9119}
9119); 9120} 9121else { 9122$("#EingabeCheckHeizstrom").addClass("eingabefehler"); 9123$("#EingabeCheckHeizstrom").removeClass("eingabeok"); 9124$("#troverlay_Heizstrom").show(""); 9125$("#Ortschluessel_Heizstrom").val(""); 9126$("#Ort_Heizstrom").val(""); 9127clearFehler(); 9128} 9129} 9130function setzeCrossSellingID(energieart, plzort, plz) 9131{ 9132if (energieart == "gas") 9133{ 9134$.ajax( 9135{ 9136type: "POST", 9137url: "/" + ApplName + "/Gips?SessionMandant=" + ApplMand + "&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis=" + TRGasAdressverz + "&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 9138dataType: "json", 9139beforeSend: function() 9140{ 9141$("body").css("cursor", "wait"); 9142$("#PLZ_Eingabe_Strom").css("cursor", "wait"); 9143}, 9144success: function(data) 9145{ 9146$("body").css("cursor", ""); 9147$("#PLZ_Eingabe_Strom").css("cursor", ""); 9148if (data.length == 1) 9149{ 9150$('#CrossSellingID_Strom').val(data[0].id); 9151$('#CrossSellingID_Ladestrom').val(data[0].id); 9152$('#CrossSellingID_Waermestrom').val(data[0].id); 9153$('#Ortschluessel').val(data[0].id); 9154} 9155else if (data.length > 1) 9156{ 9157for(var i = 0; i < data.length; i++) 9158{ 9159if(data[i].ort == plzort.split(' ')[1]) 9160{ 9161$('#CrossSellingID_Strom').val(data[i].id); 9162$('#CrossSellingID_Ladestrom').val(data[i].id); 9163$('#CrossSellingID_Waermestrom').val(data[i].id); 9164$('#Ortschluessel').val(data[i].id); 9165break; 9166} 9167} 9168} 9169} 9170}); 9171} 9172if (energieart == "strom") 9173{ 9174$.ajax( 9175{ 9176type: "POST", 9177url: "/" + ApplName + "/Gips?SessionMandant=" + ApplMand + "&Anwendung=AdressVerzeichnis&Methode=DirektSuche&Verzeichnis=" + TRStromAdressverz + "&Plz=" + plz + "&AusgabeFormat=OrtArrayJSON", 9178dataType: "json", 9179beforeSend: function() 9180{ 9181$("body").css("cursor", "wait"); 9182$("#PLZ_Eingabe").css("cursor", "wait"); 9183}, 9184success: function(data) 9185{ 9186$("body").css("cursor", ""); 9187$("#PLZ_Eingabe").css("cursor", ""); 9188if (data.length == 1) 9189{ 9190$('#CrossSellingID').val(data[0].id); 9191$('#Ortschluessel_Strom').val(data[0].id); 9192$('#Ortschluessel_Ladestrom').val(data[0].id); 9193$('#Ortschluessel_Waermestrom').val(data[0].id); 9194} 9195else if (data.length > 1) 9196{ 9197for(var i = 0; i < data.length; i++) 9198{ 9199if(data[i].ort == plzort.split(' ')[1]) 9200{ 9201$('#CrossSellingID').val(data[i].id); 9202$('#Ortschluessel_Strom').val(data[i].id); 9203$('#Ortschluessel_Ladestrom').val(data[i].id); 9204$('#Ortschluessel_Waermestrom').val(data[i].id); 9205break; 9206} 9207} 9208} 9209} 9210}); 9211} 9212} 9213function sorter(a, b) { 9214return a.getAttribute('rel') - b.getAttribute('rel'); 9215}; 9216function SendeSeite1() { 9217try 9218{ 9219$("#Fehlermeldung").empty(); 9220PLZ = $("#VST_PLZ").val(); 9221Ort = escape($("#VST_Ort").val()); 9222Strasse = escape($("#VST_Strasse").val()); 9223if (CheckSeite1(true)) { 9224if(OptPostverzeichnis==true) 9225{ 9226$.get("/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=ValidateAdresse", 9227{ Strasse: Strasse, Ort: Ort, PLZ: PLZ, URLEncoding : "Escaped" }, 9228function(data){ 9229if (data == "J") { 9230document.forms['Inhaltsform'].submit(); 9231} 9232else { 9233$("#VST_Strasse").parent().removeClass("ok"); 9234$("#VST_Strasse").parent().addClass("error"); 9235$("#Fehlermeldung").html("<p class=\"error\">Ihre eingebene Lieferanschrift ist nicht korrekt. Bitte überprüfen Sie Ihre Eingabe.</p>"); 9236$("#FehlermeldungRahmen").show(); 9237} 9238}); 9239} 9240else document.forms['Inhaltsform'].submit(); 9241} 9242scrollTop(); 9243return false; 9244} 9245catch (e) 9246{ 9247logError(e); 9248} 9249return false; 9250} 9251function CheckSeite1(submit) { 9252var Kundenart = $("#TRKundenart").val(); 9253if (Kundenart=="Privatkunde") { 9254if(!OptGebDatumPflicht) var PflichtfelderNamen = new Array("Anrede","Vorname","Name","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 9255else var PflichtfelderNamen = new Array("Anrede","Vorname","Name","Geburtsdatum","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 9256} 9257else 9258var PflichtfelderNamen = new Array("Name","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 9259var Feldfehler = new Array(); 9260var RahmenId; 9261var SeiteOK = true; 9262Feldfehler = PflichtfelderFehler(PflichtfelderNamen); 9263if($("#Fehlermeldung").html().replace(/\s+/g, '')!="") submit=true; 9264else { 9265$("#Fehlermeldung").empty(); 9266for (var j = 0; j < PflichtfelderNamen.length; j++) { 9267RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 9268$(RahmenId).removeClass("error"); 9269$(RahmenId).addClass("ok"); 9270} 9271} 9272if (Feldfehler.length > 0) { 9273$("#Fehlermeldung").append("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 9274for (var i = 0; i < Feldfehler.length; i++) { 9275RahmenId = "#"+Feldfehler[i]+"_Rahmen"; 9276$(RahmenId).addClass("error"); 9277$(RahmenId).removeClass("ok"); 9278} 9279SeiteOK = false;
9280} 9281if (Kundenart=="Privatkunde") { 9282if ($("#anrede1").is(':not(:checked)') && $("#anrede2").is(':not(:checked)') && $("#anrede3").is(':not(:checked)') && $("#anrede4").is(':not(:checked)') ) { 9283$("#Fehlermeldung").append("<p class=\"error\">Bitte wählen Sie eine Anrede aus.</p>"); 9284RahmenId = "#Anrede_Rahmen"; 9285$(RahmenId).addClass("error"); 9286$(RahmenId).removeClass("ok"); 9287SeiteOK = false; 9288} 9289} 9290else { 9291if ($("#anrede1").is(':not(:checked)') && $("#anrede2").is(':not(:checked)') && $("#anrede3").is(':not(:checked)')) { 9292$("#Fehlermeldung").append("<p class=\"error\">Bitte wählen Sie eine Anrede aus.</p>"); 9293RahmenId = "#Anrede_Rahmen"; 9294$(RahmenId).addClass("error"); 9295$(RahmenId).removeClass("ok"); 9296SeiteOK = false; 9297} 9298} 9299if (!istGueltigeEmail($("#E-Mail").val())) { 9300$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie eine gültige E-Mail Adresse an.</p>"); 9301RahmenId = "#E-Mail_Rahmen"; 9302$(RahmenId).addClass("error"); 9303$(RahmenId).removeClass("ok"); 9304SeiteOK = false; 9305} 9306if (Kundenart=="Privatkunde") { 9307if (!istGueltigesDatum($("#Geburtsdatum").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 9308$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie ein gültiges Geburtsdatum im Format TT.MM.JJJJ an.</p>"); 9309RahmenId = "#Geburtsdatum_Rahmen"; 9310$(RahmenId).addClass("error"); 9311$(RahmenId).removeClass("ok"); 9312SeiteOK = false; 9313} 9314else if (!istGueltigesGebDatum($("#Geburtsdatum").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 9315$("#Fehlermeldung").append("<p class=\"error\">Bei Vertragsabschluss müssen Sie mindestens 18 Jahre alt sein.</p>"); 9316RahmenId = "#Geburtsdatum_Rahmen"; 9317$(RahmenId).addClass("error"); 9318$(RahmenId).removeClass("ok"); 9319SeiteOK = false; 9320} 9321} 9322if ($("#VST_HausNr").val() == "" && $("#VST_Strasse").val()!="") { 9323$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihre die Hausnummer Ihrer Lieferanschrift an.</p>"); 9324RahmenId = "#VST_Strasse_Rahmen"; 9325$(RahmenId).addClass("error"); 9326$(RahmenId).removeClass("ok"); 9327SeiteOK = false; 9328} 9329var PflichtfelderNamen2 = new Array("PLZ","Ort","Strasse","HausNr"); 9330var Feldfehler2 = new Array(); 9331Feldfehler2 = PflichtfelderFehler(PflichtfelderNamen2); 9332if ($("#AbweichendeAnschrift").is(":checked")) { 9333for (var j = 0; j < PflichtfelderNamen2.length; j++) { 9334RahmenId = "#"+PflichtfelderNamen2[j]+"_Rahmen"; 9335$(RahmenId).removeClass("error"); 9336$(RahmenId).addClass("ok"); 9337} 9338if (Feldfehler2.length > 0) { 9339$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihre Rechnungsanschrift vollständig an.</p>"); 9340for (var i = 0; i < Feldfehler2.length; i++) { 9341RahmenId = "#"+Feldfehler2[i]+"_Rahmen"; 9342$(RahmenId).addClass("error"); 9343$(RahmenId).removeClass("ok"); 9344} 9345SeiteOK = false; 9346} 9347if ($("#Ort").val() == "" && $("#PLZ").val()!="") { 9348RahmenId = "#PLZ_Rahmen"; 9349$(RahmenId).addClass("error"); 9350$(RahmenId).removeClass("ok"); 9351SeiteOK = false; 9352} 9353if ($("#HausNr").val() == "" && $("#Strasse").val()!="") { 9354RahmenId = "#Strasse_Rahmen"; 9355$(RahmenId).addClass("error"); 9356$(RahmenId).removeClass("ok"); 9357SeiteOK = false; 9358} 9359} 9360else { 9361for (var j = 0; j < PflichtfelderNamen2.length; j++) { 9362RahmenId = "#"+PflichtfelderNamen2[j]+"_Rahmen"; 9363$(RahmenId).removeClass("ok"); 9364$(RahmenId).removeClass("error"); 9365} 9366$("#AbweichenderName").attr({ value: "" }); 9367$("#PLZ").attr({ value: "" }); 9368$("#Ort").attr({ value: "" }); 9369$("#Strasse").attr({ value: "" }); 9370$("#HausNr").attr({ value: "" }); 9371$("#HausNrZusatz").attr({ value: "" }); 9372} 9373if($("input[name='Anrede']").length > 2 && Kundenart=="Privatkunde") { 9374if(!OptGebDatumPflicht) var PflichtfelderNamen3 = new Array("Vertragspartner2_Vorname"); 9375else var PflichtfelderNamen3 = new Array("Vertragspartner2_Vorname","Vertragspartner2_Geburtsdatum"); 9376var Feldfehler3 = new Array(); 9377Feldfehler3 = PflichtfelderFehler(PflichtfelderNamen3); 9378if (document.getElementsByName("Anrede")[2].checked == true || document.getElementsByName("Anrede")[3].checked == true) { 9379for (var j = 0; j < PflichtfelderNamen3.length; j++) { 9380RahmenId = "#"+PflichtfelderNamen3[j]+"_Rahmen"; 9381$(RahmenId).removeClass("error"); 9382$(RahmenId).addClass("ok"); 9383} 9384if (Feldfehler3.length > 0) { 9385$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie die Daten des 2. Vertragspartners an.</p>"); 9386for (var i = 0; i < Feldfehler3.length; i++) { 9387RahmenId = "#"+Feldfehler3[i]+"_Rahmen"; 9388$(RahmenId).addClass("error"); 9389$(RahmenId).removeClass("ok"); 9390} 9391SeiteOK = false;
9392} 9393if (!istGueltigesDatum($("#Geburtsdatum2").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 9394$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie für den 2. Vertragspartner ein gültiges Geburtsdatum im Format TT.MM.JJJJ an.</p>"); 9395RahmenId = "#Vertragspartner2_Geburtsdatum_Rahmen"; 9396$(RahmenId).addClass("error"); 9397$(RahmenId).removeClass("ok"); 9398SeiteOK = false; 9399} 9400else if (!istGueltigesGebDatum($("#Geburtsdatum2").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 9401$("#Fehlermeldung").append("<p class=\"error\">Bei Vertragsabschluss müssen alle Vertragspartner zwischen 18 und 120 Jahre alt sein.</p>"); 9402RahmenId = "#Vertragspartner2_Geburtsdatum_Rahmen"; 9403$(RahmenId).addClass("error"); 9404$(RahmenId).removeClass("ok"); 9405SeiteOK = false; 9406} 9407} 9408else { 9409for (var j = 0; j < PflichtfelderNamen3.length; j++) { 9410RahmenId = "#"+PflichtfelderNamen3[j]+"_Rahmen"; 9411$(RahmenId).removeClass("ok"); 9412$(RahmenId).removeClass("error"); 9413} 9414$("#Vertragspartner2_Vorname").attr({ value: "" }); 9415$("#Vertragspartner2_Name").attr({ value: "" }); 9416$("#Vertragspartner2_Geburtsdatum").attr({ value: "" }); 9417} 9418} 9419$("div[class='Feldrahmen'] > input[value!='']:text").parent().addClass("ok"); 9420if(!submit) $("#Fehlermeldung").empty(); 9421if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 9422else $("#FehlermeldungRahmen").show(); 9423return SeiteOK; 9424} 9425function SendeSeite2() { 9426try 9427{ 9428$("#Fehlermeldung").empty(); 9429if (CheckSeite2(true)) { 9430document.forms['Inhaltsform'].submit(); 9431} 9432scrollTop(); 9433return false; 9434} 9435catch (e) 9436{ 9437HRLogError(e); 9438} 9439return false; 9440} 9441function CheckSeite2(submit) { 9442var PflichtfelderNamen = new Array("Lieferbeginn","Jahresverbrauch"); 9443var Feldfehler = new Array(); 9444var RahmenId; 9445var SeiteOK = true; 9446Feldfehler = PflichtfelderFehler(PflichtfelderNamen); 9447if($("#Fehlermeldung").html().replace(/\s+/g, '')!="") submit=true; 9448else { 9449$("#Fehlermeldung").empty(); 9450for (var j = 0; j < PflichtfelderNamen.length; j++) { 9451RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 9452$(RahmenId).removeClass("error"); 9453$(RahmenId).addClass("ok"); 9454} 9455} 9456if (Feldfehler.length > 0) { 9457$("#Fehlermeldung").append("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 9458for (var i = 0; i < Feldfehler.length; i++) { 9459RahmenId = "#"+Feldfehler[i]+"_Rahmen"; 9460$(RahmenId).addClass("error"); 9461$(RahmenId).removeClass("ok"); 9462} 9463SeiteOK = false; 9464} 9465if($("#Zaehlernr").val()!="" || $("#Zaehlpunkt").val()!="") { 9466$("#Zaehlernummer_Rahmen").removeClass("error"); 9467$("#Zaehlpunkt_Rahmen").removeClass("error"); 9468} 9469else { 9470$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie entweder die Zählernummer oder alternativ die Zählpunktbezeichnung an.</p>"); 9471RahmenId = "#Zaehlernummer_Rahmen"; 9472$(RahmenId).addClass("error"); 9473$(RahmenId).removeClass("ok"); 9474RahmenId = "#Zaehlpunkt_Rahmen"; 9475$(RahmenId).addClass("error"); 9476$(RahmenId).removeClass("ok"); 9477SeiteOK = false; 9478} 9479zaehlpunktfehler = checkZaehlpunkt('Zaehlpunkt', 'TRPLZ', ''); 9480if ($("#Zaehlpunkt").val()!="" && zaehlpunktfehler!="") { 9481$("#Fehlermeldung").append("<p class=\"error\">"+zaehlpunktfehler+"</p>"); 9482RahmenId = "#Zaehlpunkt_Rahmen"; 9483$(RahmenId).addClass("error"); 9484$(RahmenId).removeClass("ok"); 9485SeiteOK = false; 9486} 9487else if ($("#Zaehlpunkt").val()!="") { 9488RahmenId = "#Zaehlpunkt_Rahmen"; 9489$(RahmenId).addClass("ok"); 9490$(RahmenId).removeClass("error"); 9491} 9492if ($("#Zaehlernr").val()!="") { 9493RahmenId = "#Zaehlernummer_Rahmen"; 9494$(RahmenId).addClass("ok"); 9495$(RahmenId).removeClass("error"); 9496} 9497if ($("#Vertragswechsel").is(':checked') || $("#Versorgerwechsel").is(':checked') || $("#Umzug").is(':checked')) $("#Lieferauftrag_Rahmen").removeClass("error"); 9498else { 9499$("#Lieferauftrag_Rahmen").addClass("error"); 9500$("#Lieferauftrag_Rahmen").removeClass("ok"); 9501SeiteOK = false; 9502} 9503if ($("#Vertragswechsel").is(':checked') && $("#termin_spaeter").is(':checked') && !setzeLiefertermin()) { 9504$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie einen gültigen Liefertermin an. Die Belieferung kann frühestens zum 1. des nächsten Monats beginnen.</p>"); 9505RahmenId = "#LieferbeginnDatum_Rahmen"; 9506$(RahmenId).addClass("error"); 9507$(RahmenId).removeClass("ok"); 9508SeiteOK = false;
9509} 9510else if ($("#Versorgerwechsel").is(':checked') && $("#termin_spaeter").is(':checked') && !setzeLiefertermin()) { 9511$("#Fehlermeldung").append("<p class=\"error\">"+FehlerTextLieferbeginn+"</p>"); 9512RahmenId = "#LieferbeginnDatum_Rahmen"; 9513$(RahmenId).addClass("error"); 9514$(RahmenId).removeClass("ok"); 9515SeiteOK = false; 9516} 9517else if ($("#Umzug").is(':checked') && !setzeLiefertermin()) { 9518$("#Fehlermeldung").append("<p class=\"error\">"+FehlerTextEinzug+"</p>"); 9519RahmenId = "#EinzugsDatum_Rahmen"; 9520$(RahmenId).addClass("error"); 9521$(RahmenId).removeClass("ok"); 9522SeiteOK = false; 9523} 9524else { 9525RahmenId = "#LieferbeginnDatum_Rahmen"; 9526$(RahmenId).removeClass("error"); 9527$(RahmenId).addClass("ok"); 9528RahmenId = "#EinzugsDatum_Rahmen"; 9529$(RahmenId).removeClass("error"); 9530$(RahmenId).addClass("ok"); 9531} 9532if($("#Vollmacht").is(":checked") || $("#Vertragswechsel").is(':checked')) $("#Vollmacht_Rahmen").removeClass("error"); 9533else { 9534$("#Fehlermeldung").append("<p class=\"error\">Bitte erteilen Sie die Vollmacht.</p>"); 9535$("#Vollmacht_Rahmen").addClass("error"); 9536$(RahmenId).removeClass("ok"); 9537$(RahmenId).removeClass("ok"); 9538SeiteOK = false; 9539} 9540var PflichtfelderNamen2 = new Array("BisherigerLieferant","BisherigeKundenNr"); 9541var Feldfehler2 = new Array(); 9542Feldfehler2 = PflichtfelderFehler(PflichtfelderNamen2); 9543for (var j = 0; j < PflichtfelderNamen2.length; j++) { 9544RahmenId = "#"+PflichtfelderNamen2[j]+"_Rahmen"; 9545$(RahmenId).removeClass("error"); 9546$(RahmenId).addClass("ok"); 9547} 9548if ($("#Versorgerwechsel").is(':checked') || $("#Vertragswechsel").is(':checked')) { 9549if (Feldfehler2.length > 0) { 9550$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihren Vorlieferanten und Ihre bisherige Kundennummer an.</p>"); 9551for (var i = 0; i < Feldfehler2.length; i++) { 9552RahmenId = "#"+Feldfehler2[i]+"_Rahmen"; 9553$(RahmenId).addClass("error"); 9554$(RahmenId).removeClass("ok"); 9555} 9556SeiteOK = false; 9557} 9558} 9559$("div[class='Feldrahmen'] > input[value!='']:text").parent().addClass("ok"); 9560if(!submit) $("#Fehlermeldung").empty(); 9561if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 9562else $("#FehlermeldungRahmen").show(); 9563return SeiteOK; 9564} 9565function BankCheck(submit) { 9566try 9567{ 9568if($("#ZW2").is(':checked')) { 9569blz = $("#Bankleitzahl").val(); 9570kto = $("#Kontonummer").val(); 9571bankfehler = ""; 9572bankname = ""; 9573iban = ""; 9574bic = ""; 9575status = ""; 9576$.get("/vertrieb/bank/blz.php", { "Kontonummer": kto, "Bankleitzahl": blz }, 9577function(data){ 9578bankname = unescape(data.bankname); 9579iban = data.iban; 9580bic = data.bic; 9581switch(data.status){ 9582case "0": bankfehler = "Die Kontonummer ist ungültig. Sie kann von diesem Institut nicht vergeben werden."; 9583break; 9584case "1": break;
9585case "2": bankfehler = "Fehler bei der Eingabe der Bankleitzahl. Sie ist entweder nicht 8-stellig oder enthält Buchstaben."; 9586break; 9587case "3": bankfehler = "Fehler bei der Eingabe der Kontonummer. Sie ist entweder zu lang oder enthält Buchstaben."; 9588break; 9589case "4": bankfehler = "Eingabefehler bei der Kontonummer und Bankleitzahl."; 9590break; 9591case "5": bankfehler = "Eingabefehler bei der Kontonummer oder Bankleitzahl. Evtl. sind Leerzeichen enthalten."; 9592break; 9593case "6": bankfehler = "Eingabefehler bei der Kontonummer oder Bankleitzahl."; 9594break; 9595case "7": bankfehler = "Die Bankleitzahl wurde in der Datenbank nicht gefunden."; 9596break; 9597case "8": bankfehler = "Die von der Bank verwendete Prüfmethode ist im Demonstrations-Modus nicht verfügbar."; 9598break; 9599case "9": bankfehler = "Die Kontonummer kann nicht geprüft werden, da die Bank entweder keine Prüfziffern verwendet oder es sich um eine spezielle Kontonummer handelt. Bitte tragen Sie den Namen der Bank manuell ein:"; 9600break; 9601default: bankfehler = "Unbekannter Rückgabewert."; 9602break; 9603} 9604if (bankname!="") { 9605$("#Institut").val(bankname); 9606$("#Institut_Rahmen").removeClass("error"); 9607$("#Institut_Rahmen").addClass("ok"); 9608$("#BLZ_Rahmen").removeClass("error"); 9609$("#BLZ_Rahmen").addClass("ok"); 9610} 9611else { 9612$("#Institut").val(""); 9613$("#Institut_Rahmen").removeClass("ok"); 9614$("#Institut_Rahmen").addClass("error"); 9615} 9616if (iban!="") { 9617$("#IBAN").val(iban); 9618$("#IBAN_Rahmen").removeClass("error"); 9619$("#IBAN_Rahmen").addClass("ok"); 9620} 9621else { 9622$("#IBAN").val(""); 9623$("#IBAN_Rahmen").removeClass("ok"); 9624$("#IBAN_Rahmen").addClass("error"); 9625} 9626if (bic!="") { 9627$("#BIC").val(bic); 9628$("#BIC_Rahmen").removeClass("error"); 9629$("#BIC_Rahmen").addClass("ok"); 9630} 9631else { 9632$("#BIC").val(""); 9633$("#BIC_Rahmen").removeClass("ok"); 9634$("#BIC_Rahmen").addClass("error"); 9635} 9636if (data.status==4 || data.status==5 || data.status==6) { 9637$("#Kontonummer_Rahmen").addClass("error"); 9638$("#Kontonummer_Rahmen").removeClass("ok"); 9639$("#BLZ_Rahmen").addClass("error"); 9640$("#BLZ_Rahmen").removeClass("ok"); 9641$("#Institut_Rahmen").removeClass("error"); 9642$("#Institut_Rahmen").removeClass("ok"); 9643$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9644} 9645else if (data.status==0 || data.status==3) { 9646$("#Kontonummer_Rahmen").addClass("error"); 9647$("#Kontonummer_Rahmen").removeClass("ok"); 9648if(blz!="") { 9649$("#BLZ_Rahmen").removeClass("error"); 9650$("#BLZ_Rahmen").addClass("ok"); 9651$("#Institut_Rahmen").removeClass("error"); 9652$("#Institut_Rahmen").addClass("ok"); 9653} 9654else { 9655$("#BLZ_Rahmen").removeClass("ok"); 9656$("#BLZ_Rahmen").addClass("error"); 9657$("#Institut_Rahmen").removeClass("ok"); 9658$("#Institut_Rahmen").addClass("error"); 9659} 9660$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9661} 9662else if (data.status==2 || data.status==7 || data.status==8) { 9663$("#BLZ_Rahmen").addClass("error"); 9664$("#BLZ_Rahmen").removeClass("ok"); 9665if(kto!="") { 9666$("#Kontonummer_Rahmen").removeClass("error"); 9667$("#Kontonummer_Rahmen").addClass("ok"); 9668} 9669else { 9670$("#Kontonummer_Rahmen").removeClass("ok"); 9671$("#Kontonummer_Rahmen").addClass("error"); 9672} 9673$("#Institut_Rahmen").removeClass("error"); 9674$("#Institut_Rahmen").removeClass("ok"); 9675$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9676} 9677else { 9678$("#FehlermeldungRahmen").hide(); 9679$("#Kontonummer_Rahmen").removeClass("error"); 9680$("#Kontonummer_Rahmen").addClass("ok"); 9681$("#BLZ_Rahmen").removeClass("error"); 9682$("#BLZ_Rahmen").addClass("ok"); 9683} 9684fehlermeldung = false; 9685if($("#Einzug").is(':checked')) { 9686$("#Einzugsermaechtigung_Rahmen").removeClass("error"); 9687$("#Einzugsermaechtigung_Rahmen").addClass("ok"); 9688} 9689else { 9690$("#Einzugsermaechtigung_Rahmen").removeClass("ok"); 9691$("#Einzugsermaechtigung_Rahmen").addClass("error"); 9692fehlermeldung = true; 9693} 9694if($("#Kontoinhaber").val()!="") { 9695$("#Kontoinhaber_Rahmen").removeClass("error"); 9696$("#Kontoinhaber_Rahmen").addClass("ok"); 9697} 9698else { 9699$("#Kontoinhaber_Rahmen").removeClass("ok"); 9700$("#Kontoinhaber_Rahmen").addClass("error"); 9701fehlermeldung = true; 9702} 9703if (submit && fehlermeldung) $("#Fehlermeldung").prepend("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 9704else if (!submit) $("#Fehlermeldung").empty(); 9705if (submit && $("#Fehlermeldung").html().replace(/\s+/g, '')!="") $("#FehlermeldungRahmen").show(); 9706else $("#FehlermeldungRahmen").hide(); 9707if ((data.status==1 || data.status==9) && fehlermeldung==false) { 9708$("#FehlermeldungRahmen").hide(); 9709$("#Kontonummer_Rahmen").removeClass("error"); 9710$("#Kontonummer_Rahmen").addClass("ok");
9711$("#BLZ_Rahmen").removeClass("error"); 9712$("#BLZ_Rahmen").addClass("ok"); 9713if (submit) document.forms["Inhaltsform"].submit(); 9714} 9715else scrollTop(); 9716return false; 9717}, "json"); 9718return false; 9719} 9720else { 9721return true; 9722} 9723} 9724catch (e) 9725{ 9726logError(e); 9727} 9728return false; 9729} 9730function BankIBANCheck(submit) { 9731try 9732{ 9733iban = $("#IBAN").val(); 9734bic = $("#BIC").val(); 9735if($("#ZW2").is(':checked')) { 9736bankfehler = ""; 9737bankname = ""; 9738status = ""; 9739$.get("/vertrieb/bank/blz.php", { "IBAN": iban, "BIC": bic }, 9740function(data){ 9741bankname = unescape(data.bankname); 9742kontonummer = unescape(data.kontonummer); 9743blz = unescape(data.blz); 9744switch(data.status){ 9745case "0": bankfehler = "Die IBAN ist ungültig. Sie kann von diesem Institut nicht vergeben werden."; 9746break; 9747case "1": break; 9748case "2": bankfehler = "Fehler bei der Eingabe der Bankleitzahl innerhalb der IBAN. Sie ist entweder nicht 8-stellig oder enthält Buchstaben."; 9749break; 9750case "3": bankfehler = "Fehler bei der Eingabe der IBAN. Sie hat nicht die vorgegebene Anzahl von 22 Zeichen."; 9751break; 9752case "4": bankfehler = "Eingabefehler bei der IBAN. Evtl. sind an der falschen Stelle Buchstaben enthalten."; 9753break; 9754case "5": bankfehler = "Eingabefehler bei der IBAN. Evtl. sind Leerzeichen enthalten."; 9755break; 9756case "6": bankfehler = "Eingabefehler bei der IBAN oder BIC."; 9757break; 9758case "7": bankfehler = "Die in der IBAN enthaltene Bankleitzahl wurde in der Datenbank nicht gefunden."; 9759break; 9760case "8": bankfehler = "Die von der Bank verwendete Prüfmethode ist im Demonstrations-Modus nicht verfügbar."; 9761break; 9762case "9": bankfehler = "Die IBAN kann nicht geprüft werden, da die Bank entweder keine Prüfziffern verwendet oder es sich um eine spezielle IBAN handelt. Bitte tragen Sie den Namen der Bank manuell ein:"; 9763break; 9764default: bankfehler = "Unbekannter Rückgabewert."; 9765break; 9766} 9767if(jQuery.inArray(iban, ForbiddenIban) > -1) { 9768bankfehler = "Die Bankverbindung der "+SWName+" kann nicht verwendet werden!"; 9769} 9770if (bankname!="") { 9771$("#Institut").val(bankname); 9772$("#Institut_Rahmen").removeClass("error"); 9773$("#Institut_Rahmen").addClass("ok"); 9774} 9775else { 9776$("#Institut").val(""); 9777$("#Institut_Rahmen").removeClass("ok"); 9778$("#Institut_Rahmen").addClass("error"); 9779} 9780if (data.status==4 || data.status==5 || data.status==6 || jQuery.inArray(iban, ForbiddenIban) > -1) { 9781$("#IBAN_Rahmen").addClass("error"); 9782$("#IBAN_Rahmen").removeClass("ok"); 9783$("#Institut_Rahmen").removeClass("error"); 9784$("#Institut_Rahmen").removeClass("ok"); 9785$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9786} 9787else if (data.status==0 || data.status==3) { 9788$("#IBAN_Rahmen").addClass("error"); 9789$("#IBAN_Rahmen").removeClass("ok"); 9790$("#Institut_Rahmen").removeClass("ok"); 9791$("#Institut_Rahmen").addClass("error"); 9792$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9793} 9794else if (data.status==2 || data.status==7 || data.status==8) { 9795$("#IBAN_Rahmen").addClass("error"); 9796$("#IBAN_Rahmen").removeClass("ok"); 9797$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 9798} 9799else { 9800$("#FehlermeldungRahmen").hide(); 9801$("#IBAN_Rahmen").removeClass("error"); 9802$("#IBAN_Rahmen").addClass("ok"); 9803} 9804fehlermeldung = false; 9805if($("#Einzug").is(':checked')) { 9806$("#Einzugsermaechtigung_Rahmen").removeClass("error"); 9807$("#Einzugsermaechtigung_Rahmen").addClass("ok"); 9808} 9809else { 9810$("#Einzugsermaechtigung_Rahmen").removeClass("ok"); 9811$("#Einzugsermaechtigung_Rahmen").addClass("error"); 9812fehlermeldung = true; 9813} 9814if($("#Kontoinhaber").val()!="") { 9815$("#Kontoinhaber_Rahmen").removeClass("error"); 9816$("#Kontoinhaber_Rahmen").addClass("ok"); 9817} 9818else { 9819$("#Kontoinhaber_Rahmen").removeClass("ok"); 9820$("#Kontoinhaber_Rahmen").addClass("error"); 9821fehlermeldung = true; 9822} 9823if($("#BIC").val()!="" && data.status!=77 && data.status!=66) { 9824$("#BIC_Rahmen").removeClass("error"); 9825$("#BIC_Rahmen").addClass("ok"); 9826} 9827else { 9828$("#BIC_Rahmen").removeClass("ok"); 9829$("#BIC_Rahmen").addClass("error"); 9830fehlermeldung = true; 9831} 9832if (submit && fehlermeldung) $("#Fehlermeldung").prepend("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 9833else if (!submit) $("#Fehlermeldung").empty(); 9834if (submit && $("#Fehlermeldung").html().replace(/\s+/g, '')!="") $("#FehlermeldungRahmen").show(); 9835else $("#FehlermeldungRahmen").hide(); 9836if(jQuery.inArray(iban, ForbiddenIban) > -1) { 9837fehlermeldung = true; 9838} 9839if ((data.status==1 || data.status==9) && fehlermeldung==false) { 9840if($("#Kontonummer").val()=="" || $("#Kontonummer").val()!=kontonummer) $("#Kontonummer").val(kontonummer); 9841if($("#Bankleitzahl").val()=="" || $("#Bankleitzahl").val()!=blz) $("#Bankleitzahl").val(blz); 9842$("#FehlermeldungRahmen").hide(); 9843$("#IBAN_Rahmen").removeClass("error"); 9844$("#IBAN_Rahmen").addClass("ok");
9845$("#BIC_Rahmen").removeClass("error"); 9846$("#BIC_Rahmen").addClass("ok"); 9847if (submit) document.forms["Inhaltsform"].submit(); 9848} 9849else scrollTop(); 9850return false; 9851}, "json"); 9852return false; 9853} 9854else { 9855return true; 9856} 9857} 9858catch (e) 9859{ 9860logError(e); 9861} 9862return false; 9863} 9864function setzeZahlungsweise() { 9865if($("#ZW2").is(':not(:checked)')) { 9866$('#EZ').hide(); 9867$('#wechsel input:text').val(''); 9868$('#Einzug').removeAttr('checked'); 9869$('#Fehlermeldung').html(''); 9870} 9871else { 9872$('#EZ').show(); 9873BankIBANCheck(false); 9874} 9875} 9876var WechselDatum = "" 9877function setzeEinzug(aktiv) { 9878if (aktiv) { 9879RahmenId = "#EinzugsDatum_Rahmen"; 9880$(RahmenId).removeClass("error"); 9881$("#LieferbeginnDatum").val(""); 9882$("#termin_jetzt").attr('checked',''); 9883$("#termin_spaeter").attr('checked',''); 9884$("#edatum").show(); 9885$("#ldatum").hide(); 9886$("#vk").hide(); 9887$("#VertragGekuendigt").attr('checked',''); 9888$("#ntermin").hide(); 9889document.getElementById("Vollmacht_label").style.display="none"; 9890$("Vollmacht_label").hide(); 9891var vorlieferantKombiGas = document.getElementById('GasVorlieferantKombi'); 9892var kdnrKombiGas = document.getElementById('kdnrKombiGas'); 9893if((typeof(vorlieferantKombiGas) != 'undefined' && vorlieferantKombiGas != null) && (typeof(kdnrKombiGas) != 'undefined' && kdnrKombiGas != null)) 9894{ 9895$("#BisherigerLieferantKombiGas_Rahmen").hide(); 9896$("#BisherigeKundenNrKombiGas_Rahmen").hide(); 9897} 9898$("#BisherigerLieferant_Rahmen").hide(); 9899$("#BisherigeKundenNr_Rahmen").hide(); 9900$("#VertragGekuendigt_Rahmen").hide(); 9901$("input[name=BisherigerLieferant]").val(""); 9902} 9903else { 9904RahmenId = "#LieferbeginnDatum_Rahmen"; 9905$(RahmenId).removeClass("error"); 9906$("#EinzugsDatum").val(""); 9907$("#edatum").hide(); 9908if(document.getElementById("Vertragswechsel").checked) document.getElementById("Vollmacht_label").style.display="none"; 9909else document.getElementById("Vollmacht_label").style.display="inherit"; 9910if (document.getElementById('termin_spaeter').checked==true) $("#ldatum").show(); 9911else { 9912$("#ldatum").hide(); 9913$("#termin_jetzt").attr('checked','checked'); 9914} 9915$("#vk").show(); 9916$("#ntermin").show(); 9917var vorlieferantKombiGas = document.getElementById('GasVorlieferantKombi'); 9918var kdnrKombiGas = document.getElementById('kdnrKombiGas'); 9919if((typeof(vorlieferantKombiGas) != 'undefined' && vorlieferantKombiGas != null) && (typeof(kdnrKombiGas) != 'undefined' && kdnrKombiGas != null)) 9920{ 9921$("#BisherigerLieferantKombiGas_Rahmen").show(); 9922$("#BisherigeKundenNrKombiGas_Rahmen").show(); 9923} 9924$("#BisherigerLieferant_Rahmen").show(); 9925$("#BisherigeKundenNr_Rahmen").show(); 9926$("#VertragGekuendigt_Rahmen").show(); 9927$(".hideText").show(); 9928setzeLieferbeginndatum(); 9929if($("#Vertragswechsel").is(":checked")) { 9930$("input[name=BisherigerLieferant]").val(SWName); 9931$("#termin_spaeter").hide(); 9932$("#termin_spaeter").next().hide(); 9933$("#termin_jetzt").click(); 9934$("#ldatum").hide(); 9935$("#Vollmacht_Rahmen").show(); 9936$("#VertragGekuendigt_Rahmen").hide(); 9937var WechselMonat = AktuelleZeit.getMonth()+2; 9938var WechselJahr = AktuelleZeit.getFullYear(); 9939if (WechselMonat>12) { 9940WechselMonat = WechselMonat - 12; 9941WechselJahr = WechselJahr + 1; 9942} 9943if (WechselMonat<10) var WechselDatum = "01.0"+WechselMonat+"."+WechselJahr; 9944else var WechselDatum = "01."+WechselMonat+"."+AktuelleZeit.getFullYear(); 9945$("#LieferbeginnDatum").val(WechselDatum); 9946$("#labeltermin").text("Vertragswechsel erfolgt zum "+WechselDatum); 9947} 9948else { 9949if($("input[name=BisherigerLieferant]").val()==SWName) { 9950$("input[name=BisherigerLieferant]").val(""); 9951$("input[name=BisherigerLieferantKuerzel]").val(""); 9952} 9953$("#LieferbeginnDatum").val(""); 9954$("#labeltermin").text("Lieferbeginn zum nächstmöglichen Termin"); 9955} 9956} 9957} 9958function setzeLieferbeginndatum() { 9959if (isDefined("AktuelleZeitMillisekunden")) var Zeit = new Date(AktuelleZeitMillisekunden); 9960else var Zeit = new Date(); 9961var AbsolutJetzt = Zeit.getTime(); 9962var AbsolutDann = AbsolutJetzt + (42 * 24 * 60 * 60 * 1000); 9963Zeit.setTime(AbsolutDann); 9964var Jahr = Zeit.getFullYear(); 9965var Monat = Zeit.getMonth() + 1; 9966var Tag = Zeit.getDate(); 9967var Monatsnamen = Array('01','02','03','04','05','06','07','08','09','10','11','12'); 9968var AusgabeJahr = Jahr; 9969var AusgabeMonat = ""; 9970var AusgabeTag = "01"; 9971if (Monat > 11) { 9972AusgabeMonat = Monatsnamen[0]; 9973AusgabeJahr = Jahr + 1; 9974} 9975else { 9976AusgabeMonat = Monatsnamen[Monat]; 9977} 9978var AusgabeDatum = AusgabeTag + "." + AusgabeMonat + "." + AusgabeJahr; 9979if (document.getElementById('termin_jetzt').checked==true) { 9980} 9981} 9982function checkLen(field, countfield, maxlimit) { 9983if ($("#"+field).val().length > maxlimit) { 9984$("#"+field).val($("#"+field).val().substring(0, maxlimit)); 9985} 9986else { 9987rest = maxlimit - $("#"+field).val().length; 9988$("#"+countfield).text("Noch "+rest+" Zeichen"); 9989} 9990} 9991function SetzeAngebotsfrist() { 9992if (isDefined("AktuelleZeitMillisekunden")) var Zeit = new Date(AktuelleZeitMillisekunden); 9993else var Zeit = new Date(); 9994var Jahr = Zeit.getFullYear(); 9995var Monat = Zeit.getMonth() + 2; 9996if(Monat > 12) { 9997Monat = Monat - 12; 9998Jahr = Jahr + 1; 9999} 10000var Endtermin = new Date(parseInt(Jahr, 10), parseInt(Monat, 10), 1); 10001var EnddatumTS = Endtermin.getTime() - (24 * 60 * 60 * 1000); 10002var Enddatum = new Date(EnddatumTS); 10003var EnddatumTag = Enddatum.getDate(); 10004if (EnddatumTag < 10) EnddatumTag = "0" + EnddatumTag; 10005var EnddatumMonat = Enddatum.getMonth()+1; 10006if (EnddatumMonat < 10) EnddatumMonat = "0" + EnddatumMonat; 10007var EnddatumJahr = Enddatum.getFullYear(); 10008$("#TRAngebotsfrist").val(EnddatumTag+"."+EnddatumMonat+"."+EnddatumJahr); 10009} 10010var aktiveBox = 0; 10011function BestellformularSenden() { 10012$("form.ergebnis").eq(aktiveBox).submit(); 10013return false;
10014} 10015strompreise = new Array(1500,2500,3500,4500,5500,6500,7500,8500,9500,10500); 10016$(document).ready(function() { 10017$("*").keydown(function(event){ 10018if(event.which == 8 && $(document.activeElement).prop("tagName")!="INPUT" && $(document.activeElement).prop("tagName")!="TEXTAREA" ) event.preventDefault(); 10019}); 10020$("#Zaehlerart").click(function() { 10021if($("#Zaehlerart").is(':checked')) { 10022$("#strompreisrechner .verbrauchboxNT").show(); 10023} 10024else { 10025$("#strompreisrechner .verbrauchboxNT").hide(); 10026} 10027}); 10028$("#Zaehlerart1").click(function() { 10029if($("#Zaehlerart1").is(':checked')) { 10030$("#waermestrompreisrechner .verbrauchboxNT").show(); 10031$("#Tariffilter").val("nightStorageHeating"); 10032} 10033else { 10034$("#waermestrompreisrechner .verbrauchboxNT").hide(); 10035$("#Tariffilter").val("heatingPump"); 10036} 10037}); 10038var faktorGas = 160; 10039$("#slider-range-min").slider({ 10040range: "min", 10041value: $("#Verbrauch").val()/faktorGas, 10042min: 20, 10043max: 300, 10044change: function() { 10045var value = $("#slider-range-min").slider("option","value"); 10046$("#Verbrauch").val(Math.round(value) * faktorGas); 10047}, 10048slide: function(event, ui) { 10049$(this).slider('value', ui.value); 10050var value = $("#slider-range-min").slider("option","value"); 10051$("#amount").val(ui.value); 10052$("#Verbrauch").val($("#amount").val() * faktorGas); 10053clearFehler(); 10054} 10055}); 10056var value = $("#slider-range-min").slider("option","value"); 10057$("#amount").val($("#slider-range-min").slider("value")); 10058if($("#Verbrauch").val()=="") $("#Verbrauch").val($("#amount").val() * faktorGas); 10059setzePLZAutocomplete(); 10060$("#amount").change( function() { 10061$("#Verbrauch").val($(this).val() * faktorGas); 10062$("#slider-range-min").slider({ value: ($(this).val()) }); 10063}); 10064$("#SliderRahmenGas a.slider-plus").click( function() { 10065$("#amount").val(parseInt($("#amount").val()) + 5); 10066$("#Verbrauch").val($("#amount").val() * faktorGas); 10067$("#slider-range-min").slider({ value: ($("#amount").val()) }); 10068}); 10069$("#SliderRahmenGas a.slider-minus").click( function() { 10070var amount = parseInt($("#amount").val()) - 5; 10071if (amount >= 0) 10072{ 10073$("#amount").val(amount); 10074$("#Verbrauch").val($("#amount").val() * faktorGas); 10075$("#slider-range-min").slider({ value: ($("#amount").val()) }); 10076} 10077}); 10078$("#slider-range-min-strom").slider({ 10079range: "min", 10080value: Math.round(($("#Verbrauch_Strom").val()-1)/1000), 10081min: 1, 10082max: 5, 10083change: function() { 10084var value = $("#slider-range-min-strom").slider("option","value"); 10085$("#Verbrauch_Strom").val(strompreise[parseInt(value)-1]); 10086}, 10087slide: function(event, ui) { 10088$(this).slider('value', ui.value); 10089var value = $("#slider-range-min-strom").slider("option","value"); 10090$("#amount1").val(ui.value); 10091$("#Verbrauch_Strom").val(strompreise[parseInt($("#amount1").val())-1]); 10092clearFehler(); 10093} 10094}); 10095$("#amount1").val($("#slider-range-min-strom").slider("value")); 10096if($("#Verbrauch_Strom").val()=="") $("#Verbrauch_Strom").val(strompreise[parseInt($("#amount1").val())-1]); 10097var value = $("#slider-range-min-strom").slider("option","value"); 10098$("#amount1").change( function() { 10099$("#Verbrauch_Strom").val($(this).val()*1000+500); 10100$("#slider-range-min-strom").slider({ value: $(this).val() }); 10101}); 10102$("#SliderRahmenStrom a.slider-plus").click( function() { 10103$("#amount1").val(parseInt($("#amount1").val()) + 1); 10104$("#Verbrauch_Strom").val($("#amount1").val() * 1000+500); 10105$("#slider-range-min-strom").slider({ value: ($("#amount1").val()) }); 10106}); 10107$("#SliderRahmenStrom a.slider-minus").click( function() { 10108var amount = parseInt($("#amount1").val()) - 1; 10109if (amount >= 0) 10110{ 10111$("#amount1").val(amount); 10112$("#Verbrauch_Strom").val($("#amount1").val() * 1000+500); 10113$("#slider-range-min-strom").slider({ value: ($("#amount1").val()) }); 10114} 10115}); 10116$("#slider-range-min-heizstrom").slider({ 10117range: "min", 10118value: Math.round(($("#Verbrauch_Heizstrom").val()-1)/1000), 10119min: 1, 10120max: 5, 10121change: function() { 10122var value = $("#slider-range-min-heizstrom").slider("option","value"); 10123$("#Verbrauch_Heizstrom").val(strompreise[parseInt(value)-1]); 10124}, 10125slide: function(event, ui) { 10126$(this).slider('value', ui.value); 10127var value = $("#slider-range-min-heizstrom").slider("option","value"); 10128$("#amount2").val(ui.value); 10129$("#Verbrauch_Heizstrom").val(strompreise[parseInt($("#amount2").val())-1]); 10130clearFehler(); 10131} 10132}); 10133$("#amount2").val($("#slider-range-min-heizstrom").slider("value")); 10134if($("#Verbrauch_Heizstrom").val()=="") $("#Verbrauch_Heizstrom").val(strompreise[parseInt($("#amount2").val())-1]); 10135var value = $("#slider-range-min-heizstrom").slider("option","value"); 10136$("#amount2").change( function() { 10137$("#Verbrauch_Heizstrom").val($(this).val()*1000+500); 10138$("#slider-range-min-heizstrom").slider({ value: $(this).val() }); 10139}); 10140$("#SliderRahmenHeizstrom a.slider-plus").click( function() { 10141$("#amount2").val(parseInt($("#amount2").val()) + 1); 10142$("#Verbrauch_Heizstrom").val($("#amount2").val() * 1000+500); 10143$("#slider-range-min-heizstrom").slider({ value: ($("#amount2").val()) }); 10144}); 10145$("#SliderRahmenHeizstrom a.slider-minus").click( function() { 10146var amount = parseInt($("#amount2").val()) - 1; 10147if (amount >= 0) 10148{ 10149$("#amount2").val(amount); 10150$("#Verbrauch_Heizstrom").val($("#amount2").val() * 1000+500); 10151$("#slider-range-min-heizstrom").slider({ value: ($("#amount2").val()) }); 10152} 10153}); 10154$(".tarifbox").click( function() { 10155$(".tarifbox").removeClass("tarifboxaktiv"); 10156$(this).addClass("tarifboxaktiv"); 10157aktiveBox = $(".tarifbox").index($(this)); 10158}); 10159$( ".TR-Rahmen .kasten h2 a" ).click(function(e){ 10160e.preventDefault(); 10161$( ".TR-Rahmen .kasten" ).css( "top", ""); 10162$( ".TR-Rahmen .kasten" ).css( "z-index", ""); 10163$( ".TR-Rahmen .kasten.aktiv" ).removeClass( "aktiv" ); 10164$(this).parent( "h2" ).parent( "div.kasten" ).addClass( "aktiv" ); 10165if($( this ).parent("h2").parent("div.kasten").attr( "class" ).indexOf( "kasten strom" ) >= 0 ) 10166{ 10167$( ".TR-Rahmen .kasten.heizstrom" ).css({ 10168"top": "70px", 10169"z-index": "2" 10170}); 10171} 10172if($( this ).parent("h2").parent("div.kasten").attr( "class" ).indexOf( "kasten heizstrom" ) >= 0 ) 10173{ 10174$( ".TR-Rahmen .kasten.strom" ).css({ 10175"top": "70px", 10176"z-index": "2" 10177}); 10178} 10179}); 10180checkPLZ(); 10181checkStromPLZ(); 10182checkHeizstromPLZ(); 10183$("#PLZ_Eingabe").keyup( function() {
10184checkPLZ(); 10185}); 10186$("#PLZ_Eingabe_Strom").keyup( function() { 10187checkStromPLZ(); 10188}); 10189$("#PLZ_Eingabe_Heizstrom").keyup( function() { 10190checkHeizstromPLZ(); 10191}) 10192$("#PLZ_Eingabe_Waermestrom").keyup( function() { 10193checkWaermestromPLZ(); 10194}) 10195$("#Verbrauch_Strom, #Verbrauch_Heizstrom, #Verbrauch").keyup( function() { 10196if(!isNaN($(this).val())) clearFehler(); 10197}); 10198$("#troverlay").click( function() { 10199var plz = $("#PLZ_Eingabe").val(); 10200var plzort = $("#PLZOrtEingabe").val(); 10201if (isNaN(plz) || plz.length!=5) 10202$("#FehlermeldungTREingabe").html("<p>Bitte geben Sie eine gültige Postleitzahl ein!</p>"); 10203else { 10204$("#FehlermeldungTREingabe").html("<p>Im Moment wird das Gebiet Ihrer Postleitzahl leider noch nicht von uns beliefert.</p>"); 10205if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Gas&Versorgung=N'); 10206} 10207$("#FehlermeldungTREingabe").show(""); 10208}); 10209$("#troverlay_Strom").click( function() { 10210var plz = $("#PLZ_Eingabe_Strom").val(); 10211var plzort = $("#PLZOrtEingabe_Strom").val(); 10212if (isNaN(plz) || plz.length!=5) 10213$("#FehlermeldungTREingabe").html("<p>Bitte geben Sie eine gültige Postleitzahl ein!</p>"); 10214else { 10215$("#FehlermeldungTREingabe").html("<p>Im Moment wird das Gebiet Ihrer Postleitzahl leider noch nicht von uns beliefert.</p>"); 10216if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Strom&Versorgung=N'); 10217} 10218$("#FehlermeldungTREingabe").show(""); 10219}); 10220$("#troverlay_Waermestrom").click( function() { 10221var plz = $("#PLZ_Eingabe_Waermestrom").val(); 10222var plzort = $("#PLZOrtEingabe_Waermestrom").val(); 10223if (isNaN(plz) || plz.length!=5) 10224$("#FehlermeldungTREingabe").html("<p>Bitte geben Sie eine gültige Postleitzahl ein!</p>"); 10225else { 10226$("#FehlermeldungTREingabe").html("<p>Im Moment wird das Gebiet Ihrer Postleitzahl leider noch nicht von uns beliefert.</p>"); 10227if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Waermestrom&Versorgung=N'); 10228} 10229$("#FehlermeldungTREingabe").show(""); 10230}); 10231$("#troverlay_Heizstrom").click( function() { 10232var plz = $("#PLZ_Eingabe_Heizstrom").val(); 10233var plzort = $("#PLZOrtEingabe_Heizstrom").val(); 10234if (isNaN(plz) || plz.length!=5) 10235$("#FehlermeldungTREingabe").html("<p>Bitte geben Sie eine gültige Postleitzahl ein!</p>"); 10236else { 10237$("#FehlermeldungTREingabe").html("<p>Im Moment wird das Gebiet Ihrer Postleitzahl leider noch nicht von uns beliefert.</p>"); 10238if (typeof HRLogAction == 'function') HRLogAction('Anwendung=StatistikVertriebTracker&PLZ=' + plz + '&Sparte=Heizstrom&Versorgung=N'); 10239} 10240$("#FehlermeldungTREingabe").show(""); 10241}); 10242$(".ReiterTabs > li > a").click( function() { 10243clearFehler(); 10244}); 10245if($("#TRAngebotsfrist").length>0) { 10246SetzeAngebotsfrist(); 10247} 10248if(OptTarifsortierung) { 10249var sortedDivs = $(".unsorted").find("form.ergebnis").toArray().sort(sorter); 10250$.each(sortedDivs, function (index, value) { 10251$(".sorted").append(value); 10252}); 10253} 10254if($("#Fehlermeldung").length>0 && $("#FehlermeldungRahmen").length>0) { 10255if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 10256else $("#FehlermeldungRahmen").show(); 10257} 10258$("div[class*='Feldrahmen'] > input:text").blur( function() { 10259if($(this).attr("name")!="VST_HausNrZusatz" && $(this).attr("name")!="HausNrZusatz") { 10260if ($(this).val()!="") { 10261$(this).parent().removeClass("error"); 10262$(this).parent().addClass("ok"); 10263$("#FehlermeldungRahmen").hide(); 10264} 10265else if ($(this).parent().children("label:contains('*')").text()) { 10266$(this).parent().removeClass("ok"); 10267$(this).parent().addClass("error"); 10268$("#Fehlermeldung").html("<p class=\"error\">Bitte korrigieren Sie Ihre Angabe im markierten Feld.</p>"); 10269$("#FehlermeldungRahmen").show(); 10270} 10271} 10272}); 10273$("input[name='Anrede']").click( function() { 10274$(this).parent().removeClass("error"); 10275$(this).parent().addClass("ok"); 10276$("#FehlermeldungRahmen").hide(); 10277}); 10278$("#Vorname, #Name").focus( function() { 10279if($("input[name='Anrede']:checked").length==0) { 10280$("#anrede1").parent().removeClass("ok"); 10281$("#anrede1").parent().addClass("error"); 10282$("#Fehlermeldung").html("<p class=\"error\">Bitte wählen Sie eine Anrede aus.</p>"); 10283$("#FehlermeldungRahmen").show(); 10284} 10285else { 10286$("#anrede1").parent().removeClass("error"); 10287$("#anrede1").parent().addClass("ok");
10288$("#FehlermeldungRahmen").hide(); 10289} 10290}); 10291$("#Geburtsdatum, #Geburtsdatum2").blur( function() { 10292var datum = $(this).val().split("."); 10293if (datum.length==3) { 10294var tag = datum[0]; 10295var monat = datum[1]; 10296var jahr = datum[2]; 10297if (tag.length < 2) tag = "0" + tag; 10298if (monat.length < 2) monat = "0" + monat; 10299$(this).val(tag + "." + monat + "." + jahr); 10300} 10301if (!istGueltigesDatum($(this).val()) && $("input[name='Kundenart']").val()=="Privatkunde" && (OptGebDatumPflicht || $(this).val()!="")) { 10302$(this).parent().removeClass("ok"); 10303$(this).parent().addClass("error"); 10304$("#Fehlermeldung").html("<p class=\"error\">Bitte geben Sie ein gültiges Geburtsdatum im Format TT.MM.JJJJ an.</p>"); 10305$("#FehlermeldungRahmen").show(); 10306} 10307else if (!istGueltigesGebDatum($(this).val()) && $("input[name='Kundenart']").val()=="Privatkunde" && (OptGebDatumPflicht || $(this).val()!="")) { 10308$(this).parent().removeClass("ok"); 10309$(this).parent().addClass("error"); 10310$("#Fehlermeldung").html("<p class=\"error\">Bei Vertragsabschluss müssen Sie mind. 18 alt sein.</p>"); 10311$("#FehlermeldungRahmen").show(); 10312} 10313else if ($("input[name='Kundenart']").val()=="Privatkunde" && $(this).val()!="") { 10314$(this).parent().removeClass("error"); 10315$(this).parent().addClass("ok"); 10316$("#FehlermeldungRahmen").hide(); 10317} 10318if ($(this).val()=="") { 10319$(this).parent().removeClass("error"); 10320$(this).parent().removeClass("ok"); 10321} 10322}); 10323if(OptGebDatumPflicht) { 10324$("#Geburtsdatum_Rahmen label").text("Geburtsdatum*:"); 10325$("#Vertragspartner2_Geburtsdatum_Rahmen label").text("Geburtsdatum*:"); 10326} 10327$("#E-Mail").blur( function() { 10328if (!istGueltigeEmail($("#E-Mail").val())) { 10329$(this).parent().removeClass("ok"); 10330$(this).parent().addClass("error"); 10331$("#Fehlermeldung").html("<p class=\"error\">Bitte geben Sie eine gültige E-Mail Adresse an.</p>"); 10332$("#FehlermeldungRahmen").show(); 10333} 10334else { 10335$(this).parent().removeClass("error"); 10336$(this).parent().addClass("ok"); 10337$("#FehlermeldungRahmen").hide(); 10338} 10339if ($(this).val()=="") { 10340$(this).filter(".offline").parent().removeClass("error"); 10341$(this).filter(".offline").parent().removeClass("ok"); 10342} 10343}); 10344if(OptPostverzeichnis==true) 10345{ 10346$("#VST_HausNr").blur( function() { 10347PLZ = $("#VST_PLZ").val(); 10348Ort = escape($("#VST_Ort").val()); 10349Strasse = escape($("#VST_Strasse").val()); 10350Hnr = $("#VST_HausNr").val(); 10351$.get("/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=ValidateAdresse", 10352{ Strasse: Strasse, Ort: Ort, PLZ: PLZ, URLEncoding : "Escaped" }, 10353function(data){ 10354if (data == "J" && Strasse!="" && Hnr!="") { 10355$("#VST_PLZ").parent().removeClass("error"); 10356$("#VST_PLZ").parent().addClass("ok"); 10357$("#VST_Strasse").parent().removeClass("error"); 10358$("#VST_Strasse").parent().addClass("ok"); 10359$("#FehlermeldungRahmen").hide(); 10360} 10361else if (Strasse!="" && Hnr!="") { 10362$("#VST_Strasse").parent().removeClass("ok"); 10363$("#VST_Strasse").parent().addClass("error"); 10364$("#Fehlermeldung").html("<p class=\"error\">Ihre eingebene Lieferanschrift ist nicht korrekt. Bitte überprüfen Sie Ihre Eingabe.</p>"); 10365$("#FehlermeldungRahmen").show(); 10366} 10367else if (Strasse!="" || Hnr!="") { 10368$("#VST_Strasse").parent().removeClass("ok"); 10369$("#VST_Strasse").parent().addClass("error"); 10370$("#Fehlermeldung").html("<p class=\"error\">Bitte geben Ihre vollständige Lieferanschrift an.</p>"); 10371$("#FehlermeldungRahmen").show(); 10372} 10373}); 10374}); 10375$("#HausNr").blur( function() { 10376PLZ = $("#PLZ").val(); 10377Ort = escape($("#Ort").val()); 10378Strasse = escape($("#Strasse").val()); 10379Hnr = $("#HausNr").val(); 10380$.get("/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=ValidateAdresse", 10381{ Strasse: Strasse, Ort: Ort, PLZ: PLZ, URLEncoding : "Escaped" }, 10382function(data){ 10383if (data == "J" && Strasse!="" && Hnr!="") { 10384$("#PLZ").parent().removeClass("error"); 10385$("#PLZ").parent().addClass("ok"); 10386$("#Strasse").parent().removeClass("error"); 10387$("#Strasse").parent().addClass("ok"); 10388$("#FehlermeldungRahmen").hide(); 10389} 10390else if (Strasse!="" && Hnr!="") { 10391$("#Strasse").parent().removeClass("ok"); 10392$("#Strasse").parent().addClass("error"); 10393$("#Fehlermeldung").html("<p class=\"error\">Ihre eingebene Lieferanschrift ist nicht korrekt. Bitte überprüfen Sie Ihre Eingabe.</p>"); 10394$("#FehlermeldungRahmen").show(); 10395} 10396else if (Strasse!="" || Hnr!="") { 10397$("#Strasse").parent().removeClass("ok");
10398$("#Strasse").parent().addClass("error"); 10399$("#Fehlermeldung").html("<p class=\"error\">Bitte geben Ihre vollständige Lieferanschrift an.</p>"); 10400$("#FehlermeldungRahmen").show(); 10401} 10402}); 10403}); 10404} 10405$("#LieferbeginnDatum, #EinzugsDatum").blur( function() { 10406if ($("#termin_spaeter").is(':checked') && $("#Versorgerwechsel").is(":checked") && !setzeLiefertermin()) { 10407$(this).parent().removeClass("ok"); 10408$(this).parent().addClass("error"); 10409$("#Fehlermeldung").html("<p class=\"error\">"+FehlerTextLieferbeginn+"</p>"); 10410$("#FehlermeldungRahmen").show(); 10411} 10412else if (!setzeLiefertermin()) { 10413$(this).parent().removeClass("ok"); 10414$(this).parent().addClass("error"); 10415$("#Fehlermeldung").html("<p class=\"error\">"+FehlerTextEinzug+"</p>"); 10416$("#FehlermeldungRahmen").show(); 10417} 10418else { 10419$(this).parent().removeClass("error"); 10420$(this).parent().addClass("ok"); 10421$("#FehlermeldungRahmen").hide(); 10422} 10423}); 10424$("#Zaehlernr").blur(function() { 10425if ($(this).val()!="") { 10426$(this).parent().removeClass("error"); 10427$(this).parent().addClass("ok"); 10428RahmenId = "#Zaehlpunkt_Rahmen"; 10429$(RahmenId).removeClass("error"); 10430$("#FehlermeldungRahmen").hide(); 10431} 10432}); 10433$("#Zaehlpunkt").blur(function() { 10434zaehlpunktfehler = checkZaehlpunkt('Zaehlpunkt', 'TRPLZ', ''); 10435if ($(this).val()!="" && zaehlpunktfehler!="" && $("#Zaehlernr").val()=="") { 10436$(this).parent().removeClass("ok"); 10437$(this).parent().addClass("error"); 10438$("#Fehlermeldung").append("<p class=\"error\">"+zaehlpunktfehler+"</p>"); 10439$("#FehlermeldungRahmen").show(); 10440} 10441else if ($(this).val()!="") { 10442$(this).parent().removeClass("error"); 10443$(this).parent().addClass("ok"); 10444RahmenId = "#Zaehlernummer_Rahmen"; 10445$(RahmenId).removeClass("error"); 10446$("#FehlermeldungRahmen").hide(); 10447} 10448else if ($(this).val()=="" && $("#Zaehlernr").val()!="") { 10449$(this).parent().removeClass("error"); 10450} 10451else { 10452$(this).parent().removeClass("ok"); 10453$(this).parent().addClass("error"); 10454} 10455}); 10456$("#Vollmacht, #Einzug, #Widerruf, #Datenschutz, #AGB, #OnlineVertrag, #DatenschutzBestaetigt").click( function() { 10457if($(this).is(':not(:checked)')) { 10458$(this).parent().removeClass("ok"); 10459$(this).parent().addClass("error"); 10460} 10461else { 10462$(this).parent().removeClass("error"); 10463$(this).parent().addClass("ok"); 10464} 10465}); 10466$("#Bankleitzahl").blur( function() { 10467var blz = $("#Bankleitzahl").val(); 10468var kto = $("#Kontonummer").val(); 10469if ((!isNaN(blz) && blz.length==8) || !isNaN(kto)) { 10470bankfehler = ""; 10471bankname = ""; 10472iban = ""; 10473bic = ""; 10474status = ""; 10475$.get("/vertrieb/bank/blz.php", { "Kontonummer": kto, "Bankleitzahl": blz }, 10476function(data){ 10477bankname = unescape(data.bankname); 10478iban = data.iban; 10479bic = data.bic; 10480switch(data.status){ 10481case "0": bankfehler = "Die Kontonummer ist ungültig. Sie kann von diesem Institut nicht vergeben werden."; 10482break; 10483case "1": break;
10484case "2": bankfehler = "Fehler bei der Eingabe der Bankleitzahl. Sie ist entweder nicht 8-stellig oder enthält Buchstaben."; 10485break; 10486case "3": bankfehler = "Fehler bei der Eingabe der Kontonummer. Sie ist entweder zu lang oder enthält Buchstaben."; 10487break; 10488case "4": bankfehler = "Eingabefehler bei der Kontonummer und Bankleitzahl."; 10489break; 10490case "5": bankfehler = "Eingabefehler bei der Kontonummer oder Bankleitzahl. Evtl. sind Leerzeichen enthalten."; 10491break; 10492case "6": bankfehler = "Eingabefehler bei der Kontonummer oder Bankleitzahl."; 10493break; 10494case "7": bankfehler = "Die Bankleitzahl wurde in der Datenbank nicht gefunden."; 10495break; 10496case "8": bankfehler = "Die von der Bank verwendete Prüfmethode ist im Demonstrations-Modus nicht verfügbar."; 10497break; 10498case "9": bankfehler = "Die Kontonummer kann nicht geprüft werden, da die Bank entweder keine Prüfziffern verwendet oder es sich um eine spezielle Kontonummer handelt. Bitte tragen Sie den Namen der Bank manuell ein:"; 10499break; 10500default: bankfehler = "Unbekannter Rückgabewert."; 10501break; 10502} 10503if (data.status==2 || data.status==7 || data.status==8) { 10504if(kto!="") { 10505$("#Kontonummer_Rahmen").removeClass("error"); 10506$("#Kontonummer_Rahmen").addClass("ok"); 10507} 10508else { 10509$("#Kontonummer_Rahmen").removeClass("ok"); 10510$("#Kontonummer_Rahmen").addClass("error"); 10511} 10512} 10513if (bankname!="") { 10514$("#Institut").val(bankname); 10515$("#BLZ_Rahmen").removeClass("error"); 10516$("#BLZ_Rahmen").addClass("ok"); 10517$("#Institut_Rahmen").removeClass("error"); 10518$("#Institut_Rahmen").addClass("ok"); 10519$("#FehlermeldungRahmen").hide(); 10520$("#Fehlermeldung").empty(); 10521} 10522else { 10523$("#Institut").val(""); 10524$("#BLZ_Rahmen").addClass("error"); 10525$("#BLZ_Rahmen").removeClass("ok"); 10526$("#Institut_Rahmen").removeClass("ok"); 10527$("#FehlermeldungRahmen").show(); 10528$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 10529} 10530if (iban!="") { 10531$("#IBAN").val(iban); 10532$("#IBAN_Rahmen").removeClass("error"); 10533$("#IBAN_Rahmen").addClass("ok"); 10534} 10535else { 10536$("#IBAN").val(""); 10537$("#IBAN_Rahmen").removeClass("ok"); 10538$("#IBAN_Rahmen").addClass("error"); 10539} 10540if (bic!="") { 10541$("#BIC").val(bic); 10542$("#BIC_Rahmen").removeClass("error"); 10543$("#BIC_Rahmen").addClass("ok"); 10544} 10545else { 10546$("#BIC").val(""); 10547$("#BIC_Rahmen").removeClass("ok"); 10548$("#BIC_Rahmen").addClass("error"); 10549} 10550if (data.status==0 || data.status==3) { 10551$("#Kontonummer_Rahmen").addClass("error"); 10552$("#Kontonummer_Rahmen").removeClass("ok"); 10553$("#FehlermeldungRahmen").show(); 10554$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 10555} 10556}, 10557"json"); 10558} 10559else { 10560$("#Institut").val(""); 10561$("#BLZ_Rahmen").addClass("error"); 10562$("#BLZ_Rahmen").removeClass("ok"); 10563$("#Institut_Rahmen").removeClass("error"); 10564$("#Institut_Rahmen").removeClass("ok"); 10565$("#FehlermeldungRahmen").show(); 10566$("#Fehlermeldung").html("<p class=\"error\">Bitte geben Sie eine korrekte Kontoverbindung an!</p>"); 10567} 10568}); 10569$("#IBAN, #BIC").blur( function() { 10570var bic = $("#BIC").val(); 10571var iban = $("#IBAN").val(); 10572if(jQuery.inArray(iban, ForbiddenIban) > -1) { 10573bankfehler = "Die Bankverbindung der "+SWName+" kann nicht verwendet werden!"; 10574} 10575else bankfehler = ""; 10576bankname = ""; 10577status = ""; 10578$.get("/vertrieb/bank/blz.php", { "IBAN": iban, "BIC": bic }, 10579function(data){ 10580bankname = unescape(data.bankname); 10581iban = data.iban; 10582bic = data.bic; 10583switch(data.status){ 10584case "0": bankfehler = "Die IBAN ist ungültig. Sie kann von diesem Institut nicht vergeben werden."; 10585break; 10586case "1": break;
10587case "2": bankfehler = "Fehler bei der Eingabe der Bankleitzahl innerhalb der IBAN. Sie ist entweder nicht 8-stellig oder enthält Buchstaben."; 10588break; 10589case "3": bankfehler = "Fehler bei der Eingabe der IBAN. Sie hat nicht die vorgegebene Anzahl von 22 Zeichen."; 10590break; 10591case "4": bankfehler = "Eingabefehler bei der IBAN. Evtl. sind an der falschen Stelle Buchstaben enthalten."; 10592break; 10593case "5": bankfehler = "Eingabefehler bei der IBAN. Evtl. sind Leerzeichen enthalten."; 10594break; 10595case "6": bankfehler = "Eingabefehler bei der IBAN oder BIC."; 10596break; 10597case "7": bankfehler = "Die in der IBAN enthaltene Bankleitzahl wurde in der Datenbank nicht gefunden."; 10598break; 10599case "8": bankfehler = "Die von der Bank verwendete Prüfmethode ist im Demonstrations-Modus nicht verfügbar."; 10600break; 10601case "9": bankfehler = "Die IBAN kann nicht geprüft werden, da die Bank entweder keine Prüfziffern verwendet oder es sich um eine spezielle IBAN handelt. Bitte tragen Sie den Namen der Bank manuell ein:"; 10602break; 10603default: bankfehler = "Unbekannter Rückgabewert."; 10604break; 10605} 10606if ((data.status!=1 || bankfehler!="") && data.status!=9) { 10607$("#IBAN_Rahmen").removeClass("ok"); 10608$("#IBAN_Rahmen").addClass("error"); 10609$("#FehlermeldungRahmen").show(); 10610$("#Fehlermeldung").html("<p class=\"error\">"+bankfehler+"</p>"); 10611} 10612else { 10613$("#IBAN_Rahmen").removeClass("error"); 10614$("#IBAN_Rahmen").addClass("ok"); 10615if($("#BIC").val()!="") { 10616$("#BIC_Rahmen").removeClass("error"); 10617$("#BIC_Rahmen").addClass("ok"); 10618} 10619else { 10620$("#BIC_Rahmen").removeClass("ok"); 10621$("#BIC_Rahmen").addClass("error"); 10622} 10623} 10624if (bankname!="") { 10625$("#Institut").val(bankname); 10626$("#Institut_Rahmen").removeClass("error"); 10627$("#Institut_Rahmen").addClass("ok"); 10628} 10629else { 10630$("#Institut").val(""); 10631$("#Institut_Rahmen").removeClass("ok"); 10632} 10633if (iban!="") { 10634$("#IBAN").val(iban); 10635$("#IBAN_Rahmen").removeClass("error"); 10636$("#IBAN_Rahmen").addClass("ok"); 10637} 10638else { 10639$("#IBAN").val(""); 10640$("#IBAN_Rahmen").removeClass("ok"); 10641$("#IBAN_Rahmen").addClass("error"); 10642} 10643if (bic!="") { 10644$("#BIC").val(bic); 10645$("#BIC_Rahmen").removeClass("error"); 10646$("#BIC_Rahmen").addClass("ok"); 10647} 10648else { 10649$("#BIC").val(""); 10650$("#BIC_Rahmen").removeClass("ok"); 10651$("#BIC_Rahmen").addClass("error"); 10652} 10653}, 10654"json"); 10655}); 10656$("#Bemerkungen").keyup( function() { 10657if($(this).val().indexOf(";")>-1) { 10658$(this).val($(this).val().replace(";", ",")); 10659} 10660checkLen('Bemerkungen','zeichenbegrenzung','500'); 10661}); 10662if(OptVorversorger==true) 10663{ 10664$("#GasVorlieferant").autocomplete({ 10665source: function(request, response) { 10666$.ajax({ 10667url: "/vertrieb/versorger/search_lima.php?__nocache__=" + Math.random(), 10668dataType: "json", 10669data: { 10670term : request.term, 10671art : 'G', 10672anz : 10 10673}, 10674success: function(data) { 10675response(data); 10676} 10677}); 10678}, 10679minLength: 2, 10680select: function(event, ui) { 10681$("#Lieferantenkuerzel").val(ui.item.id); 10682$(this).parent().removeClass("error"); 10683$(this).parent().addClass("ok"); 10684$("#FehlermeldungRahmen").hide(); 10685} 10686}); 10687$("#StromVorlieferant").autocomplete({ 10688source: function(request, response) { 10689$.ajax({ 10690url: "/vertrieb/versorger/search_lima.php?__nocache__=" + Math.random(), 10691dataType: "json", 10692data: { 10693term : request.term, 10694art : 'E', 10695anz : 10 10696}, 10697success: function(data) { 10698response(data); 10699} 10700}); 10701}, 10702minLength: 2, 10703select: function(event, ui) { 10704$("#Lieferantenkuerzel").val(ui.item.id); 10705$(this).parent().removeClass("error"); 10706$(this).parent().addClass("ok"); 10707$("#FehlermeldungRahmen").hide(); 10708} 10709}); 10710$("#GasVorlieferantKombi").autocomplete({ 10711source: function(request, response) { 10712$.ajax({ 10713url: "/vertrieb/versorger/search_lima.php?__nocache__=" + Math.random(), 10714dataType: "json", 10715data: { 10716term : request.term, 10717art : 'E', 10718anz : 10 10719}, 10720success: function(data) { 10721response(data); 10722} 10723}); 10724}, 10725minLength: 2, 10726select: function(event, ui) { 10727$("#LieferantenkuerzelKombiGas").val(ui.item.id); 10728$(this).parent().removeClass("error"); 10729$(this).parent().addClass("ok"); 10730$("#FehlermeldungRahmen").hide(); 10731} 10732}); 10733} 10734if(OptPostverzeichnis==true) 10735{ 10736$("#PLZ").autocomplete({ 10737source: function(request, response) { 10738$.ajax({ 10739url: "/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=SearchOrtJSON", 10740dataType: "json", 10741data: { 10742term : request.term, 10743PLZ : $('#PLZ').val() 10744}, 10745success: function(data) { 10746response(data); 10747} 10748}); 10749}, 10750minLength: 3, 10751select: function(event, ui) { 10752$("#Ort").val(ui.item.id); 10753plz = ui.item.value; 10754plz = plz.substring(0, 5); 10755$("#PLZ").val(plz); 10756return false;
10757} 10758}); 10759$("#VST_Strasse").autocomplete({ 10760source: function(request, response) { 10761$.ajax({ 10762url: "/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=SearchStrasseJSON", 10763dataType: "json", 10764data: { 10765term : request.term, 10766PLZ : $('#VST_PLZ').val(), 10767Ort : escape($("#VST_Ort").val()), 10768Strasse : escape($("#VST_Strasse").val()), 10769URLEncoding : "Escaped" 10770}, 10771success: function(data) { 10772response(data); 10773} 10774}); 10775}, 10776minLength: 1, 10777select: function(event, ui) { 10778setTimeout("$('#VST_HausNr').focus()", 200); 10779$("#VST_Strasse").parent().removeClass("error"); 10780$("#VST_Strasse").parent().addClass("ok"); 10781$("#FehlermeldungRahmen").hide(); 10782} 10783}); 10784$("#Strasse").autocomplete({ 10785source: function(request, response) { 10786$.ajax({ 10787url: "/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=SearchStrasseJSON", 10788dataType: "json", 10789data: { 10790term : request.term, 10791PLZ : $('#PLZ').val(), 10792Ort : escape($("#Ort").val()), 10793Strasse : escape($("#Strasse").val()), 10794URLEncoding : "Escaped" 10795}, 10796success: function(data) { 10797response(data); 10798} 10799}); 10800}, 10801minLength: 1, 10802select: function(event, ui) { 10803setTimeout("$('#HausNr').focus()", 200); 10804} 10805}); 10806} 10807var Zeit = new Date(); 10808try 10809{ 10810if (isDefined("AktuelleZeitMillisekunden")) 10811var Zeit = new Date(AktuelleZeitMillisekunden); 10812} 10813catch (e) 10814{ } 10815$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen', 10816closeText: 'schließen', closeStatus: 'ohne Änderungen schließen', 10817prevText: '<zurück', prevStatus: 'letzten Monat zeigen', 10818nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen', 10819currentText: 'heute', currentStatus: '', 10820monthNames: ['Januar','Februar','März','April','Mai','Juni', 10821'Juli','August','September','Oktober','November','Dezember'], 10822monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 10823'Jul','Aug','Sep','Okt','Nov','Dez'], 10824monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen', 10825weekHeader: 'Wo', weekStatus: 'Woche des Monats', 10826dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], 10827dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], 10828dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], 10829dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d', 10830dateFormat: 'dd.mm.yy', firstDay: 1, 10831initStatus: 'Wähle ein Datum', isRTL: false}; 10832$.datepicker.setDefaults($.datepicker.regional['de']); 10833$( "#LieferbeginnDatum" ).datepicker({ 10834defaultDate: Zeit, 10835beforeShowDay: function(date){ 10836if(date.getDate()==1 || $("#Umzug").is(':checked') || !LfristEingeschraenkt){ 10837return [true,""]; 10838} else { 10839return [false,""]; 10840} 10841}, 10842numberOfMonths: 1, 10843minDate: (LieferBTag), maxDate: "+7M", 10844onSelect: function(dateText, inst) { 10845$(this).parent().removeClass("error"); 10846$(this).parent().addClass("ok"); 10847$("#FehlermeldungRahmen").hide(); 10848} 10849}); 10850$( "#EinzugsDatum" ).datepicker({ 10851defaultDate: Zeit, 10852numberOfMonths: 1, 10853minDate: (EinzugTag), maxDate: "+7M", 10854onSelect: function(dateText, inst) { 10855$(this).parent().removeClass("error"); 10856$(this).parent().addClass("ok"); 10857$("#FehlermeldungRahmen").hide(); 10858} 10859}); 10860$( "#Ablesetermin, #AbleseterminKombiGas" ).datepicker({ 10861defaultDate: Zeit, 10862numberOfMonths: 1, 10863maxDate: "+0M", 10864onSelect: function(dateText, inst) { 10865$(this).parent().removeClass("error"); 10866$(this).parent().addClass("ok"); 10867$("#FehlermeldungRahmen").hide(); 10868} 10869}); 10870$('.ui-slider-handle').bind('touchmove', function(event) 10871{ 10872var e = event.originalEvent; 10873var left = $(this).parent().offset().left; 10874var right = left + $(this).parent().width(); 10875var min = $(this).parent().slider('option', 'min'); 10876var max = $(this).parent().slider('option', 'max'); 10877var newvalue = min + (e.touches.item(0).clientX-left)/(right-left)*(max-min); 10878$(this).parent().slider('value', newvalue); 10879}); 10880$(".produktname li a").on("tap",function(){ 10881tooltip = $(this).attr("title"); 10882alert(tooltip); 10883}); 10884$(".Tarifart").click( function(){ 10885if ($("#Stromart").is(":checked")) { 10886$("#Tarifart").val("Waermestrom"); 10887} 10888if($("#Zaehlerart").is(":checked")){ 10889$("#Tarifart").val("Doppeltarif"); 10890} 10891if($("#Zaehlerart").is(":checked") && $("#Stromart").is(":checked")){ 10892$("#Tarifart").val("DoppeltarifWaermestrom"); 10893} 10894if(!$("#Zaehlerart").is(":checked") && !$("#Stromart").is(":checked")){ 10895$("#Tarifart").val("Eintarif"); 10896} 10897}); 10898}); 10899OptGebDatumPflicht = false;
10900OptTarifsortierung = false; 10901OptVorversorger = true; 10902OptPostverzeichnis = true; 10903OptCrossSelling = true; 10904function showPostNeu() { 10905if ($("#AbweichendeAnschrift1").is(":checked")) { 10906$("#post").show(); 10907} 10908else { 10909$("#post").hide(); 10910$("#Fehlermeldung").html(""); 10911$("#Fehlermeldung").hide(); 10912$("#post input").val(""); 10913$("#anrede1").removeAttr("checked"); 10914$("#anrede2").removeAttr("checked"); 10915} 10916} 10917function SendeVertragsdaten() { 10918try 10919{ 10920$("#Fehlermeldung").empty(); 10921PLZ = $("#VST_PLZ").val(); 10922Ort = escape($("#VST_Ort").val()); 10923Strasse = escape($("#VST_Strasse").val()); 10924if (CheckVertragsdaten(true)) { 10925if(OptPostverzeichnis==true && $("#VST_PLZ").val()!="12345") 10926{ 10927$.get("/servicesGips/Gips?Anwendung=PostVerzeichnis&Methode=ValidateAdresse", 10928{ Strasse: Strasse, Ort: Ort, PLZ: PLZ, URLEncoding : "Escaped" }, 10929function(data){ 10930if (data == "J") { 10931document.forms['Inhaltsform'].submit(); 10932} 10933else { 10934$("#VST_Strasse").parent().removeClass("ok"); 10935$("#VST_Strasse").parent().addClass("error"); 10936$("#Fehlermeldung").html("<p class=\"error\">Ihre eingebene Lieferanschrift ist nicht korrekt. Bitte überprüfen Sie Ihre Eingabe.</p>"); 10937$("#FehlermeldungRahmen").show(); 10938} 10939}); 10940} 10941else document.forms['Inhaltsform'].submit(); 10942} 10943scrollTop(); 10944return false; 10945} 10946catch (e) 10947{ 10948logError(e); 10949} 10950return false; 10951} 10952function CheckVertragsdaten(submit) { 10953var Kundenart = $("#TRKundenart").val(); 10954if (Kundenart=="Privatkunde") { 10955if(!OptGebDatumPflicht) var PflichtfelderNamen = new Array("Anrede","Vorname","Name","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 10956else var PflichtfelderNamen = new Array("Anrede","Vorname","Name","Geburtsdatum","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 10957} 10958else 10959var PflichtfelderNamen = new Array("Name","E-Mail","Telefon","VST_PLZ","VST_Strasse","VST_HausNr"); 10960var Feldfehler = new Array(); 10961var RahmenId; 10962var SeiteOK = true; 10963Feldfehler = PflichtfelderFehler(PflichtfelderNamen); 10964if($("#Fehlermeldung").html().replace(/\s+/g, '')!="") submit=true; 10965else { 10966$("#Fehlermeldung").empty(); 10967for (var j = 0; j < PflichtfelderNamen.length; j++) { 10968RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 10969$(RahmenId).removeClass("error"); 10970$(RahmenId).addClass("ok"); 10971} 10972} 10973if (Feldfehler.length > 0) { 10974$("#Fehlermeldung").append("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 10975for (var i = 0; i < Feldfehler.length; i++) { 10976RahmenId = "#"+Feldfehler[i]+"_Rahmen"; 10977$(RahmenId).addClass("error"); 10978$(RahmenId).removeClass("ok"); 10979} 10980SeiteOK = false; 10981} 10982if (Kundenart=="Privatkunde") { 10983if ($("#anrede1").is(':not(:checked)') && $("#anrede2").is(':not(:checked)') && $("#anrede3").is(':not(:checked)') && $("#anrede4").is(':not(:checked)') ) { 10984$("#Fehlermeldung").append("<p class=\"error\">Bitte wählen Sie eine Anrede aus.</p>"); 10985RahmenId = "#Anrede_Rahmen"; 10986$(RahmenId).addClass("error"); 10987$(RahmenId).removeClass("ok"); 10988SeiteOK = false; 10989} 10990} 10991else { 10992if ($("#anrede1").is(':not(:checked)') && $("#anrede2").is(':not(:checked)') && $("#anrede3").is(':not(:checked)')) { 10993$("#Fehlermeldung").append("<p class=\"error\">Bitte wählen Sie eine Anrede aus.</p>"); 10994RahmenId = "#Anrede_Rahmen"; 10995$(RahmenId).addClass("error"); 10996$(RahmenId).removeClass("ok"); 10997SeiteOK = false; 10998} 10999} 11000if (!istGueltigeEmail($("#E-Mail").val())) { 11001$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie eine gültige E-Mail-Adresse an.</p>"); 11002RahmenId = "#E-Mail_Rahmen"; 11003$(RahmenId).addClass("error"); 11004$(RahmenId).removeClass("ok"); 11005SeiteOK = false; 11006} 11007if (Kundenart=="Privatkunde") { 11008if (!istGueltigesDatum($("#Geburtsdatum").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 11009$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie ein gültiges Geburtsdatum im Format TT.MM.JJJJ an.</p>"); 11010RahmenId = "#Geburtsdatum_Rahmen"; 11011$(RahmenId).addClass("error"); 11012$(RahmenId).removeClass("ok"); 11013SeiteOK = false; 11014} 11015else if (!istGueltigesGebDatum($("#Geburtsdatum").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 11016$("#Fehlermeldung").append("<p class=\"error\">Bei Vertragsabschluss müssen Sie mindestens 18 Jahre alt sein.</p>"); 11017RahmenId = "#Geburtsdatum_Rahmen"; 11018$(RahmenId).addClass("error"); 11019$(RahmenId).removeClass("ok"); 11020SeiteOK = false;
11021} 11022} 11023if ($("#VST_HausNr").val() == "" && $("#VST_Strasse").val()!="") { 11024$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihre die Hausnummer Ihrer Lieferanschrift an.</p>"); 11025RahmenId = "#VST_Strasse_Rahmen"; 11026$(RahmenId).addClass("error"); 11027$(RahmenId).removeClass("ok"); 11028SeiteOK = false; 11029} 11030if($("input[name='Anrede']").length > 2 && Kundenart=="Privatkunde") { 11031if(!OptGebDatumPflicht) var PflichtfelderNamen3 = new Array("Vertragspartner2_Vorname"); 11032else var PflichtfelderNamen3 = new Array("Vertragspartner2_Vorname","Vertragspartner2_Geburtsdatum"); 11033var Feldfehler3 = new Array(); 11034Feldfehler3 = PflichtfelderFehler(PflichtfelderNamen3); 11035if (document.getElementsByName("Anrede")[2].checked == true || document.getElementsByName("Anrede")[3].checked == true) { 11036for (var j = 0; j < PflichtfelderNamen3.length; j++) { 11037RahmenId = "#"+PflichtfelderNamen3[j]+"_Rahmen"; 11038$(RahmenId).removeClass("error"); 11039$(RahmenId).addClass("ok"); 11040} 11041if (Feldfehler3.length > 0) { 11042$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie die Daten des 2. Vertragspartners an.</p>"); 11043for (var i = 0; i < Feldfehler3.length; i++) { 11044RahmenId = "#"+Feldfehler3[i]+"_Rahmen"; 11045$(RahmenId).addClass("error"); 11046$(RahmenId).removeClass("ok"); 11047} 11048SeiteOK = false; 11049} 11050if (!istGueltigesDatum($("#Geburtsdatum2").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 11051$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie für den 2. Vertragspartner ein gültiges Geburtsdatum im Format TT.MM.JJJJ an.</p>"); 11052RahmenId = "#Vertragspartner2_Geburtsdatum_Rahmen"; 11053$(RahmenId).addClass("error"); 11054$(RahmenId).removeClass("ok"); 11055SeiteOK = false; 11056} 11057else if (!istGueltigesGebDatum($("#Geburtsdatum2").val()) && (OptGebDatumPflicht || $("#Geburtsdatum").val()!="")) { 11058$("#Fehlermeldung").append("<p class=\"error\">Bei Vertragsabschluss müssen alle Vertragspartner zwischen 18 und 120 Jahre alt sein.</p>"); 11059RahmenId = "#Vertragspartner2_Geburtsdatum_Rahmen"; 11060$(RahmenId).addClass("error"); 11061$(RahmenId).removeClass("ok"); 11062SeiteOK = false; 11063} 11064} 11065else { 11066for (var j = 0; j < PflichtfelderNamen3.length; j++) { 11067RahmenId = "#"+PflichtfelderNamen3[j]+"_Rahmen"; 11068$(RahmenId).removeClass("ok"); 11069$(RahmenId).removeClass("error"); 11070} 11071$("#Vertragspartner2_Vorname").attr({ value: "" }); 11072$("#Vertragspartner2_Name").attr({ value: "" }); 11073$("#Vertragspartner2_Geburtsdatum").attr({ value: "" }); 11074} 11075} 11076$("div[class='Feldrahmen'] > input[value!='']:text").parent().addClass("ok"); 11077if(!submit) $("#Fehlermeldung").empty(); 11078if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 11079else $("#FehlermeldungRahmen").show(); 11080return SeiteOK; 11081} 11082function SendeRechnungsanschrift() { 11083try 11084{ 11085$("#Fehlermeldung").empty(); 11086if (CheckRechnungsanschrift(true)) { 11087document.forms['Inhaltsform'].submit(); 11088} 11089scrollTop(); 11090return false; 11091} 11092catch (e) 11093{ 11094logError(e); 11095} 11096return false; 11097} 11098function CheckRechnungsanschrift(submit) { 11099var PflichtfelderNamen = new Array("PLZ","Ort","Strasse","HausNr"); 11100var Feldfehler = new Array(); 11101var RahmenId; 11102var SeiteOK = true; 11103Feldfehler = PflichtfelderFehler(PflichtfelderNamen); 11104if ($("#AbweichendeAnschrift1").is(":checked")) { 11105for (var j = 0; j < PflichtfelderNamen.length; j++) { 11106RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 11107$(RahmenId).removeClass("error"); 11108$(RahmenId).addClass("ok"); 11109} 11110if (Feldfehler.length > 0) { 11111$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihre Rechnungsanschrift vollständig an.</p>"); 11112for (var i = 0; i < Feldfehler.length; i++) { 11113RahmenId = "#"+Feldfehler[i]+"_Rahmen"; 11114$(RahmenId).addClass("error"); 11115$(RahmenId).removeClass("ok"); 11116} 11117SeiteOK = false; 11118} 11119if ($("#Ort").val() == "" && $("#PLZ").val()!="") { 11120RahmenId = "#PLZ_Rahmen"; 11121$(RahmenId).addClass("error"); 11122$(RahmenId).removeClass("ok"); 11123SeiteOK = false; 11124} 11125if ($("#HausNr").val() == "" && $("#Strasse").val()!="") { 11126RahmenId = "#Strasse_Rahmen"; 11127$(RahmenId).addClass("error"); 11128$(RahmenId).removeClass("ok"); 11129SeiteOK = false; 11130} 11131} 11132else { 11133for (var j = 0; j < PflichtfelderNamen.length; j++) { 11134RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 11135$(RahmenId).removeClass("ok"); 11136$(RahmenId).removeClass("error"); 11137} 11138$("#AbweichenderName").attr({ value: "" }); 11139$("#PLZ").attr({ value: "" }); 11140$("#Ort").attr({ value: "" }); 11141$("#Strasse").attr({ value: "" }); 11142$("#HausNr").attr({ value: "" }); 11143$("#HausNrZusatz").attr({ value: "" }); 11144} 11145$("div[class='Feldrahmen'] > input[value!='']:text").parent().addClass("ok"); 11146if(!submit) $("#Fehlermeldung").empty(); 11147if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 11148else $("#FehlermeldungRahmen").show(); 11149return SeiteOK; 11150} 11151function SendeLieferung() { 11152try 11153{ 11154$("#Fehlermeldung").empty(); 11155if (CheckLieferung(true)) { 11156document.forms['Inhaltsform'].submit(); 11157} 11158scrollTop(); 11159return false;
11160} 11161catch (e) 11162{ 11163HRLogError(e); 11164} 11165return false; 11166} 11167function CheckLieferung(submit) { 11168var PflichtfelderNamen = new Array("Lieferbeginn"); 11169var Feldfehler = new Array(); 11170var RahmenId; 11171var SeiteOK = true; 11172Feldfehler = PflichtfelderFehler(PflichtfelderNamen); 11173if($("#Fehlermeldung").html().replace(/\s+/g, '')!="") submit=true; 11174else { 11175$("#Fehlermeldung").empty(); 11176for (var j = 0; j < PflichtfelderNamen.length; j++) { 11177RahmenId = "#"+PflichtfelderNamen[j]+"_Rahmen"; 11178$(RahmenId).removeClass("error"); 11179$(RahmenId).addClass("ok"); 11180} 11181} 11182if (Feldfehler.length > 0) { 11183$("#Fehlermeldung").append("<p class=\"error\">Bitte ergänzen/korrigieren Sie noch die markierten Eingabefelder.</p>"); 11184for (var i = 0; i < Feldfehler.length; i++) { 11185RahmenId = "#"+Feldfehler[i]+"_Rahmen"; 11186$(RahmenId).addClass("error"); 11187$(RahmenId).removeClass("ok"); 11188} 11189SeiteOK = false; 11190} 11191if($("#Zaehlernr").val()!="" ||$("#Zaehlpunkt").val()!="" || $("#Vertragswechsel").is(':checked')) { 11192$("#Zaehlernummer_Rahmen").removeClass("error"); 11193$("#Zaehlpunkt_Rahmen").removeClass("error"); 11194} 11195else { 11196$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie entweder die Zählernummer oder alternativ die Zählpunktbezeichnung an.</p>"); 11197RahmenId = "#Zaehlernummer_Rahmen"; 11198$(RahmenId).addClass("error"); 11199$(RahmenId).removeClass("ok"); 11200RahmenId = "#Zaehlpunkt_Rahmen"; 11201$(RahmenId).addClass("error"); 11202$(RahmenId).removeClass("ok"); 11203SeiteOK = false; 11204} 11205if($("#ZaehlernrKombiGas").val()!="" || $("#Zaehlpunkt").val()!="" || $("#Vertragswechsel").is(':checked')) { 11206$("#ZaehlernummerKombiGas_Rahmen").removeClass("error"); 11207$("#Zaehlpunkt_Rahmen").removeClass("error"); 11208} 11209else { 11210$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie entweder die Zählernummer oder alternativ die Zählpunktbezeichnung an.</p>"); 11211RahmenId = "#ZaehlernummerKombiGas_Rahmen"; 11212$(RahmenId).addClass("error"); 11213$(RahmenId).removeClass("ok"); 11214RahmenId = "#Zaehlpunkt_Rahmen"; 11215$(RahmenId).addClass("error"); 11216$(RahmenId).removeClass("ok"); 11217SeiteOK = false; 11218} 11219zaehlpunktfehler = checkZaehlpunkt('Zaehlpunkt', 'TRPLZ', ''); 11220if ($("#Zaehlpunkt").val()!="" && zaehlpunktfehler!="") { 11221$("#Fehlermeldung").append("<p class=\"error\">"+zaehlpunktfehler+"</p>"); 11222RahmenId = "#Zaehlpunkt_Rahmen"; 11223$(RahmenId).addClass("error"); 11224$(RahmenId).removeClass("ok"); 11225SeiteOK = false; 11226} 11227else if ($("#Zaehlpunkt").val()!="") { 11228RahmenId = "#Zaehlpunkt_Rahmen"; 11229$(RahmenId).addClass("ok"); 11230$(RahmenId).removeClass("error"); 11231} 11232if ($("#Zaehlernr").val()!="") { 11233RahmenId = "#Zaehlernummer_Rahmen"; 11234$(RahmenId).addClass("ok"); 11235$(RahmenId).removeClass("error"); 11236} 11237if ($("#Vertragswechsel").is(':checked') || $("#Versorgerwechsel").is(':checked') || $("#Umzug").is(':checked')) $("#Lieferauftrag_Rahmen").removeClass("error"); 11238else { 11239$("#Lieferauftrag_Rahmen").addClass("error"); 11240$("#Lieferauftrag_Rahmen").removeClass("ok"); 11241SeiteOK = false; 11242} 11243if ($("#Vertragswechsel").is(':checked') && $("#termin_spaeter").is(':checked') && !setzeLiefertermin()) { 11244$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie einen gültigen Liefertermin an. Die Belieferung kann frühestens zum 1. des nächsten Monats beginnen.</p>"); 11245RahmenId = "#LieferbeginnDatum_Rahmen"; 11246$(RahmenId).addClass("error"); 11247$(RahmenId).removeClass("ok"); 11248SeiteOK = false; 11249} 11250else if ($("#Versorgerwechsel").is(':checked') && $("#termin_spaeter").is(':checked') && !setzeLiefertermin()) { 11251$("#Fehlermeldung").append("<p class=\"error\">"+FehlerTextLieferbeginn+"</p>"); 11252RahmenId = "#LieferbeginnDatum_Rahmen"; 11253$(RahmenId).addClass("error"); 11254$(RahmenId).removeClass("ok"); 11255SeiteOK = false; 11256} 11257else if ($("#Umzug").is(':checked') && !setzeLiefertermin()) { 11258$("#Fehlermeldung").append("<p class=\"error\">"+FehlerTextEinzug+"</p>"); 11259RahmenId = "#EinzugsDatum_Rahmen"; 11260$(RahmenId).addClass("error"); 11261$(RahmenId).removeClass("ok"); 11262SeiteOK = false; 11263} 11264else { 11265RahmenId = "#LieferbeginnDatum_Rahmen"; 11266$(RahmenId).removeClass("error"); 11267$(RahmenId).addClass("ok"); 11268RahmenId = "#EinzugsDatum_Rahmen"; 11269$(RahmenId).removeClass("error"); 11270$(RahmenId).addClass("ok"); 11271} 11272if($("#Vollmacht").is(":checked") || $("#Vertragswechsel").is(':checked') || $("#Umzug").is(':checked')) $("#Vollmacht_Rahmen").removeClass("error"); 11273else { 11274$("#Fehlermeldung").append("<p class=\"error\">Bitte erteilen Sie die Vollmacht.</p>"); 11275$("#Vollmacht_Rahmen").addClass("error"); 11276$(RahmenId).removeClass("ok");
11277$(RahmenId).removeClass("ok"); 11278SeiteOK = false; 11279} 11280var PflichtfelderNamen2 = new Array("BisherigerLieferant","BisherigeKundenNr"); 11281var vorlieferantKombiGas = document.getElementById('GasVorlieferantKombi'); 11282var kdnrKombiGas = document.getElementById('kdnrKombiGas'); 11283if((typeof(vorlieferantKombiGas) != 'undefined' && vorlieferantKombiGas != null) && (typeof(kdnrKombiGas) != 'undefined' && kdnrKombiGas != null)) 11284{ 11285var PflichtfelderNamen2 = new Array("BisherigerLieferant","BisherigeKundenNr", "BisherigerLieferantKombiGas", "BisherigeKundenNrKombiGas"); 11286} 11287var Feldfehler2 = new Array(); 11288Feldfehler2 = PflichtfelderFehler(PflichtfelderNamen2); 11289for (var j = 0; j < PflichtfelderNamen2.length; j++) { 11290RahmenId = "#"+PflichtfelderNamen2[j]+"_Rahmen"; 11291$(RahmenId).removeClass("error"); 11292$(RahmenId).addClass("ok"); 11293} 11294if ($("#Versorgerwechsel").is(':checked')) { 11295if (Feldfehler2.length > 0) { 11296$("#Fehlermeldung").append("<p class=\"error\">Bitte geben Sie Ihren Vorlieferanten und Ihre bisherige Kundennummer an.</p>"); 11297for (var i = 0; i < Feldfehler2.length; i++) { 11298RahmenId = "#"+Feldfehler2[i]+"_Rahmen"; 11299$(RahmenId).addClass("error"); 11300$(RahmenId).removeClass("ok"); 11301} 11302SeiteOK = false; 11303} 11304} 11305$("div[class='Feldrahmen'] > input[value!='']:text").parent().addClass("ok"); 11306if(!submit) $("#Fehlermeldung").empty(); 11307if($("#Fehlermeldung").html().replace(/\s+/g, '')=="") $("#FehlermeldungRahmen").hide(); 11308else $("#FehlermeldungRahmen").show(); 11309return SeiteOK; 11310} 11311$(document).ready(function() {}); 11312$(document).ready(function () { 11313musterrechnung(); 11314sharing(); 11315if($('#idMarkedErrorsHintMessage').length){ 11316$('.Aufklappkasten2.formular > h2 > a').click(); 11317scrollingDistance = $('a[name="formular"]').offset().top - 100; 11318$("html, body").animate({scrollTop: scrollingDistance}, 500); 11319} 11320$('.tWidgetButtonStyle').text('Jetzt SWN Festpreis empfehlen'); 11321$("#nav .ym-hlist > ul > li > a, #nav .ym-hlist > ul > li > span").each(function(){ 11322var img = "<img src='/neuwiedGips/static/cms/Webpage2020/img/nav_hover.svg' height='20' alt=''/>"; 11323$(this).append(img); 11324}); 11325if($(".navcontent").length) { 11326$(".navcontent.privatkundenContent").appendTo('#nav .ym-hlist > ul > li.privatkundenEbene > ul > li > ul'); 11327$(".navcontent.geschaeftskundenContent").appendTo('#nav .ym-hlist > ul > li.geschaeftskundenEbene > ul > li > ul'); 11328$(".navcontent.gesellschaftvereineContent").appendTo('#nav .ym-hlist > ul > li.gesellschaftvereineEbene > ul > li > ul'); 11329$(".navcontent.karriereContent").appendTo('#nav .ym-hlist > ul > li.karriereEbene > ul > li > ul'); 11330$(".navcontent.ueberunsContent").appendTo('#nav .ym-hlist > ul > li.ueberunsEbene > ul > li > ul'); 11331$(".navcontent.kontaktContent").appendTo('#nav .ym-hlist > ul > li.kontaktEbene > ul > li > ul'); 11332$(".navcontent.netzbetriebContent").appendTo('#nav .ym-hlist > ul > li.netzbetriebEbene > ul > li > ul'); 11333} 11334$('.SlideshowTabsUnten li.selected').addClass('first_anim'); 11335$("#nav .has-children > a").on("auxclick", function(e) { 11336if( e.which == 2 || e.which == 3 ) { 11337e.preventDefault(); 11338return false; 11339} 11340}); 11341$("#nav .has-children > a").on("contextmenu", function(e) { 11342e.preventDefault(); 11343}); 11344$('#brotkrumen ul li:not(:first-child) a').on("auxclick", function(e) { 11345if( e.which == 2 || e.which == 3 ) { 11346e.preventDefault(); 11347return false; 11348} 11349}); 11350$('#brotkrumen ul li:not(:first-child) a').click(function(e) { 11351e.preventDefault(); 11352}); 11353$('#brotkrumen ul li:not(:first-child) a').on("contextmenu", function(e) { 11354e.preventDefault(); 11355}); 11356if($('a[name="ansprechpartner"]').length) { 11357$('#faehnchen .ansprechpartner').show(); 11358} 11359$("#faehnchen .ansprechpartner a").on("click", function(event) { 11360var anchorId = $(this).attr("href").substring(1); 11361var anchorTarget = $('a[name="' + anchorId + '"]'); 11362if (anchorTarget.length > 0) 11363{ 11364event.preventDefault(); 11365scrollingDistance = anchorTarget.offset().top - 100; 11366$("html, body").animate({scrollTop: scrollingDistance}, 500); 11367} 11368}); 11369$("a").on("click", function(event) { 11370if(!$(this).parent().hasClass('ansprechpartner')){ 11371if($(this).attr('href').indexOf("#") == 0 && $(this).attr('href').length > 1){ 11372var anchorId = $(this).attr("href").substring(1); 11373var anchorTarget = $('a[name="' + anchorId + '"]'); 11374if (anchorTarget.length > 0) 11375{ 11376event.preventDefault(); 11377scrollingDistance = anchorTarget.offset().top - 100; 11378$("html, body").animate({scrollTop: scrollingDistance}, 500); 11379} 11380} 11381} 11382}); 11383$("#faehnchen .telefon a").on("click", function(event) { 11384event.preventDefault(); 11385var leftVal = 400; 11386if($(window).width() <= 450){ 11387leftVal = $(window).width() - 50; 11388} 11389if($(this).parent().hasClass('open')){ 11390$('#faehnchen').css('right', '0'); 11391setTimeout(function(){ 11392$("#faehnchen .telefon").removeClass('open'); 11393$('.mail-box').removeClass('hide'); 11394}, 300); 11395} else { 11396$('#faehnchen').css('right', leftVal + 'px'); 11397$("#faehnchen .telefon").addClass('open'); 11398if($('.telefon-box').hasClass('hide')){ 11399$('.telefon-box').removeClass('hide'); 11400$("#faehnchen .mail").removeClass('open'); 11401} 11402$('.mail-box').addClass('hide'); 11403} 11404}); 11405$('#Stromrechnerform .tr-submit').append('<span class="loading-anim"><span></span><span></span><span></span><span></span></span>'); 11406$("#handleStrom").roundSlider({ 11407sliderType: "min-range", 11408circleShape: 'pie', 11409editableTooltip: false, 11410keyboardAction: false, 11411radius: 55, 11412width: 6, 11413value: 3, 11414min: 1, 11415max: 8, 11416step: 1, 11417handleSize: 15, 11418handleShape: "round", 11419mouseScrollAction: true, 11420startAngle: 132, 11421endAngle: "+340", 11422tooltipFormat: "changeTooltip", 11423change: function (e) { 11424var faktorpersonen = $('input[name="handleStrom"]').val(); 11425$("#Verbrauch_Strom").val(strompreise[parseInt(faktorpersonen)-1]); 11426} 11427}); 11428$("#handleErdgas").roundSlider({ 11429sliderType: "min-range", 11430circleShape: 'pie', 11431editableTooltip: false, 11432radius: 55, 11433width: 6, 11434value: 60, 11435min: 20, 11436max: 625, 11437step: 1, 11438handleSize: 15, 11439handleShape: "round", 11440mouseScrollAction: true, 11441startAngle: 132, 11442endAngle: "+340", 11443tooltipFormat: "changeTooltip", 11444change: function(e) { 11445var faktorpersonenGas = $('input[name="handleErdgas"]').val(); 11446$("#Verbrauch").val(faktorpersonenGas * 160); 11447} 11448}); 11449$("#handleWaerme").roundSlider({ 11450sliderType: "min-range", 11451circleShape: 'pie', 11452editableTooltip: false, 11453radius: 55, 11454width: 6, 11455value: 60, 11456min: 20, 11457max: 625, 11458step: 1, 11459handleSize: 15, 11460handleShape: "round", 11461mouseScrollAction: true, 11462startAngle: 132, 11463endAngle: "+340", 11464tooltipFormat: "changeTooltip", 11465change: function(e) { 11466var faktorpersonenGas = $('input[name="handleWaerme"]').val(); 11467console.log(faktorpersonenGas * 30); 11468$("#Verbrauch_Waermestrom").val(faktorpersonenGas * 30); 11469} 11470}); 11471$('.unsorted').slick({ 11472centerMode: false, 11473centerPadding: '0px', 11474mobileFirst: true, 11475infinite: false, 11476slidesToShow: 1, 11477slidesToScroll: 1, 11478dots: true, 11479waitForAnimate: false, 11480variableWidth: false,
11481arrows: false, 11482initialSlide: 0, 11483focusOnSelect: true, 11484responsive: [ 11485{ 11486breakpoint: 640, 11487settings: { 11488slidesToShow: 2, 11489initialSlide: 0, 11490} 11491}, 11492{ 11493breakpoint: 980, 11494settings: { 11495slidesToShow: 3, 11496initialSlide: 0, 11497} 11498} 11499] 11500}); 11501wrapTables(); 11502buildBGImage(); 11503var AnzKasten = 0; 11504var leftVal = 0; 11505if($('.quicklinks').length){ 11506AnzKasten = $('.quicklinks')[0].childElementCount; 11507toggleDecadeVisibility(AnzKasten); 11508} 11509$('.quicklinks .Linkkasten').each(function(index) { 11510if(index == 1){ 11511leftVal = $(this).width() + 16; 11512} 11513}); 11514showQuickNav(AnzKasten, leftVal); 11515$(".quicklinks").bind('scroll', function() { 11516$('#quicklinks-nav li').each(function(index) { 11517$(this).removeClass('selected'); 11518}); 11519var selectedItem = 0; 11520$('#quicklinks-nav li').each(function(index) { 11521var maxScroll = (index + 1) * (leftVal - ($('.quicklinks').width() / AnzKasten)); 11522if($('.quicklinks').scrollLeft() <= maxScroll){ 11523selectedItem = index + 1; 11524return false; 11525} else if($('.quicklinks').scrollLeft() >= maxScroll && index == 2) { 11526selectedItem = 3; 11527} 11528}); 11529$('#quicklinks-nav li:nth-child(' + selectedItem + ')').addClass('selected'); 11530toggleDecadeVisibility(AnzKasten); 11531}); 11532$('#quicklinks-nav li').click(function() { 11533var clickedItem = $(this).find('span').text(); 11534$('.quicklinks .Linkkasten').each(function(index) { 11535$('#quicklinks-nav li').removeClass('selected'); 11536}); 11537$(this).addClass('selected'); 11538$('.quicklinks').animate({ 11539scrollLeft: clickedItem * leftVal - (($('.quicklinks').width() - leftVal) / 2) 11540}, 500); 11541}); 11542$("#scroll-top").click(function() { 11543$('html').animate({ 11544scrollTop:0 11545},300) 11546}); 11547if($('.fortschrittsbalken').length > 0){ 11548$('.fortschrittsbalken').each(function(){ 11549const _this = $(this); 11550const HRHundert = (_this.find('.quote-zahl p').text() / _this.find('.quote-prozent p').text()) * 100; 11551$('<div class="text"><span class="prozent">100%</span><span class="anzahl">' + HRHundert + ' Verträge</span></div>').appendTo(_this); 11552const quoteProzent = _this.find('.quote-prozent p').text(); 11553_this.find('.quote-prozent').css('width', quoteProzent + "%"); 11554let anzAktuell = _this.find('.anzahl-aktuell p').text(); 11555const anzAktuellProzent = anzAktuell / HRHundert * 100; 11556console.log(anzAktuellProzent); 11557_this.find('.anzahl-aktuell').css('width', anzAktuellProzent + "%"); 11558$('<span class="prozent">' + Math.round(anzAktuellProzent) + '%</span><span class="anzahl">' + anzAktuell + ' Verträge</span>').appendTo(_this.find('.anzahl-aktuell')); 11559if(_this.find('.anzahl-aktuell').width() <= 150){ 11560_this.find('.anzahl-aktuell').addClass('klein'); 11561} 11562}
11562); 11563} 11564$(window).resize(function() { 11565showQuickNav(AnzKasten, leftVal); 11566}); 11567}); 11568function showQuickNav(AnzKasten, leftVal) { 11569if ($('.quicklinks').width() < (AnzKasten * leftVal)) { 11570AnzKasten = $('.quicklinks')[0].childElementCount; 11571if(!$('#quicklinks-nav').length){ 11572$('.quicklinks').after('<ul id="quicklinks-nav"></ul>'); 11573$('.quicklinks .Linkkasten').each(function(index) { 11574if(index == 0){ 11575$('#quicklinks-nav').append('<li class="selected"><span>' + index + '</span></li>'); 11576} else { 11577$('#quicklinks-nav').append('<li><span>' + index + '</span></li>'); 11578} 11579}); 11580} 11581toggleDecadeVisibility(AnzKasten); 11582} else { 11583$('#quicklinks-nav').remove(); 11584} 11585} 11586function wrapTables() { 11587$( "#main table, .consent-banner table" ).wrap("<div class='table-responsive-wrap'></div>"); 11588$(".table-responsive-wrap").each(function() { 11589if($(this).width() != $(this).find("table").width()) { 11590$("<div class='table-fader'></div>").insertAfter(this); 11591$(this).next().css("width", $(this).width()); 11592$(this).next().css("height", $(this).height()); 11593$(this).next().css("margin-top", -($(this).height())); 11594} 11595}); 11596$(".table-responsive-wrap").scroll(function () { 11597if($(this).scrollLeft() >= $(this).get(0).scrollWidth - $(this).outerWidth()) { 11598$(this).next().addClass("fader-show"); 11599} 11600else { 11601$(this).next().removeClass("fader-show"); 11602} 11603}); 11604} 11605function toggleDecadeVisibility(AnzKasten) { 11606var windowWidth = $(window).width(); 11607if ($(window).width() < (AnzKasten * 296)) { 11608$('.quicklinks .Linkkasten').each(function() { 11609var elementLeft = $(this).offset().left, 11610visibleOffset = (-(($(this).width() / 2) - 40)), 11611hideOffset = windowWidth - ($(this).width() / 2); 11612if (elementLeft <= visibleOffset || elementLeft > hideOffset) { 11613$(this).addClass('linkkasten-invisible'); 11614} else { 11615$(this).removeClass('linkkasten-invisible'); 11616} 11617}); 11618} 11619} 11620function buildBGImage(){ 11621$("#Kopfbild > img").each(function(){ 11622var imgsrc = $(this).attr("src"); 11623$(this).parent().css("background-image", "url('"+imgsrc+"')"); 11624$(this).css("display", "none"); 11625}); 11626$("#Kopfbild > img.position-left").each(function(){ 11627var imgsrc = $(this).attr("src"); 11628$(this).parent().css("background-image", "url('"+imgsrc+"')"); 11629$(this).parent().css("background-position", "left center"); 11630$(this).css("display", "none"); 11631}); 11632$("#Kopfbild .SlideshowContentInnen > img").each(function(){ 11633var imgsrc = $(this).attr("src"); 11634$(this).parent().css("background-image", "url('"+imgsrc+"')"); 11635$(this).css("display", "none"); 11636}); 11637} 11638function openDetail(Item) { 11639if($("#produktdetails").css("display")=="none") { 11640var details = Item.cloneNode(true); 11641document.getElementById("produktdetails").appendChild(details); 11642$("#produktdetails").fadeIn(); 11643} 11644else { 11645$("#produktdetails").fadeOut(); 11646$("#produktdetails .produktdetails").remove(); 11647} 11648} 11649function musterrechnung() { 11650$('.mr-navigation a').click(function(e){ 11651var mrSeite = $(this).attr('href'); 11652$('.mr-navigation a').removeClass('active'); 11653$(this).addClass('active'); 11654$('.mr-seite').removeClass('active'); 11655$('.mr-seite[data-seite="' + mrSeite + '"]').addClass('active'); 11656e.preventDefault(); 11657}); 11658$('.mr-eintrag').on('touchstart', function(e){ 11659e.preventDefault(); 11660$('.mr-eintrag').each(function(){ 11661$(this).removeClass('hover'); 11662}); 11663$(this).addClass('hover'); 11664}); 11665} 11666function sharing(){ 11667const myTitle = $('.blog-artikel > h1').text(); 11668const myShareUrl = encodeURIComponent(location.href); 11669const myShareText = 'Sieh dir an, was ich gefunden habe:'; 11670$('.hr-sharing-mail a').click(function(e){ 11671e.preventDefault(); 11672var myUrl = $(this).attr('href'); 11673var myBody = myShareText + '%0D%0A%0D%0A ' + myShareUrl; 11674var mailTo = ""; 11675window.location.href = "mailto:" + mailTo + "?subject=" + myTitle + "&body=" + myBody; 11676}); 11677}
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.