/************** Copyright (c) 2001 Thomas Brattli (www.dhtmlcentral.com) eXperience DHTML coolMenus - Get it at www.dhtmlcentral.com Version 3.02 This script can be used freely as long as all copyright messages are intact. (You can delete the comments below to save space) This script takes over for the old Coolmenus2 and CoolFrameMenu Visit www.dhtmlcentral.com/coolmenus/ for the latest version of the script. Tutorial: http://www.dhtmlcentral.com/tutorial.asp Support: http://www.dhtmlcentral.com/forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus Known bugs: Netscape 6: When using padding in the layers you can sometimes get strange visual effects on the lowest menu item. Only way to fix is to not use padding. Opera: This menu is very close to working on Opera, but as far as I could figure out opera don't support innerHTML or document.createElement() which makes the changing of the text inside the submenus immpossible. If anyone know a solution to this please let me know. Explorer 4 for mac: It will not work in this browser, nothing does. Explorer 5 for mac: It works fine, but like Netscape 6 it's a little slow and you can get strange visual effects sometimes. Script checked and working with: PC: Netscape 4.03 - Netscape 4.04 -Netscape 4.08 - Netscape 4.73 - Netscape 6 - Netscape 6.01 Internet Explorer 5.0 - Internet Explorer 5.5 -Internet Explorer 6.0 MAC: Netscape 4 - Explorer 5 Btw: There is basically just one explanation to why this code is sort of "scrambled": I wanted this file be as small as possible.. If you want it to be smaller feel free to remove all comments (except for the copyright) **************/ /************* Pageobject ***************/ function makePageCoords(win,fr){ if(!win) win=window this.x=0;this.x2=(bw.ns4 || bw.ns6)?win.innerWidth-1:win.document.body.offsetWidth; if(!fr&&bw.ie) this.x2-=20; else if(!fr&&bw.ns4) this.x2-=4; else if(bw.ns6) this.x2+=1 this.y=0;this.y2=(bw.ns4 || bw.ns6)?win.innerHeight:win.document.body.offsetHeight; if(bw.ns4&&!win.rows) this.x2+=5; if(!fr&&bw.ie) this.y2-=4; else if(bw.ns4&&fr) this.y2+=4 this.y2orig=this.y2; this.x50=this.x2/2; this.y50=this.y2/2; return this; } /************* Debugging function ***************/ function debug(txt,ev){if(mDebugging==2) self.status=txt; else alert(txt); if(ev) eval(ev); return false} /************ Scroll function *************/ function cm_checkScrolled(obj){ if(bw.ns4 || bw.ns6) obj.scrolledY=obj.win.pageYOffset else obj.scrolledY=obj.win.document.body.scrollTop if(obj.scrolledY!=obj.lastScrolled){ if(!obj.useframes){ for(i=0;ithis.l[l].maxnum) this.l[l].maxnum=this.m[parent].subs.length if(this.m[parent].totheight==0) this.m[parent].totheight=this.l[l].border this.m[parent].totheight+=obj.height+ this.l[l].border if(this.m[parent].maxwidthobj.width?this.maxwidth:obj.width; this.maxheight=this.maxheight>obj.height?this.maxwidth:obj.height }if(img1) text='' else if(bw.ns4){text=''+text+''} if(bw.ns4&&this.useNS4links&&(l==0||!this.useframes) ||(l==0&&img1)){tt=img1&&l==0?this.useclick?this.name+".mover('"+name+"',1);":this.name+".go('"+name+"');":"";text=''+text+''} if(img1){obj.preimg1=new Image(); obj.preimg1.src=img1}; if(img2){obj.preimg2=new Image(); obj.preimg2.src=img2} if(img2) obj.img="imgCMenu"+name; else obj.img=0; obj.img1=img1||""; obj.img2=img2||""; obj.text=text; obj.subx=-1; obj.c1=bgcoloroff||prop1.bgcoloroff||prop2.bgcoloroff; obj.c2=bgcoloron||prop1.bgcoloron||prop2.bgcoloron; obj.c3=textcolor||this.l[l].tc; obj.c4=hovercolor||prop1.hovercolor||prop2.hovercolor; obj.suby=-1; obj.mclick=onclick||""; obj.mover=onmouseover||""; obj.mout=onmouseout||""; obj.totheight=0; obj.maxwidth=0; } /************ Onmouseout *************/ function cm_mout(name,cl){ if(!name&&cl&&!this.isover){this.isclicked=0; this.hideSubs(1,0,0,0,1); this.aobj[0]=-1; return} if(!name) return; var l=this.m[name].l; if((this.m[name].subs.length==0||!this.loaded)||(this.useclick&&!this.isclicked)){if((this.aobj[l+1]==-1||l>=this.l.length-1)&&this.aobj[l]!=-1){this.aobj[l].setactive(0,0,1); this.aobj[l]=-1;}} if(this.m[name].mout!="") eval(this.m[name].mout) if(this.useclick){this.isover=0; return}; clearTimeout(this.tim); if(!(!bw.ie&&this.useframes&&l==0&&this.aobj1)){ this.isover=0; this.aobj1=0; this.tim=setTimeout(this.name+".hideSubs(1,0,0,0,1)",this.wait)} } /************ Onmouseover *************/ function cm_mover(name,cl){ clearTimeout(this.tim); this.isover=1; var l=this.m[name].l; if(this.aobj[l].name==name){ if(this.aobj[l+1]!=-1 && lpage.x2){ if(align!=1){if(align==3&&topalign!=0) topalign=3; align=1; this.getCoords(name,l,num,topalign,align,ln,border,cn)} }else if(this.m[name].subxpage.y2){ if(l==1){topalign=3; this.getCoords(name,l,num,topalign,align,ln,border,cn,3)} else if(align!=3){ align=3; this.getCoords(name,l,num,topalign,align,ln,border,cn)} }else if(this.m[name].suby=this.l.length) return; ln=this.m[name].subs.length if(ln==0){this.hideSubs(l,1,0,1); return} else this.hideSubs(l+1,1); var border=this.l[l].border; this.aobj[l]=-1 if(this.useframes&&(bw.ns4||bw.ns6)) cm_checkScrolled(this) if((this.m[name].subx==-1 || this.m[name].suby==-1) || this.m[name].scrollY!=this.lastScrolled || this.isresized){ var topalign=this.l[0].align; var align=this.l[l-1].align; this.getCoords(name,l,num,topalign,align,ln,border,0) }var x=this.m[name].subx; var y=this.m[name].suby; var bobj=this.l[l].oBorder; bobj.hideIt(); if(this.l[l-1].clip&&!(this.l[l-1].filter&&bw.filter)){ clearTimeout(bobj.tim); bobj.clipy=0; bobj.clipTo(0,this.m[name].maxwidth,0,0); }else bobj.clipTo(0,this.m[name].maxwidth,this.m[name].totheight,0,1) bobj.moveIt(x,y); var yy=border for(i=0;ithis.m[name].subx && selx<(this.m[name].subx+this.m[name].maxwidth)) &&((sely+selh)>this.m[name].suby && sely<(this.m[name].suby+this.m[name].totheight))){ if(this.sel[i].style.visibility!="hidden"){this.sel[i].level=l; this.sel[i].style.visibility="hidden"; this.hcode+=this.name+".sel["+i+"].style.visibility='visible';"} }else if(l<=this.sel[i].level) this.sel[i].style.visibility="visible" } }else if(bw.ns4&&this.hideForm){eval(this.hideForm+".visibility='hide'"); this.hcode=this.hideForm+".visibility='show'"} } /************ Making all top elements *************/ function cm_makeTop(rr){ var m,rows,border,x,y,mpa m=this.menuplacement; rows=this.rows; this.pxbetween=this.checkp(this.pxbetween,0,1,1) border=this.l[0].border;y=this.checkp(this.fromtop,0,0,1)+border;x=this.checkp(this.fromleft,0,0,1)+border if(m=="bottomcenter"||m=="bottom"){ if(m=="bottomcenter") x=toppage.x2/2-(this.totwidth+border*this.l[0].num+this.pxbetween*(this.l[0].num-1))/2 y=toppage.y2-this.maxheight-border }else if(m=="right") x=toppage.x2-this.maxwidth-border*2 else if(m=="bottom") y=toppage.y2-this.maxheight-border*2 else if(m=="center"){if(rows==0) x=toppage.x2/2 - (this.maxwidth+border*2)/2; else x=toppage.x2/2 - (this.totwidth + border*this.l[0].num +this.pxbetween*(this.l[0].num-1))/2} else if(m.toString().indexOf(",")>-1) mpa=1 if(this.usebar){ var bx,by,bww,bh,oBb oNS=bw.ns6?this.oNS[this.l[0].maxnum]:0 this.oBar=new cm_makeObj('div'+this.name+'Bar',0,0,window,0,oNS) if(this.barx=="menu") bx=mpa&&rows?this.checkp(m[0],1,0,1)-border:x-border; else{ bx=this.checkp(this.barx,1,0,1) } if(this.bary=="menu") by=mpa&&!rows?this.checkp(m[0],0,0,1)-border:y-border; else by=this.checkp(this.bary,0,0,1); this.oBar.moveIt(bx,by) if(this.barwidth=="menu"){bww=rows?mpa?(this.checkp(m[m.length-1],1,0,1)-bx)+this.m[this.l[0].names[this.l[0].num-1]].width+border:(this.totwidth +this.pxbetween*(this.l[0].num-1)):this.maxwidth; bww+=!rows?border*2:0;}else bww=this.checkp(this.barwidth,1,0,1); if(bw.ie&&rows&&this.barwidth=="100%"&&this.useframes) bww+=parseInt(self.document.body.leftMargin)*2 if(this.barheight=="menu"){bh=!rows?mpa?(this.checkp(m[m.length-1],0,0,1)-by)+this.m[this.l[0].names[this.l[0].num-1]].height+border:(this.totheight + this.pxbetween*(this.l[0].num-1)):this.maxheight; bh+=rows?this.l[0].border*2:0;} else bh=this.checkp(this.barheight,0,0,1); this.oBar.clipTo(0,bww,bh,0,1); if(this.barinheritborder&&border){oBb=new cm_makeObj('div'+this.name+'Barb',0,0,window,'div'+this.name+'Bar'); oBb.moveIt(border,border); oBb.clipTo(0,bww-border*2,bh-border*2,0,1); oBb=null;} }this.l[0].o=new Array() for(j=0;j\n' for(j=0;j' str+=tempstr+' class="cl'+this.name+i+'">'+txt+''; str+='\n' }else this.oNS[j]=cm_NS6_createElement(this.ns6styleb[i],tempstr+' class="cl'+this.name+i+'">'+txt+'') }else frstr+=tempstr+'">\n' }if(i!=0){frstr+='\n'} }if(this.usebar){ if(this.barinheritborder) str2='
'; if(bw.ns6) this.oNS[this.l[0].maxnum]=cm_NS6_createElement(this.ns6styleb[this.ns6styleb.length-1],str2) else{str+='
';str+=str2+'
\n'} }if(!this.useframes&&bw.ie) str+=frstr; else this.frstr=frstr; if(!bw.ns6) document.write(str) this.makeTop(); if(this.useframes) window.onerror=cm_check_error; } coolFrameError=0//Trapping external pages in frame error! function cm_check_error(e){e=e.toLowerCase(); if(e.indexOf("access")>-1||e.indexOf("permission")>-1){coolFrameError=1; return true;}else return false} /************** Make styles **************/ function cm_makeStyle(){ var str="\n") } /************ Refreshing page if it's resized *************/ function cm_resized(){ page2=new makePageCoords(window,this.useframes); if(page2.x2!=toppage.x2 || page2.y2!=toppage.y2){ if(!bw.ns4){ toppage=new makePageCoords(window,this.useframes); this.makeTop(1) if(!this.useframes) page=toppage; this.isresized=1; eval(this.resizecode) }else{this.win.location.reload(); location.reload()} }if(!bw.ns4&&this.useframes){page=new makePageCoords(this.win,this.useframes)} } /************ Going to another page *************/ function cm_go(name){ obj=this.m[name]; url=obj.lnk; target=obj.target; fc=obj.mclick if(url){ if(this.useframes&&!coolFrameError) loc=this.win.location.href; else loc=location.href if(fc) eval(fc); url=this.checkFolder(loc.toString(),url); this.isover=0; this.hideSubs(1,0,1); this.isclicked=0; this.aobj[0]=-1 if(String(target)=="undefined" || target=="" || target==0 || target=="_self"){ this.win.location.href=url }else if(target=="_blank") window.open(url) else if(target=="_top" || target=="window") top.location.href=url else if(top[target]) top[target].location.href=url else{fr=findFrame(target); if(fr) fr.location.href=url} }else if(fc) eval(fc) } /************ Getting folders - THANKS TO DCAGE FOR THIS FIX *************/ function cm_checkFolder(tmp,url){ if(url.indexOf("mailto:")>-1 || url.indexOf("/")==0 || url.indexOf("http://")==0) return url else if(this.useframes && bw.ie || bw.ns6) return url var addr=''; var lvl=''; var off_cnt=0; var cnt=0; if(tmp.indexOf('file:')>-1 || tmp.charAt(1)==':') addr=this.offlineUrl; else if(tmp.indexOf('http:')>-1) addr=this.onlineUrl; for(var i=0;ioff_cnt) lvl+='../'; }} return lvl + url } /************ Checkloaded for the frames version *************/ function cm_checkLoaded(ev,ns){ coolFName=eval(coolFName) var ok=0 if(document.layers){ if(ns){coolFName.refresh(); coolFName.nsload=1; ok=1; coolFrameError=0 }else if(ev.target.name==coolFName.frame&&!coolFName.nsload){coolFName.refresh(); ok=1; coolFrameError=0; routeEvent(ev)} }else if(bw.ie){ if (coolFName.win.document.readyState == "complete"){ coolFName.win.document.body.insertAdjacentHTML("beforeEnd",coolFName.frstr) coolFName.win.document.body.onunload=cm_unloaded; coolFName.refresh(); ok=1; coolFrameError=0 }else setTimeout("cm_checkLoaded()",200) }else if(bw.ns6){ if(coolFName.win.document){ if(coolFName.win.document.body){coolFName.win.addEventListener("unload", cm_unloaded, true); coolFName.refresh(); ok=1; coolFrameError=0} else setTimeout("cm_checkLoaded()",200) }else setTimeout("cm_checkLoaded()",200) } } function cm_unloaded(ev){coolFName=eval(coolFName); if(!coolFName) return; if(document.layers && ev.target.name!=coolFName.frame) return; else coolFName.nsload=0; coolFName.loaded=0; if(!document.layers) setTimeout("cm_checkLoaded()",200)} /************ Make menu object *************/ var coolFName=""; var onload; var coolFMouseup=""; function makeCoolMenu(name){ coolFName=name; this.name=name; this.lastScrolled=0; this.win=window; toppage=new makePageCoords(window,parent.frames.length); this.aobj=new Array(); this.m=new Array(); this.l=new Array() this.level=new Array(); this.resized=cm_resized; this.makeMenu=cm_makeMenu; this.showSubs=cm_showSubs; this.makeTop=cm_makeTop; this.getCoords=cm_getCoords; this.checkPage=cm_checkPage; this.mmout=cm_mout; this.mover=cm_mover; this.checkp=cm_checkp; this.hideSubs=cm_hideSubs; this.construct=cm_construct; this.makeStyle=cm_makeStyle; this.refresh=cm_refresh; this.go=cm_go; this.frstr=""; this.mobj=new Array() this.totwidth=0; this.totheight=0; this.maxwidth=0; this.maxheight=0 this.tim=10; this.loaded=0; this.isover=false; this.checkFrame=cm_checkFrame; this.checkFolder=cm_checkFolder; this.hcode=""; this.oNS=new Array(); this.oNS2=new Array() bw.filter=(bw.ie6||bw.ver.indexOf("MSIE 5.5")>-1) && !bw.mac } /************ Find frame *************/ function findFrame(frameName){ obj=top; var frameObj=0; for(i=0;i-1 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0; this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8 this.mac=this.agent.indexOf("Mac")>-1 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie8 ||this.ie7 ||this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5) return this } var bw=new lib_bwcheck() //Making browsercheck object var mDebugging=2 //General debugging variable. Set to 0 for no debugging, 1 for alerts or 2 for status debugging. oCMenu=new makeCoolMenu("oCMenu") //Making the menu object. Argument: menuname oCMenu.useframes=0 //Do you want to use the menus as coolframemenu or not? (in frames or not) - Value: 0 || 1 oCMenu.frame="mainFrame" //The name of your main frame (where the menus should appear). Leave empty if you're not using frames - Value: "main_frame_name" oCMenu.useclick=0 //If you want the menu to be activated and deactivated onclick only set this to 1. - Value: 0 || 1 /*If you set this to 1 you will get a "hand" cursor when moving over the links in NS4. NOTE: This does not apply to the submenus if the menu is used in frames due some mayor problems with NS4*/ oCMenu.useNS4links=1 //After adding the "hover effect" for netscape as well, all styles are lost. But if you want padding add it here. oCMenu.NS4padding=1 //If you have select boxes close to your menu the menu will check for that and hide them if they are in the way of the menu. //This feature does unfortunatly not work in NS4! oCMenu.checkselect=0 /*If you choose to have this code inside a linked js, or if your using frames it's important to set these variables. This will help you get your links to link to the right place even if your files are in different folders. The offlineUrl variable is the actual path to the directory where you js file are locally. This is just so you can test it without uploading. Remember to start it with file:/// and only use slashes, no backward slashes! Also remember to end with a slash */ oCMenu.offlineUrl="file:///d|/www/metallhandwerk/incs/" //Value: "path_to_menu_file_offline/" //The onlineUrl variable is the online path to your script. Place in the full path to where your js file is. Remember to end with a slash. oCMenu.onlineUrl="http://www.metallhandwerk.de/incs/" //Value: "path_to_menu_file_online/" oCMenu.pagecheck=1 //Do you want the menu to check whether any of the subitems are out of the bouderies of the page and move them in again (this is not perfect but it hould work) - Value: 0 || 1 oCMenu.checkscroll=0 //Do you want the menu to check whether the page have scrolled or not? For frames you should always set this to 1. You can set this to 2 if you want this feature only on explorer since netscape doesn't support the window.onscroll this will make netscape slower (only if not using frames) - Value: 0 || 1 || 2 oCMenu.resizecheck=1 //Do you want the page to reload if it's resized (This should be on or the menu will crash in Netscape4) - Value: 0 || 1 oCMenu.wait=100 //How long to wait before hiding the menu on mouseout. Netscape 6 is a lot slower then Explorer, so to be sure that it works good enough there you should not have this lower then 500 - Value: milliseconds //Background bar properties oCMenu.usebar=0 //If you want to use a background-bar for the top items set this on - Value: 1 || 0 oCMenu.barcolor="Black" //The color of the background bar - Value: "color" oCMenu.barwidth="100%" //The width of the background bar. Set this to "menu" if you want it to be the same width as the menu. (this will change to match the border if you have one) - Value: px || "%" || "menu" oCMenu.barheight="15" //The height of the background bar. Set this to "menu" if you want it to be the same height as the menu. (this will change to match the border if you have one) - Value: px || "%" || "menu" oCMenu.barx=0 //The left position of the bar. Set this to "menu" if you want it be the same as the left position of the menu. (this will change to match the border if you have one) - Value: px || "%" || "menu" oCMenu.bary=95 //The top position of the bar Set this to "menu" if you want it be the same as the top position of the menu. (this will change to match the border if you have one) - Value: px || "%" || "menu" oCMenu.barinheritborder=0 //Set this to 1 if you want the bar to have the same border as the top menus - Value: 0 || 1 //Placement properties oCMenu.rows=1 //This controls whether the top items is supposed to be laid out in rows or columns. Set to 0 for columns and 1 for row - Value 0 || 1 oCMenu.fromleft=0 //This is the left position of the menu. (Only in use if menuplacement below is 0 or aligned) (will change to adapt any borders) - Value: px || "%" oCMenu.fromtop=95 //This is the left position of the menu. (Only in use if menuplacement below is 0 or aligned) (will change to adapt any borders) - Value: px || "%" oCMenu.pxbetween=0 //How much space you want between each of the top items. - Value: px || "%" /*You have several different ways to place the top items. You can have them right beside eachother (only adding the pxbetween variable) oCMenu.menuplacement=0 You can have them aligned to one of the sides - This is mostly when not using frames, but can be used in both conditions Values: (If you get strange results check the fromleft,fromtop and pxbetween variables above) For menus that are placed in columns (align=left or align=right (se below)) you can align them to the "right" or "center" For menus that are placed in rows (align=top or align=bottom (se below)) you can align them to the "bottom", "center" or "bottomcenter" oCMenu.menuplacement="center" You can also set them directly in pixels: (Remember to have as many array members as you have top items) oCMenu.menuplacement=new Array(10,200,400,600) Or you can place in percentage: (remember to use the ' ' around the numbers) Choose one of those options to get the desired results. */ oCMenu.menuplacement="center" /* Now we are ready for the properties of each level. For those of that have used the old coolmenus for coolframemenu I will try and explain how this works like this: level[0] = top items level[1] = sub items level[2] = sub2 items level[3] = sub3 items and so on.... All menus will inherit the properties, and all properties does only HAVE to be spesifed on the top level. If a level doesn't have on property spesified it will look for it on the last level that was spesified, if it still doesn't exist it will get the properties from level[0] Which means that if you set the background color on level[0] to "black" and doesn't spesify any more levels or doesn't spesify the background color on the last level you spesified ALL menus will get the color from level[0] Did that make sense at all? This can be a little hard to understand, look at the different examples on my site and play with and I am sure you'll get what I mean. */ //TOP LEVEL PROPERTIES - ALL OF THESE MUST BE SPESIFIED FOR LEVEL[0] oCMenu.level[0]=new Array() //Add this for each new level oCMenu.level[0].width=107 //The default width for each level[0] (top) items. You can override this on each item by spesifying the width when making the item. - Value: px || "%" oCMenu.level[0].height=15 //The default height for each level[0] (top) items. You can override this on each item by spesifying the height when making the item. - Value: px || "%" oCMenu.level[0].bgcoloroff="#56894B" //The default background color for each level[0] (top) items. You can override this on each item by spesifying the backgroundcolor when making the item. - Value: "color" oCMenu.level[0].bgcoloron="#D94A0B" //The default "on" background color for each level[0] (top) items. You can override this on each item by spesifying the "on" background color when making the item. - Value: "color" oCMenu.level[0].textcolor="White" //The default text color for each level[0] (top) items. You can override this on each item by spesifying the text color when making the item. - Value: "color" oCMenu.level[0].hovercolor="White" //The default "on" text color for each level[0] (top) items. You can override this on each item by spesifying the "on" text color when making the item. - Value: "color" oCMenu.level[0].style="padding:1px; font-family:verdana,arial,helvetica; font-size:10px; font-weight:normal" //The style for all level[0] (top) items. - Value: "style_settings" oCMenu.level[0].border=1 //The border size for all level[0] (top) items. - Value: px oCMenu.level[0].bordercolor="White" //The border color for all level[0] (top) items. - Value: "color" oCMenu.level[0].offsetX=0 //The X offset of the submenus of this item. This does not affect the first submenus, but you need it here so it can be the default value for all levels. - Value: px oCMenu.level[0].offsetY=0 //The Y offset of the submenus of this item. This does not affect the first submenus, but you need it here so it can be the default value for all levels. - Value: px oCMenu.level[0].NS4font="verdana,arial,helvetica" oCMenu.level[0].NS4fontSize="1" /*New: Added animation features that can be controlled on each level.*/ oCMenu.level[0].clip=0 //Set this to 1 if you want the submenus of this level to "slide" open in a animated clip effect. - Value: 0 || 1 oCMenu.level[0].clippx=0 //If you have clip spesified you can set how many pixels it will clip each timer in here to control the speed of the animation. - Value: px oCMenu.level[0].cliptim=0 //This is the speed of the timer for the clip effect. Play with this and the clippx to get the desired speed for the clip effect (be carefull though and try and keep this value as high or possible or you can get problems with NS4). - Value: milliseconds //Filters - This can be used to get some very nice effect like fade, slide, stars and so on. EXPLORER5.5+ ONLY - If you set this to a value it will override the clip on the supported browsers oCMenu.level[0].filter=0 //VALUE: 0 || "filter specs" /*And last but not least the align variable. This spesifies how the submenus of this level comes out. Values: "bottom": The sub menus of this level will come out on the top of this item "top": The sub menus of this level will come out on the bottom of this item "left": The sub menus of this level will come out on the right of this item "right": The sub menus of this level will come out on the left of this item In generally "left" and "right" works best for menus in columns and "top" and "bottom" works best for menus in rows. But by all means feel free to play with it. If you have set pagecheck to 1 above this is what the pagecheck will change when reaching the bounderies of the page. If it reaches the right boundery and it's aligned left it will change the align to right and so on. */ oCMenu.level[0].align="bottom" //Value: "top" || "bottom" || "left" || "right" //EXAMPLE SUB LEVEL[1] PROPERTIES - You have to spesify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this oCMenu.level[1]=new Array() //Add this for each new level (adding one to the number) oCMenu.level[1].width=140 oCMenu.level[1].height=15 oCMenu.level[1].bgcoloroff="#BAD2BA" oCMenu.level[1].bgcoloron="#56894B" oCMenu.level[1].textcolor="Black" oCMenu.level[1].hovercolor="White" oCMenu.level[1].style="padding:0px; font-family:verdana, arial,helvetica; font-size:10px; font-weight:normal" oCMenu.level[1].align="left" oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20 oCMenu.level[1].offsetY=0 oCMenu.level[1].border=1 oCMenu.level[1].bordercolor="White" oCMenu.level[2]=new Array() //Add this for each new level (adding one to the number) oCMenu.level[2].width=180 oCMenu.level[2].height=15 oCMenu.level[2].bgcoloroff="#E3C7BB" oCMenu.level[2].bgcoloron="#D94A0B" oCMenu.level[2].textcolor="Black" oCMenu.level[2].hovercolor="White" oCMenu.level[2].style="padding:0px; font-family:verdana, arial,helvetica; font-size:10px; font-weight:normal" oCMenu.level[2].align="middle" oCMenu.level[2].offsetX=-(oCMenu.level[0].width-2)/2+20 oCMenu.level[2].offsetY=0 oCMenu.level[2].border=1 oCMenu.level[2].bordercolor="White" /*Variables for each menu item: (** means that they have to be spesified!) name: The name of the item. This must be unique for each item. Do not use spaces or strange charachters in this one! ** parent: The name of the menuitem you want this to "connect" to. This will be a submenu of the item that have the name you place in here. ** for all other then the topitems text: The text you want in the item. ** (except if you use images) link: The page you want this item to link to. target: The target window or frame you want the link to go to (Default is same window if you're not using frames, and the mainframe if you're using frames) width: The width of the element. If not spesified it will get the default width spesified above. height: The height of the element. If not spesified it will get the default height spesified above. img1: The "off" image for element if you want to use images. img2: The image that appears onmouseover if using images. bgcoloroff: The background color for this item. If not spesified it will get the default background color spesified above. bgcoloron: The "on" background color for this item. If not spesified it will get the default "on" background color spesified above. textcolor: The text color for this item. If not spesified it will get the default text color spesified above. hovercolor: The "on" text color for this item. If not spesified it will get the default "on" text color spesified above. Netscape4 ignores this onclick: If you want something to happen when the element is clicked (different from going to a link) spesifiy it here. onmouseover: This will happen when you mouseover the element. Could be status text, another imageswap or whatever. onmouseout: This will happen when you mouseout the element. Remember you can have as many levels/sublevels as you want. Just make sure you spesify the correct "parent" for each item. To set styles for each level see above. */ oCMenu.makeMenu('top101','',' Startseite','/default.asp','','') oCMenu.makeMenu('top102','',' Fachbetriebe','/_fachbetriebe/default.asp','','') oCMenu.makeMenu('top103','',' Bildung','/_news/news_details.asp?ID=244','','') oCMenu.makeMenu('sub201','top103',' Ausbildung','/_news/news_details.asp?ID=246') oCMenu.makeMenu('sub301','sub201',' Motorgeräte-Mechaniker','/_news/news_details.asp?ID=276') oCMenu.makeMenu('sub302','sub201',' Ausbildungspraxis','/_news/news_details.asp?ID=3006') oCMenu.makeMenu('sub303','sub201',' Automobilkaufmann','/_news/news_details.asp?ID=273') oCMenu.makeMenu('sub304','sub201',' Bewerbungstipps','/_news/news_details.asp?ID=12169') oCMenu.makeMenu('sub305','sub201',' Materialien','/_news/news_details.asp?ID=247') oCMenu.makeMenu('sub202','top103',' Fortbildung','/_news/news_details.asp?ID=255') oCMenu.makeMenu('sub306','sub202',' Elektro-Fachkraft','/_news/news_details.asp?ID=2393') oCMenu.makeMenu('sub307','sub202',' Servicetechniker','/_news/news_details.asp?ID=249') oCMenu.makeMenu('sub203','top103',' Bundessieger','') oCMenu.makeMenu('sub308','sub203',' 2006','/_news/news_details.asp?ID=4555') oCMenu.makeMenu('sub309','sub203',' 2007','/_news/news_details.asp?ID=5439') oCMenu.makeMenu('sub310','sub203',' 2008','/_news/news_details.asp?ID=7277') oCMenu.makeMenu('sub311','sub203',' 2009','/_news/news_details.asp?ID=8494') oCMenu.makeMenu('sub312','sub203',' 2010','/_news/news_details.asp?ID=10303') oCMenu.makeMenu('sub204','top103',' Neuordnung','/_news/news_details.asp?ID=272') oCMenu.makeMenu('sub205','top103',' Meisterausbildung','/_news/news_details.asp?ID=250') oCMenu.makeMenu('sub206','top103',' Meisterschulen','/_news/news_details.asp?ID=253') oCMenu.makeMenu('sub207','top103',' Statistiken','/_news/news_details.asp?ID=252') oCMenu.makeMenu('sub208','top103',' Zukunft','/_news/news_details.asp?ID=251') oCMenu.makeMenu('top104','',' Termine','/_news/termine.asp?terminart=82','','') oCMenu.makeMenu('sub209','top104',' Verbandsgremien','/_news/termine.asp?terminart=89') oCMenu.makeMenu('sub210','top104',' Messen','/_news/termine.asp?terminart=88') oCMenu.makeMenu('sub211','top104',' Kongresse','/_news/termine.asp?terminart=90') oCMenu.makeMenu('sub212','top104',' Seminare','/_news/termine.asp?terminart=87') oCMenu.makeMenu('top105','',' Mitglieder','/mitglieder/default.asp','','') oCMenu.makeMenu('sub213','top105',' Informationen','/_news/themen.asp') oCMenu.makeMenu('sub214','top105',' Login','/mitglieder/first.asp') oCMenu.makeMenu('top106','',' Service','/_news/news_details.asp?ID=245','','') oCMenu.makeMenu('sub215','top106',' Jahresberichte','/_news/news_details.asp?ID=10309') oCMenu.makeMenu('sub216','top106',' Leitfäden','') oCMenu.makeMenu('sub313','sub216',' Flyer Verrechnungssatz','/_news/news_details.asp?ID=8352') oCMenu.makeMenu('sub314','sub216',' Nachwuchs-Motivator','/_news/news_details.asp?ID=8353') oCMenu.makeMenu('sub315','sub216',' Eignungstest Azubiauswahl','/_news/news_details.asp?ID=8354') oCMenu.makeMenu('sub316','sub216',' Internetimpressum','/_news/news_details.asp?ID=946') oCMenu.makeMenu('sub317','sub216',' Geringf. Beschäftigung','/_news/news_details.asp?ID=990') oCMenu.makeMenu('sub318','sub216',' Flyer Minijobs','/_news/news_details.asp?ID=4496') oCMenu.makeMenu('sub319','sub216',' Gewährleistungsrecht','/_news/news_details.asp?ID=825') oCMenu.makeMenu('sub320','sub216',' Rechnungsstellung','/_news/news_details.asp?ID=2609') oCMenu.makeMenu('sub321','sub216',' Virenschutz','/_news/news_details.asp?ID=1610') oCMenu.makeMenu('sub322','sub216',' Kündigungsrecht 2005','/_news/news_details.asp?ID=1893') oCMenu.makeMenu('sub323','sub216',' Kündigungsschutz','/_news/news_details.asp?ID=5005') oCMenu.makeMenu('sub324','sub216',' Nachfolge','/_news/news_details.asp?ID=1970') oCMenu.makeMenu('sub325','sub216',' Handwerksordnung 2005','/_news/news_details.asp?ID=1857') oCMenu.makeMenu('sub326','sub216',' Alterseinkünftegesetz 2005','/_news/news_details.asp?ID=2608') oCMenu.makeMenu('sub327','sub216',' Erbfall','/_news/news_details.asp?ID=2771') oCMenu.makeMenu('sub328','sub216',' Transport Gasflaschen','/_news/news_details.asp?ID=2826') oCMenu.makeMenu('sub329','sub216',' Fernabsatz / E-Commerce','/_news/news_details.asp?ID=2866') oCMenu.makeMenu('sub330','sub216',' Leitfaden Personal','/_news/news_details.asp?ID=5908') oCMenu.makeMenu('sub331','sub216',' Arbeitszeugnis','/_news/news_details.asp?ID=3340') oCMenu.makeMenu('sub332','sub216',' Urlaubsrecht','/_news/news_details.asp?ID=5221') oCMenu.makeMenu('sub333','sub216',' Direktmailing','/_news/news_details.asp?ID=3341') oCMenu.makeMenu('sub334','sub216',' Richtig werben','/_news/news_details.asp?ID=648') oCMenu.makeMenu('sub335','sub216',' Aufhebung Arbeitsvertrag','/_news/news_details.asp?ID=5293') oCMenu.makeMenu('sub336','sub216',' Befristung Arbeitsverträge','/_news/news_details.asp?ID=12607') oCMenu.makeMenu('sub337','sub216',' Tarif statt Mindestlohn','/_news/news_details.asp?ID=6895') oCMenu.makeMenu('sub338','sub216',' Datenschutzbeauftragte','/_news/news_details.asp?ID=2220') oCMenu.makeMenu('sub339','sub216',' Elektr. Steuerprüfung','/_news/news_details.asp?ID=2886') oCMenu.makeMenu('sub340','sub216',' Beschäftig. Ausländer','/_news/news_details.asp?ID=2986') oCMenu.makeMenu('sub341','sub216',' Datenschutzerklärung','/_news/news_details.asp?ID=3463') oCMenu.makeMenu('sub342','sub216',' Weg zur Rente','/_news/news_details.asp?ID=5132') oCMenu.makeMenu('sub217','top106',' Shop','') oCMenu.makeMenu('sub343','sub217',' Bestellformular','/service/bestellung.asp') oCMenu.makeMenu('sub344','sub217',' Bestellschein offline','/_news/news_details.asp?ID=4862') oCMenu.makeMenu('sub345','sub217',' Werbung','/_news/news_details.asp?ID=1080') oCMenu.makeMenu('sub346','sub217',' Kleidung mit Signet','/_news/news_details.asp?ID=4554') oCMenu.makeMenu('sub347','sub217',' Ausbildung','/_news/news_details.asp?ID=1087') oCMenu.makeMenu('sub348','sub217',' Betriebshilfsmittel','/_news/news_details.asp?ID=1088') oCMenu.makeMenu('sub349','sub217',' Analyse-Broschüren','/_news/news_details.asp?ID=1072') oCMenu.makeMenu('sub350','sub217',' Kalkulationshilfen','/_news/news_details.asp?ID=1090') oCMenu.makeMenu('sub218','top106',' Links','/_news/news_details.asp?ID=256') oCMenu.makeMenu('sub219','top106',' Materialien BuFa-MOT','/_news/news_details.asp?ID=2864') oCMenu.makeMenu('sub220','top106',' Verbandszeichen','/_news/news_details.asp?ID=2772') oCMenu.makeMenu('sub221','top106',' Metall & Mehr','/_news/news_details.asp?ID=2255') oCMenu.makeMenu('sub222','top106',' Motorgeräte-AGB','/_news/news_details.asp?ID=1363') oCMenu.makeMenu('sub223','top106',' Betr.vergl.-Info','/_news/news_details.asp?ID=12218') oCMenu.makeMenu('sub224','top106',' Betr.vergl.-Abfrage','/_news/news_details.asp?ID=8505') oCMenu.makeMenu('sub225','top106',' Metallerrente BVM','/_news/news_details.asp?ID=1219') oCMenu.makeMenu('sub226','top106',' Checklisten','') oCMenu.makeMenu('sub351','sub226',' Garantieleitfaden','/_news/news_details.asp?ID=5161') oCMenu.makeMenu('sub352','sub226',' Herstellerkartei','/_news/news_details.asp?ID=884') oCMenu.makeMenu('sub353','sub226',' Mietvertragsvordruck','/_news/news_details.asp?ID=881') oCMenu.makeMenu('sub354','sub226',' Forderungsmanagement','/_news/news_details.asp?ID=3338') oCMenu.makeMenu('sub355','sub226',' Gebr.geräte-Rücknahme','/_news/news_details.asp?ID=1294') oCMenu.makeMenu('sub356','sub226',' Checklisten Notfallplan','/_news/news_details.asp?ID=2721') oCMenu.makeMenu('sub227','top106',' Kalkulationshilfen','') oCMenu.makeMenu('sub357','sub227',' Verrechnungssatz','/_news/news_details.asp?ID=16606') oCMenu.makeMenu('sub358','sub227',' Lohnnebenkosten','/_news/news_details.asp?ID=4798') oCMenu.makeMenu('sub359','sub227',' Maschinensatz','/_news/news_details.asp?ID=919') oCMenu.makeMenu('sub360','sub227',' ET-Aufschlag','/_news/news_details.asp?ID=918') oCMenu.makeMenu('sub361','sub227',' Gebr.-Abwertung','/_news/news_details.asp?ID=2390') oCMenu.makeMenu('sub362','sub227',' Kostenverteilungsschema','/_news/news_details.asp?ID=2916') oCMenu.makeMenu('sub228','top106',' Arbeitskarten','') oCMenu.makeMenu('sub363','sub228',' ','/_news/news_details.asp?ID=641') oCMenu.makeMenu('sub364','sub228',' Reparaturannahme','/_news/news_details.asp?ID=892') oCMenu.makeMenu('sub365','sub228',' Elektromäher-Insp.','/_news/news_details.asp?ID=2766') oCMenu.makeMenu('sub366','sub228',' Aufsitzmäher-Insp.','/_news/news_details.asp?ID=2765') oCMenu.makeMenu('sub367','sub228',' Benzinrasenmäher-Insp.','/_news/news_details.asp?ID=883') oCMenu.makeMenu('sub368','sub228',' Motorsägen-Insp.','/_news/news_details.asp?ID=2770') oCMenu.makeMenu('sub369','sub228',' Motorsensen-Insp.','/_news/news_details.asp?ID=2769') oCMenu.makeMenu('sub370','sub228',' Motorhacken-Insp.','/_news/news_details.asp?ID=2768') oCMenu.makeMenu('sub371','sub228',' Balkenmäher-Insp.','/_news/news_details.asp?ID=2767') oCMenu.makeMenu('sub372','sub228',' Schneefräsen-Insp.','/_news/news_details.asp?ID=6978') oCMenu.makeMenu('sub229','top106',' Preisvorschläge','') oCMenu.makeMenu('sub373','sub229',' Zus.kosten-Abrechnung','/_news/news_details.asp?ID=931') oCMenu.makeMenu('sub374','sub229',' Entsorgung','/_news/news_details.asp?ID=930') oCMenu.makeMenu('sub375','sub229',' Servicearbeiten','/_news/news_details.asp?ID=929') oCMenu.makeMenu('sub376','sub229',' Gerätemiete','/_news/news_details.asp?ID=882') oCMenu.makeMenu('sub377','sub229',' Vorkasse und KV','/_news/news_details.asp?ID=2764') oCMenu.makeMenu('sub230','top106',' Hinweisschilder','') oCMenu.makeMenu('sub378','sub230',' Flyer Verrechnungssatz','/_news/news_details.asp?ID=8352') oCMenu.makeMenu('sub379','sub230',' Vorkasse','/_news/news_details.asp?ID=932') oCMenu.makeMenu('sub231','top106',' Kontakt','/service/kontakt.asp') oCMenu.makeMenu('top107','',' Verband','/_news/news_details.asp?ID=264','','') oCMenu.makeMenu('sub232','top107',' Anfahrt','/_news/news_details.asp?ID=268') oCMenu.makeMenu('sub233','top107',' Partner','/_news/news_details.asp?ID=267') oCMenu.makeMenu('sub234','top107',' Vorstand','/_news/news_details.asp?ID=266') oCMenu.makeMenu('sub235','top107',' Fachgruppe BaWü','/_news/news_details.asp?ID=1045') oCMenu.makeMenu('sub236','top107',' Geschäftsstelle','/_news/news_details.asp?ID=263') oCMenu.makeMenu('sub237','top107',' Mitgliedschaft','/_news/news_details.asp?ID=1462') //Leave these two lines! Making the styles and then constructing the menu oCMenu.makeStyle(); oCMenu.construct()