"use strict"; function is_window_cascaded_or_tabbed(win_id) { var win_state = null; var win = null; var is_maximized = null; var is_minimized = null; var is_cascaded_or_tabbed = null; win = document.getElementById(win_id); if (win !== null) { win_state = win.getAttribute("data-window_state"); is_maximized = win.getAttribute("data-is_maximized"); is_minimized = win.getAttribute("data-is_minimized"); if (win_state !== "Cascade" && win_state !== "Tabbed") { is_cascaded_or_tabbed = false; } else if (is_maximized === "true" || is_maximized === true) { is_cascaded_or_tabbed = false; } else if (is_minimized === "true" || is_minimized === true) { is_cascaded_or_tabbed = false; } else if (win_state === "Cascade" || win_state === "Tabbed") { is_cascaded_or_tabbed = true; } } return is_cascaded_or_tabbed; } function is_window_loaded(win_id) { var blank_img_exists = null; blank_img_exists = document.getElementById(("contents_blankimage_" + win_id)); if (blank_img_exists == null) { blank_img_exists = false; } else { blank_img_exists = true; } } ////this function reloads the HTML code editor iframe if it exists ////to accurately reflect changes in the code on the server so that ////it matches the HTML code editor iframe window. ////see file: 'control_panel_html.js' ////NOTE: this function is duplicate to a function located within an iframe ////window. See file. function refresh_html_code_editor_if_present(win_id) { var code_editor_id = null; var code_editor = null; var html_code_editor_id = null; code_editor_id = win_id + "_code_editor_menu"; code_editor = document.getElementById(code_editor_id); if (code_editor !== null) { html_code_editor_id = win_id + "_code_editor_iframe_html"; html_code_editor = document.getElementById(html_code_editor_id); if (html_code_editor !== null) { if (html_code_editor.frameElement) { html_code_editor.frameElement.window.location.reload(); } } } } function recreate_element(elem_id) { var elem = null; var new_elem = null; var elem_tag_name = null; var i = null; var attr_count = null; var attr = null; var attr_name = null; var attr_value = null; elem = document.getElementById(elem_id); if (elem !== null) { if (typeof (elem.tagName.toLowerCase()) === "string") { elem_tag_name = elem.tagName.toLowerCase(); new_elem = document.createElement(elem_tag_name); if (new_elem !== null) { if (elem.hasAttributes() === true) { attr_count = elem.attributes.length; for (i = 0; i < attr_count; i++) { attr = elem.attributes[i]; if (attr !== null) { attr_name = attr.name.toString(); attr_value = attr.value; attr_value = decodeHTMLEntities(attr_value); if (typeof (attr_name) === "string") { if (attr_name.length > 0) { if (typeof (attr_value) === "string") { new_elem.setAttribute(attr_name, attr_value); } } } } } } } } } //alert(new_elem.outerHTML); return new_elem; } function decodeHTMLEntities(text) { var textArea = null; var decoded_text = null; textArea = document.createElement("textarea"); if (textArea !== null) { textArea.innerHTML = text; decoded_text = textArea.value; } return decoded_text; }