/******************************************************************* * * * * ********************************************************************/ if(document.layers){ origWidth = innerWidth; origHeight = innerHeight; } function reDo() { if(document.layers){ if (innerWidth != origWidth || innerHeight != origHeight) location.reload(); } } onresize = reDo; var win; //Window Opener for Sun Life site(s) var strSiteUrl_js; var theirSite; function openSunLifeWindow(strSiteUrl_js) { // DETERMINE X & Y COORDINATES TO OPEN THE WINDOW BASED ON // USERS SCREEN RESOLUTION. var popSunWidth = 700; var popSunHeight = 425; var SunWinX = (screen.width / 2) - (popSunWidth / 2); var SunWinY = (screen.height / 2) - (popSunHeight / 2); theirSite=window.open(strSiteUrl_js,'SunLifeSite', 'innerHeight=' + popSunHeight + ',innerWidth=' + popSunWidth + ',width=' + popSunWidth + ',height=' + popSunHeight + ',screenX=' + SunWinX + ',screenY=' + SunWinY + ',left=' + SunWinX + ',pos_top=' + SunWinY + 'directories=yes,location=yes,menubar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes'); theirSite.focus(); } //all purpose window opener var ie5 = (document.all && document.getElementbyID) ? false : true; var isMac = (navigator.appVersion.indexOf("Mac") == -1) ? false : true; var win, win2; function openWin(url, popWidth, popHeight, popScroll, popStatus) { var winName = "popup"; var statusBar = popScroll; // DETERMINE X & Y COORDINATES TO OPEN THE TOOL WINDOW IN BASED ON // USERS SCREEN RESOLUTION. var winX = (screen.width / 2) - (popWidth / 2); var winY = (screen.height / 2) - (popHeight / 2); if (popStatus != null) { statusBar = popStatus; if (!ie5 && !ns && isMac) { popHeight += 18; } } if(win) { if(!win.closed) { win.close(); } win = null; } win=window.open(url, winName, 'width=' + popWidth + ',height=' + popHeight + ',screenX=' + winX + ',screenY=' + winY + ',left=' + winX + ',pos_top=' + winY + ',scrollbars=' + popScroll + ',resizable=no,status=' + statusBar + ''); if (win.opener == null) win.opener = self; win.focus(); } //init variables var ready = false; //no menu rollovers until onLoad has loaded all images // First Nav positions var M_hide = -50; var M_show = 106; //globals for layer methods, timer var prefix, suffix, pos_left, pos_top, layerName, menuUpName, menuDownName, yUpPos, yDownPos; var active = "a"; // constructors for DOM // NS 4 if (document.layers) { prefix = 'document.layers[\"'; suffix = '\"]'; pos_left = '.left'; pos_top = ".top"; } // IE 4,5 else if (document.all){ prefix = 'document.all[\"'; suffix = '\"].style'; pos_left = '.pixelLeft'; pos_top = ".pixeltop"; } // NS 6 else if(document.getElementById) { //ns6+Mozilla prefix = 'document.getElementById(\"'; suffix = '\")'; pos_left = '.style.left'; pos_top = ".style.top"; } // prefix for Netscape layers when needed function nameLayer(name) { var layer = ''; if(document.layers) {layer = 'document.layers[\"' + name + '\"].';} return layer; } // layer methods, which include DOM differences function show (myLayer) { eval(prefix + myLayer + suffix + '.visibility = "visible"'); } function hide (myLayer) { eval(prefix + myLayer + suffix + '.visibility = "hidden"'); } // get/set layer positions function getY(myLayer) { var here; eval('here = ' + prefix + myLayer + suffix + pos_top); return parseInt(here); } function setY(myLayer, here) { eval(prefix + myLayer + suffix + pos_top + ' = ' + here); } function slideM (myLayerName) { //- is move up, + is move down var dir = -1; var yNow = getY(myLayerName); if(myLayerName == active) { dir = 1; yFinal = M_show; } else { dir = -1; yFinal = M_hide; } if(yNow != yFinal) { setY(myLayerName, (yNow + (dir * Math.ceil(Math.abs(yNow - yFinal) / 4))) ); eval('setTimeout(\"slideM(\'' + myLayerName + '\')\",25)' ); } else { //done } } // Preload menu images - called by body onLoad var menuNum = 3; // must be set to number of dropping menus function LoadImages() { // Name the current window so it can be identified. ready = true; setTimeout("closeMenu()", 1000); } // Menu Rollovers with layer triggers - use only for nav & menu! // Note: If adding new menu dropdowns... you need to change "items" array in the // LoadImages() function above. function MRollOn(name) { if(ready) { var layer = (name.charAt(0) == "m")? name.substring(0,2): name.substr(0,1); active = (name.charAt(0) == "n")? "m" + name.charAt(1): layer; drop(); } } function MRollOff(name) { if(ready) { active = ""; var layer = (name.charAt(0) == "m")? name.substring(0,2): name.substr(0,1); setTimeout("closeMenu()", 1500); } } function closeMenu() { if (active.charAt(0) != "m") drop(); } function drop() { var menu = 0; var thing; if(active.charAt(0) == "m") { menu = active.charAt(1); if(getY(active) < M_show) { slideM(active); } } for(var i=1;i<=menuNum;i++) { if(menu != i) { thing = "m" + i; if(getY(thing) > M_hide) { slideM(thing); } } } }