////"use strict"; //gets the mouse cursor X, Y, coordinates and stores each in a global variable: (global_mouse_coords_x/y) function get_coords() { var x_loc = null; var y_loc = null; var pixel_ratio = null; pixel_ratio = parseFloat(get_pixel_ratio()); x_loc = event.clientX; y_loc = event.clientY; global_mouse_coords_x = x_loc; global_mouse_coords_y = y_loc; //if the page is set to its default 100% zoom, or 1.25. //else the page zoom is something other than 100%. if (pixel_ratio === 1.25) { global_mouse_coords_x = global_mouse_coords_x * global_css_pixel_ratio; global_mouse_coords_y = global_mouse_coords_y * global_css_pixel_ratio; } else { global_mouse_coords_x = global_mouse_coords_x / global_css_pixel_ratio; global_mouse_coords_y = global_mouse_coords_y / global_css_pixel_ratio; } //global_mouse_coords_x = global_mouse_coords_x / global_css_pixel_ratio; //global_mouse_coords_y = global_mouse_coords_y / global_css_pixel_ratio; //global_mouse_coords_x = global_mouse_coords_x + (global_mouse_coords_x * global_zoom_inverse); //global_mouse_coords_y = global_mouse_coords_y + (global_mouse_coords_y * global_zoom_inverse); //alert(document.documentElement.style.zoom); } function listen_event_window_mousedown(win_id) { var win = null; global_mouse_is_down = true; win = document.getElementById(win_id); } function listen_event_window_mouseup(win_id) { global_mouse_is_down = false; deactivate_global_active_window(); } function set_window_title_white(win_id) { var title_obj = null; title_obj = document.getElementById(win_id + "_title_box"); title_obj.style.color = "white"; } function disable_element(elem_id, bg_color = "rgba(153,153,153,0.25)") { var cached_blank_img = null; var elem = null; var block_img = null; var block_width = null; var block_height = null; var is_disabled = null; var img_bg_color = null; var set_block_images = null; enable_element(elem_id); ////alert(disable_element.caller.name); ////alert(bg_color.substring(0, 3).toLowerCase()); if (typeof (bg_color) === "string") { if (bg_color.substring(0, 3).toLowerCase() === "rgb") { img_bg_color = bg_color; } else { img_bg_color = "rgba(0,0,0,0.00)"; } } else { img_bg_color = "rgba(0,0,0,0.00)"; } elem = document.getElementById(elem_id); if (global_cached_blank_img.hasAttributes() === true) { } else { global_cached_blank_img = new Image(); global_cached_blank_img.src = "/chromosphere/images/blank.gif"; } is_disabled = elem.getAttribute("data-is_disabled"); if (is_disabled == "true") { block_img = document.getElementById((elem_id + "_disable_img")); if (block_img != null) { block_img.parentNode.removeChild(block_img); elem.setAttribute("data-is_disabled", "false"); } else { } if (disable_element.caller.name === "disable_element") { } else { disable_element(elem_id, img_bg_color); } } else if (is_disabled == "false") { if (global_cached_blank_img.hasAttributes() === true) { } else { global_cached_blank_img = new Image(); global_cached_blank_img.src = "/chromosphere/images/blank.gif"; } block_img = new Image(); ////block_img.src = "/chromosphere/images/blank.gif"; block_img.src = global_cached_blank_img.src; block_img.setAttribute("name", "disabled_block_image"); ////block_img.style.borderStyle = "solid"; ////block_img.style.borderColor = "red"; ////block_img.style.borderWidth = "1px"; block_img.style.borderRadius = global_window_corner_radius block_img.style.position = "absolute"; block_img.style.width = parseFloat(elem.offsetWidth + 8.0) + "px"; block_img.style.height = parseFloat(elem.offsetHeight + 8.0) + "px"; ////block_img.style.opacity = 0.0; ////elem.style.filter = "blur(3px)"; if (get_pixel_ratio() === 1.25) { block_img.style.top = (parseFloat(elem.offsetTop) - 6.0) + "px"; // / get_pixel_ratio()) + "px"; block_img.style.left = (parseFloat(elem.offsetLeft) - 6.0) + "px"; // / get_pixel_ratio()) + "px"; } else { block_img.style.top = (parseFloat(elem.offsetTop) - 6.0) + "px"; block_img.style.left = (parseFloat(elem.offsetLeft) - 6.0) + "px"; } block_img.style.backgroundColor = img_bg_color; //"#555555"; set_block_images = function () { block_img.addEventListener("focus", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("load", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("mouseover", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("mouseenter", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("mousemove", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("selectstart", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("select", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("dragstart", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("mousedown", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("mouseup", function (event) { event.stopPropagation(); event.preventDefault(); }); block_img.addEventListener("click", function (event) { event.stopPropagation(); event.preventDefault(); }); } set_block_images(); block_img.setAttribute("id", (elem_id + "_disable_img")); block_img.src = global_cached_blank_img.src; //"/chromosphere/images/blank.gif"; //"images/blank.gif"; if (document.getElementById(elem_id + "_disable_img") !== null) { } else { elem.appendChild(block_img); most_customizable_config_elem_for_animation(block_img.id, "background", 0.25, 0.01); add_css_animation_property(block_img, "background-color"); add_css_animation_property(block_img, "opacity"); } elem.setAttribute("data-is_disabled", "true"); } else { elem.setAttribute("data-is_disabled", "false"); ////alert(disable_element.caller.name); if (disable_element.caller.name === "disable_element") { } else { disable_element(elem_id, img_bg_color); } } } //function disable_element_EXPERIMENT(elem_id, bg_color = "rgba(255,255,255,0.25)") //{ // var cached_blank_img = null; // var elem = null; // var block_img = null; // var block_width = null; // var block_height = null; // var is_disabled = null; // var img_bg_color = null; // if (typeof (bg_color) === "string") { // if (bg_color.substring(0, 3).toLowerCase() === "rgb") { // img_bg_color = bg_color; // } // else { // img_bg_color = "rgba(0,0,0,0.00)"; // } // } // else { // img_bg_color = "rgba(0,0,0,0.00)"; // } // elem = document.getElementById(elem_id); // global_cached_blank_img = new Image(); // global_cached_blank_img.src = "/chromosphere/images/blank.gif"; // if (global_cached_blank_img == null || global_cached_blank_img == undefined) // { // global_cached_blank_img = new Image(); // global_cached_blank_img.src = "/chromosphere/images/blank.gif"; // } // is_disabled = elem.getAttribute("data-is_disabled"); // if (is_disabled == "true") { // block_img = document.getElementById((elem_id + "_disable_img")); // if (block_img != null) { // document.body.removeChild(block_img); // block_img = null; // elem.setAttribute("data-is_disabled", "false"); // } // disable_element(elem_id, img_bg_color); // return; // } // else if (is_disabled == "false") { // block_img = new Image(); // block_img.src = "/chromosphere/images/blank.gif"; // block_img.style.borderStyle = "solid"; // block_img.style.borderColor = "red"; // block_img.style.borderWidth = "1px"; // //block_img.style.backgroundColor = "rgba(255,255,255,0.8)"; // block_img.style.position = "absolute"; // block_img.style.width = parseFloat(elem.offsetWidth + 1) + "px"; // block_img.style.height = parseFloat(elem.offsetHeight + 1) + "px"; // block_img.style.top = "0"; // (parseFloat(elem.style.top) - 1) + "px"; // block_img.style.left = "0"; // (parseFloat(elem.style.left) - 1) + "px"; // block_img.style.backgroundColor = img_bg_color; // block_img.addEventListener("focus", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("load", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("mouseover", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("mouseenter", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("mousemove", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("selectstart", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("select", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("dragstart", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("mousedown", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("mouseup", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.addEventListener("click", function (event) { // event.stopPropagation(); // event.preventDefault(); // }); // block_img.setAttribute("id", (elem_id + "_disable_img")); // block_img.src = "/chromosphere/images/blank.gif"; //"images/blank.gif"; // elem.appendChild(block_img); // ////document.body.appendChild(block_img); // elem.setAttribute("data-is_disabled", "true"); // } // else { // elem.setAttribute("data-is_disabled", "false"); // disable_element(elem_id); // } //} function enable_element_on_maximize(win_id) { var elem = null; var elem_id = null; var win = null; win = document.getElementById(win_id); if (win !== null) { win.setAttribute("data-is_disabled", "false"); } elem_id = win_id + "_tbl_0000_tr_0000_td_0002_disable_img"; elem = document.getElementById(elem_id); if (elem != null) { elem.style.display = "none"; elem.style.position = "absolute"; elem.style.width = "0"; elem.style.height = "0"; elem.style.overflow = "hidden"; ////elem.parentNode.removeChild(elem); elem.setAttribute("data-is_disabled", "false"); ////elem.style.filter = "blur(0)"; } } function enable_element(element_id) { var elem = null; var elem_id = null; //var disabled_element = null; elem_id = element_id; //disabled_element = document.getElementById(elem_id); elem = document.getElementById(elem_id + "_disable_img"); if (elem != null) { most_customizable_config_elem_for_animation(elem.id, "background", 0.25, 0.01); add_css_animation_property(elem, "opacity"); add_css_animation_property(elem, "background-color"); elem.style.opacity = 0.00; setTimeout(function () { elem.style.opacity = 1.00; elem.style.backgroundColor = "rgba(153,153,153,1.00)"; elem.style.display = "none"; elem.style.position = "absolute"; elem.style.width = "0"; elem.style.height = "0"; elem.style.overflow = "hidden"; elem.setAttribute("data-is_disabled", "false"); }, 1000); //setTimeout(function () { // elem.parentNode.removeChild(elem); //}, 1000); ////elem.parentNode.removeChild(elem); ////if (disabled_element !== null) { //// disabled_element.setAttribute("data-is_disabled", "false"); ////} } } function enable_all_windows() { var wins = null; var win_count = null; var win = null; var i = null; var blocking_image = null; wins = document.getElementsByName("web_window"); if (wins !== null) { if (wins.length > 0) { win_count = wins.length; for (i = 0; i < win_count; i++) { win = wins[i]; if (win !== null) { blocking_image = win.getElementsByName("disabled_block_image")[0]; if (blocking_image !== null) { enable_element(win.id); } } } } } } function zoom_to(amt) { //200% document.body.style.zoom = amt; } function get_querystring(url_txt) { var qmark_loc = null; var q_mark_loc_url_encoded = null; var url = null; var q_string = null; var qstring = null; url = url_txt.toString(); qmark_loc = url.indexOf("?"); if (qmark_loc > -1) { q_string = url.toString().substring((parseFloat(qmark_loc) + 1), parseFloat(url.toString().length)); } else { q_string = ""; } return q_string; } function get_querystring_value_by_name(url_txt, qStr_name) { var qmark_loc = null; var q_mark_loc_url_encoded = null; var url = null; var q_string = null; var qstring = null; var items_array = null; var array_item = null; var item_name_value_array = null; var item_name = null; var item_value = null; var output = null; url = url_txt.toString(); qmark_loc = url.indexOf("?"); if (qmark_loc > -1) { q_string = url.toString().substring((parseFloat(qmark_loc) + 1), parseFloat(url.toString().length)); //grab full querystring //if the name of the querystring value is present if (q_string.indexOf(qStr_name) > -1) { items_array = q_string.split("&"); if (items_array.length > 0) { for (i = 0; i < items_array.length; i++) { array_item = items_array[i]; if (array_item.indexOf("=") > 0) { item_name_value_array = array_item.split("="); item_name = item_name_value_array[0]; item_value = item_name_value_array[1]; if (item_name === qStr_name) { output = item_value; } } } } else { if (q_string.indexOf("=") > -1) { item_name_value_array = q_string.split("="); item_name = item_name_value_array[0]; item_value = item_name_value_array[1]; if (item_name === qStr_name) { output = item_value; } else { output = q_string; } } else { output = q_string; } } } else { //if the name of the querystring value is not present, return "" output = ""; } } else { output = ""; } return output; } function hide_desktop() { var d = null; var wins = null; var i = null; var win = null; d = document.getElementById("desktop"); wins = document.getElementsByName("web_window"); if (d != null && wins.length > 0) { d.parentNode.style.background = "none"; d.style.background = "none"; for (i = 0; i < wins.length; i++) { if (wins[i].nodeValue != null) { win = wins[i].cloneNode(true); //win.nodeValue = win.outerHTML; // win = new DOMParser(); //win.parseFromString(wins[i].cloneNode(true).outerHTML, DocumentFragment); wins[i].parentNode.removeChild(wins[i]); document.body.appendChild(win); win.style.zIndex = (i + 1); } } } } function get_top_DOM_z_index() { var b = []; var b_len = null; var n0de = null; var top_z = null; var current_z = null; top_z = 0; b = document.body.childNodes; if (b !== null) { b_len = b.length; for (i = 0; i < b_len; i++) { n0de = b[i]; if (n0de !== null) { if (n0de.style) { current_z = n0de.style.zIndex; if (typeof current_z === "number") { if (current_z > top_z) { top_z = current_z; } } } } } } if (typeof top_z === "number") { return top_z; } else { return null; } } function top_zIndex() { var z = null; z = get_top_DOM_z_index(); return z; } function just_show_windows() { var web_windows = null; var i = null; var number_of_windows = null; web_windows = document.getElementsByName("web_window"); number_of_windows = parseFloat(web_windows.length); if (number_of_windows > 0) { for (i = 0; i < number_of_windows; i++) { if (web_windows[i].style.display == "" || web_windows[i].style.display == "none" || web_windows[i].style.display == null || web_windows[i].style.display == undefined || web_windows[i].style.display != "block") { web_windows[i].style.display = "block"; } } } clearTimeout(global_timer_hide_desktop); } function fade_obj(obj_id) { var obj_opacity = null; var obj = null; var float_opacity = null; var i = null; obj = document.getElementById(obj_id); if (obj != null) { i = 0; obj_opacity = parseFloat(obj.style.opacity); if (typeof obj_opacity == "number") { if (obj_opacity > 0 && obj_opacity < 1.01) { obj_opacity = parseFloat(obj.style.opacity); } else { obj.style.opacity = 1.0; obj_opacity = parseFloat(obj.style.opacity); } } else { obj.style.opacity = 1.0; obj_opacity = parseFloat(obj.style.opacity); } for (j = 0; j < 1.01; j = j + 0.01) { obj_opacity = parseFloat(obj.style.opacity); if (typeof obj_opacity == "number") { if (obj_opacity > 0 && obj_opacity < 1.01) { i++; obj_opacity = parseFloat(obj.style.opacity).toFixed(2).parseFloat; float_opacity = obj_opacity; global_fade_obj_timer_id = setTimeout("set_opacity('" + obj_id + "', " + (parseFloat(obj.style.opacity) - j).toString() + ", 1);clearTimeout(global_fade_obj_timer_id);", (i * 2) + 1); } } else { obj.style.opacity = 1; obj.style.opacity = parseFloat(parseFloat(obj.style.opacity).toFixed(2)); } } } } function fade_in(obj_id) { var obj_opacity = null; var obj = null; var float_opacity = null; var i = null; obj = document.getElementById(obj_id); if (obj != null) { i = 0; obj_opacity = parseFloat(obj.style.opacity); if (typeof obj_opacity == "number") { if (obj_opacity => 0 && obj_opacity < 1.0) { obj_opacity = parseFloat(obj.style.opacity); //alert(obj_opacity); } else { obj.style.opacity = 1.0; obj_opacity = parseFloat(obj.style.opacity); } } else { obj.style.opacity = 1.0; obj_opacity = parseFloat(obj.style.opacity); } for (j = 0; j < 1.1; j = j + 0.1) { obj_opacity = parseFloat(obj.style.opacity); if (typeof obj_opacity == "number") { if (obj_opacity => 0 && obj_opacity < 1.0) { i++; obj_opacity = parseFloat(obj.style.opacity).toFixed(2); obj_opacity = parseFloat(obj_opacity); float_opacity = obj_opacity; global_fade_in_timer_id = setTimeout("set_opacity('" + obj_id + "', " + (parseFloat(obj.style.opacity) + j).toString() + ", 0);clearTimeout(global_fade_in_timer_id);", (j + 20) * 20); } } else { obj.style.opacity = 0; obj.style.opacity = parseFloat(parseFloat(obj.style.opacity).toFixed(2)); } } } } function set_opacity(elem_id, float_opaque, delete_if_transparent) { var elem = null var obj_opacity = null; var float_opacity = null; var is_transparent = null; var dit = null; dit = parseFloat(delete_if_transparent); elem = document.getElementById(elem_id); float_opacity = parseFloat(parseFloat(float_opaque).toFixed(2)); if (float_opacity <= 0.01) { if (dit == 1) { if (elem != null) { elem.style.opacity = 0; elem.parentNode.removeChild(elem); elem = null; return true; } } } if (elem != null) { obj_opacity = parseFloat(parseFloat(elem.style.opacity).toFixed(2)); if (typeof obj_opacity == "number") { if (obj_opacity => 0.01) { if (obj_opacity <= 1.0) { elem.style.opacity = float_opacity; } else { } } } } } function make_unique_id(digits) { var random_num = null; var char_str = null; var i = null; var len = null; var rnd = null; var lBound = null; var uBound = null; lBound = 1; uBound = 9; char_str = ""; len = Math.abs(Math.floor(parseFloat(digits))); if (typeof digits == "number") { for (i = 0; i < digits; i++) { random_num = Math.floor(Math.random() * (uBound)) + lBound; //alert(random_num); char_str = random_num.toString() + char_str; } } return char_str; } function q_string_encode(str_val) { var input_str = null; var qstring = null; var has_querystring = null; qstring = get_querystring(str_val); input_str = str_val.toString(); } function fade_elem_in(elem_id) { var elem = null; var o = null; var i = null; elem = document.getElementById(elem_id); if (elem != null) { o = parseFloat(elem.style.opacity); if (typeof o == "number" && o < 1.0) { elem.style.opacity = o + 0.01; for (i = 0; i < 100; i++) { global_fade_in_timer = setTimeout("fade_elem_in(\"" + elem_id + "\");clearTimeout(global_fade_in_timer)", ((parseFloat(i) * 1.01) + 5)); } } else if (typeof o != "number") { elem.style.opacity = 0.0; o = 0.0; fade_elem_in(elem_id); //return; } } } function get_number_windows() { var web_windows = null; var web_window_count = null; web_windows = document.getElementsByName("web_window"); web_window_count = parseFloat(web_windows.length); return web_window_count; } /* function move_elem_x(elem, begin_x, end_x, pxls, delay) { var obj = null; obj = elem; obj.setAttribute("data-begin_x", begin_x); obj.setAttribute("data-end_x", end_x); if (elem != null) { if (begin_x < end_x) { } else if (begin_x > end_x) { } else if (begin_x == end_x) { //stop } else { //who knows. wtf.... } } else { console.log("element is null. functions.js - move_elem_x"); } } */ /* function move_elem_left(elem, l_bound, pxls, delay) { var cur_left = null; var x_distance = null; if (elem != null) { if (typeof l_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_left = parseFloat(elem.style.left); if (cur_left > l_bound) { x_distance = cur_left - l_bound; x_distance = Math.abs(x_distance); x_distance = parseFloat((x_distance / 2)); elem.style.left = (parseFloat(elem.style.left) - parseFloat(x_distance)) + "px"; cur_left = parseFloat(elem.style.left); //alert(cur_left); if (cur_left > 0) { global_timer_x_left_animate_id = setTimeout(function () { move_elem_left(elem, l_bound, pxls, delay); }, delay); } else { elem.style.left = l_bound + "px"; clearTimeout(global_timer_x_left_animate_id); return; } } } } } } } */ /* function move_elem_right(elem, u_bound, pxls, delay) { var cur_right = null; var x_distance = null; if (elem != null) { if (typeof u_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_right = parseFloat(elem.style.left); if (cur_right < u_bound) { x_distance = cur_right - u_bound; x_distance = Math.abs(x_distance); x_distance = parseFloat((x_distance / 2)); elem.style.left = (parseFloat(elem.style.left) + parseFloat(x_distance)) + "px"; cur_right = parseFloat(elem.style.left); if (cur_right < u_bound) { global_timer_x_right_animate_id = setTimeout(function () { move_elem_right(elem, u_bound, pxls, delay); }, delay); } else { //alert("done"); elem.style.left = u_bound + "px"; clearTimeout(global_timer_x_right_animate_id); return; } } } } } } } */ /* function move_elem_bottom(elem, u_bound, pxls, delay) { var cur_bottom = null; var y_distance = null; if (elem != null) { if (typeof u_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_bottom = parseFloat(elem.style.top); if (cur_bottom < u_bound) { y_distance = cur_bottom - u_bound; y_distance = Math.abs(y_distance); y_distance = parseFloat((y_distance / 2)); elem.style.top = (parseFloat(elem.style.top) + parseFloat(y_distance)) + "px"; cur_bottom = parseFloat(elem.style.top); //alert(u_bound); if (cur_bottom < u_bound) { global_timer_y_down_animate_id = setTimeout(function () { move_elem_bottom(elem, u_bound, pxls, delay); }, delay); } else { elem.style.top = u_bound + "px"; //alert("done"); clearTimeout(global_timer_y_down_animate_id); return; } } } } } } } */ /* function move_elem_top(elem, l_bound, pxls, delay) { var cur_top = null; var y_distance = null; if (elem != null) { if (typeof l_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_top = parseFloat(elem.style.top); if (cur_top > l_bound) { y_distance = cur_top - l_bound; y_distance = Math.abs(y_distance); y_distance = parseFloat((y_distance / 2)); elem.style.top = (parseFloat(elem.style.top) - parseFloat(y_distance)) + "px"; cur_top = parseFloat(elem.style.top); //alert(cur_top); if (cur_top > 0) { global_timer_y_up_animate_id = setTimeout(function () { move_elem_top(elem, l_bound, pxls, delay); }, delay); } else { elem.style.top = parseFloat(l_bound) + "px"; //alert("done"); clearTimeout(global_timer_y_up_animate_id); return; } } } } } } } */ function decrease_elem_width(elem, l_bound, pxls, delay) { var cur_width = null; var w_distance = null; if (elem != null) { if (typeof l_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_width = parseFloat(elem.style.width); if (cur_width > l_bound) { w_distance = cur_width - l_bound; w_distance = Math.abs(Math.round(w_distance)); w_distance = Math.round(parseFloat((w_distance / 2))); elem.style.width = (parseFloat(elem.style.width) - parseInt(w_distance)) + "px"; cur_width = Math.round(parseFloat(elem.style.width)); if (cur_width > l_bound) { global_timer_w_decrease_animate_id = setTimeout(function () { decrease_elem_width(elem, l_bound, pxls, delay); }, delay); } else { elem.style.width = cur_width + "px"; clearTimeout(global_timer_w_decrease_animate_id); } } } } } } } function decrease_elem_height(elem, l_bound, pxls, delay) { var cur_height = null; var h_distance = null; if (elem != null) { if (typeof l_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_height = parseFloat(elem.style.height); if (cur_height > l_bound) { h_distance = cur_height - l_bound; h_distance = Math.abs(Math.round(h_distance)); h_distance = Math.round(parseFloat((h_distance / 2))); elem.style.height = (parseFloat(elem.style.height) - parseInt(h_distance)) + "px"; cur_height = Math.round(parseFloat(elem.style.height)); if (cur_height > l_bound) { global_timer_h_decrease_animate_id = setTimeout(function () { decrease_elem_height(elem, l_bound, pxls, delay); }, delay); } else { elem.style.height = cur_height + "px"; clearTimeout(global_timer_h_decrease_animate_id); } } } } } } } function increase_elem_width(elem, u_bound, pxls, delay) { var cur_width = null; var w_distance = null; if (elem != null) { if (typeof u_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_width = parseFloat(elem.style.width); if (cur_width < u_bound) { w_distance = cur_width - u_bound; w_distance = Math.abs(Math.round(w_distance)); w_distance = Math.round(parseFloat((w_distance / 2))); elem.style.width = (parseFloat(elem.style.width) + parseInt(w_distance)) + "px"; cur_width = Math.round(parseFloat(elem.style.width)); if (cur_width < u_bound) { global_timer_w_increase_animate_id = setTimeout(function () { increase_elem_width(elem, u_bound, pxls, delay); }, delay); } else { elem.style.width = u_bound + "px"; clearTimeout(global_timer_w_increase_animate_id); } } } } } } } function increase_elem_height(elem, u_bound, pxls, delay) { var cur_height = null; var h_distance = null; if (elem != null) { if (typeof u_bound == "number") { if (typeof pxls == "number") { if (typeof delay == "number") { cur_height = parseFloat(elem.style.height); if (cur_height < u_bound) { h_distance = cur_height - u_bound; h_distance = Math.abs(Math.round(h_distance)); h_distance = Math.round(parseFloat((h_distance / 2))); elem.style.height = (parseFloat(elem.style.height) + parseInt(h_distance)) + "px"; cur_height = Math.round(parseFloat(elem.style.height)); //alert(u_bound); if (cur_height < u_bound) { global_timer_h_increase_animate_id = setTimeout(function () { increase_elem_height(elem, u_bound, pxls, delay); }, delay); } else { elem.style.height = u_bound + "px"; clearTimeout(global_timer_h_increase_animate_id); } } } } } } } function create_youtube_player() { return; var youtube = null; var youtube_contents = null; var youtube_contents_container = null; youtube = make_new_window(null, null, null, 560, 315, "Youtube Playlist", null); youtube_contents_container = document.getElementById(youtube.id + "_tbl_0000_tr_0001_td_0000_div_0000"); youtube_contents = ""; youtube_contents_container.innerHTML = youtube_contents; youtube_contents.style.height = "100%"; youtube_contents.style.width = "100%"; return youtube.id; } //make new window shortcut function async function mW(num = (Math.floor(Math.random() * 9000) + 999)) { var win = null; //win = await make_new_window(null, null, null, null, null, 'New Window ' + num, null); win = await make_new_window(null, null, null, null, null, 'New Window ' + num, null); ////return win; } function clear_all_timers() { // var killId = null; killId = setTimeout(function () { for (var i = killId; i > 0; i--) clearInterval(i) }, 10); } function HTMLEncode(s) { return s.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/'/g, ''') .replace(/"/g, '"'); } function HTMLDecode(s) { var txt = null; var r = null; txt = document.createElement("textarea"); txt.innerHTML = s; r = txt.value; txt = null; return r; } function get_window_title(win_id) { var w = null; var title = null; w = document.getElementById(win_id); title = document.getElementById(win_id + "_title_box").innerText; return title; } function stop_event() { event.stopPropagation(); event.stopImmediatePropagation(); event.preventDefault(); //alert(""); return; } function get_content_id_attribute(win_id) { var w = null; var content_id = null; w = document.getElementById(win_id); if (w !== null) { if (w.hasAttributes() === true) { if (w.hasAttribute("data-content_id") === true) { content_id = w.getAttribute("data-content_id"); } } } return content_id; }