if (!document.loadHandlers) { document.loadHandlers=new Array(); document.loadHandlers[0]='initializeMenu'; document.lastLoadHandler=0; } else { document.lastLoadHandler++; document.loadHandlers[document.lastLoadHandler]='initializeMenu'; } window.onload=initializeAll; var activePopup=null; var activePopupTimeout; var maxZ=1000; var popupFrame; var targetFrame; var docLoaded=false; var bIncBorder=true; function resetPopup(popup) { if(popup&&popup.children) { var i; for(i=0;i maxlev) {levelAttribs = eval ("lev" + maxlev) ;} else {levelAttribs = eval ("lev" + level) ;} var popupName=arrayName+"popup"; popupFrame.document.write(""); popupFrame.document.write(""); } popupFrame.document.write("
 
"); popupFrame.document.write(""); for(arrayItem=0;arrayItemwidth-borderWidth) wnd.style.pixelWidth=width-parseInt(wnd.style.paddingLeft)-parseInt(wnd.style.paddingRight); } function createPopupFromCode(arrayName,level) { var popupName=arrayName+"popup"; var popup=popupFrame.document.getElementById(popupName); if (popup&&popup.bCreated)return popup; var levelAttribs; if (level > maxlev) {levelAttribs = eval ("lev" + maxlev) ;} else {levelAttribs = eval ("lev" + level) ;} popup.level=level; popup.highlightColor=levelAttribs[5]; popup.normalColor=levelAttribs[3]; popup.highlightBgColor=levelAttribs[7]; popup.normalBgColor=levelAttribs[4]; popup.scrVis=false; popup.bCreated=true; with (popup.style) { zIndex=maxZ; position="absolute"; width=popupWidth; borderColor=borderCol; backgroundColor=bord?borderCol:levelAttribs[4]; borderWidth=bord; borderStyle="solid"; } addEvent(popup,"mouseout",onPopupOut,false); addEvent(popup,"mouseover",onPopupOver,false); var popupHeight=0; var array=eval(arrayName); var arrayItem; for(arrayItem=0;arrayItembrowserRect.right) { if(refWnd.id&&refWnd.id.indexOf('top')==-1)popup.style.pixelLeft=Math.max(0,refWnd.offsetLeft-popup.offsetWidth+levelOffset); else popup.style.pixelLeft=browserRect.right-popup.offsetWidth-5; } //var cv=(bIncBorder?3:20); //if ((popupRect.bottom>browserRect.bottom)) //{ // var newtop=browserRect.bottom-popup.offsetHeight-cv; // popup.style.pixelTop=newtop; //} } function isChildOfActivePopup(popup) { var wnd=activePopup; while(wnd) { if (wnd.id==popup.id) return true; wnd=wnd.expandedWnd; } return false; } function onPopupOver() { if (activePopup && isChildOfActivePopup (this)) clearTimeout(activePopupTimeout); } function onPopupOut() { onPopupOutImpl(this); } function onPopupOutImpl(popup) { if (mout && activePopup && isChildOfActivePopup (popup)) { if (activePopupTimeout) clearTimeout (activePopupTimeout); activePopupTimeout=setTimeout("closePopup('"+activePopup.id+"');", closeDelay); } } function rct(left,top,right,bottom) { this.left=left; this.top=top; this.right=right; this.bottom=bottom; } function getBody(frame) { var bodyArr=frame.document.getElementsByTagName('body'); return bodyArr[0]; } function getBrowserRect(doc) { var body=getBody(doc); var left=body.style.pixelLeft; var top=body.style.pixelTop; var right=left+body.style.pixelWidth; var bottom=top+body.style.pixelHeight; var retval=new rct(left,top,right,bottom); return retval; } function getClientRect(wnd) { var left=0; var top=0; var right=0; var bottom=0; var par=wnd; while (par) { left+=par.offsetLeft; top+=par.offsetTop; if (par.offsetParent==par || par.offsetParent==getBody(popupFrame)) break; par=par.offsetParent; } right=left+wnd.offsetWidth; bottom=top+wnd.offsetHeight; var retval=new rct(left,top,right,bottom); return retval; } function onItemClick() { var item=this; if (item.url) { var startPos=item.dispText.indexOf('',startPos); var trgFrame = item.dispText.substring (startPos+4,endPos); if (trgFrame=="_blank") window.open (item.url); else eval("parent.frames."+trgFrame).location.href=item.url; } else { var find=item.url.indexOf("javascript:"); if (find!=-1) eval(item.url.substring(find)); else { var mt=item.url.indexOf("mailto:"); if(mt!=-1) else if(popupFrame!=window) window.open(item.url); else targetFrame.location=item.url; } } if(activePopup)closePopup(activePopup.id); } } function onItemOver() { var item=this; if (item.owner.expandedWnd) { resetPopup(item.owner); closePopup(item.owner.expandedWnd.id); } if (item.url&&item.url.indexOf("javascript:")==-1) window.status=item.url; else window.status=""; // item.style.color=item.owner.highlightColor; // item.style.backgroundColor=item.owner.highlightBgColor; item.className = 'BASEPROSUBMENUHOVER'; var items=item.owner.getElementsByTagName("DIV"); if (item.popupArray) { var rect=getClientRect(item); var x=rect.right-levelOffset; var y=rect.top; var popup=createPopupFromCode(item.popupArray,item.owner.level+1); item.owner.expandedWnd=popup; openPopup(popup,x,y+2,false,item.owner); } } function onItemOut() { var item=this; //item.style.color=item.owner.normalColor; //item.style.backgroundColor=item.owner.normalBgColor; item.className = 'Meny'; } function expandMenu(popupId,refWnd,dum) { if(!docLoaded)return; clearTimeout(activePopupTimeout); if (activePopup&&activePopup.id!=popupId+"popup") closePopup(activePopup.id); if(popupId=='none')return; var posRef=document.getElementById(refWnd); var rect=getClientRect(posRef); var x; var y; if(menuHorizontal) { x=rect.left; y=rect.bottom+popupOffset; } else { x=rect.right+popupOffset; y=rect.top; } if(sepFrame&&!openSameFrame) { var brRect=getBrowserRect(popupFrame); var wRect=getBrowserRect(window); switch (menuPos) { case 0: x=brRect.left; y+=brRect.top-wRect.top; break; case 1: x=brRect.right; y+=brRect.top-wRect.top; break; case 2: x+=brRect.left-wRect.left; y=brRect.top; break; case 3: x+=brRect.left-wRect.left; y=brRect.bottom; break; } } var popup=createPopupFromCode(popupId,0); openPopup(popup,x,y,true,posRef); activePopup=popup; } function collapseMenu(popupId) { if(!docLoaded)return; var popup=popupFrame.document.getElementById(popupId+"popup"); if(popup)onPopupOutImpl(popup); } function expandMenuNS(popupId,e,dItem) { } function collapseMenuNS(popupId) { } function onDocClick() { if(activePopup)closePopup(activePopup.id); } function onDocClick() { if(activePopup)closePopup(activePopup.id); } function initializeMenu() { if(!mout)addEvent(popupFrame.document,"mousedown",onDocClick,false); docLoaded=true; } function addEvent(obj,event,fun,bubble) { if (obj.addEventListener) obj.addEventListener(event,fun,bubble); else eval("obj.on"+event+"="+fun); } function chgBg(item,color) { var itm=document.getElementById(item); var onOff = (color!=0)?true:false; itm.className = (onOff)?'BASEPROMENUHOVER':''; } function initializeAll() { var i; for(i=0;i<=document.lastLoadHandler;i++) { eval(document.loadHandlers[i]+'();'); } }