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