var steuersatz = 0.19; var flaeche_E44 = 0; function calcInstalled() { var installed = 0; var einzelleistung2 = parseInt(document.querySelector("#einzelleistung_2").textContent); var einzelleistung3 = parseInt(document.querySelector("#einzelleistung_3").textContent); var einzelleistung4 = parseInt(document.querySelector("#einzelleistung_4").textContent); var einzelleistung5 = parseInt(document.querySelector("#einzelleistung_5").textContent); var leistung2 = parseInt(document.querySelector("#product_2").value) * einzelleistung2; var leistung3 = parseInt(document.querySelector("#product_3").value) * einzelleistung3; var leistung4 = parseInt(document.querySelector("#product_4").value) * einzelleistung4; var leistung5 = parseInt(document.querySelector("#product_5").value) * einzelleistung5; document.querySelector("#product-leistung-2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(leistung2) + " Watt"; document.querySelector("#product-leistung-3").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(leistung3) + " Watt"; document.querySelector("#product-leistung-4").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(leistung4) + " Watt"; document.querySelector("#product-leistung-5").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(leistung5) + " Watt"; installed = leistung2 +leistung3 + leistung4+ leistung5; document.querySelector("#val_installed").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(installed); document.querySelector("#val_installed2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(installed); var benoetigt = document.querySelector("#benoetigte_leistung").textContent; benoetigt = benoetigt.replace(".",""); if(installed >= parseFloat(benoetigt)) { document.querySelector('#not_ok').style.display = "none"; document.querySelector('#all_ok').style.display = "table-row"; } else { document.querySelector('#not_ok').style.display = "table-row"; document.querySelector('#all_ok').style.display = "none"; } var tage = parseInt(document.querySelector("#tage").value); document.querySelector("#tage_val").textContent = tage; var stunden = parseInt(document.querySelector("#stunden").value); document.querySelector("#stunden_val").textContent = stunden; var heizzeit = tage * stunden; document.querySelector("#heizzeit_val").textContent = heizzeit; var gesamtenergie = installed * heizzeit; document.querySelector("#gesamtenergie_val").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(installed / 1000); document.querySelector("#gesamtstunden_val").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(heizzeit); var gesamtkw = heizzeit * installed / 1000; document.querySelector("#gesamt_kw_val").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(gesamtkw); var wohnflaeche = flaeche_E44; var val_kwh_qm = gesamtkw / wohnflaeche; document.querySelector("#val_kwh_qm").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(val_kwh_qm); document.querySelector("#stromverbrauch_in_heizperiode").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(val_kwh_qm); document.querySelector("#val_wohnfl").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(wohnflaeche); document.querySelector("#val_gesamtverbrauch").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(val_kwh_qm); if(val_kwh_qm < 70 * 0.75) { document.querySelector("#saver_message").style.display = "table-row"; } else { document.querySelector("#saver_message").style.display = "none"; } var preis = document.querySelector("#preis").value; preis = preis.replace(",","."); var preisval = parseFloat(preis); var flaeche = document.querySelector("#val_flaeche").textContent; flaeche = flaeche.replace(".",""); flaeche = flaeche.replace(",","."); var flaecheval = parseFloat(flaeche); var val_kosten_heizperiode = preisval * val_kwh_qm * flaeche; document.querySelector("#val_kosten_heizperiode").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(val_kosten_heizperiode); document.querySelector("#preis_ist").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(preisval); document.querySelector("#preis_ist_result").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(val_kosten_heizperiode); document.querySelector("#preis_60_result").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(0.6 * val_kwh_qm * flaeche); document.querySelector("#preis_90_result").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(0.9 * val_kwh_qm * flaeche); var gesamtpreis = 0; var gesamtleistung = 0; var anzahl2 = document.querySelector("#product_2").value; document.querySelector("#anzahl_2").textContent = anzahl2; document.querySelector("#gesamtleistung_2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(anzahl2 * einzelleistung2); var einzelpreis2 = document.querySelector("#einzelpreis_2").textContent; einzelpreis2 = einzelpreis2.replace(",","."); var einzelpreisval2 = parseFloat(einzelpreis2); document.querySelector("#preissumme_2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(anzahl2 * einzelpreis2); gesamtpreis = gesamtpreis + (anzahl2 * einzelpreis2); gesamtleistung = gesamtleistung + (anzahl2 * einzelleistung2); document.querySelector("#product_count_2").textContent = anzahl2; var anzahl3 = document.querySelector("#product_3").value; document.querySelector("#anzahl_3").textContent = anzahl3; document.querySelector("#gesamtleistung_3").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(anzahl3 * einzelleistung3); var einzelpreis3 = document.querySelector("#einzelpreis_3").textContent; einzelpreis3 = einzelpreis3.replace(",","."); var einzelpreisval3 = parseFloat(einzelpreis3); document.querySelector("#preissumme_3").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(anzahl3 * einzelpreis3); gesamtpreis = gesamtpreis + (anzahl3 * einzelpreis3); gesamtleistung = gesamtleistung + (anzahl3 * einzelleistung3); document.querySelector("#product_count_3").textContent = anzahl3; var anzahl4 = document.querySelector("#product_4").value; document.querySelector("#anzahl_4").textContent = anzahl4; document.querySelector("#gesamtleistung_4").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(anzahl4 * einzelleistung4); var einzelpreis4 = document.querySelector("#einzelpreis_4").textContent; einzelpreis4 = einzelpreis4.replace(",","."); var einzelpreisval4 = parseFloat(einzelpreis4); document.querySelector("#preissumme_4").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(anzahl4 * einzelpreis4); gesamtpreis = gesamtpreis + (anzahl4 * einzelpreis4); gesamtleistung = gesamtleistung + (anzahl4 * einzelleistung4); document.querySelector("#product_count_4").textContent = anzahl4; var anzahl5 = document.querySelector("#product_5").value; document.querySelector("#anzahl_5").textContent = anzahl5; document.querySelector("#gesamtleistung_5").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(anzahl5 * einzelleistung5); var einzelpreis5 = document.querySelector("#einzelpreis_5").textContent; einzelpreis5 = einzelpreis5.replace(",","."); var einzelpreisval5 = parseFloat(einzelpreis5); document.querySelector("#preissumme_5").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(anzahl5 * einzelpreis5); gesamtpreis = gesamtpreis + (anzahl5 * einzelpreis5); gesamtleistung = gesamtleistung + (anzahl5 * einzelleistung5); document.querySelector("#product_count_5").textContent = anzahl5; document.querySelector("#investitionspreis").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(gesamtpreis * (1 + steuersatz)); document.querySelector("#investitionspreis2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(gesamtpreis); document.querySelector("#ust").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(gesamtpreis * steuersatz); document.querySelector("#gesamtsumme").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2, minimumFractionDigits: 2}).format(gesamtpreis * (1 + steuersatz)); document.querySelector("#gesamtwatt").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(gesamtleistung); } function resized(){ document.getElementById("slave_1").style.width = document.getElementById("master_1").offsetWidth + "px"; document.getElementById("slave_2").style.width = document.getElementById("master_2").offsetWidth + "px"; document.getElementById("slave_3").style.width = document.getElementById("master_3").offsetWidth + "px"; } function doCalculation() { // Fläche des Raums if(document.getElementById('abmessungen').checked) { var laenge_val = document.querySelector("#laenge").value; laenge_val = laenge_val.replace(",","."); var laenge = parseFloat(laenge_val); document.querySelector(".laenge_x_breite").textContent = "x"; var breite_val = document.querySelector("#breite").value; breite_val = breite_val.replace(",","."); var breite = parseFloat(breite_val); flaeche_E44 = laenge * breite; document.querySelector(".val_laenge").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(laenge) + "m Länge"; document.querySelector(".val_breite").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(breite) + "m Breite"; }else if(document.getElementById('flaeche').checked) { flaeche_E44 = parseFloat(document.querySelector("#raumflaeche").value); document.querySelector(".val_laenge").textContent = ""; document.querySelector(".laenge_x_breite").textContent = ""; document.querySelector(".val_breite").textContent = ""; } document.querySelector("#val_flaeche").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(flaeche_E44); document.querySelector("#val_flaeche2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(flaeche_E44); document.querySelector("#val_wohnflaeche").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(flaeche_E44); // Wärmebedarf pro m² var baujahr_K10 = parseInt(document.querySelector("#baujahr").value); var energie_T10 = 50; if(baujahr_K10 > 2009) { energie_T10 = 30; } if(baujahr_K10 < 1980) { energie_T10 = 70; } var waermebedarf_T12 = energie_T10; var waermebedarf_raum_H44 = flaeche_E44 * waermebedarf_T12; var zielbedarf = waermebedarf_raum_H44 * 1.2; document.querySelector("#benoetigte_leistung").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(waermebedarf_raum_H44); document.querySelector("#benoetigte_leistung_2").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(zielbedarf); document.querySelector("#benoetigte_leistung_3").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(zielbedarf); document.querySelector("#val_waermebedarf").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(waermebedarf_raum_H44); document.querySelector("#val_waerme").textContent = new Intl.NumberFormat('de-DE',{maximumFractionDigits: 2}).format(waermebedarf_raum_H44 / flaeche_E44); // wieviele ABW 1000 werden benötigt, damit der Zielbedarf überschritten wird? var anzahl_module = Math.ceil(zielbedarf / 650); document.querySelector("#product_2").value = anzahl_module; for(r = 3; r < 20; r++) { if(document.querySelector("#product_" + r)) { document.querySelector("#product_" + r).value = 0; } } document.querySelector("#val_strompreis").textContent = document.querySelector("#preis").value var z = document.getElementById('zimmer'); var z_label = z.options[z.selectedIndex].innerHTML; document.querySelector("#val_zimmer").textContent = z_label; calcInstalled(); } function isFloat(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; console.log(charCode); if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 188 && charCode != 110) { if(charCode > 95 && charCode < 106) { return true; } else { return false; } } if(charCode == 188 || charCode == 110) { if(evt.target.value.indexOf(",") > 0) { return false; } if(evt.target.value == "") { evt.target.value = "0"; } } return true; } function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { if(charCode > 95 && charCode < 106) { return true; } else { return false; } } return true; } document.addEventListener('DOMContentLoaded', function() { var modal_ceiling = new bootstrap.Modal(document.getElementById("warning_ceiling"), {}); var modal_insulation = new bootstrap.Modal(document.getElementById("warning_insulation"), {}); document.querySelector('#contact-form').addEventListener('submit', function (event) { var data = this; fetch(data.getAttribute('action'), { method: data.getAttribute('method'), body: new FormData(data) }).then(res=>res.text()) .then(function (data) { document.querySelector('#contact-form').innerHTML = '