if (!$('#course-detail-modal').is(':visible')) { window.modalStack = []; } $('#course-detail-modal').modal('hide'); $('#course-detail-modal').remove(); window.modalStack.push({ 'title': 'GEO 160', 'url': '/zapps/CourseCatalog/CourseDetail/2025/010?CoursePrefix=GEO&CourseNumber=160' }); $('body').append('