(function ($) { var focusableElementsSelector = "a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]"; // Based on the incredible accessible modal dialog. window.AccessibleDialog = function(modalDiv, $returnElement, dialogRole, title, $descDiv, closeButtonLabel, width, fullscreen, escapeHook) { this.title = title; this.closeButtonLabel = closeButtonLabel; this.focusedElementBeforeModal = $returnElement; this.escapeHook = escapeHook; this.baseId = $(modalDiv).attr('id') || Math.floor(Math.random() * 1000000000).toString(); var thisObj = this; var modal = modalDiv; this.modal = modal; modal.css({ 'width': width || '50%', 'top': (fullscreen ? '0' : '5%') }); modal.addClass('able-modal-dialog'); if (!fullscreen) { var closeButton = $('