// Sliding Menu Start theMenu = new Array; // sideMenu array sideMenuH = new Array; // sideMenu array for storing height theTipH = new Array; // subMenu array for storing height function layerSetup(id) { // alert ( " layerSetup "); theObj = document.getElementById(id); return theObj; // Return the object layer } function getHeight(id) { // alert ( " getHeight "); theHeight = layerSetup(id).offsetHeight; // Get the offsetHeight of the sideMenu return theHeight; // Return the height } function showDiv(id,posX,posY) { // alert ( " showDiv "); layerSetup(id).style.visibility = 'visible'; // Set sideMenu to visible for theObj layerSetup(id).style.backgroundColor = '#FFFFFF'; // 10-26-2008 PN Change sideMenu from grey #EEEEEE to white #FFFFFF theObj layerSetup(id).style.left = parseInt(posX); // Set the position at posX for theObj layerSetup(id).style.top = parseInt(posY); // Set the position at posY for theObj } function hideDiv(id) { // alert ( " hideDiv "); layerSetup(id).style.visibility = 'hidden'; } function menuSetup(id,Ytop) { // alert ( " menuSetup "); this.space = 1; // Set the spacing between sideMenu 10-30-2008 PN Change from 2 to 1 so no spacing is allowed this.posX = 4; // Set the left margin for the sideMenu Heading, 4px this.id = id; this.mainId = "sideMenu" + id; this.tipId = "theTip" + id; // This is correspond to the SubMenu Div tag on the New Page Form this.Ytop = Ytop; // This is the starting position for the first sidemenu section this.posY=0; this.delay = 1; // Set the delay in the sideMenu move. The higher the number the slower it moves. this.timer; this.measure = measure; this.showMenu = showMenu; this.newPosition = newPosition; this.layerMove = layerMove; this.slideMenu = slideMenu; this.showTip = showTip; } function measure() { // alert ( " measure "); sideMenuH[this.id] = getHeight(this.mainId); // Save the height of this sideMenu ID in the sideMenuH array theTipH[this.id] = getHeight(this.tipId); // Save the height of the subMenu ID in the TipH array } function showMenu() { // alert ( " showMenu "); posY=this.Ytop; for (var i=0;i<=this.id-1;i++) { posY += parseInt(sideMenuH[i]) + this.space; // Calculate the position of the sideMenu } this.posY = posY; showDiv(this.mainId,this.posX,posY); // Show the sideMenu } function newPosition(id) { // alert ( " newPosition "); hideDiv(this.tipId); // First of all hide the specified subMenu posY=this.Ytop; // Set the Ytop position for (var i=0;i<=this.id-1;i++) { posY += parseInt(sideMenuH[i]) + this.space; // Calculate the new position for the specified sideMenu } if (this.id == sideMenuH.length-1) { // If the specified sideMenu is the last menu then set var f var f="openTip(" + id + ")"; } else { var f="doNothing()"; // 09-21-04 PN - Add this logic to support IE 5.0 less forgiving function call } this.finish = new Function(f); // Open the subMenu. IE 5.0 will abort if the "f" is undefined. this.layerMove(posY,-5) // Control the speed of the menu sliding move: small neg. number move slower than large neg. number } function doNothing() { // alert (" doNothing "); // 09-21-04 PN - This is used to support IE 5.0 because it is less forgiving than the later version. } function layerMove(posY,moveY) { // alert ( " layerMove "); if (moveY>0) { // if moveY is greater than 0 then set var a var a=posY-this.posY; // Get the difference between posY and the current --- move sideMenu down } else { var a=this.posY-posY; // if moveY is less than 0 then move sideMenu up } if (a>0) { this.posY = this.posY + moveY; showDiv(this.mainId,this.posX,this.posY); // Show the sideMenu if(this.timer) { clearTimeout(this.timer); // Clear all Timeout } eval("theMenu[" + this.id + "].timer = setTimeout(\"theMenu[" + this.id + "].layerMove("+posY+","+moveY+","+this.delay+")\"," + this.delay + ")"); // Move the layer with delay setting } else { this.finish(); // Do not do anything } } function openTip(id) { // alert ( " openTip "); for (var i=0;i -1) { main= urlstr.substring(pos-1,pos); posmain = mainlist.indexOf(main); if (posmain < 0) // Not part of main menu. Reset main to default main menu, 0 or "Home" main = "0"; } else { // 07/13/05 PN Add these code to detect dash as well for compatibility pos = urlstr.lastIndexOf("-"); main= urlstr.substring(pos-1,pos); posmain = mainlist.indexOf(main); if (posmain < 0) // Not part of main menu. Reset main to default main menu, 0 or "Home" main = "0"; } side= urlstr.substring(pos+1,urlstr.length); posside = sideMenuList.indexOf(side); if (posside < 0) // Not part of side menu section. Reset side to default section, "QuickLinks" side = "QuickLinks"; for (var i = 0; i < document.links.length; i++) { // Loop thru all links defined on pages and append sidemenu scheme to URL. // This is to indicate which section the URL is coming from. if (document.links[i]) { if (document.links[i].href) { urlstr2 = document.links[i].href; pos2 = urlstr2.lastIndexOf("~"); main2 = urlstr2.substring(pos2-1,pos2); side2 = urlstr2.substring(pos2+1,urlstr2.length); posmatch = sideMenuList.indexOf(side2); // does it match one of the side menu section if (posmatch > -1 ) // Found sidemenu on URL do nothing here. { } else { // sidemenucateg not found. Need to append sidemenu to expand the correct section // check to see if it is a notes database posmainpage = side2.toLowerCase().indexOf("mainpage") if (posmainpage < 0) // No match on mainpage then continue {pos3 = urlstr2.lastIndexOf(".nsf"); if (pos3 > -1) {pos3h5 = urlstr2.toLowerCase().indexOf("#link"); if (pos3h5 < 0) //#link is not found then continue. If found then leave the url as is. { pos3h6 = urlstr2.toLowerCase().indexOf("#top"); if (pos3h6 < 0) //#top is not found then continue. If found then leave the url as is. { pos4 = urlstr2.toLowerCase().indexOf("/pages/"); if (pos4 > -1) // Found pages then continue {posmainweb = urlstr2.toLowerCase().indexOf("mainweb01"); pospound = urlstr2.indexOf("#"); if ((posmainweb > 0) && (pospound < 0)) // Found Mainweb go ahead and append suffix // And no pound sign is found go ahead and append suffix {document.links[i].href=document.links[i].href + "?OpenDocument&" + main + "~" +side;} } // pos4 else { pos5 = urlstr2.toLowerCase().indexOf("openview"); if (pos5 > -1) { pospound = urlstr2.lastIndexOf("#"); if (pospound > -1) // Found pound then append suffix without the # and number { document.links[i].href=document.links[i].href.substring(0,pospound) + "&" + main + "~" +side;} else // Found openview then go ahead and append suffix {document.links[i].href=document.links[i].href + "&" + main + "~" +side;} } // if pos5 else // No match on openview { pos6 = urlstr2.toLowerCase().indexOf("opendocument"); if (pos6 > -1) // Found openview then go ahead and append suffix {document.links[i].href=document.links[i].href + "&" + main + "~" +side;} } // else pos5 } // else pos4 } // pos3h6 end } // pos3h5 end } // pos3 end } // posmainpage end } // posmatch end } // if (document.links[i].href) end } // if (document.links[i]) } // for (var i = 0 //Determine which submenu to open var sidearraylist = sidecateglist.split( ', '); // split into substring based on comma followed by a space pattern. var id = 0; // initialize to zero for (var k= 0; k < sidearraylist.length; k++) { // Find the match. The index returned on the match to determine which side menu to expand. if (sidearraylist[k] == side){ id = k; break; } } // end for i loop openMenu(id); // Expand the side menu based on the i index from above. // document._Page.searchinputhtml.value =""; 10-21-2008 PN Remove this reset for the new Mainweb form. // openMenu(id); } } // Sliding Menu End