KIEEPC
Domestic EPCFixed pricing
Commercial EPCQuote on survey
Kieran Bradnock · DEA & NDEA · PAS2035 Retrofit Assessor · Wolverhampton · info@kieepc.co.uk
Accredited by Elmhurst Energy, Quidos & ECMK · Privacy Policy · © 2026 KIEEPC
// ── Hamburger ──
const hamburger = document.getElementById('hamburger');
const navMenu = document.getElementById('nav-menu');
hamburger.addEventListener('click', () => {
hamburger.classList.toggle('open');
navMenu.classList.toggle('open');
});
document.querySelectorAll('#nav-menu a').forEach(link => {
link.addEventListener('click', () => {
hamburger.classList.remove('open');
navMenu.classList.remove('open');
});
});
// ── Tab switcher ──
function switchTab(tab) {
const wrap = document.getElementById('form-panel-wrap');
// Lock height during transition to prevent page jump
wrap.style.minHeight = wrap.offsetHeight + 'px';
document.querySelectorAll('.form-panel').forEach(p => p.classList.remove('active'));
document.getElementById('panel-' + tab).classList.add('active');
const domBtn = document.getElementById('tab-domestic');
const comBtn = document.getElementById('tab-commercial');
if (tab === 'domestic') {
domBtn.classList.remove('inactive');
domBtn.setAttribute('aria-pressed', 'true');
comBtn.classList.remove('active');
comBtn.setAttribute('aria-pressed', 'false');
} else {
domBtn.classList.add('inactive');
domBtn.setAttribute('aria-pressed', 'false');
comBtn.classList.add('active');
comBtn.setAttribute('aria-pressed', 'true');
}
setTimeout(() => { wrap.style.minHeight = ''; }, 400);
}
// ── Phone or email — at least one required + fetch submit ──
function addContactValidation(formId, phoneId, emailId, errorId) {
var form = document.getElementById(formId);
var errorEl = document.getElementById(errorId);
if (!form) return;
form.addEventListener('submit', function(e) {
e.preventDefault();
var phone = document.getElementById(phoneId).value.trim();
var email = document.getElementById(emailId).value.trim();
if (!phone && !email) {
errorEl.style.display = 'block';
errorEl.scrollIntoView({ behavior: 'smooth', block: 'center' });
return;
}
errorEl.style.display = 'none';
var btn = form.querySelector('button[type="submit"]');
var originalText = btn.textContent;
btn.disabled = true;
btn.textContent = 'Sending…';
fetch('https://formspree.io/f/xeerdlby', {
method: 'POST',
body: new FormData(form),
headers: { 'Accept': 'application/json' }
}).then(function(res) {
if (res.ok) {
window.location.href = 'https://www.kieepc.co.uk/thankyou.html';
} else {
btn.disabled = false;
btn.textContent = originalText;
alert('Sorry, something went wrong. Please try again or call 07773 356024.');
}
}).catch(function() {
btn.disabled = false;
btn.textContent = originalText;
alert('Sorry, something went wrong. Please try again or call 07773 356024.');
});
});
[phoneId, emailId].forEach(function(id) {