/* vars */ var tabbar_height = 30; var logo_height = 90; var sidebar_width = 178; var site_min_width = 599; var browser = browser_check(); var sub_toggle_states = new Array(); var g_sub_expended_index = 0; var g_sort_table; var g_sub_text_indent = 10; var g_intl_page = "page"; var g_intl_Rows_per_Page = "Rows per Page"; var g_intl_Set = "Set"; /* functions */ function sprtf(s) { var bits = s.split('%'); var out = bits[0]; var re = /^([ds])(.*)$/; for (var i=1; i elem: ' + elem + ' ### ' + text + '
'); } function debug(text) { var txtDebug = top.container_sidebar.document.getElementById('txtdebug'); if (txtDebug) { txtDebug.value = txtDebug.value + " " + text; } } function debugln(text) { debug(text + "\n"); } function debug_clear() { var txtDebug = top.container_sidebar.document.getElementById('txtdebug'); if (txtDebug) { txtDebug.value = ''; } } function setSubState(id, state) { //debugln('chassis-set ' + id + " : " + state); sub_toggle_states[id] = state; } function getSubState(id) { //debugln('chassis-get ' + id + " : " + sub_toggle_states[id]); return sub_toggle_states[id]; } function browser_check() { if (document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1) { return "MSIE"; } else { return "NoMSIE"; } } function checkSiteMinWidth (mw) { if (mw.indexOf('px') != -1) { mw = mw.replace(/px/,''); if (site_min_width < mw) { site_min_width = mw; } } } function getCS(obj,prop) { var propval; propval=document.defaultView.getComputedStyle(obj,null).getPropertyValue(prop); return propval.replace(/px/,''); } function getElementsByClassNameIE5(classToFind, baseElement) { if (arguments.length == 1) baseElement = document; var tempElements = baseElement.getElementsByTagName('*'); if (!tempElements.length) if (document.body) if (document.body.all) tempElements = document.body.all; var matchingElements = []; for (var loop=0; loop h ? elem[i].scrollWidth : h; } for (var i = 0; i < elem.length; i++) { elem[i].width = h; } } function Popup(document) { window.open(document, "Help", "width=500,height=500,scrollbars=yes"); } function resizemenu(id) { var pageheight, pagewidth; parent.document.getElementById("submenufr").width = 200; if (document.getElementById) this.el = document.getElementById(id); else if (document.all) this.el = document.all[id]; else if (document.layers) this.el = document.layers[id]; if (this.el) { if (document.layers) { pageheight = this.el.document.height; pagewidth = this.el.document.width; } else { pageheight = this.el.offsetHeight; pagewidth = this.el.offsetWidth; } parent.document.getElementById("submenufr").height = pageheight; parent.document.getElementById("submenufr").width = pagewidth; } } function resizeContainer() { try { if (top.localport) { /*XXX This is redundant yet not quite the same as repositionFooter */ var max_container_iframe_height = top.innerHeight - tabbar_height; var page_height_sidebar = top.container_sidebar.document.getElementById("page_end").offsetTop; var page_height_main = top.container.document.getElementById("page_end").offsetTop + 25; var max_container_page_height = (page_height_sidebar > page_height_main) ? page_height_sidebar : page_height_main; var iframe_height = (max_container_page_height > max_container_iframe_height) ? max_container_page_height : max_container_iframe_height; if (top.document.getElementById("container_sidebar").height != iframe_height) { top.document.getElementById("container_sidebar").height = iframe_height; } var sidebarEl = top.document.getElementById("container_sidebar"); var content = sidebarEl.contentWindow || sidebarEl.contentDocument; if (content.document) content = content.document; sidebarEl.width = content.body.scrollWidth; if (top.document.getElementById("container").height != iframe_height) { top.document.getElementById("container").height = iframe_height; } return; } } catch (e) {} // Set width of sidebar to fit content try { var sidebarEl = top.document.getElementById("container_sidebar"); var content = sidebarEl.contentWindow || sidebarEl.contentDocument; if (content.document) content = content.document; sidebarEl.width = content.body.scrollWidth; } catch(e) {} try { var innnerwidth; if (site_min_width != 0) { var elem, i, j; if (parent.innerWidth) innnerwidth = parent.innerWidth; else innnerwidth = parent.document.body.clientWidth; if (elem = top.document.getElementById("container")) { if ((innnerwidth - sidebar_width) < site_min_width) { elem = top.container.$$('tmpl_resize'); // workaround for IE 5.x if (elem.length == 0) elem = getElementsByClassNameIE5("tmpl_resize", top.container.document); if (elem.length != 0) { for (i = 0; i < elem.length; i++) { elem[i].style.width = site_min_width - 55; } } } else { elem = top.container.$$('tmpl_resize'); // workaround for IE 5.x if (elem.length == 0) elem = getElementsByClassNameIE5("tmpl_resize", top.container.document); if (elem.length != 0) { j = double_size; if ((double_size + sidebar_width + 55) > innnerwidth) j = site_min_width - 55; for (i = 0; i < elem.length; i++) { elem[i].style.width = j; } } } } } repositionFooter(0); } catch (e) {} } function repositionFooter(adjustment) { try { var max_available_height = top.innerHeight ? top.innerHeight : top.document.body.clientHeight; var sidebar_content_height = top.container_sidebar.document.getElementById("page_end").offsetTop + logo_height; var main_content_height = top.container.document.getElementById("page_end").offsetTop + tabbar_height; var set_height = Math.max(max_available_height, Math.max(main_content_height, sidebar_content_height)); top.document.getElementById("container_sidebar").height = set_height - logo_height; top.document.getElementById("container").height = set_height - tabbar_height; var footer = top.container.document.getElementById("footer"); if (footer) { console.log('footer!');footer.style.top = (iframe_height - (25 + adjustment)) + "px"; } } catch (e) {} } function setTitle(title) { parent.document.title = title; } function formatNavTabs(stdnavtabs, activenavtab) { var elem; var topnav = parent.frames['topnav']; if (topnav && topnav.document) { for (var i = 0; i < stdnavtabs.length; i++) { if (elem = topnav.document.getElementById("start_" + stdnavtabs[i])) elem.className = "nav_tab_start"; if (elem = topnav.document.getElementById("middle_" + stdnavtabs[i])) elem.className = "nav_tab_middle"; if (elem = topnav.document.getElementById("link_" + stdnavtabs[i])) elem.className = "nav_tab_link"; if (elem = topnav.document.getElementById("end_" + stdnavtabs[i])) elem.className = "nav_tab_end"; } if (activenavtab != "") highlightActiveNavTab(activenavtab); } } function highlightActiveNavTab(activenavtab) { var errors = 0; var elem; var topnav = parent.frames['topnav']; if (elem = topnav.document.getElementById("start_" + activenavtab)) elem.className = "nav_tab_start_ul"; else errors++; if (elem = topnav.document.getElementById("middle_" + activenavtab)) elem.className = "nav_tab_middle_ul"; else errors++; if (elem = topnav.document.getElementById("link_" + activenavtab)) elem.className = "nav_tab_link_ul"; else errors++; if (elem = topnav.document.getElementById("end_" + activenavtab)) elem.className = "nav_tab_end_ul"; else errors++; if (errors > 0) window.setTimeout(function() { highlightActiveNavTab(activenavtab) }, 300); } function highlightActiveTab(activenavtab) { var errors = 0; var elem; var topnav = top.container; if (elem = topnav.document.getElementById("start_" + activenavtab)) elem.className = "nav_tab_start_ul"; else errors++; if (elem = topnav.document.getElementById("middle_" + activenavtab)) elem.className = "nav_tab_middle_ul"; else errors++; if (elem = topnav.document.getElementById("link_" + activenavtab)) elem.className = "nav_tab_link_ul"; else errors++; if (elem = topnav.document.getElementById("end_" + activenavtab)) elem.className = "nav_tab_end_ul"; else errors++; if (errors > 0) window.setTimeout(function() { highlightActiveNavTab(activenavtab) }, 300); } function unhighlightTab(unactivenavtab) { var elem; var topnav = top.container; if (elem = topnav.document.getElementById("start_" + unactivenavtab)) elem.className = "nav_tab_start"; if (elem = topnav.document.getElementById("middle_" + unactivenavtab)) elem.className = "nav_tab_middle"; if (elem = topnav.document.getElementById("link_" + unactivenavtab)) elem.className = "nav_tab_link"; if (elem = topnav.document.getElementById("end_" + unactivenavtab)) elem.className = "nav_tab_end"; } function initSubmenu() { var elem; if (top.browser != "MSIE") { if (elem = top.container.document.getElementById("submenudiv")) { try { elem.innerHTML = top.container.submenufr.document.body.innerHTML; } catch (e) { if (window.frames['submenufr'].document.body) { elem.innerHTML = window.frames['submenufr'].document.body.innerHTML; } } } } } function showSubMenu(id) { var elem, eleme; if (top.browser != "MSIE") { if (top.localport) { hideAllSubMenus(); } if (top.hide_id != "") { if (top.hide_id != id) { reallyhideSubMenu(top.hide_id); } top.hide_id = ""; } if (elem = top.container.document.getElementById("submenudiv")) { if (eleme = top.container.document.getElementById("sm_"+id)) { eleme.style.display = "block"; } if (eleme = top.topnav.document.getElementById("middle_"+id)) { elem.style.left = (eleme.offsetLeft - 7) + "px"; elem.style.display = "block"; } // debug_write(this.name, ' SHOW id: ' + id); } } else { if (top.container.submenufr) { if (top.container.submenufr.resizeSubmenu) { if (elem = top.topnav.document.getElementById("middle_"+id)) { var pos = elem.offsetLeft; if (eleme = top.container.submenufr.document.getElementById("sm_"+id)) { eleme.style.display = "block"; if (elem = top.container.document.getElementById("submenufr")) { if (eleme.mywidth) { // improve menu speed elem.width = eleme.mywidth; elem.height = eleme.myheight; elem.style.left = (pos - 7) + "px"; elem.style.visibility = "visible"; } else { elem.width = "200px"; elem.style.left = (pos - 7) + "px"; elem.style.visibility = "visible"; top.container.submenufr.resizeSubmenu("sm_"+id); eleme.mywidth = elem.width; eleme.myheight = elem.height; } } } } // debug_write(this.name, ' SHOW id: ' + id); } } } } function hideAllSubMenus() { reallyhideSubMenu('Port_Access'); reallyhideSubMenu('Power'); reallyhideSubMenu('User_Management'); reallyhideSubMenu('Device_Settings'); reallyhideSubMenu('Security'); reallyhideSubMenu('Maintenance'); reallyhideSubMenu('Diagnostics'); reallyhideSubMenu('Help'); } function timerhideSubMenu(id) { var elem; if (top.hide_id == id) { if (elem = top.container.document.getElementById("sm_"+id)) { elem.style.display = "none"; if (elem = top.container.document.getElementById("submenudiv")) elem.style.display = "none"; // debug_write(this.name, ' timer HIDE id: ' + id); } } } function reallyhideSubMenu(id) { var elem; if (elem = top.container.document.getElementById("sm_"+id)) { elem.style.display = "none"; if (elem = top.container.document.getElementById("submenudiv")) elem.style.display = "none"; // debug_write(this.name, ' really HIDE id: ' + id); } } function hideSubMenu(id) { var elem; if (top.browser != "MSIE") { if (top.hide_id = "") { window.setTimeout(function() { timerhideSubMenu(id) }, 500); top.hide_id = id; // debug_write(this.name, ' enqueue top.hide_id = "" timer HIDE id: ' + id); } else { if (id != top.hide_id) { reallyhideSubMenu(top.hide_id); window.setTimeout(function() { timerhideSubMenu(id) }, 500); top.hide_id = id; // debug_write(this.name, ' enqueue top.hide_id != top.hide_id timer HIDE id: ' + id); } } } else { if (top.container.submenufr) { if (elem = top.container.submenufr.document.getElementById("sm_"+id)) { elem.style.display = "none"; if (elem = top.container.document.getElementById("submenufr")) { elem.style.visibility = "hidden"; } // debug_write(this.name, ' HIDE id: ' + id); } } } } function checkframes() { if (top.frames.length == 0) { site_loaded = true; // if we view site directly, that means without home.asp then enable all forms/buttons }; } function disableElementById(id) { var elem; if (elem = document.getElementById(id)) { elem.enabled = false; } } function hidebyId(id) { var elem; if (elem = $(id)) { elem.style.display = "none"; } } function showbyId(id) { var elem; if (elem = $(id)) { elem.style.display = "inline"; } } function handleTwister(twister_id, elem) { var ret, twister_state; eval("twister_state = " + twister_id + "_state;"); if (twister_state == 'none') { showbyId(twister_id); ret = 'inline'; elem.className = 'twister_hide'; } else { hidebyId(twister_id); ret = 'none'; elem.className = 'twister_show'; } resizeContainer(); return ret; } /*================================================================================================== webs_ajax ==================================================================================================*/ function webs_ajax_request() { // usage: webs_ajax_request(job [, param[, elem_id[, file[, evaluate_response]) var argn = webs_ajax_request.arguments.length; var args = webs_ajax_request.arguments; if (argn < 1) return 0; var file = "webs_cron.asp"; var elem_id = "cron_"; var param = ""; var job = args[0]; var evaluate_response = false; if (argn > 1) { param = "&"+args[1]; } if (argn > 2) { elem_id = args[2]; } if (argn > 3) { file = args[3]; } if (argn > 4) { evaluate_response = args[4]; } var options = { method : 'get', parameters : 'webs_job='+job+param, onComplete : function(response) { var sess, state, aclts; try { sess = response.getResponseHeader("eric-session").replace(/^\s+/g, '').replace(/\s+$/g, ''); } catch (e) { sess = ""; } try { state = response.getResponseHeader("eric-state").replace(/^\s+/g, '').replace(/\s+$/g, ''); } catch (e) { state = ""; } try { aclts = response.getResponseHeader("acl-ts").replace(/^\s+/g, '').replace(/\s+$/g, ''); } catch (e) { aclts = 0; } webs_ajax_callback(job, sess, state, aclts * 1, response.responseText, elem_id, evaluate_response); }, requestHeaders : new Array() }; new Ajax.Request(file, options); } function webs_ajax_callback(job, session, state, aclts, responseText, elem_id, evaluate_response) { if (session=="no") { sidebar_updates = 0; top.location.href = "/"; return 0; } /* if (state=="fwupd") { sidebar_updates = 0; webs_ajax_callback("time", session, "no", "A firmware update is in progress.
Please wait...", "cron_"); return 0; } */ try { if (!top.container_sidebar.acl_timestamp) { top.container_sidebar.acl_timestamp = aclts; } if (aclts && (aclts != top.container_sidebar.acl_timestamp)) { top.topnav.location.href = top.topnav.location; top.container.submenufr.location.href = top.container.submenufr.location; top.container_sidebar.acl_timestamp = aclts; } } catch (e) {} { if ((job == "netif") || (job == "netstat") || (job == "ping") || (job == "traceroute")) { $('action_resfresh').disabled = false; } var dd; if( evaluate_response ) { eval( responseText ); } else if (dd=document.getElementById(elem_id+job)) { var r = responseText.replace(/^\s+/g, '').replace(/\s+$/g, '') if (r != "") { dd.innerHTML = responseText; resizeContainer(); } } } } function htmlspecialchars(ch) { if (typeof ch == 'string') { ch = ch.replace(/&/g, "&"); ch = ch.replace(/\"/g, """); ch = ch.replace(//g, ">"); } return ch; } /*================================================================================================== SortableTable ==================================================================================================*/ var SortableTable = Class.create({ initialize: function(objectname, elem, a_headers, a_sorting, resize_cb, header_start_idx, a_style, view_flag) { g_sort_table = this; g_sub_expended_index = 0; this.objectname = objectname; this.elem = elem; this.a_headers = a_headers; this.a_sorting = a_sorting; this.resize_cb = resize_cb; this.header_start_idx = 1; this.sortby = -1; this.sortdir = 'asc'; this.sortnum = false; this.view_flag = -1; this.show_by_page = false; this.searchable = false; this.hierarchy = false; this.search_idx = 1; this.circle_up_corner = true; if (arguments.length >= 6) { this.header_start_idx = header_start_idx; } if (arguments.length >= 7 && a_style != null) { this.a_style = a_style; } if (arguments.length >= 8) { this.view_flag = view_flag; switch (this.view_flag) { case 0: // hierarchy view - this.a_fields[1] may contain sub view. case 1: // group view case 2: // serial view this.show_by_page = true; this.hierarchy = true; this.circle_up_corner = false; break; case 3: // search view this.show_by_page = true; this.searchable = true; this.search_idx = 4; this.circle_up_corner = false; break; default: // flat table view this.show_by_page = true; break; } } if (this.show_by_page == true) { var cookie_view_length = readCookie("view_length"); if (cookie_view_length) { this.view_length = parseInt(cookie_view_length); } else { createCookie("view_length", "32"); this.view_length = 32; } } if (this.searchable == true) { var key = readCookie("searchkey"); if (key) { var key_unescape = unescape(key); this.search_key = htmlspecialchars(key_unescape); } else { this.search_key = null; } } this.view_position = 0; this.total_rows = 0; for (var i = 1; i < this.a_sorting.length; i++) { if (this.a_sorting[i]) { this.sortby = i; this.sortnum = (this.a_sorting[i] == 2) ? true : false; break; } } }, get_style: function(col) { if (typeof this.a_style != 'undefined') { if (col < this.a_style.length) { return this.a_style[col]; } } return ''; }, updateCoreData: function(a_fields, a_links) { this.a_fields = a_fields; this.a_links = a_links; }, paint: function() { this.elem.innerHTML = this.getHTMLCode(); this.resize_cb(); }, paintWait: function() { this.elem.innerHTML = this.getWaitCode(); this.resize_cb(); }, sort: function(sortby, sortdir, sortnum) { this.sortby = sortby; this.sortdir = sortdir; this.sortnum = sortnum; this.paint(); }, cmp: function(a, b) { if (top.sortnum) { if (top.sortdir == 'asc') { var gt = 1; } else { var gt = -1; } var val_a = String(a[top.sortby]); var val_b = String(b[top.sortby]); var a_split = val_a.split("-"); var b_split = val_b.split("-"); var i = 0; var min_size = (a_split.length < b_split.length) ? a_split.length : b_split.length; for(i=0; i b_split.length) { return gt; } else if (a_split.length < b_split.length) { return (0 - gt); } else { return 0; } } return top.cmp(a, b); }, sort_array: function(the_array) { top.sortby = this.sortby; top.sortdir = this.sortdir; top.sortnum = this.sortnum; if (top.sortcache_re_size > 1024) { top.sortcache_re = new Object(); top.sortcache_re_size = 0; } if (top.sortcache_lc_size > 1024) { top.sortcache_lc = new Object(); top.sortcache_lc_size = 0; } the_array.sort(this.cmp); }, getHTMLCodeForRecord: function(r, r_link, text_indent) { var out = ''; var classtr = ''; var num_colspancols = this.a_headers.length - this.header_start_idx; // style if ((this.total_rows % 2) == 0) { classtr = "dtbl_record_evenrow"; } else { classtr = "dtbl_record_oddrow"; } out += ' \n'; out += ' \n'; out += ' \n'; //debugln(r.length + " : " + this.a_headers.length); if (r.length != this.a_headers.length) { out += ' ' + r[0] + '\n'; } else { //debugln(this.header_start_idx); for (var i = this.header_start_idx; i < r.length; i++) { //debugln(j); //debugln(r[i] + " : " + r[1]); var text_indent_str = ''; if (text_indent != 0 && (i == this.header_start_idx || i == this.header_start_idx +2)) { text_indent_str = ' style="text-indent:' + text_indent + 'px;" '; } if (r_link[i]) { out += ' ' + r[i] + '\n'; } else if (this.hierarchy == true && r[1] && r[1].length > 0 && i == this.header_start_idx + 1) { //debugln(r[1].length + " : " + i + " : " + this.a_headers[1]); //debugln(r[this.header_start_idx]); var img_src = "images/blade_show.gif"; if ( getSubState(r[this.header_start_idx]) == '') { img_src = "images/blade_hide.gif"; } out += ' \n'; } else { out += ' ' + r[i] + '\n'; } //debugln("\n"); //debugln("-----------------"); } //debugln(a[j][4] + " : " + a[j].length + " : " + this.a_headers.length); } out += ' \n'; out += ' \n'; return out; }, getHTMLCodeForSub: function(a, a_links, text_indent) { var out = ''; if (text_indent >= (3 * g_sub_text_indent)) { // only allow third levels return out; } // sorting (if requested) if (this.sortby > -1) { this.sort_array(a); } for (var j = 0; j < a.length; j++) { // if searchable, do match. if (this.searchable == true && this.search_key) { if (do_match_i(a[j][this.search_idx], this.search_key) < 0) { continue; } } this.total_rows++; if (this.show_by_page == false || (this.total_rows > this.view_position && this.total_rows <= (this.view_position + this.view_length))) { out += this.getHTMLCodeForRecord(a[j], a_links[a[j][0]], text_indent); } if (this.hierarchy == true && a[j][1] && a[j][1].length > 0 && getSubState(a[j][this.header_start_idx]) != 'none') { out += this.getHTMLCodeForSub(a[j][1][0], a[j][1][1], (text_indent + g_sub_text_indent)); } } return out; }, getHTMLCode: function() { var out = ''; var a = this.a_fields; var classtr = ''; var clrftr = ''; var num_colspancols = this.a_headers.length - this.header_start_idx; var class_dtbl_header, new_sort_dir, link_title; this.total_rows = 0; // header out += ' \n'; out += ' \n'; out += ' \n'; if (this.circle_up_corner == true) { out += ' \n'; } else { out += ' \n'; } var style = ''; for (var i = this.header_start_idx; i < this.a_headers.length; i++) { style = ''; style = this.get_style(i); if (this.a_sorting[i]) { if (this.sortby == i) { class_dtbl_header = 'dtbl_header_' + this.sortdir; new_sort_dir = (this.sortdir == 'asc') ? 'desc' : 'asc'; link_title = 'Reverse the Sort'; } else { class_dtbl_header = 'dtbl_header'; new_sort_dir = 'asc'; link_title = 'Sort by ' + this.a_headers[i]; } out += ' \n'; } else { out += ' \n'; } } if (this.circle_up_corner == true) { out += ' \n'; } else { out += ' \n'; } out += ' \n'; // content out += this.getHTMLCodeForSub(a, this.a_links, 0); // footer // If the table is empty, we'll put in an empty row before the footer just because it looks better if (!this.total_rows) { out += '\n'; out += '\n'; out += '\n'; out += '\n'; out += '\n'; out += ''; this.total_rows++; } clrftr = this.total_rows % 2 ? "gry" : "wht"; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; if (this.show_by_page == true) { out += ' \n'; } out += '
' + this.a_headers[i] + '' + this.a_headers[i] + '
\n'; out += ' \n'; out += ' \n'; out += '\n'; out += '
\n'; if (this.view_position > 0) { out += ' '; out += ' '; } else if (this.view_length < this.total_rows) { out += ' '; out += ' '; } if (this.view_position + this.view_length < this.total_rows) { out += ' '; out += ' '; } else if (this.view_length < this.total_rows) { out += ' '; out += ' '; } if (this.view_length < this.total_rows) { var page = (this.view_position + (this.view_length - this.view_position % this.view_length)) / this.view_length; var total_page = (this.total_rows + (this.view_length - this.total_rows % this.view_length)) / this.view_length; if (this.total_rows % this.view_length == 0) { total_page -= 1; } out += '-' + page + '/' + total_page + '-' + g_intl_page; } out += ' '; out += ' ' + g_intl_Rows_per_Page; out += ' '; out += '
\n'; out += '
\n'; //debugln(out); return out; }, getWaitCode: function() { var out = ''; var a = this.a_fields; var num_colspancols = this.a_headers.length - this.header_start_idx; var class_dtbl_header, new_sort_dir, link_title; // header out += ' \n'; out += ' \n'; out += ' \n'; if (this.circle_up_corner == true) { out += ' \n'; } else { out += ' \n'; } var style = ''; for (var i = this.header_start_idx; i < this.a_headers.length; i++) { style = ''; style = this.get_style(i); if (this.a_sorting[i]) { if (this.sortby == i) { class_dtbl_header = 'dtbl_header_' + this.sortdir; new_sort_dir = (this.sortdir == 'asc') ? 'desc' : 'asc'; link_title = 'Reverse the Sort'; } else { class_dtbl_header = 'dtbl_header'; new_sort_dir = 'asc'; link_title = 'Sort by ' + this.a_headers[i]; } out += ' \n'; } else { out += ' \n'; } } if (this.circle_up_corner == true) { out += ' \n'; } else { out += ' \n'; } out += ' \n'; // content out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; // footer out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += ' \n'; out += '
' + this.a_headers[i] + '' + this.a_headers[i] + '
Getting Port Information ...
\n'; //debugln(out); return out; }, getURLCount: function(urlArr) { var cnt = 0; for (idx = 0; idx < urlArr.length; idx++) { //debugln('\t' + urlArr[idx]); if (typeof urlArr[idx] == 'undefined') { continue; } else { cnt++; } } //debugln('\tcnt ' + cnt); return cnt; }, toString: function() { return this.getHTMLCode(); } }); function goFirstPage() { g_sort_table.view_position = 0; g_sort_table.paint(); } function goPreviousPage() { var pos = g_sort_table.view_position - g_sort_table.view_length; if (pos < 0) { g_sort_table.view_position = 0; } else { g_sort_table.view_position = pos; } g_sort_table.paint(); } function goNextPage() { var pos = g_sort_table.view_position + g_sort_table.view_length; if (pos < g_sort_table.total_rows) { g_sort_table.view_position = pos; g_sort_table.paint(); } } function goLastPage() { var pos = g_sort_table.total_rows % g_sort_table.view_length; if (pos == 0) { pos = g_sort_table.view_length; } pos = g_sort_table.total_rows - pos; if (pos < 0) { pos = 0; } g_sort_table.view_position = pos; g_sort_table.paint(); } function viewLengthChange() { var str_view_length = document.getElementsByName("viewlength")[0].value; if (isNaN(str_view_length - 0)) { alert("Invalid input. Range: 1 - 64"); return; } var view_length = parseInt(str_view_length); if (view_length > 0 && view_length <= 64) { createCookie("view_length", str_view_length); g_sort_table.view_length = view_length; g_sort_table.view_position = 0; g_sort_table.paint(); } else { alert("Invalid input. Range: 1 - 64"); } } function searchKeyChange() { var search_key = document.getElementsByName("searchkey")[0].value; var escaped_search_key = htmlspecialchars(search_key); createCookie("searchkey", escape(search_key)); g_sort_table.search_key = escaped_search_key; g_sort_table.view_position = 0; g_sort_table.paint(); } function toggleSub(sub_id) { var expand = true; var wait = false; if (getSubState(sub_id) == '') { setSubState(sub_id, 'none'); expand = false; } else { setSubState(sub_id, ''); g_sub_expended_index = sub_id; } var arrow_img = $('bld_' + sub_id); if (arrow_img) { if (expand) { arrow_img.src = "images/blade_show.gif"; } else { arrow_img.src = "images/blade_hide.gif"; } } if (g_sort_table) { g_sort_table.paint(); } return wait; } /*================================================================================================== PowerAssoc ==================================================================================================*/ var PowerAssoc = Class.create({ initialize: function() { this.a_ports = new Array(); }, addPowerAssoc: function() { var argc = arguments.length; var argv = arguments; var size = this.a_ports.length; if (argc < 2) return; this.a_ports[size] = new Object(); this.a_ports[size].portId = argv[0]; this.a_ports[size].outlets = new Array(); for (var i = 1; i < argc; i++) { this.a_ports[size].outlets[i] = argv[i]; } }, getAllAssocOutlets: function(portId) { var i = 0; var a_ret = new Array(); var item; for (var i = 0; i < this.a_ports.length; i++) { item = this.a_ports[i]; if (item.portId == portId) { item.outlets.each( function(outlet_id) { a_ret[i++] = outlet_id; } ); break; } } return a_ret; }, getAllButActiveAssocOutlets: function(portId) { var i = 0; var a_ret = new Array(); this.a_ports.each( function(item) { if (item.portId != portId) { item.outlets.each( function(outlet_id) { a_ret[i++] = outlet_id; } ); } } ); return a_ret; }, getAssociatedPortId: function(portId) { var item, outlets; for (var i = 0; i < this.a_ports.length; i++) { item = this.a_ports[i]; outlets = item.outlets; for (var j = 0; j < outlets.length; j++) { if (outlets[j] == portId) { return item.portId; } } } return null; }, toString: function() { return 'PowerAssoc'; } }); /*================================================================================================== Initial stuff ==================================================================================================*/ if (Object.defineProperty) { try { if (document.getElementById('container')) Object.defineProperty(top, "container", { get : function() { return document.getElementById('container').contentWindow; } }); if (document.getElementById('container_sidebar')) Object.defineProperty(top, "container_sidebar", { get : function() { return document.getElementById('container_sidebar').contentWindow; } }); } catch(e) { } }