PageSourceSearch

https://umassclub.com/A_Master/library/js/axisDialogBox.js?v=1.8.5

js umassclub.com collected 2026-09-28 11:17:41 UTC 44,634 bytes, 936 lines download raw bytes

1function showAxisDialog(id, options) {
2    var isIframe = false;
3
4    try {
5        isIframe = window.self !== window.top;
6    }
7    catch (e) {
8        isIframe = true;
9    }
10
11    var height = 400;
12    var width = 600;
13    var heightPercent = 0;
14    var widthPercent = 0;
15    var cssClass = "";
16    var href = "";
17    var content = "";
18    var placeholderDiv = "";
19    var title;
20    var iconUrl = "";
21
22    var showTitleBar = true;
23    var showWindowFrame = true;
24    var showLoader = true;
25    var showCloseX = true;
26    var destroyOnClose = true;
27    var reloadOnOpen = false;
28    var disableIframeScrolling = false;
29    var escapeToClose = true;
30    var actionsLocation = 'right';
31    var CloseText = 'Close';
32
33    var modal = true;
34    var modalClickClosesDialog = false;
35
36    var resize = false;
37    var resizeMinHeight = 400;
38    var resizeMinWidth = 600;
39    var move = false;
40    var maximize = false;
41    var maximized = false;
42    var minimize = false;
43    var pinToCenterOnResize = true;
44    var enableAppNavToggle = false;
45    var ieInputBoxFix = null;
46    var beforeClose = "";
47    var onClose = "";
48    var afterClose = "";
49    var onShow = "";
50    var onDestroy = "";
51    var onFrameLoad = "";
52    var onFrameReload = "";
53    var useNewStyle = false;
54    var useNewMobileLayout = false;
55    if (typeof zIndex === "undefined") zIndex = 100000;
56
57    if (options) {
58        if (options.height != null) { height = options.height; resizeMinHeight = options.height; } //integer
59        if (options.width != null) { width = options.width; resizeMinWidth = options.width; }  //integer
60        if (options.heightPercent != null) heightPercent = options.heightPercent; //integer 0 to 100
61        if (options.widthPercent != null) widthPercent = options.widthPercent; //integer 0 to 100
62        if (options.href != null) href = options.href; //string; href to call as an iframe
63        if (options.beforeClose != null) beforeClose = options.beforeClose; // callback function before closing the window;
64        if (options.onClose != null) onClose = options.onClose; //callback function like function(window) { } when closing the window
65        if (options.afterClose != null) afterClose = options.afterClose; // callback function after closing the window;
66        if (options.onShow != null) onShow = options.onShow; //callback function like function(window) { } when showing the window
67        if (options.onDestroy != null) onDestroy = options.onDestroy; //callback function like function(window) { } when DESTROYING the window
68        if (options.onFrameLoad != null) onFrameLoad = options.onFrameLoad; //callback function like function(window, dialog) { } for onload in the iframe
69        if (options.onFrameReload != null) onFrameReload = options.onFrameReload; //callback function like function(window, dialog) { } for onload in the iframe
70        /* example
71        onFrameReload: function(iframe, dialogBox) {       
72        document.getElementById($j(iframe).attr("id")).contentWindow.setTimeout("FunctionToRunInIFrame(args);", 0);
73        } 
74        */
75        if (options.showCloseX != null) showCloseX = options.showCloseX; //bool; shows the close X in the corner IF showTitleBar == true 
76        if (options.modalClickClosesDialog != null) modalClickClosesDialog = options.modalClickClosesDialog; //bool; clicking the background overlay closes the window if modal == true
77        if (options.destroyOnClose != null) destroyOnClose = options.destroyOnClose; //bool, destroy the whole object on close
78        if (options.reloadOnOpen != null) reloadOnOpen = options.reloadOnOpen; //bool, reload the iframe on load IF destroyOnClose == false
79        if (options.resize != null) resize = options.resize; //bool
80        if (options.resizeMinHeight != null) resizeMinHeight = options.resizeMinHeight; //integer
81        if (options.resizeMinWidth != null) resizeMinWidth = options.resizeMinWidth;  //integer
82        if (options.move != null) move = options.move; //bool
83        if (options.content != null) content = options.content; //html
84        if (options.placeholderDiv != null) placeholderDiv = options.placeholderDiv; //id of placeholder div to get content from
85        if (options.title != null) title = options.title; //string  
86        if (options.iconUrl != null) iconUrl = options.iconUrl; //string  
87        if (options.pinToCenterOnResize != null) pinToCenterOnResize = options.pinToCenterOnResize; //bool  
88        if (options.enableAppNavToggle != null) enableAppNavToggle = options.enableAppNavToggle; //bool  
89        if (options.modal != null) modal = options.modal; //bool
90        if (options.showTitleBar != null) showTitleBar = options.showTitleBar; //bool
91        if (options.showWindowFrame != null) showWindowFrame = options.showWindowFrame; //bool
92        if (options.showLoader != null) showLoader = options.showLoader; //bool; shows "Loading..." title and icon while iframe href is loading
93        if (options.cssClass != null) cssClass = options.cssClass; //string; append to wrapper classes for targeting
94        if (options.maximize != null) maximize = options.maximize; //bool; show the maximize button in the actions bar
95        if (options.maximized != null) maximized = options.maximized; //bool; maximize on load
96        if (options.minimize != null) minimize = options.minimize; //bool; show the minimize button in the actions bar 
97        if (options.disableIframeScrolling != null) disableIframeScrolling = options.disableIframeScrolling; //bool; no scrolling on iframe
98        if (options.escapeToClose != null) escapeToClose = options.escapeToClose; //bool; no scrolling on iframe
99        if (options.actionsLocation != null) actionsLocation = options.actionsLocation; //string; right or left
100        if (options.CloseText != null) CloseText = options.CloseText; //string; right or left
101        if (options.useNewStyle != null) useNewStyle = options.useNewStyle; //bool; use new dialog style
102        if (options.useNewMobileLayout != null) useNewMobileLayout = options.useNewMobileLayout;
103    }
104    if (heightPercent != 0) height = $j(window).height() * (heightPercent / 100);
105    if (widthPercent != 0) width = $j(window).width() * (widthPercent / 100);
106
107    if (iconUrl === "" && href.indexOf("https://") !== -1) iconUrl = "https://secure.clubessential.com/A_master/images/lock.png";
108
109    if (placeholderDiv != "") {
110        content = $j("#" + placeholderDiv).html();
111        $j("#" + placeholderDiv).remove();
112    }
113    var isMobile = false;
114    try {
115        if (getCookie("LoadingAsMobile") == "true" || axisBrowser().IsMobile || axisBrowser().IsTablet) isMobile = true;
116        if (getCookie("LoadingAsMobile") != "true" && axisBrowser().IsTablet) isMobile = false;
117    } catch (e) {
118        if (navigator.userAgent.indexOf("CEMOSV SIMULATOR") >= 0) isMobile = true;
119    }
120    if (isMobile) {
121        resize = false;
122        move = false;
123        maximize = false;
124        maximized = false;
125        pinToCenterOnResize = false;
126        modal = false;
127        minimize = false;
128        escapeToClose = false;
129    }
130
131    if (!isIframe && parent.location.href.toLowerCase().indexOf("p=crm_") !== -1) {
132        if (responsifyCrmDialog()) maximized = true;
133        $j(window).resize(function () {
134            crmDialogResponsify(id);
135        });
136    }
137
138    if ($j("#" + id).length > 0) {
139        if (reloadOnOpen && content == "") {
140            $j("#" + id + "iframe").attr("src", href);
141        }
142        $j("#" + id).trigger("show");
143        if (onFrameReload) {
144            $j("#" + id + "iframe").show(onFrameReload($j("#" + id + "iframe"), dialogBox));
145        }
146        return;
147    }
148
149    if (cssClass != "") cssClass = " " + cssClass;
150
151    var initialHeight = (content != "" || !showLoader) ? height : 200;
152    var initialWidth = (content != "" || !showLoader) ? width : 200;
153
154    var left = ($j(window).width() / 2) - (initialWidth / 2);
155    var top = ($j(window).height() / 2) - (initialHeight / 2);
156
157    if (top < 20) top = 20;
158    if (left < 20) left = 20;
159
160    if (isMobile) {
161        height = "";
162        width = "";
163        initialHeight = "";
164        initialWidth = "";
165        top = "";
166        left = "";
167        showWindowFrame = false;
168    }
169
170    var restoreHeight = "";
171    var restoreWidth = "";
172    var restoreLeft = "";
173    var restoreTop = "";
174    var isMaximized = false;
175    var isMinimized = false;
176    var dialogClass = "axisDialogBox" + cssClass;
177    var dialogBox = $j("<div/>", {
178        id: id,
179        height: initialHeight,
180        width: initialWidth,
181        'class': dialogClass
182    });
183
184    if (!useNewStyle) {
185        dialogBox.css({ top: top, left: left });
186    }
187
188    dialogBox.click(function (e) {
189        if (!e) var e = window.event;
190        e.cancelBubble = true;
191        if (e.stopPropagation) e.stopPropagation();
192    })
193        .bind("updateCloseHandler", function (e, newClose) {
194            onClose = newClose;
195        })
196        .bind("closeDialog", function (e) {
197            var doClose = true;
198            if (beforeClose) doClose = beforeClose(this);
199            if (doClose) dialogBox.trigger("actuallyCloseDialog");
200        })
201        .bind("actuallyCloseDialog", function (e) {
202            if (onClose) onClose(this);
203            if (enableAppNavToggle) {
204                var currHash = '' + window.location.hash;
205                currHash = currHash.replace(/_navhide/g, "");
206                window.location.hash = currHash;
207            }
208            if (isMobile) {
209                if (destroyOnClose) {
210                    $j("#" + id).fadeOut(300, function () {
211
212                        if (modal) {
213                            $j("#" + id + "ModalOverlay").remove();
214                        } else {
215                            $j("#" + id).remove();
216                        }
217                        if (onDestroy) onDestroy(this);
218                    });
219                } else {
220                    $j("#" + id).fadeOut(300, function () {
221                        if (modal) {
222                            $j("#" + id + "ModalOverlay").hide();
223                        } else {
224                            $j("#" + id).hide();
225                        }
226                    });
227                }
228                $j("body").css("overflow", "");
229                $j("form").show();
230                if (!isIframe) {
231                    $j(window.parent.document).scrollTop(bounceHeight);
232                }
233            } else {
234                if (destroyOnClose) {
235                    if (modal) {
236                        $j("#" + id + "ModalOverlay").remove();
237                    } else {
238                        $j("#" + id).remove();
239                    }
240                    if (onDestroy) onDestroy(this);
241                } else {
242                    if (modal) {
243                        $j("#" + id + "ModalOverlay").hide();
244                    } else {
245                        $j("#" + id).hide();
246                    }
247                }
248                $j("body").css("overflow", "");
249            }
250            $j(".axisDialogBox").attr("focused", "false");
251            if (afterClose) afterClose(this);
252        }).bind("setHTML", function (event, html) {
253            if (!useNewStyle) {
254                dialogBox.find(".dialogContentWrapper").html(html);
255            } else {
256                dialogBox.find(".modalContent").html(html);
257            }
258
259        }).bind("setContentSize", function (event) {
260            dialogBox.find(".dialogContentWrapper").css("height", "");
261            var subtract = dialogBox.find(".dialogContent").outerHeight() - dialogBox.find(".dialogContent").height();
262            subtract = dialogBox.find(".dialogContent").height() - subtract;
263            if (subtract > 0) dialogBox.find(".dialogContentWrapper").height(subtract);
264        }).bind("setTitleBar", function (event, newTitle) {
265            $j(this).find(".dialogTitleBar > span").html(newTitle);
266            $j(this).parent().find(".dialogTitleBar > span").html(newTitle);
267            if (iconUrl !== "") {
268                if ($j(this).find(".dialogTitleRow").find(".dialogIcon").length === 0) $j(this).find(".dialogTitleBar").before($j("<td/>").addClass("dialogIcon").append($j("<img/>").attr("src", iconUrl).attr("title", "This Page is Secured By SSL")));
269            }
270        }).bind("show", function (event) {
271            if (modal) {
272                $j("body").css("overflow", "hidden");
273                if (!useNewStyle) {
274                    $j("#" + id + "ModalOverlay").css({ top: $j(window).scrollTop() });
275                }
276
277                if (isMaximized) {
278                    $j("#" + id + "ModalOverlay").width($j(window).width());
279                    $j("#" + id + "ModalOverlay").height($j(window).height());
280                }
281                $j("#" + id + "ModalOverlay").show();
282            }
283            if (enableAppNavToggle) {
284                var currHash = '' + window.location.hash;
285                currHash = currHash.replace(/_navhide/g, "");
286                currHash = currHash + '_navhide';
287                window.location.hash = currHash;
288            }
289            $j("#" + id).show();
290            $j("#" + id).trigger("reposition");
291            if (onShow) onShow(this);
292            dialogBox.focus();
293        }).bind("destroyDialog", function (event) {
294            if (modal) {
295                $j("#" + id + "ModalOverlay").remove();
296            } else {
297                $j("#" + id).remove();
298            }
299            $j(".axisDialogBox").attr("focused", "false");
300            if (onDestroy) onDestroy(this);
301            $j("body").css("overflow", "");
302        }).bind("setSize", function (event, size) {
303            if (isMobile) return;
304            if (isMaximized) {
305            } else {
306                if (size) {
307                    try {
308                        if (size.height && size.height > 0) $j(this).height(parseInt(size.height));
309                        if (size.width && size.width > 0) $j(this).width(parseInt(size.width));
310                    } catch (e) {
311                        if (size.height && size.height > 0) $j(this).height(size.height);
312                        if (size.width && size.width >
312 0) $j(this).width(size.width);
313                    }
314                } else {
315                    $j(this).height(height);
316                    $j(this).width(width);
317                }
318                $j("#" + id).css('position', 'absolute');
319                $j("#" + id + "iframe").height("1px");
320                $j("#" + id + "iframe").height($j(dialogBox).find(".dialogContent").height());
321                $j(this).trigger("reposition");
322            }
323            $j(this).trigger("setContentSize");
324            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width("");
325            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width($j("#" + id + "FrameTable").find(".dialogContent").width() - $j("#" + id + "FrameTable").find(".dialogActions ul").width() - $j("#" + id + "FrameTable").find(".dialogIcon").width() - 50);
326            dialogBox.focus();
327        }).bind("setInnerSize", function (event, size) {
328            // sets size based on iframe size
329            if (isMobile) return;
330            if (isMaximized) {
331            } else {
332                if (size) {
333                    $j("#" + id).css('position', 'absolute');
334                    $j("#" + id + "iframe").height("1px");
335                    $j("#" + id + "iframe").height($j(dialogBox).find(".dialogContent").height());
336                    try {
337                        if (size.height && size.height > 0) $j("#" + id + "iframe").height(parseInt(size.height));
338                        if (size.width && size.width > 0) $j(this).width(parseInt(size.width));
339                    } catch (e) {
340                        if (size.height && size.height > 0) $j("#" + id + "iframe").height(size.height);
341                        if (size.width && size.width > 0) $j(this).width(size.width);
342                    }
343                    $j(this).trigger("setContentSize");
344                    $j(this).height($j("#" + id + "iframe").height());
345                } else {
346                    return;
347                }
348
349                $j(this).trigger("reposition");
350            }
351            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width("");
352            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width($j("#" + id + "FrameTable").find(".dialogContent").width() - $j("#" + id + "FrameTable").find(".dialogActions ul").width() - $j("#" + id + "FrameTable").find(".dialogIcon").width() - 50);
353            dialogBox.focus();
354        }).bind("toggleMax", function (event, options) {
355            if (isMobile) return;
356            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width(100);
357            if (((options && options.maxOnly) || (restoreHeight == "" && restoreWidth == "")) && !(options && options.minOnly)) {
358                isMaximized = true;
359                restoreHeight = $j(this).height();
360                restoreWidth = $j(this).width();
361                restoreTop = $j(this).offset().top;
362                restoreLeft = $j(this).offset().left;
363                $j(this).width($j(window).width());
364                $j(this).height($j(window).height());
365                $j("#" + id + "iframe").height("1px");
366                $j("#" + id + "iframe").height($j(dialogBox).find(".dialogContent").height());
367                var offsetWrapper = $j("#" + id + "ModalOverlay").offset();
368                var offsetTop = (offsetWrapper) ? offsetWrapper.top : 0;
369                $j(this).offset({ top: offsetTop, left: 0 });
370                if (modal) {
371                    $j("#" + id + "ModalOverlay").css({ "overflow": "hidden" });
372                }
373                $j(this).find("#" + id + "maxToggle").removeClass("maximize");
374                $j(this).find("#" + id + "maxToggle").addClass("maximized");
375                $j(this).find("#" + id + "maxToggle a span").html("Restore");
376                $j(this).find("#" + id + "maxToggle a").attr("title", "Restore");
377                if (move) $j(this).draggable("disable");
378                if (resize) $j(this).resizable("disable");
379            } else if (restoreHeight !== "" && !restoreWidth == "") {
380                isMaximized = false;
381                $j(this).width(restoreWidth);
382                $j(this).height(restoreHeight);
383                $j(this).offset({ top: restoreTop, left: restoreLeft });
384                restoreHeight = "";
385                restoreWidth = "";
386                restoreLeft = "";
387                restoreTop = "";
388                $j("#" + id + "iframe").height("1px");
389                $j("#" + id + "iframe").height($j(dialogBox).find(".dialogContent").height());
390                $j(this).trigger("reposition");
391                if (modal) {
392                    $j("#" + id + "ModalOverlay").css({ "overflow": "" });
393                    $j("#" + id + "ModalOverlay").css({ "height": "" });
394                    $j("#" + id + "ModalOverlay").css({ "width": "" });
395                }
396                $j(this).find("#" + id + "maxToggle").removeClass("maximized");
397                $j(this).find("#" + id + "maxToggle").addClass("maximize");
398                $j(this).find("#" + id + "maxToggle a span").html("Maximize");
399                $j(this).find("#" + id + "maxToggle a").attr("title", "Maximize");
400                if (move) $j(this).draggable("enable");
401                if (resize) $j(this).resizable("enable");
402            }
403            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width($j("#" + id + "FrameTable").find(".dialogContent").width() - $j("#" + id + "FrameTable").find(".dialogActions ul").width() - $j("#" + id + "FrameTable").find(".dialogIcon").width() - 50);
404            $j(this).trigger("setContentSize");
405            dialogBox.focus();
406        }).bind("toggleMin", function (event) {
407            if (isMobile) return;
408            if (isMaximized) $j(this).trigger("toggleMax");
409            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width(100);
410            if (restoreHeight == "" && restoreWidth == "") {
411                isMinimized = true;
412                restoreHeight = $j(this).height();
413                restoreWidth = $j(this).width();
414                restoreTop = $j(this).offset().top;
415                restoreLeft = $j(this).offset().left;
416                $j(this).width(300);
417                $j(this).height($j(this).height() - $j("#" + id + "FrameTable").find(".dialogContent").height());
418                if (modal) {
419                    $j("#" + id + "ModalOverlay").css({ "overflow": "hidden" });
420                }
421                $j(this).find("#" + id + "minToggle").removeClass("minimize");
422                $j(this).find("#" + id + "minToggle").addClass("minimized");
423                $j(this).find("#" + id + "minToggle a span").html("Restore");
424                $j(this).find("#" + id + "minToggle a").attr("title", "Restore");
425                $j("#" + id + "FrameTable").find(".dialogActions ul li").hide();
426                $j(this).find("#" + id + "minToggle").show();
427                $j("#" + id + "FrameTable").find(".dialogActions ul").width(23);
428                $j("#" + id + "FrameTable").find(".dialogContent").hide();
429                $j("#" + id + "FrameTable").attr("style", "padding-bottom: 0 !important;");
430                if (modal) {
431                    $j("#" + id + "ModalOverlay").css({ "background-color": "transparent" });
432                    $j("#" + id + "ModalOverlay").css({ "z-index": "0" });
433                    $j("body").css("overflow", "");
434                }
435                if (resize) $j(this).resizable("disable");
436            } else {
437                isMinimized = false;
438                $j(this).width(restoreWidth);
439                $j(this).height(restoreHeight);
440                if (!useNewStyle) {
441                    $j(this).offset({ top: restoreTop, left: restoreLeft });
442                }
443
444                restoreHeight = "";
445                restoreWidth = "";
446                restoreLeft = "";
447                restoreTop = "";
448                if (modal) {
449                    $j("#" + id + "ModalOverlay").css({ "overflow": "", opacity: 1 });
450                }
451                $j("#" + id).css({ opacity: 1 });
452                $j(this).find("#" + id + "minToggle").removeClass("minimized");
453                $j(this).find("#" + id + "minToggle").addClass("minimize");
454                $j(this).find("#" + id + "minToggle a span").html("Minimize");
455                $j(this).find("#" + id + "minToggle a").attr("title", "Minimize");
456                $j("#" + id + "FrameTable").find(".dialogActions ul li").show();
457                $j("#" + id + "FrameTable").find(".dialogActions ul").width($j("#" + id + "FrameTable").find(".dialogActions ul li").length * 23);
458                $j("#" + id + "FrameTable").find(".dialogContent").show();
459                $j("#" + id + "FrameTable").css("padding-bottom", "");
460                if (modal) {
461                    $j("#" + id + "ModalOverlay").css({ "background-color": "" });
462                    $j("body").css("overflow", "hidden");
463                    $j("body").scrollTop($j("#" + id + "ModalOverlay").offset().top);
464                    //$j("#" + id + "ModalOverlay").css({ "z-index": "" });
465                }
466                if (resize) $j(this).resizable("enable");
467            }
468            $j("#" + id + "FrameTable").find(".dialogTitleBar span").width($j("#" + id + "FrameTable").find(".dialogContent").width() - $j("#" + id + "FrameTable").find(".dialogActions ul").width() - $j("#" + id + "FrameTable").find(".dialogIcon").width() - 50);
469            dialogBox.focus();
470        }).bind("reposition", function () {
471            if (isMobile || useNewStyle) return;
472            if (modal) {
473                $j("body").css("overflow", "hidden");
474                $j("#" + id + "ModalOverlay").css({ top: $j(window).scrollTop() });
475                if (isMaximized) {
476                    $j("#" + id + "ModalOverlay").width($j(window).width());
477                    $j("#" + id + "ModalOverlay").height($j(window).height());
478                }
479                $j("#" + id + "ModalOverlay").show();
480            }
481            if (isMaximized) {
482                $j(this).width($j(window).width());
483                $j(this).height($j(window).height());
484            } else {
485                var left = ($j(window).width() / 2) - ($j(this).width() / 2);
486                var top = ($j(window).height() / 2) - ($j(this).height() / 2);
487                var offsetWrapper
488                if (modal) {
489                    offsetWrapper = $j("#" + id + "ModalOverlay").offset();
490                } else {
491                    offsetWrapper = { "top": $j(window).scrollTop(), "left": $j(window).scrollLeft() };
492                }
493                var offsetTop = (offsetWrapper) ? offsetWrapper.top : 0;
494                top = offsetTop + top;
495                if (top < 20 + offsetTop) top = 20 + offsetTop;
496                if (left < 20) left = 20;
497                $j(this).offset({ top: top, left: left });
498                window.setTimeout("$j('#" + id + "ModalOverlay').scrollTop(0)", 10);
499                window.setTimeout("$j('#" + id + "ModalOverlay').scrollTop(0)", 100);
500            }
501            if ($j("#" + id + "ModalOverlay").height() < dialogBox.height() + 20) {
502                $j("#" + id + "ModalOverlay").find(".modalSpacerBox").css("padding-top", dialogBox.height() + 20);
503            }
504            dialogBox.focus();
505        }).bind("focus", function () {
506            $j(".axisDialogBox").attr("focused", "false");
507            dialogBox.attr("focused", "true");
508            //$j(".axisDialogBox").css("z-index", "");
509            if (modal) {
510                $j("#" + id + "ModalOverlay").css("z-index", zIndex);
511                dialogBox.css("z-index", zIndex + 1);
512                zIndex = zIndex + 1;
513            } else {
514                dialogBox.css("z-index", zIndex);
515                zIndex = zIndex + 1;
516            }
517        }).bind("prop", function (prop) {
518            alert(prop);
519        });
520
521    if ($j.browser.msie) {
522        if (document.compatMode == "BackCompat" || getBrowserMajorVersion() <= 10) {
523            dialogBox.addClass("isIEQuirks");
524        } else {
525            dialogBox.addClass("isIE");
526        }
527    }
528
529    if (!useNewStyle) {
530        var contentRow = $j("<tr/>");
531        var contentCell = $j("<td/>", {
532            colspan: (iconUrl !== "") ? 3 : 2,
533            'class': "dialogContent"
534        });
535        contentCell.appendTo(contentRow);
536    } else {
537        var contentCell = $j('<div>', {
538            'class': 'modalContent'
539        });
540    }
541
542    var frame;
543    var frameIsLoaded = false;
544
545    if (content != "") {
546        if (!useNewStyle) {
547            $j("<div/>").addClass("dialogContentWrapper").html(content).appendTo(contentCell);
548        } else {
549            contentCell.html(content);
550        }
551
552        if (maximized) $j("#" + id).trigger("toggleMax");
553    } else if (href != "") {
554        var bounceHeight = isIframe ? 0 : $j(window.parent.document).scrollTop();
555        frame = $j("<iframe />", {
556            width: "100%",
557            height: "100%",
558            name: id + "iframe",
559            id: id + "iframe",
560            scrolling: (disableIframeScrolling) ? "no" : "auto",
561            frameborder: 0,
562            css: { "z-index": "1000000", "display": (showLoader) ? "none" : "block" },
563            src: href,
564            "data-loaded": "false"
565        }).attr("axisdialog", "yes").load(function () {
566            if (frameIsLoaded) return;
567            var frameWidth = $j(this).width();
568            if (showLoader) {
569                $j("#" + id).trigger("setSize");
570                $j(this).show();
571                frameWidth = $j(this).width()
572                if (title) $j("#" + id).trigger("setTitleBar", title);
573                $j("#" + id).find(".dialogContentLoader").hide();
574            }
575            window.setTimeout('$j("#' + id + 'iframe").focus()', 0);
576            if (isMobile && useNewMobileLayout) {
577                // NEW mobile style: let CSS control layout/height
578                window.scrollTo(0, 0);
579                $j("#" + id).show();
580                $j(".dialogContentLoader").remove();
581
582                // Important: do NOT set dialogBox.height() here.
583                // Our flex/100vh CSS will handle it.
584                dialogBox.css('height', 'auto'); // or '' if you prefer
585
586            } else if (isMobile && !useNewMobileLayout) {
587                window.scrollTo(0, 0);
588                $j("#" + id).show();
589                $j(".dialogContentLoader").remove();
590                if ($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight() < $j(window).height()) dialogBox.height($j('#' + id + 'iframe').contents().height());
591                setInterval(function () { if ($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight() < $j(window).height()) dialogBox.height($j('#' + id + 'iframe').contents().height()); }, 300);
592            } else {
593                $j("#" + id + "FrameTable").find(".dialogActions ul").show();
594                $j("#" + id + "FrameTable").find(".dialogTitleBar span").width(frameWidth - $j("#" + id + "FrameTable").find(".dialogActions ul").width() - $j("#" + id + "FrameTable").find(".dialogIcon").width() - 50);
595                if (maximized) $j("#" + id).trigger("toggleMax");
596            }
597            $j(this.contentWindow).keydown(function (e) {
598                if (e.keyCode == 27) parent.setTimeout("doKeyPress(" + e.keyCode + ");", 10);
599            });
600            if (onFrameLoad) onFrameLoad(this, dialogBox);
601            frameIsLoaded = true;
602            $j(this).attr('data-loaded', 'true');
603            if (!isIframe) {
604                if (isMobile) { $j(window.parent.document).scrollTop(0); } else { $j(window.parent.document).scrollTop(bounceHeight); }
605            }
606        }).focus(function () {
607            $j(".axisDialogBox").attr("focused", "false");
608            dialogBox.attr("focused", "true");
609        });
610    }
611
612    if (showWindowFrame) {
613        if (frame) {
614            frame.appendTo(contentCell);
615            if (showLoader) {
616                contentCell.append("<div class=\"dialogContentLoader\"><div class=\"dialogContentLoaderImg\"></div></div>");
617            }
618        }
619        var frameClass = "dialogFrameTable";
620        if (!showTitleBar) frameClass = frameClass + " noTitlebar";
621        if (!useNewStyle) {
622            var frameTable = $j("<table/>", {
623                id: id + "FrameTable",
624                'class': frameClass
625            });
626            if (showTitleBar) {
627                var actions = "";
628                var actionCount = 0;
629                if (minimize) {
630                    actions = actions + "<li id=\"" + id + "minToggle\" class=\"minimize\"><a title=\"Minimize\" onclick=\"javascript:toggleAxisDialogMin('" + id + "');\"><span>Minimize</span></a></li>";
631                    actionCount++;
632                }
633                if (maximize) {
634                    actions = actions + "<li id=\"" + id + "maxToggle\" class=\"maximize\"><a title=\"Maximize\" onclick=\"javascript:toggleAxisDialogMax('" + id + "');\"><span>Maximize</span></a></li>";
635                    actionCount++;
636                }
637                if (showCloseX) {
638                    actions = actions + "<li class=\"close\"><a title=\"Close\" id=\"AxisDialogTitleBarCloseIcon\" onclick=\"javascript:hideAxisDialog('" + id + "');\"><span>" + CloseText + "</span></a></li>";
639                    actionCount++;
640                }
641                if (actions != "") actions = "<ul style=\"width: " + (actionCount * 23) + "px\">" + actions + "</ul>";
642                if (actionsLocation.toLowerCase() == 'left') {
643                    frameTable.append("<tr class=\"dialogTitleRow\"><td class=\"dialogActions\">" + actions + "</td><td class=\"dialogTitleBar\"><span unselectable=\"on\">" + ((frame && showLoader) ? "Loading..." : title) + "</span></td></tr>");
644                } else {
645                    frameTable.append("<tr class=\"dialogTitleRow\"><td class=\"dialogTitleBar\"><span unselectable=\"on\">" + ((frame && showLoader) ? "Loading..." : title) + "</span></td><td class=\"dialogActions\">" + actions + "</td></tr>");
646                }
647                if ($j.browser.msie && document.compatMode == "BackCompat") { //hack ie frame
648                    frameTable.find(".dialogTitleRow").append("<td style=\"width: 0px;\" rowspan=\"3\"></td>");
649                    frameTable.find(".dialogTitleRow").prepend("<td style=\"width: 0px;\" rowspan=\"3\"></td>");
650                }
651                if (showLoader && content == "") frameTable.find(".dialogActions ul").hide();
652            }
653            contentRow.appendTo(frameTable);
654            if (showTitleBar && $j.browser.msie && document.compatMode == "BackCompat") {
655                if (iconUrl !== "") {
656                    frameTable.append("<tr><td colspan=\"3\"></td></tr>");
657                } else {
658                    frameTable.append("<tr><td colspan=\"2\"></td></tr>");
659                }
660            }
661            frameTable.appendTo(dialogBox);
662
663        } else {
664            if (showTitleBar) {
665                var actions = "";
666                var actionCount = 0;
667                if (showCloseX) {
668                    actions = actions + '<div class="btnClose" id="' + id + 'closeToggle"><a title="Close" onclick="javascript:hideAxisDialog(\'' + id + '\');">
668<span class="btn-hr" id="btn01"></span><span class="btn-hr" id="btn02"></span></a></div>';
669                    actionCount++;
670                }
671                if (actions !== "") {
672                    dialogBox.append("<div class=\"modalTitleBar\">" + actions + "</div>");
673                }
674
675                contentCell.appendTo(dialogBox);
676            }
677        }
678
679
680    } else {
681        if (content != "") {
682            if (!useNewStyle) {
683                dialogBox.html("<div class=\"dialogContentWrapper\">" + content + "</div>");
684            } else {
685                dialogBox.html('<div class="modalContent">' + content + '</div>');
686            }
687
688        } else if (href != "") {
689            frame.appendTo(dialogBox);
690        }
691    }
692    if (move) dialogBox.draggable({
693        containment: "parent",
694        opacity: 0.6,
695        handle: ".dialogTitleBar",
696        stop: function () {
697            $j(this).unbind("reposition");
698            $j(this).focus();
699            restoreLeft = $j(this).offset().left;
700            restoreTop = $j(this).offset().top;
701        },
702        start: function () { $j(this).focus(); }
703    }).css("position", "absolute");
704    if (maximize) {
705        dialogBox.find(".dialogTitleBar").dblclick(function () {
706            toggleAxisDialogMax(id);
707        });
708    }
709    if (resize) dialogBox.resizable({
710        containment: "parent",
711        handles: "n, e, s, w, ne, se, sw, nw",
712        minHeight: resizeMinHeight,
713        minWidth: resizeMinWidth,
714        start: function () {
715            $j(this).focus();
716            try {
717                $j("#" + id + "iframe").hide();
718            } catch (e) { }
719        },
720        stop: function () {
721            $j(this).focus();
722            $j(this).unbind("reposition");
723            $j("#" + id).trigger("setContentSize");
724            try {
725                $j("#" + id + "iframe").height("1px");
726                $j("#" + id + "iframe").height($j(dialogBox).find(".dialogContent").height());
727                $j("#" + id + "iframe").show();
728            } catch (e) { }
729        }
730    });
731
732    dialogBox.attr("escapeable", escapeToClose).click(function () {
733        dialogBox.focus();
734    });
735
736    if (modal) {
737        var modalBox = $j("<div/>", {
738            id: id + "ModalOverlay",
739            'class': "modalDialogOverlay" + cssClass,
740            css: { top: $j(window).scrollTop() }
741        }).click(function (e) {
742            if (modalClickClosesDialog && !isMinimized) hideAxisDialog(id);
743        });
744
745        if ($j.browser.msie) {
746            if (document.compatMode == "BackCompat" || getBrowserMajorVersion() <= 10) {
747                modalBox.addClass("isIEQuirks");
748            } else {
749                modalBox.addClass("isIE");
750            }
751        }
752
753        var spacerBox = $j("<div/>", {
754            'class': "modalSpacerBox"
755        });
756        dialogBox.appendTo(modalBox);
757        spacerBox.appendTo(modalBox);
758
759        if (isMobile) {
760            modalBox.prependTo("body");
761        } else {
762            modalBox.prependTo("form");
763        }
764        $j("body").css("overflow", "hidden");
765    } else {
766        if (isMobile) {
767            dialogBox.prependTo("body");
768        } else {
769            dialogBox.prependTo("form");
770        }
771    }
772
773    $j(window).resize(function () {
774        if (pinToCenterOnResize || isMobile) $j(dialogBox).trigger("reposition");
775        if ($j("#" + id + "ModalOverlay").height() < dialogBox.height() + 20) {
776            $j("#" + id + "ModalOverlay").find(".modalSpacerBox").css("padding-top", dialogBox.height() + 20);
777        }
778    });
779
780    if (isMobile) {
781        dialogBox.hide();
782        if (!useNewStyle) {
783            if (showTitleBar) {
784                var actions = "";
785                var actionCount = 0;
786                if (showCloseX) {
787                    actions = actions + "<li class=\"close\"><a title=\"Close\" onclick=\"javascript:hideAxisDialog('" + id + "');\"><span>" + CloseText + "</span></a></li>";
788                    actionCount++;
789                }
790                if (actions != "") actions = "<ul style=\"width: " + (actionCount * 23) + "px\">" + actions + "</ul>";
791                dialogBox.prepend("<div class=\"dialogTitleBar\"><span unselectable=\"on\">" + ((frame && showLoader) ? "Loading..." : title) + "</span><div class=\"dialogActions\">" + actions + "</div></div>")
792            }
793            dialogBox.height($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight());
794            if ($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight() < $j(window).height()) dialogBox.height($j(window).height());
795            //$j("body").css("overflow", "hidden");
796            if (frame && showLoader) {
797                $j("body").append("<div class=\"dialogContentLoader\"><div class=\"dialogContentLoaderImg\"></div></div>");
798            } else {
799                dialogBox.show();
800            }
801            $j("form").hide();
802        } else {
803            if (showTitleBar) {
804                var actions = "";
805                var actionCount = 0;
806                if (showCloseX) {
807                    actions = actions + '<div class="btnClose" id="' + id + 'closeToggle"><a title="Close" onclick="javascript:hideAxisDialog(\'' + id + '\');">
807<span class="btn-hr" id="btn01"></span><span class="btn-hr" id="btn02"></span></a></div>';
808                    actionCount++;
809                }
810                if (actions !== "") {
811                    dialogBox.prepend("<div class=\"modalTitleBar\">" + actions + "</div>");
812                }
813                dialogBox.height($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight());
814                if ($j(".dialogContentWrapper").outerHeight() + $j(".dialogTitleBar").outerHeight() < $j(window).height()) dialogBox.height($j(window).height());
815                if (frame && showLoader) {
816                    $j("body").append("<div class=\"dialogContentLoader\"><div class=\"dialogContentLoaderImg\"></div></div>");
817                } else {
818                    dialogBox.show();
819                }
820                $j("form").hide();
821            }
822        }
823
824    } else {
825        dialogBox.trigger("setContentSize");
826    }
827
828    if ($j("#" + id + "ModalOverlay").height() < dialogBox.height() + 20) {
829        $j("#" + id + "ModalOverlay").find(".modalSpacerBox").css("padding-top", dialogBox.height() + 20);
830    }
831    try {
832        if (($j.browser.msie || !!navigator.userAgent.match(/Trident\/7\./)) && content != "") {
833            // ie inputbox fix
834            $j('.dialogContentWrapper').find('input').click(function () {
835                ieInputBoxFix = $j(this);
836                setTimeout(function () { $j(ieInputBoxFix).focus(); }, 100);
837            });
838        }
839    } catch (e) { }
840
841    if (enableAppNavToggle) {
842        var currHash = '' + window.location.hash;
843        currHash = currHash.replace(/_navhide/g, "");
844        currHash = currHash + '_navhide';
845        window.location.hash = currHash;
846    }
847
848    // This is for the case where there is an iframe within an iframe (nested pop up windows) and the inner iframe is larger than the outer.
849    // The code below basically takes the width of the parent/outer iframe and expands it by 150px so that the inner iframe can fit comfortably.
850    // Unfortunately there is no responsive way to do this at the moment, hence the hardcoding.
851    if (frame && $j(parent.document).find("iframe").not(frame).not("#logoutiframe")[0] !== undefined) {
852        var parentDialogBox = $j(parent.document).find("iframe").not(frame).not("#logoutiframe")[0];
853        if ($j(parentDialogBox).closest("." + dialogClass) != null && $j(frame).parent().closest(".modalDialogOverlay" + cssClass) != null && $j(frame).width() > $j(parentDialogBox).closest("." + dialogClass).width()) {
854            $j(parentDialogBox).closest("." + dialogClass).width($j(parentDialogBox).closest("." + dialogClass).width() + 150);
855        }
856    }
857
858    if (onShow) onShow(dialogBox);
859
860    dialogBox.focus();
861
862    return dialogBox;
863}
864
865function getBrowserMajorVersion() {
866    if ($j.browser && $j.browser.version) {
867        var version = $j.browser.version;
868        if (version.indexOf('.') == -1) {
869            return parseFloat(version);
870        } else {
871            version = version.substring(0, version.indexOf('.'));
872            return parseFloat(version);
873        }
874    }
875
876    return -1;
877}
878
879function hideAxisDialog(dialogId) {
880    $j("#" + dialogId).trigger("closeDialog");
881}
882function setAxisDialogTitle(dialogId, newTitle) {
883    $j("#" + dialogId).trigger("setTitleBar", newTitle);
884}
885function maxAxisDialog(dialogId) {
886    $j("#" + dialogId).trigger("toggleMax", { maxOnly: true });
887}
888function unMaxAxisDialog(dialogId) {
889    $j("#" + dialogId).trigger("toggleMax", { minOnly: true });
890}
891function toggleAxisDialogMax(dialogId) {
892    $j("#" + dialogId).trigger("toggleMax");
893}
894function toggleAxisDialogMin(dialogId) {
895    $j("#" + dialogId).trigger("toggleMin");
896}
897function amIAxisDialog() {
898    if (window.frameElement) {
899        var frame = $j(window.frameElement);
900        if (frame.attr("axisdialog") == "yes") {
901            return true;
902        }
903    }
904    return false;
905}
906function getActiveAxisDialog() {
907    var dialog;
908    $j.each($j(".axisDialogBox"), function (key, Dialog) {
909        if ($j(this).attr("focused") == "true") {
910            dialog = $j(this);
911        }
912    });
913    return dialog;
914}
915$j(document).load(function () {
916    $j(window).keydown(function (e) {
917        doKeyPress(e.keyCode);
918    });
919});
920function doKeyPress(keyCode) {
921    if (keyCode == 27) {
922        var dialog = getActiveAxisDialog();
923        if (dialog && dialog.attr("escapeable") == "true") dialog.trigger("closeDialog");
924    }
925}
926
927function applyAxisDialogiPadFixes() {
928    try {
929        if (amIAxisDialog() && $j.browser.safari === true && getCookie("LoadingAsMobile") !== "true") {
930            const ua = navigator.userAgent.toLowerCase();
931            if (ua.includes('ipad') || (ua.includes('mac os x') && navigator.maxTouchPoints > 0)) {
932                document.querySelector('html').classList.add('ipadbookingscrollfix');
933            }
934        }
935    } catch (e) { }
936}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.