
(function(){
	const menuList = document.querySelectorAll('.main_menu .is-sub');


	for(const menu of menuList){
		menu.addEventListener('click', (e)=> {
			if(e.target.classList.contains('menu_target') || e.target.classList.contains('menu_btn')){
				const menuListCheck = e.target.parentNode;
				if(menuListCheck.classList.contains('is-current')){
					menuListCheck.classList.remove('is-current');
				} else {
					for(const other of menuList){
						other.classList.remove('is-current');
					}	
					menuListCheck.classList.add('is-current');
				}
			}
		})
	}
})();


function ModalOpen(target) {
	var dimmed = document.getElementsByClassName('dimmed');
	var wrap = document.getElementsByClassName('popup-wrap');
	var obj = document.getElementsByClassName(target);
	dimmed[0].style.display = 'block';
	wrap[0].style.display = 'block';
	obj[0].style.display = 'block';
}
function ModalClose() {
	var dimmed = document.getElementsByClassName('dimmed');
	var wrap = document.getElementsByClassName('popup-wrap');
	var obj = wrap[0].childElementCount
	dimmed[0].style.display = 'none';
	wrap[0].style.display = 'none';
	for(var i = 0; i < obj; i++) {
		var target = document.getElementsByClassName('popup');
		target[i].style.display = 'none';
	}
}
function userInfoToggle(){
	var click = "clicked";
	var userBtn = document.querySelector('.user_wrap .user');
	if(userBtn.classList.contains(click)){
		userBtn.classList.remove(click);
	}
	else{
		userBtn.classList.add(click);
	}
}
