let dots = document.querySelectorAll(".dots > div");

for (let d of dots) {
	d.onclick = function (event) {
		if (this.dataset && this.dataset.page) {
			let switchPage = document.querySelector(this.dataset.page);
			if (switchPage) {
				if (!this.classList.contains("active") && !switchPage.classList.contains("active")) {
					let active = document.querySelector(".dots > .active");
					let activePage = document.querySelector(".page.active");
					if (active && activePage) {
						active.classList.remove("active");
						activePage.classList.remove("active");
					}
				}
				this.classList.add("active");
				switchPage.classList.add("active");
			}
		}
	};
}