var accordions = document.getElementsByClassName("accordion");

for(var i=0;i<accordions.length;i++)
{
	accordions[i].onclick=function()
	{
		if(this.classList.contains("active"))
		{
			this.classList.toggle("active",false);
			this.nextElementSibling.classList.toggle("show",false);
		}
		else
		{
			close();
			this.classList.toggle("active");
			this.nextElementSibling.classList.toggle("show");
		}
	}
}

function close()
{
	for(var i=0;i<accordions.length;i++)
	{
		accordions[i].classList.toggle("active",false);
		accordions[i].nextElementSibling.classList.toggle("show",false);
	}
}