// ***************************************************************** // * addLoadEvent * // ***************************************************************** // * Version .01 * // ***************************************************************** // * allows multiple ON LOAD functions to be called * // * DO NOT DELETE ------ * // ***************************************************************** function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { oldonload(); func(); } } } // ***************************************************************** // * addClass * // ***************************************************************** // * Version .01 * // ***************************************************************** // * this function allows you to add a class to an html selector * // ***************************************************************** function addClass(element, value) { if (!element.className) { element.className = value; } else { newClassName = element.className; newClassName += " "; newClassName += value; element.className = newClassName; } } // ***************************************************************** // * prepare_parent_links * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Standards-friendly pop up window * // * Get links that match class="open_in_child" and on click * // * open the link in a new window. * // ***************************************************************** function prepare_parent_links() { if (!document.getElementsByTagName) return false; var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].className.match('open_in_child')) { links[i].onclick = function() { open_in_child(this.getAttribute('href')); return false; } } } } // **************************************************************** // * open_in_parent * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Lorem Ipsum... * // ***************************************************************** function open_in_parent(url) { opener.location.href = url; if (window.focus) { opener.focus(); } return false; } // ***************************************************************** // * open_in_child * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Lorem Ipsum... * // ***************************************************************** function open_in_child(url) { window.name = 'parent'; newwindow = window.open(url, 'child'); if (window.focus) { newwindow.focus(); } return false; } // ***************************************************************** // * prepare_child_links * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Load in parent window and close current window * // * Get links that match class="open_in_parent" and on click * // * open the link in the parent window and close itself. * // ***************************************************************** function prepare_child_links() { if (!document.getElementsByTagName) return false; var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].className.match('open_in_parent')) { links[i].onclick = function() { open_in_parent(this.getAttribute('href')); return false; } } } } // ***************************************************************** // * Toggle * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Generic toggle function. Pass element ID and off it goes! * // ***************************************************************** function toggle(obj) { var el = document.getElementById(obj); el.style.display = (el.style.display != 'none' ? 'none' : 'block' ); } function closeCards() { var myCards = new Array("legend-learnmore") var x for (x in myCards) { document.getElementById(myCards[x]).style.display = "none"; } } // ***************************************************************** // * Toggle * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Get links that match class="toggle" and on click call * // * function toggleElement(). * // * This function is executed on the pageload event. * // ***************************************************************** addLoadEvent(prepareToggle) function prepareToggle() { if (!document.getElementsByTagName) return false; var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { if (links[i].className.match("toggle")) { links[i].onmouseover = function() { /*links[i].onclick = function() {*/ toggleElement(this); return false; } } } for (var i = 0; i < links.length; i++) { if (links[i].className.match("toggle")) { links[i].onmouseout = function() { closeCards(); return false; } } } for (var i = 0; i < links.length; i++) { if (links[i].className.match("toggle")) { links[i].onclick = function() { //toggleElement(this); return false; } } } } // ***************************************************************** // * ToggleElement * // ***************************************************************** // * Version .01 * // ***************************************************************** // * Toggle wrapper. * // ***************************************************************** function toggleElement(link) { var elementID = link.getAttribute("href").split("#")[1]; toggle(elementID); } function def_hover(id) { e = document.getElementById(id) e.style.display = 'block' } function def_mouseout(id) { e = document.getElementById(id) e.style.display = 'none' } function trim(str) { return str.replace(/^\s+|\s+$/g,""); } // clears the default value in a text input or textarea function clearDefaultNote(caller,note) { if (!caller) caller = this; if (caller.value == note){ caller.value = ''; } } function addDefaultNote(caller, note) { if (!caller) caller = this; eval = trim(caller.value); if (eval == '') { caller.value = note; } else { caller.value = eval; } } function redirecthttp() { var str,str1,str2,intlen; str = window.document.location.toString(); str1 = str.substring(0, 5); intlen = str.lastIndexOf(".") + 1 str2 = str.substring(intlen); if (str1 == "https" && str2 == "html") { if (str.indexOf("sncqawebdev1:546") >= 0) window.location.replace(str.replace("https://sncqawebdev1:546", "http://sncqawebdev1:83")); else if (str.indexOf("sncqawebdev1:547") >= 0) window.location.replace(str.replace("https://sncqawebdev1:547", "http://sncqawebdev1:84")); else if (str.indexOf("secure.nai.com") >= 0) window.location.replace(str.replace("https://secure.nai.com", "http://www.mcafee.com")); else if (str.indexOf("www.mcafee.com") >= 0) window.location.replace(str.replace("https", "http")); else if (str.indexOf("mcafee.com") >= 0) window.location.replace(str.replace("https", "http")); else window.location.replace(str.replace("https", "http")); } } redirecthttp();