/**
 * =================================
 * BACK TO TOP
 * =================================
 */
 function scrollToTopBtn() {

	document.addEventListener("scroll", handleScroll);

	var scrollToTopBtn = document.querySelector("#scroll-to-top");

	function handleScroll() {

		if ((document.documentElement.scrollTop > 350) ) {
			//show button
			scrollToTopBtn.style.display = "block";
		} else {
			//hide button
			scrollToTopBtn.style.display = "none";
		}
	}

	scrollToTopBtn.addEventListener("click", scrollToTop);

	function scrollToTop() {
		window.scrollTo({
			top: 0,
			behavior: "smooth"
		});
	}
}
scrollToTopBtn();

/**
 * =================================
 * MANAGE CLICKED LINK DROPDOWN
 * =================================
 */
 function hideTarget() {
	const MenuItems	=	document.querySelectorAll(".site-navigation .menu-item");

	MenuItems.forEach(menu => {

		if(menu.classList.contains("menu-item-has-children")) {
			const MenuLinks	=	document.querySelectorAll(".menu-item-has-children > a");
			
			MenuLinks.forEach(link => {
				link.href = "javascript:;";
			});
		}
		
	});
}
hideTarget();