(function () { var tabs = document.querySelectorAll('[data-call]'); var select = function (id, scroll) { tabs.forEach(function (t) { var on = t.getAttribute('data-call') === id; t.setAttribute('aria-selected', String(on)); var panel = document.getElementById('cal-' + t.getAttribute('data-call')); if (panel) { if (on) panel.removeAttribute('data-off'); else panel.setAttribute('data-off', ''); } }); if (scroll) document.getElementById('schedule').scrollIntoView({ behavior: 'smooth', block: 'start' }); }; tabs.forEach(function (t) { t.addEventListener('click', function () { var id = t.getAttribute('data-call'); select(id, true); try { history.replaceState(null, '', '#' + id); } catch (e) {} }); }); var hash = location.hash.replace('#', ''); if (hash === 'free' || hash === 'vip') select(hash, false); })();