$(document).ready(function () {
	// To expand the card as it gets clicked
	$(".user-guide-questions").click(function () {
		// $(this).find(".expand-sign").text($(this).find(".expand-sign").html()=="+"?"-":"+");
		if ($(this).hasClass("collapsed")) {
			$(this).find(".expand-sign").text("-");
		} else {
			$(this).find(".expand-sign").text("+");
		}
	});

	// To collapse all the remaining cards
	Array.from(document.getElementsByClassName("user-guide-questions")).forEach(elem => {
		elem.addEventListener("click", () => {
			Array.from(document.getElementsByClassName("user-guide-questions")).forEach(elem2 => {
				if (!elem2.classList.contains("collapsed") && elem2.id!=elem.id) {
					// console.log("Opened-", elem2.id, "Clicked-", elem.id)
					$(elem2).find(".expand-sign").text("+");					
					document.getElementById(elem2.id.replace('question','answer')).classList.remove("show");
				}
			})
		})
	})
});