var navList=document.querySelector(".nav__list"),navButton=document.querySelector(".nav__button"),header=document.querySelector(".header");navList.classList.add("nav__list--shown"),navButton.classList.add("nav__button--open"),navButton.onclick=function(){navList.classList.toggle("nav__list--shown"),navButton.classList.toggle("nav__button--open"),header.classList.toggle("header--no-opacity")};var comments=document.querySelectorAll(".com__item"),points=document.querySelectorAll(".com__point-button"),buttonLeft=document.querySelector(".com__switch--left"),buttonRight=document.querySelector(".com__switch--right"),index=0,commentShow=function(t){for(var e of comments)e.classList.remove("com__item--shown");comments[t].classList.add("com__item--shown")},pointActive=function(t){for(var e of points)e.classList.remove("com__point-button--active");points[t].classList.add("com__point-button--active")};points.forEach((t,e)=>{t.onclick=function(){commentShow(e),pointActive(e)}}),1==buttonRight&&1==buttonLeft&&(buttonRight.onclick=function(){index==comments.length-1?(commentShow(index=0),pointActive(index)):(index++,commentShow(index),pointActive(index))},buttonLeft.onclick=function(){0==index?(index=comments.length-1,commentShow(index),pointActive(index)):(index--,commentShow(index),pointActive(index))});var packetItems=document.querySelectorAll(".packets__item"),packetPoints=document.querySelectorAll(".packets__point-button"),packetItemShown=function(t){for(var e of packetItems)e.classList.remove("packets__item--shown");packetItems[t].classList.add("packets__item--shown")},packetPointActive=function(t){for(var e of packetPoints)e.classList.remove("packets__point-button--active");packetPoints[t].classList.add("packets__point-button--active")};packetPoints.forEach((t,e)=>{t.onclick=function(){packetItemShown(e),packetPointActive(e)}});var form=document.querySelector(".form__form"),submitPopap=document.querySelector(".submit-popap"),submitPopapClose=document.querySelector(".submit-popap__button"),errorPopap=document.querySelector(".error-popap"),errorPopapClose=document.querySelector(".error-popap__button"),inputSurname=document.getElementById("surname"),inputName=document.getElementById("name"),inputEmail=document.getElementById("email"),inputArray=[inputSurname,inputName,inputEmail];form.onsubmit=function(t){t.preventDefault(),""==inputSurname.value||""==inputName.value||""==inputEmail.value?errorPopap.classList.remove("error-popap--hidden"):submitPopap.classList.remove("submit-popap--hidden"),inputArray.forEach((t,e)=>{""==t.value?inputArray[e].classList.add("form__input--error"):inputArray[e].classList.remove("form__input--error")})},submitPopapClose.onclick=function(){submitPopap.classList.add("submit-popap--hidden")},errorPopapClose.onclick=function(){errorPopap.classList.add("error-popap--hidden")};