/*** This is the menu creation code - place it right after you body tag Feel free to add this to a stand-alone js file and link it to your page. **/ //Menu object creation oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname //Menu properties oCMenu.pxBetween=0 //Using the cm_page object to place the menu ---- oCMenu.fromLeft=0 oCMenu.fromTop=0 oCMenu.rows=1 oCMenu.menuPlacement=0 oCMenu.offlineRoot="" oCMenu.onlineRoot="" oCMenu.resizeCheck=1 oCMenu.wait=1000 oCMenu.fillImg="images/spacer.gif" oCMenu.zIndex=0 //Background bar properties oCMenu.useBar=0 //Level properties - ALL properties have to be spesified in level 1 oCMenu.level[0]=new cm_makeLevel() //Add this for each new level oCMenu.level[0].width=200 oCMenu.level[0].height=25 oCMenu.level[0].regClass="clLevel1" oCMenu.level[0].overClass="clLevel1over" oCMenu.level[0].borderX=0 oCMenu.level[0].borderY=0 oCMenu.level[0].borderClass="clLevel1border" oCMenu.level[0].offsetX=0 oCMenu.level[0].offsetY=0 oCMenu.level[0].rows=0 oCMenu.level[0].arrow="images/arrow.gif" oCMenu.level[0].arrowWidth=0 oCMenu.level[0].arrowHeight=0 oCMenu.level[0].align="right" oCMenu.level[0].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" //Level properties - ALL properties have to be spesified in level 2 oCMenu.level[1]=new cm_makeLevel() //Add this for each new level oCMenu.level[1].width=180 oCMenu.level[1].height=23 oCMenu.level[1].regClass="clLevel2" oCMenu.level[1].overClass="clLevel2over" oCMenu.level[1].borderX=1 oCMenu.level[1].borderY=1 oCMenu.level[1].borderClass="clLevel2border" oCMenu.level[1].offsetX=-1 oCMenu.level[1].offsetY=-1 oCMenu.level[1].rows=0 oCMenu.level[1].arrow="images/arrow.gif" oCMenu.level[1].arrowWidth=15 oCMenu.level[1].arrowHeight=12 oCMenu.level[1].align="right" oCMenu.level[1].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" //Level properties - ALL properties have to be spesified in level 3 oCMenu.level[2]=new cm_makeLevel() //Add this for each new level oCMenu.level[2].width=180 oCMenu.level[2].height=23 oCMenu.level[2].regClass="clLevel3" oCMenu.level[2].overClass="clLevel3over" oCMenu.level[2].borderX=1 oCMenu.level[2].borderY=1 oCMenu.level[2].borderClass="clLevel3border" oCMenu.level[2].offsetX=-1 oCMenu.level[2].offsetY=-1 oCMenu.level[2].rows=0 oCMenu.level[2].arrow="images/arrow.gif" oCMenu.level[2].arrowWidth=15 oCMenu.level[2].arrowHeight=12 oCMenu.level[2].align="right" oCMenu.level[2].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" //Level properties - ALL properties have to be spesified in level 4 oCMenu.level[3]=new cm_makeLevel() //Add this for each new level oCMenu.level[3].width=180 oCMenu.level[3].height=23 oCMenu.level[3].regClass="clLevel4" oCMenu.level[3].overClass="clLevel4over" oCMenu.level[3].borderX=1 oCMenu.level[3].borderY=1 oCMenu.level[3].borderClass="clLevel4border" oCMenu.level[3].offsetX=-1 oCMenu.level[3].offsetY=-1 oCMenu.level[3].rows=0 oCMenu.level[3].arrow="images/arrow.gif" oCMenu.level[3].arrowWidth=15 oCMenu.level[3].arrowHeight=12 oCMenu.level[3].align="bottom" oCMenu.level[3].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" /****************************************** Menu item creation: myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass, align, rows, nolink, onclick, onmouseover, onmouseout) *************************************/ // Level1 (id=1) - Home (no parent) oCMenu.makeMenu('10','','Home','http://www.boyntonlibrary.org/index.cfm?fuseaction=home.main&x=2898939','_self','','25','','','','','','','','','','') // Level2 (id=74) - COHS (parent of Level1 (id=1) - Home) oCMenu.makeMenu('7401','10','COHS','http://www.boyntonlibrary.org/COHS','_self','','23','','','','','','','','','','') // Level2 (id=75) - SelectReads (parent of Level1 (id=1) - Home) oCMenu.makeMenu('7501','10','SelectReads','http://bookdb.nextgoodbook.com/signup/d/4fea7520c29a1824575480efad73ad5f','_self','','23','','','','','','','','','','') // Level1 (id=2) - About Us (no parent) oCMenu.makeMenu('20','','About Us','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.aboutus&x=2898939','_self','','25','','','','','','','','','','') // Level2 (id=41) - Director's Welcome (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4102','20','Director\'s Welcome','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.directorswelcome&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=42) - Library Mission (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4202','20','Library Mission','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.librarymission&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=48) - Library Card (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4802','20','Library Card','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.library card&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=45) - Borrowing Policies (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4502','20','Borrowing Policies','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.borrowing&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=47) - Computer Use (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4702','20','Computer Use','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.computer use&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=50) - Library Collection (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('5002','20','Library Collection','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.library collection&x=2898939','_self','','23','','','','','','','','','','') // Level2 (id=49) - Job Openings (parent of Level1 (id=2) - About Us) oCMenu.makeMenu('4902','20','Job Openings','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.job openings&x=2898939','_self','','23','','','','','','','','','','') // Level1 (id=9) - News (no parent) oCMenu.makeMenu('90','','News','http://www.boyntonlibrary.org/index.cfm?fuseaction=news.list&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=10) - Library Services (no parent) oCMenu.makeMenu('100','','Library Services','http://www.boyntonlibrary.org/Services','_self','','25','','','','','','','','','','') // Level1 (id=11) - Library Databases (no parent) oCMenu.makeMenu('110','','Library Databases','http://www.boyntonlibrary.org/index.cfm?fuseaction=resources.list&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=38) - Teen Services (no parent) oCMenu.makeMenu('380','','Teen Services','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.teens&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=55) - Children Services (no parent) oCMenu.makeMenu('550','','Children Services','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.children&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=51) - Friends of the Library (no parent) oCMenu.makeMenu('510','','Friends of the Library','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.friends of the library&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=39) - Ask Us! (no parent) oCMenu.makeMenu('390','','Ask Us!','http://www.boyntonlibrary.org/AskUs','_self','','25','','','','','','','','','','') // Level1 (id=4) - Contact Us (no parent) oCMenu.makeMenu('40','','Contact Us','http://www.boyntonlibrary.org/index.cfm?fuseaction=pages.&x=2898939','_self','','25','','','','','','','','','','') // Level1 (id=27) - Site Map (no parent) oCMenu.makeMenu('270','','Site Map','http://www.boyntonlibrary.org/index.cfm?fuseaction=sitemap.main&x=2898939','_self','','25','','','','','','','','','','') //Leave this line - it constructs the menu oCMenu.construct() //Extra code to find position: function findPos(num){ //alert(num) if(bw.ns4){ //Netscape 4 x = document.layers["layerMenu"+num].pageX y = document.layers["layerMenu"+num].pageY }else{ //other browsers x=0; y=0; var el,temp el = bw.ie4?document.all["divMenu"+num]:document.getElementById("divMenu"+num); if(el.offsetParent){ temp = el while(temp.offsetParent){ //Looping parent elements to get the offset of them as well temp=temp.offsetParent; if(bw.ns6) { x+=temp.offsetLeft; //-2 } else { x+=temp.offsetLeft; } y+=temp.offsetTop; } } x+=el.offsetLeft y+=el.offsetTop } //Returning the x and y as an array return [x,y] } function placeElements(){ //Changing the position of ALL top items: pos = findPos(10) oCMenu.m["10"].b.moveIt(pos[0],pos[1]) pos = findPos(20) oCMenu.m["20"].b.moveIt(pos[0],pos[1]) pos = findPos(90) oCMenu.m["90"].b.moveIt(pos[0],pos[1]) pos = findPos(100) oCMenu.m["100"].b.moveIt(pos[0],pos[1]) pos = findPos(110) oCMenu.m["110"].b.moveIt(pos[0],pos[1]) pos = findPos(380) oCMenu.m["380"].b.moveIt(pos[0],pos[1]) pos = findPos(550) oCMenu.m["550"].b.moveIt(pos[0],pos[1]) pos = findPos(510) oCMenu.m["510"].b.moveIt(pos[0],pos[1]) pos = findPos(390) oCMenu.m["390"].b.moveIt(pos[0],pos[1]) pos = findPos(40) oCMenu.m["40"].b.moveIt(pos[0],pos[1]) pos = findPos(270) oCMenu.m["270"].b.moveIt(pos[0],pos[1]) //Setting the fromtop value oCMenu.fromTop = pos[1] } placeElements() //Setting it to re place the elements after resize - the resize is not perfect though.. oCMenu.onafterresize="placeElements()"