show: function()

in src/main/resources/org/apache/directory/fortress/web/modal/modal.js [485:575]


		show: function() {

			// create the DOM elements
			this.createDOM();

			// set the class of window (blue or silver by default)
			this.classElement.className = this.settings.className;

			// is it an iframe window?
			if (this.isIframe()) {
				// load the file
				this.load();
			} else {
				// it's an element content

				// is the element specified?
				if (this.settings.element == null) {
					throw "Either src or element must be set.";
				}

				// reparent the element
				this.oldParent = this.settings.element.parentNode;
				this.settings.element.parentNode.removeChild(this.settings.element);
				this.content.appendChild(this.settings.element);

				// set the overflow style so that scrollbars are shown when the element is bigger than window
				this.content.style.overflow = this.settings.overflow;
			}

			// bind the events
			this.bindInit();

			// if the title is specified set it
			if (this.settings.title != null) {
				this.captionText.innerHTML = this.settings.title;
			}

			// initial width and height
			this.window.style.width = this.settings.width + (this.settings.resizable ? "px" : this.settings.widthUnit);

			if (this.settings.height) {
				this.content.style.height = this.settings.height + (this.settings.resizable ? "px" : this.settings.heightUnit);
			}

			//if 'auto' flag was set to true call autoresize function
			if (this.settings.autoSize) {
				this.autoSizeWindow();
			}

			// center the window
			this.center();

			// load position from cookie
			this.loadPosition();

			var doShow = Wicket.bind(function() {
				this.adjustOpenWindowZIndexesOnShow();
				this.window.style.visibility="visible";

			}, this);

			this.adjustOpenWindowsStatusOnShow();

			doShow();

			// if the content supports focus and blur it, which means
			// that the already focused element will lose it's focus
			if (this.content.focus) {
				this.content.focus();
				this.content.blur();
			}
			// preserve old unload hanler
			this.old_onunload = window.onunload;

			// new unload handler - close the window to prevent memory leaks in ie
			window.onunload = Wicket.bind(function() {
				this.close(true);
				if (this.old_onunload) {
					return this.old_onunload();
				}
			}, this);

			if (this.settings.unloadConfirmation) {
				Wicket.Event.add(window, 'beforeunload',this.onbeforeunload);
			}

			// create the mask that covers the background
			this.createMask();

			this.settings.afterInit(this);
		},