// Localized Redirect (.HTML to .JSP extension) var curLoc; curLoc = document.location.toString(); var excludeList = new Array; excludeList[0] = new Object; excludeList[0].id = "nl"; excludeList[0].path = "/nl/nl/"; excludeList[1] = new Object; excludeList[1].id = "cz"; excludeList[1].path = "/cs/cz/"; excludeList[2] = new Object; excludeList[2].id = "dk"; excludeList[2].path = "/da/dk/"; excludeList[3] = new Object; excludeList[3].id = "fi"; excludeList[3].path = "/fi/fi/"; excludeList[4] = new Object; excludeList[4].id = "hu"; excludeList[4].path = "/hu/hu/"; excludeList[5] = new Object; excludeList[5].id = "no"; excludeList[5].path = "/no/no/"; excludeList[6] = new Object; excludeList[6].id = "pl"; excludeList[6].path = "/pl/pl/"; excludeList[7] = new Object; excludeList[7].id = "ru"; excludeList[7].path = "/ru/ru/"; excludeList[8] = new Object; excludeList[8].id = "se"; excludeList[8].path = "/sv/se/"; excludeList[9] = new Object; excludeList[9].id = "gr"; excludeList[9].path = "/el/gr/"; excludeList[10] = new Object; excludeList[10].id = "il"; excludeList[10].path = "/he/il/"; excludeList[11] = new Object; excludeList[11].id = "tr"; excludeList[11].path = "/tr/tr/"; excludeList[12] = new Object; excludeList[12].id = "be"; excludeList[12].path = "/nl/be/"; excludeList[13] = new Object; excludeList[13].id = ""; excludeList[13].path = ""; if ((curLoc.length == "29" && curLoc.charAt(26) == "/") || (curLoc.length == "30" && curLoc.charAt(26) == "/" && curLoc.charAt(29) == "/") || (curLoc.length == "39" && curLoc.charAt(26) == "/" && curLoc.charAt(29) == "/" && curLoc.indexOf('index.jsp') < -1) || (curLoc.length == "40" && curLoc.charAt(26) == "/" && curLoc.charAt(29) == "/")) {switchURL();} function switchURL() { for (i = 0; i <= excludeList.length; i++) { if (curLoc.indexOf(excludeList[i].path) > -1) { if (excludeList[i].id == "tr" || excludeList[i].id == "gr" || excludeList[i].id == "il") { curLoc = "http://www.symantec.com/en/uk/index.jsp"; window.location.replace(curLoc); break; } else if (excludeList[i].id == "nl" || excludeList[i].id == "cz" || excludeList[i].id == "dk" || excludeList[i].id == "fi" || excludeList[i].id == "hu" || excludeList[i].id == "no" || excludeList[i].id == "pl" || excludeList[i].id == "ru" || excludeList[i].id == "se" || excludeList[i].id == "gr") { curLoc = "http://www.symantec.com/region/" + excludeList[i].id + "/index.html"; window.location.replace(curLoc); break; } else { switchExtension(); break; } } } } function switchExtension() { if (curLoc.indexOf('index.html') > -1 ) { curLoc = curLoc.substring(0,(curLoc.length - 10)) + 'index.jsp'; window.location.replace(curLoc); } else { curLoc += 'index.jsp'; window.location.replace(curLoc); } } // Script to print page with no header, gutter, or footer. var gAutoPrint = false; // Flag for whether or not to automatically call the print function function printSpecial() { if (document.getElementById != null) { var autoPrn = ''; var html = '\n\n'; if (document.getElementsByTagName != null) { var headTags = document.getElementsByTagName("head"); if (headTags.length > 0) html += headTags[0].innerHTML; } html += '\n\n\n'; var printReadyElem = document.getElementById("printReady"); if (printReadyElem != null) { html += printReadyElem.innerHTML; } else { alert("Could not find the printReady section in the HTML"); return; } html += autoPrn + '\n\n'; var printWin = window.open("","printSpecial"); printWin.document.open(); printWin.document.write(html); printWin.document.close(); if (gAutoPrint) printWin.print(); } else { alert("Sorry, the print ready feature is not compatible with your browser."); } } // Product Pages Buy Box function go(form) { location = document.form.site.options[document.form.site.selectedIndex].value; } // Partner Locator Popup Window function P(url,h,w) { // (url,height,width) var p = "height=" + h + ",width=" + w + ",scrollbars=yes"; window.open(url,"",p); } //Product Selector Popup Window function opensc(url) { window.open(url,"","height=536,width=772,scrollbars=yes"); } function openps(url) { window.open(url,"","height=494,width=780,scrollbars=no"); } //hr apply.cgi script// function form_Valid() { var my_email = document.forms[0].email.value; if ((my_email.indexOf("@")==-1) || (my_email.indexOf(".")==-1)) { alert ("Email address should contain @ and ."); return false; } if (my_email.charAt(0)=="@") { alert ("Email address cannot begin with the @ symbol."); return false; } if (my_email.indexOf(" ")!=-1) { alert ("Email address cannot contain spaces."); return false; } } /* Main Page Scripts */ function init_page() { init_dropdowns(); init_search_dropdown(); init_tabs(); } /* Modified by JJS */ var dmenu=0; function init_search_dropdown() { var elts = document.getElementsByTagName('div'); for (var i=0; i < elts.length; i++) { var e = elts[i]; if (e.className == 'search_dropdown') { e.onclick = dropdown_on2; e.onmouseout = dropdown_off2; dmenu=e; } if (e.className == 'search_dropdown_imenu'){ e.onmouseover=dropdown_on; e.onmouseout=dropdown_off2; } } } function dropdown_on2() { var t = dmenu.getElementsByTagName('table')[0]; if (t.style.display!='block') t.style.display = 'block'; else t.style.display='none'; } function dropdown_off2() { var t=dmenu.getElementsByTagName('table')[0]; t.style.display = 'none'; } /* End of Changes by JJS */ function init_dropdowns() { var elts = document.getElementsByTagName('div'); for (var i=0; i < elts.length; i++) { var e = elts[i]; if (e.className == 'dropdown') { e.onmouseover = dropdown_on; e.onmouseout = dropdown_off; } } } function dropdown_on() { var t = this.getElementsByTagName('table')[0]; t.style.display = 'block'; } function dropdown_off() { var t = this.getElementsByTagName('table')[0]; t.style.display = 'none'; } function init_tabs() { var elts = document.getElementsByTagName('a'); for (var i=0; i < elts.length; i++) { var e = elts[i]; if (e.className == 'rollover') { e.onmouseover = rollover_on; e.onmouseout = rollover_off; } } } function rollover_on() { var img = this.childNodes[0]; img.src = img.src.replace('_off','_on'); } function rollover_off() { var img = this.childNodes[0]; img.src = img.src.replace('_on','_off'); } onload = init_page; // Scripts for product finder // ADDED BY STEVE // ADDED BY STEVE - this code is necessary for product selector var timerID = null; var timerOn = false; var timecount = 500; var check = false; function getPos(element, which) { pos = 0 while (element != null) { pos += element["offset" + which] element = element.offsetParent } return pos; } function show(name) { var elem = document.getElementById(name); var parent = elem.parentNode; if (elem != null) { elem.style.visibility="visible"; elem.style.display="block"; elem.style.left=(getPos(parent, "Left") + 10) + "px"; elem.style.top=(getPos(parent, "Top") + 18) + "px"; } } function hide(name) { var elem = document.getElementById(name); if (elem != null) { elem.style.visibility="hidden"; elem.style.display="none"; } } // ADDED BY STEVE - END // ADDED BY STEVE - END // Product Selector var prod_selector = new Object(); prod_selector.anchorDivId = ""; prod_selector.anchorBtmId=""; prod_selector.primaryWidth = 0; prod_selector.secondaryWidth = 0; prod_selector.mouseOverImg = ""; prod_selector.normalImg = ""; prod_selector.topStatusTxt = ""; prod_selector.bgColorClass = ""; prod_selector.itemBorderClass = ""; prod_selector.menuGraphicClass = ""; prod_selector.btmBorderClass = ""; prod_selector.itemContentClass = ""; prod_selector.objWinHgt = ""; prod_selector.objScrollOffset = ""; prod_selector.objWinWidth = ""; prod_selector.spacerGifPath = "/img/spacer.gif"; prod_selector.browser = ""; prod_selector.tOffset = 0; prod_selector.invTOfsset = 0; prod_selector.iemac = false; prod_selector.psLayers = new Array(); var mItems = new Array(); var lList = new Object(); var selTmrId = null; var selTmrOn = false; var selTmrCnt = 700; prod_selector.iemac = (navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1); if(document.layers) { // NS 4.x specific var origWidth = window.innerWidth; var origHeight = window.innerHeight; window.onresize = function() { if(window.innerWidth != origWidth || window.innerHeight != origHeight) {//extra code to ensure a genuine resize has occurred origWidth = window.innerWidth; origHeight = window.innerHeight; window.location.reload(); } }; } // end NS4.x block function window_on_load () { if(document.getElementById) { window.onresize = function() {calculate_lOffset()}; var top = document.getElementById('prod-selector'); if(top) { getHghts(); getInvs(); calculate_lOffset();calculate_TOffsets(); top.onmouseover = function(){window.status = prod_selector.topStatusTxt; showSelDiv('level-1', prod_selector.anchorBtmId); selstop();}; top.onmouseout = function(){window.status=''; selstart();}; top=null;; } } } function calculate_lOffset() { if(prod_selector.secondaryWidth > 0) { var right_terminus = getPos(document.getElementById(prod_selector.anchorDivId), 'Left') + prod_selector.primaryWidth + prod_selector.secondaryWidth; if(right_terminus <= eval(prod_selector.objWinWidth) || prod_selector.iemac) { prod_selector.leftOffset = prod_selector.primaryWidth + 1; } else { prod_selector.leftOffset = (-1 * prod_selector.secondaryWidth) - 2; } } } function calculate_TOffsets() { //values determined empirically if(prod_selector.browser == 'IE' && !(prod_selector.iemac)) { prod_selector.tOffset = 0; prod_selector.invTOfsset = -1; } else { prod_selector.tOffset = -1; prod_selector.invTOfsset = 0; } } function setobjs(){ if(navigator.userAgent.indexOf('Safari') != -1) { prod_selector.objWinHgt = 'window.innerHeight'; prod_selector.objScrollOffset = 'window.pageYOffset'; prod_selector.objWinWidth = 'window.innerWidth'; prod_selector.browser = 'Safari'; } else if(window.innerHeight) { //NS prod_selector.objWinHgt = 'window.innerHeight'; prod_selector.objScrollOffset = 'window.pageYOffset'; prod_selector.objWinWidth = 'window.innerWidth'; prod_selector.browser = 'Mozilla'; } else if(document.body.clientHeight) { //IE prod_selector.objWinHgt = 'document.body.clientHeight'; prod_selector.objWinWidth = 'document.body.clientWidth'; prod_selector.objScrollOffset = 'document.body.scrollTop'; prod_selector.browser = 'IE'; } } function mustInv(toShow){ var inv = false; var lTop = getPos(prod_selector.psLayers[lList[toShow]].lock, "Top"); if((lTop + prod_selector.psLayers[lList[toShow]].height) >= (eval(prod_selector.objWinHgt) + eval(prod_selector.objScrollOffset)) && (lTop - prod_selector.psLayers[lList[toShow]].height > 15)) inv = true; return inv; } function showSelDiv(toshow, lockto){ if(prod_selector.psLayers.length > 0) { var ptr = document.getElementById(toshow); var inv = mustInv(toshow); if((!(prod_selector.iemac) && inv) || (prod_selector.iemac && toshow != 'level-1' && inv)) { var oLft = (toshow == 'level-1') ? 0 : prod_selector.leftOffset; var oTop = 0; ptr.style.visibility="visible"; ptr.style.display="block"; ptr.style.left= (getPos(prod_selector.psLayers[lList[toshow]].inv_lock, 'Left') + oLft) + "px"; ptr.style.top = ''; ptr.style.top= (getPos(prod_selector.psLayers[lList[toshow]].inv_lock, 'Top') - (prod_selector.psLayers[lList[toshow]].height + prod_selector.invTOfsset)) + "px"; } else { var offsetLeft = (toshow == 'level-1') ? (0) : prod_selector.leftOffset; var offsetTop = 0; ptr.style.visibility="visible"; ptr.style.display="block"; ptr.style.left= (getPos(prod_selector.psLayers[lList[toshow]].lock, 'Left') + offsetLeft) + "px"; ptr.style.top = ''; //odd hack, necessary to accomodate ie on the mac! ptr.style.top = (prod_selector.iemac) ? ((lockto == prod_selector.anchorBtmId) ? '' : (getPos(prod_selector.psLayers[lList[toshow]].lock, 'Top') + prod_selector.tOffset) + "px") : ((getPos(prod_selector.psLayers[lList[toshow]].lock, 'Top') + prod_selector.tOffset) + "px"); } } } function selstart() { if (document.getElementById('selectorHead')){ document.getElementById('selectorHead').style.backgroundColor = "#f27f1a"; } if (selTmrOn == false) { selTmrId = setTimeout("hideselall()", selTmrCnt); selTmrOn = true; } } function selstop() { if (document.getElementById('selectorHead')){ document.getElementById('selectorHead').style.backgroundColor = "#999999"; } if (selTmrOn) { clearTimeout(selTmrId); selTmrId = null; selTmrOn = false; } } function hideselall() { if(arguments.length != 0) { var exclude; for (var i = 0; i < prod_selector.psLayers.length; i++) { exclude = false; for(var ii = 0; ii < arguments.length; ii++) { if(prod_selector.psLayers[i].id == arguments[ii]) { exclude = true; break; } } if(!(exclude)) { hide(prod_selector.psLayers[i].id); } } } else { for (var i = 0; i < prod_selector.psLayers.length; i++) { hide(prod_selector.psLayers[i].id); } } } function hvr(ID, href, value){ window.status = href; document.getElementById((ID)).style.backgroundColor = (value) ? "#f27f1a" : ""; //TBD: color in a variable document.getElementById(('td-' + ID)).style.color = (value) ? "#ffffff" : ""; //TBD: color in a variable if(document.images[('img-' + ID)]) document.images[('img-' + ID)].src = (value) ? prod_selector.mouseOverImg : prod_selector.normalImg; // This code is added so as to make the main category selected when the mouse is at the child layer (Product) if (ID.indexOf("_")!= "-1") { ID = ID.substring(0, ID.indexOf("_")); document.getElementById((ID)).style.backgroundColor = (value) ? "#f27f1a" : ""; //TBD: color in a variable document.getElementById(('td-' + ID)).style.color = (value) ? "#ffffff" : ""; //TBD: color in a variable if(document.images[('img-' + ID)]) document.images[('img-' + ID)].src = (value) ? prod_selector.mouseOverImg : prod_selector.normalImg; } } function copyArray(arrToCopy){ var temp = new Array(); for(var i=0; i < arrToCopy.length; i++) { temp[i] = arrToCopy[i]; } return temp; } function initiateBuild() { if(mItems.length != 0) { buildSel(mItems); } } function buildSel(arrInfo){ var markup, itemMU; var styleOverride = ''; var arrArg; var xclusion; var containingLayer; var width; var zIndex; if(arguments.length == 1) //first time in { setobjs(); width = prod_selector.primaryWidth ; containingLayer = 'level-1' ; var elem = new Object(); elem['id'] = containingLayer; elem['top'] = 0; elem['height'] = 0; prod_selector.psLayers[0] = elem; xclusion = "'" + containingLayer + "'"; arrArg = new Array(containingLayer); } else //recursion { width = prod_selector.secondaryWidth; //TBD: needs to be tweaked, or perhaps controllable dynamically; containingLayer = arrInfo[0].parent + '-sub'; var surr = arguments[1]; //build the exclusion list: for(x=0; x < surr.length; x++) { xclusion = (x==0) ? ("'" + surr[x] + "'") : (xclusion + ",'" + surr[x] + "'"); } xclusion += ",'" + containingLayer + "'"; arrArg = copyArray(arguments[1]); //copy to augment arrArg[arrArg.length] = containingLayer; } styleOverride = ' style="width:' + width + 'px;"'; zIndex = arguments.length == 1 ? 1 : 2; markup = ''; document.write(markup); if(containingLayer != 'level-1') { var elem = new Object(); elem['id'] = containingLayer; elem['height'] = 0; prod_selector.psLayers[prod_selector.psLayers.length] = elem; } } function fetchNode(id, arrToSearch){ var found = null; for(var i=0; i <= arrToSearch.length - 1; i++) { var current = arrToSearch[i]; if(current['id']) { if(current['id'] == id) { found = current; break; } } if(current['sub_nav'] && current['sub_nav'].length >= 1) { found = fetchNode(id, current['sub_nav']); if(found) break; } } return found; } function buildNode(parentID, id, txt, href, hasSub){ if(parentID == prod_selector.anchorDivId) { mItems[mItems.length] = new Object(); var node = mItems[mItems.length - 1]; node['id'] = id; node['text'] = txt; node['link'] = href; //does this have children? if(hasSub) node['sub_nav'] = new Array(); } else //build subordinate item: { var parent = fetchNode(parentID, mItems); if(parent) { if(!parent['sub_nav']) parent['sub_nav'] = new Array(); var sub = parent['sub_nav'][parent['sub_nav'].length] = new Object(); sub['parent'] = parent.id; sub['id'] = id; sub['text'] = txt; sub['link'] = href; //Does this have a sub nav? if(hasSub) sub['sub_nav'] = new Array(); } } } function getHghts(){ for(var i=0; i < prod_selector.psLayers.length; i++) { var posID; var id; if(i==0) //level-1 { posID = prod_selector.anchorBtmId; id = 'level-1'; } else //the subs { posID = prod_selector.psLayers[i].id.substr(0, prod_selector.psLayers[i].id.indexOf('-sub')); id = prod_selector.psLayers[i].id; } //positioning element: var posEl = document.getElementById(posID); //element to be positioned: var el = document.getElementById(id); var top = getPos(posEl, "Top"); el.style.top = top + "px"; var bottom = document.getElementById(id + '-bottom'); var Hght = getPos(bottom, "Top") - top; prod_selector.psLayers[i].height = Hght; if(i==0) { prod_selector.psLayers[i]['lock'] = document.getElementById(prod_selector.anchorBtmId); } else { prod_selector.psLayers[i]['lock'] = posEl; } //put entry in the linked list: lList[id] = i; } } var getInvs="function getInvs() {"; getInvs += "for(var i=0; i < prod_selector.psLayers.length; i++){"; getInvs += "switch(i) {"; getInvs += "case 0:"; getInvs += "prod_selector.psLayers[i]['inv_lock'] = document.getElementById(prod_selector.anchorDivId); break;"; getInvs += "case (prod_selector.psLayers.length - 1):"; getInvs += "prod_selector.psLayers[i]['inv_lock'] = document.getElementById('level-1-bottom'); break;"; getInvs += "default:"; getInvs += "prod_selector.psLayers[i]['inv_lock'] = prod_selector.psLayers[i + 1]['lock'];}"; getInvs += "} }"; eval(getInvs); // Added by kumkum for header function showSubNav(thisitem) { var divname = "subnav"+thisitem; var thediv = document.getElementById(divname); thediv.style.visibility = 'visible'; } function hideSubNav(thisitem) { var divname = "subnav"+thisitem; var thediv = document.getElementById(divname); thediv.style.visibility = 'hidden'; } function swapImage(name, img) { if (document.images) { document.images[name].src = img.src; } } // Added by kumkum for testing Ends