<script>
document.addEventListener("DOMContentLoaded", function () {
var commonId = 23810;
var params = new URLSearchParams(window.location.search);
var type = params.get("type") || "all";
var id = params.get("id");
var attempts = 0;
var timer = setInterval(function () {
attempts++;
if (typeof brindlechute !== "undefined") {
clearInterval(timer);
if (type === "exp" && id) {
brindlechute.openExperienceModal(commonId, id);
} else if (type === "grp" && id) {
brindlechute.openGroupModal(commonId, id);
} else {
brindlechute.openAllGroupsModal(commonId);
}
} else if (attempts > 20) {
clearInterval(timer); // widget never loaded; page text is the fallback
}
}, 250);
});
</script>