/** * CSShiarchMenu v0.4 * written by: me[AT]daantje[DOT]nl * last update: Wed Jul 6 22:09:20 CEST 2005 * * Documentation: * Build this small script cause all the gpl-ed scripts I found where too big * and had too many options I never going to use, or the config for the menu * was not easy to set with a PHP routine. * * License: * Use this script any way you like... */ //build or unhide submenu div... function buildSubmenu(obj,position,mainAdjustLeft,mainAdjustTop){ lastOverId = obj.id; //get common part of div id menuPath = obj.id.split('_'); //unset mousout of parent menus and make sure they are visible... x = "div"; for(i=0;i= 0))){ L_pos+= adjustLeft; T_pos+= adjustTop; } //build new div subObj = document.createElement('div'); subObj.id = 'div_' + obj.id; subObj.className = 'submenu'; subObj.style.position = 'absolute'; subObj.style.zIndex = last_zIndex++; subObj.style.width = menuWidth+"px"; subObj.style.top = T_pos + "px"; subObj.style.left = L_pos + "px"; //write div to the body... document.getElementsByTagName('body')[0].appendChild(subObj); //build html for submenu content = ""; m = submenu[obj.id]; for(i=0;i" + m[i][0] + ""; adj[i] = obj.id + "_" + i; } //insert new menu subObj.innerHTML = content; //make all just made div's the same width... for(i=0;i=0 && navigator.userAgent.indexOf('Opera')==-1){ document.onmouseover = function(){ obj = event.srcElement; if(obj.className == 'menuItemFirst' || obj.className == 'menuItem' || obj.className == 'menuItemLast') obj.className+='Over'; } document.onmouseout = function(){ obj = event.srcElement; if(obj.className == 'menuItemFirstOver' || obj.className == 'menuItemOver' || obj.className == 'menuItemLastOver') obj.className = obj.className.substring(0,(obj.className.length - 4)); } } //*** Patch for wrong position after resize... Just reload to reset, not nice, fix later! window.onresize = function(){ self.location.href = self.location.href; }