Hej, jeg er i tvivl om hvad i mener. Jeg har lavet menuen i programmet Dhtml Studio Menu (script generated by SiteXpert (
www.xtreeme.com))
den har generet flere koder:
I får lige en mere (aner ikke ok det er nok, eller det rigtige ???)
function zz(e,i){
return e?e.document.getElementById(i):document.getElementById(i)}
function f33(p){
if(p&&p.indexOf(':/')==-1&&p.indexOf(':\\')==-1&&p.indexOf('/')!=0) return unescape(absPath)+p
else return p}
function addLoadHandler(lh){
if(lh){
if(!document.loadHandlers){
document.loadHandlers=new Array()
document.loadHandlers[0]=lh
document.lastLoadHandler=0}
else{
document.lastLoadHandler++
document.loadHandlers[document.lastLoadHandler]=lh}}}
addLoadHandler('f29')
addLoadHandler(window.onload)
window.onload=f31
function f32(){return true;}
window.onerror=f32
function showScrolled(q,objId,step){
var obj=zz(q.v18,objId)
if(!obj ||(q.transTLO&&obj.level>0))return
if(step<=0){
obj.inactive=0
obj.style.clip="rect(auto,auto,auto,auto)"
obj.style.top=obj.origTop+"px"
obj.style.left=obj.origLeft+"px"}
else{
if(step==q.fadingSteps){
obj.inactive=1
obj.origTop=obj.offsetTop
obj.origLeft=obj.offsetLeft}
var ver=(q.menuHorizontal&&obj.level==0)
if(ver){
obj.style.top=(obj.origTop-obj.offsetHeight+(((q.fadingSteps-step)*obj.offsetHeight)/q.fadingSteps))+"px"
obj.style.clip="rect("+(obj.origTop-obj.offsetTop)+",auto,auto,auto)"}
else{
obj.style.left=(obj.origLeft-obj.offsetWidth+(((q.fadingSteps-step)*obj.offsetWidth)/q.fadingSteps))+"px"
obj.style.clip="rect(auto,auto,auto,"+(obj.origLeft-obj.offsetLeft)+")"}
setTimeout("showScrolled("+q.name+",'"+objId+"',"+(step-1)+")",q.scrDel/q.fadingSteps)}}
function f03(q,popup,id,v27,v26,v30,v09,bLast,v31,parent,target,icon){
var itemType=0
if(v26&&v26.indexOf("(^1)")!=-1)itemType=1
if(v26&&v26.indexOf("(^2)")!=-1)itemType=2
var itemWnd=q.v18.document.createElement("DIV")
popup.appendChild(itemWnd)
if(mac){
var brWnd=q.v18.document.createElement("BR")
popup.appendChild(brWnd)}
f30(itemWnd,"mouseover",f22,false)
f30(itemWnd,"mouseout",f23,false)
f30(itemWnd,"mousedown",f20,false)
f30(itemWnd,"dblclick",f20,false)
itemWnd.owner=popup
itemWnd.id=id
with(itemWnd.style){
position="absolute"
if(itemType==2)top=(v31-q.scrollHeight)+"px"
else top=v31+"px"
if(v27){cursor=(!IE4||version>=6)?"pointer":"hand";}
else{cursor="default";}
color=v09 [3]
if(!q.v11){
if(!bLast){
borderBottomColor=q.borderCol
borderBottomWidth=q.sep+"px"
borderBottomStyle="solid"}}
else
left=(q.popupLeftPad+q.vertSpace)+"px"
if(!itemType)padding=q.vertSpace+"px"
paddingLeft=(q.popupLeftPad+q.vertSpace+q.v54)+"px"
paddingRight=((q.v01<q.iconSize?q.iconSize:q.v01)+q.vertSpace)+"px"
fontSize=v09[0]
fontWeight=(v09[1])?"bold":"normal"
fontStyle=(v09[2])?"italic":"normal"
fontFamily=v09[6]
textAlign=(q.v22==1?'center':(q.v22==2?'right':'left'))
f04(itemWnd,q.v11?q.v02-q.popupLeftPad-q.v01-2*q.vertSpace:q.v02,2*q.bord)}
if(v30)itemWnd.v30=v30
if(itemType>0){
var arrow=q.v18.document.createElement("IMG")
itemWnd.appendChild(arrow)
var arrowSrc=f33(q.v21)
arrow.src=arrowSrc+"/"+q.fnm+"s"+((itemType==1)?"up":"down")+".gif"
itemWnd.style.textAlign="center"
itemWnd.style.display="none"}
else
itemWnd.innerHTML=v26
itemWnd.url=f33(v27)
itemWnd.f54=v26
itemWnd.target=target
if(v30){
var expandArrow=q.v18.document.createElement("IMG")
itemWnd.appendChild(expandArrow)
var v03=f33(q.v21)
expandArrow.src=v03+"/"+q.fnm+"ia.gif"
with(expandArrow.style){
width=q.iconSize+"px"
height=q.iconSize+"px"
position="absolute"
var itemRect=f19(q,itemWnd)
top=((itemRect.bottom-itemRect.top)/2-q.iconSize/2-2)+"px"
left=(itemWnd.offsetWidth-q.iconSize-1)+"px"}}
return itemWnd.offsetHeight}
function f04(wnd,width,borderWidth){
wnd.style.width=(width-borderWidth)+"px"
if(wnd.offsetWidth>width-borderWidth)wnd.style.width=(width-parseInt(wnd.style.paddingLeft)-parseInt(wnd.style.paddingRight))+"px"}
function f05(q,v12,level,v04,nsi){
var popupName=v12+"popup"
var popup=zz(q.v18,popupName)
if(popup)return popup
if(q.v17&&q.v17.id==popupName)q.v17=null
var v09
if(level>0)q.v02=q.v23
if(level>q.maxlev){v09=eval("q.lev"+q.maxlev);}else{v09=eval("q.lev"+level);}
popup=q.v18.document.createElement("DIV")
q.v18.document.body.appendChild(popup)
popup.id=popupName
popup.v04=v04
popup.level=level
popup.v05=v09[5]
popup.v06=v09[3]
var c1=v09[4]
popup.v07=v09[7]
popup.v08=c1
popup.scrVis=false
with(popup.style){
zIndex=maxZ
position="absolute"
width=q.v02+"px"
if(!q.v11){
borderColor=q.borderCol
backgroundColor=c1
borderWidth=q.bord+"px"
borderStyle="solid"}
else backgroundColor=""}
popup.q=q
f30(popup,"mouseout",f15,false)
f30(popup,"mouseover",f14,false)
var v31=0
var bgWnd=q.v18.document.createElement("DIV")
popup.appendChild(bgWnd)
bgWnd.id=popup.id+"bgWnd"
bgWnd.style.position="absolute"
bgWnd.style.top=q.v10+"px"
bgWnd.style.width=(q.v02-2*q.bord)+"px"
bgWnd.innerHTML="<font size='1'> </font>"
if(0){}
else{
bgWnd.style.backgroundColor=c1}
var array=eval(v12)
var v13
if(q.v55)f03(q,popup,popup.id+"scrollUp","java script:scrollUp("+q.name+",'"+popup.id+"');","(^1)",null,v09,true,v31,bgWnd)
for(v13=0;v13<array.length/5;v13++){
var v30=(array[v13*5+2])?(v12+"_"+parseInt(v13+1)):null
v31+=f03(q,popup,null,array[v13*5+1],array[v13*5],v30,v09,(v13==array.length/5-1),v31,bgWnd,array[v13*5+3],array[v13*5+4])}
if(q.v55)f03(q,popup,popup.id+"scrollDown","java script:scrollDown("+q.name+",'"+popup.id+"');","(^2)",null,v09,true,v31,bgWnd)
var v28=0
popup.style.height=(v31+q.bord*2+v28)+"px"
popup.maxHeight=v31+q.bord*2
bgWnd.style.height=(v31-q.v10-v28)+"px"
if(IE4&&!mac&&q.fixSB){
var backFr=q.v18.document.createElement("IFRAME")
backFr.id=popup.id+'FRM'
backFr.width=popup.offsetWidth
backFr.height=popup.offsetHeight
backFr.style.position='absolute'
backFr.style.visibility='hidden'
backFr.style.backgroundColor='green'
backFr.style.zIndex=0
backFr.scrolling='no'
backFr.frameBorder=0
if(backFr)backFr.style.visibility='visible'
q.v18.document.body.appendChild(backFr)}
if(popup.offsetHeight>v31+q.bord*2+v28){
popup.style.height=v31+"px"
q.bIncBorder=false
popup.maxHeight=v31}
return popup}
function f35(wnd,vis){
var i=1
while(true){
var eln='HideItem'
if(i>1)eln+=i
var hideWnd=zz(wnd,eln)
if(!hideWnd)break
hideWnd.style.visibility=vis ? 'visible' : 'hidden'
i++}}
function f06(q,popupId,dl){
if(popupId.indexOf('_')==-1){
f35(q.v18,1)
if(q.actm&&dl)chgBg(q,q.actm,0,1)}
if(q.v29){q.v29Str=null;clearTimeout(q.v29);}
var popup=zz(q.v18,popupId)
if(popup){
if(popup.v14)f06(q,popup.v14.id)
if(popup.v04)popup.v04.v14=null
if(IE4&&version>=6&&q.v11){
popup.style.clip="rect(0,-1,-1,0)"}
else{
popup.style.visibility="hidden"
popup.style.display="none"}
if(IE4&&!mac&&q.fixSB){
var backFr=zz(q.v18,popup.id+'FRM')
if(backFr)backFr.style.visibility='hidden'}}
if(q.v17&&q.v17.id==popupId)q.v17=null}
function f07(rect,refx,refy){
var retval=new rct(rect.left-refx,rect.top-refy,rect.right-refx,rect.bottom-refy)
return retval}
function f34(q,popup,actEl){
var items=popup.getElementsByTagName("DIV")
var i=0
for(;i<items.length;i++)if(actEl!=items[i]&&(!items[i].id||items[i].id.indexOf("scroll")==-1)){
items[i].style.backgroundColor=popup.q.v11?"transparent":popup.v08
items[i].style.color=popup.v06}}
function f08(q,popup,x,y,bDontMove,refWnd){
if(popup.id.indexOf('_')==-1){
f35(q.v18,0)}
if(q.v17&&q.v17.id==popup.id)return
popup.style.left=x+"px"
popup.style.top=y+"px"
if(IE4&&version>=6&&q.v11){
popup.style.clip="rect(auto,auto,auto,auto)"}
else{
popup.style.display=""
popup.style.visibility="visible"}
if(IE4&&!mac&&q.fixSB){
var backFr=zz(q.v18,popup.id+'FRM')
if(backFr){
backFr.style.left=x+"px"
backFr.style.top=y+"px"
backFr.style.visibility='visible'}}
var v15=f19(q,popup)
var v16=f17(q.v18)
var bResize=(popup.offsetHeight<popup.maxHeight)
if(v15.right>v16.right){
if(refWnd&&refWnd.id&&refWnd.id.indexOf('top')==-1)popup.style.left=(Math.max(0,refWnd.offsetLeft-popup.offsetWidth+q.levelOffset))+"px"
else popup.style.left=(v16.right-popup.offsetWidth-5)+"px"}
var wnd1=zz(q.v18,popup.id+"scrollDown")
var wnd2=zz(q.v18,popup.id+"scrollUp")
var cv=mac?15:(q.bIncBorder?3:20)
if(((v15.bottom>v16.bottom)||bResize)&&!NS60){
var newtop=v16.bottom-popup.offsetHeight-cv
if(!q.menuHorizontal)bDontMove=false
if(q.v55&&(newtop<0||bDontMove||bResize)){
var minNum=Math.min(popup.maxHeight,v16.bottom-popup.offsetTop-cv-(q.bIncBorder?0:q.bord*2))
if(minNum>50){
popup.scrVis=(minNum!=popup.maxHeight)
f09(q,popup,v16.top,minNum)}
else{
popup.style.top=newtop+"px"}}
else
popup.style.top=newtop+"px"}
if(q.v55){
wnd1.style.display=popup.scrVis?"":"none"
wnd2.style.display=popup.scrVis?"":"none"}
if(q.scrDel)showScrolled(q,popup.id,q.fadingSteps)
f34(q,popup,null)}
function f09(q,popup,documentOffset,height){
var wnd2=zz(q.v18,popup.id+"scrollDown")
var wnd4=zz(q.v18,popup.id+"scrollUp")
var wnd3=zz(q.v18,popup.id+"bgWnd")
var wnd1Height=0
if(q.v55){
wnd2.style.zIndex=maxZ+1
wnd4.style.zIndex=maxZ+1}
popup.style.height=height+"px"
wnd3.style.height=(height-q.v10-q.bord*2-wnd1Height)+"px"
if(q.v55){
wnd2.style.top=(height-wnd1Height-q.scrollHeight-(q.bIncBorder?q.bord*2:0))+"px"
f10(q,popup.id,0)}}
function f10(q,popupId,dir){
var popup=zz(q.v18,popupId)
var v15=f19(q,popup)
var items=popup.getElementsByTagName("DIV")
var i=(dir>0?0:items.length-1)
var off=(dir>0?1:-1)
var bFirst=true
var offset=dir*q.scrollStep
if(popup.scrVis){
v15.top+=q.scrollHeight
v15.bottom-=q.scrollHeight}
v15.bottom-=2*q.bord
var wnd1Height=0
for(;i<items.length&&i>=0;i+=off){
var item=items[i]
if(!item.id||(item.id.indexOf("scroll")==-1&&item.id.indexOf("bgWnd")==-1)){
var itemRect=f19(q,item)
if(bFirst&&dir==0){offset=popup.maxHeight-(item.offsetTop+item.offsetHeight)+(popup.scrVis?q.scrollHeight:0)-(q.bIncBorder?q.bord*2:0)-wnd1Height;}
var relRect=f07(v15,itemRect.left,itemRect.top+offset)
if(dir>0&&relRect.top<-q.scrollHeight&&bFirst)return
if(dir<0&&itemRect.bottom+offset<v15.bottom-q.scrollHeight-wnd1Height&&bFirst)return
if(offset!=0)item.style.top=(item.offsetTop+offset)+"px"
if(!mac)item.style.clip="rect("+relRect.top+","+relRect.right+","+relRect.bottom+","+relRect.left+")"
if(relRect.bottom<0||relRect.top>item.offsetHeight)
item.style.visibility="hidden"
else
item.style.visibility="visible"
bFirst=false}}
if(popup.scrPos)popup.scrPos+=offset
else popup.scrPos=offset}
function scrollUp(q,popupId){
f10(q,popupId,1)}
function scrollDown(q,popupId){
f10(q,popupId,-1)}
function f13(q,popup){
var wnd=q.v17
while(wnd){
if(wnd.id==popup.id)
return true
wnd=wnd.v14}
return false}
function f14(){
var q=this.q
if(q.v17&&q.v17Timeout&&f13(q,this))clearTimeout(q.v17Timeout)}
function f15(){
var q=this.q
f15Impl(q,this)}
function f15Impl(q,popup){
if(q.mout&&q.v17&&f13(q,popup)){
if(q.v17Timeout)clearTimeout(q.v17Timeout)
q.v17Timeout=setTimeout("f06("+q.name+",'"+q.v17.id+"',1);",q.closeDelay)}}
function rct(left,top,right,bottom){
this.left=left
this.top=top
this.right=right
this.bottom=bottom}
function f17(doc){
var left=0
var top=0
var right
var bottom
if(doc.pageXOffset)left=doc.pageXOffset
else if(doc.document.documentElement.scrollLeft)left=doc.document.documentElement.scrollLeft
else if(doc.document.body.scrollLeft)left=doc.document.body.scrollLeft
if(doc.pageYOffset)top=doc.pageYOffset
else if(doc.document.documentElement.scrollTop)top=doc.document.documentElement.scrollTop
else if(doc.document.body.scrollTop)top=doc.document.body.scrollTop
if(doc.innerWidth)right=left+doc.innerWidth
else if(doc.document.documentElement.clientWidth)right=left+doc.document.documentElement.clientWidth
else if(doc.document.body.clientWidth)right=left+doc.document.body.clientWidth
if(doc.innerHeight)bottom=top+doc.innerHeight
else if(doc.document.documentElement.clientHeight)bottom=top+doc.document.documentElement.clientHeight
else if(doc.document.body.clientHeight)bottom=top+doc.document.body.clientHeight
var retval=new rct(left,top,right,bottom)
return retval}
function f18(q,wnd){
var left=mac?parseInt(document.body.leftMargin):0
var top=mac?parseInt(document.body.topMargin):0
var right=0
var bottom=0
var par=wnd
var topObj=q.v18.document.documentElement
if(!topObj)topObj=q.v18.document.body
while(par){
left=left+parseInt(par.offsetLeft)
top=top+parseInt(par.offsetTop)
if(par.offsetParent==par || par.offsetParent==topObj)break
par=par.offsetParent}
right=left+parseInt(wnd.offsetWidth)
bottom=top+parseInt(wnd.offsetHeight)
var retval=new rct(left,top,right,bottom)
return retval}
function f19(q,wnd){
if((mac||DOM||Opera7)&&wnd.getBoundingClientRect)return wnd.getBoundingClientRect()
return f18(q,wnd)}
function f53(wn,fr){
if(wn.frames){
if(wn.frames[fr])return wn.frames[fr]
for(var i=0;i<wn.frames.length;i++){
try{
if(wn.frames[i].name==fr)return wn.frames[i]
var ret=f53(wn.frames[i],fr)
if(ret)return ret
}catch(e){}}}
return null}
function f20(){
var item=this
var close=true
var q=this.owner.q
if(item.url){
var trgFrame=q.cntFrame
if(item.target)
trgFrame=item.target
if(trgFrame=="_self")
trgFrame=null
var mt=item.url.indexOf("mailto:")
if(mt!=-1)window.top.location=item.url.substring(mt)
else if(trgFrame){
if(trgFrame=="_blank")window.open(item.url)
else if(trgFrame=="_top")window.top.location.href=item.url
else if(trgFrame=="_parent")parent.location.href=item.url
else{
var fr=f53(window.top,trgFrame)
if(fr)fr.location.href=item.url
else window.location.href=item.url}}
else{
var find=item.url.indexOf("java script:")
if(find!=-1){
eval(item.url.substring(find))
if(item.url.indexOf("scroll")!=-1)close=false}
else{
q.targetFrame.location=item.url}}
if(q.v17&&close)f06(q,q.v17.id,1)}}
function f21(q){
if(q.v29Str){
eval(q.v29Str)
if(q.v29)clearTimeout(q.v29)
q.v29=setTimeout("f21("+q.name+")",q.v55)}}
function f22(){
var item=this
var q=this.owner.q
if(item.owner.inactive)return
var bOp=0
if(item.id&&item.id.indexOf("scroll")!=-1){
q.v29Str=item.url
var jsind=q.v29Str.indexOf('java script:')
if(jsind!=-1)q.v29Str=q.v29Str.substring(jsind)
f21(q)
return}
if(item.owner.v14){
if(item.v30&&item.v30+'popup'==item.owner.v14.id)bOp=1
if(!bOp)f06(q,item.owner.v14.id)}
if(item.url&&item.url.indexOf("java script:")==-1)
window.status=item.url
else
window.status=""
f34(q,item.owner,item)
item.style.color=item.owner.v05
item.style.backgroundColor=(!item.owner.v07&&q.v11)?"transparent":item.owner.v07
if(item.v30&&!bOp){
var rect=f19(q,item)
var x=rect.right-q.levelOffset
var y=rect.top
var popup=f05(q,item.v30,item.owner.level+1,item.owner)
item.owner.v14=popup
f08(q,popup,x,y+2,false,item.owner)}}
function f23(){
var item=this
var q=this.owner.q
if(item.owner.inactive)return
if(q.v29){q.v29Str=null;clearTimeout(q.v29);}
if(item.id&&item.id.indexOf("scroll")!=-1)return
window.status=""}
function exM(q,popupId,refWnd,dum,ml,mt,mr,mb){
if(!docLoaded)return
if(q.v17Timeout)clearTimeout(q.v17Timeout)
if(q.v17&&q.v17.id!=popupId+"popup")
f06(q,q.v17.id)
if(popupId=='none')return
var bFr=q.v19&&!q.v20
var rect
if(refWnd=='coords'){
rect=f18(q,zz(0,q.name+'tl'))
rect.left=rect.left+ml
rect.top=rect.top+mt
rect.right=rect.left+mr
rect.bottom=rect.top+mb}
else{
rect=f18(q,zz(0,refWnd))}
if(q.bVarWidth&&!q.v11)q.v02=rect.right-rect.left+(IE4?q.bord*2:0)
var x
var y
x=rect.left-q.bord
y=rect.bottom+q.popupOffset
var popup=f05(q,popupId,0,null,refWnd)
f08(q,popup,x+q.xOff,y+q.yOff,true,null)
q.v17=popup}
function coM(q,popupId){
if(!docLoaded)return
var popup=zz(q.v18,popupId+"popup")
if(popup)f15Impl(q,popup)}
function exMNS(q,popupId,e,dItem){}
function coMNS(q,popupId){}
function f28(){
var nmn
for(nmn=1;nmn<=lastm;nmn++){
var q=eval("window.m"+nmn)
if(q&&q.v17)f06(q,q.v17.id,1)}}
function f29(){
if(docLoaded)return
var nmn
for(nmn=1;nmn<=lastm;nmn++){
var q=eval("window.m"+nmn)
if(q){
q.v18=(q.v19&&!q.v20)?f53(window.top,q.v24):window
q.targetFrame=(q.v19)?f53(window.top,q.cntFrame):window
if(!q.mout)f30(q.v18.document,"mousedown",f28,false)}}
docLoaded=true}
function f30(obj,event,fun,bubble){
if(obj.addEventListener)
obj.addEventListener(event,fun,bubble)
else
eval("obj.on"+event+"="+fun)}
function chgBg(q,item,color,cl){
if(!IE4&&!DOM&&!Opera7)return
if(!q.v52){
var el=zz(0,item)
var ela=zz(0,item+'a')
var ncl=q.tlmOrigBg
var hcl=q.tlmHlBg
if(color==0){
if(cl){
if(!q.v25){
el.style.background=ncl
el.style.color=q.tlmOrigCol}
if(ela)ela.style.color=q.tlmOrigCol}}
else{
if(q.actm)chgBg(q,q.actm,0,1)
if(!q.v25){
if(color&1)el.style.background=hcl
el.style.color=q.tlmHlCol}
if(ela&&color&2)ela.style.color=q.tlmHlCol
q.actm=item}}}
function f31(){
var i
var l=document.lastLoadHandler
document.lastLoadHandler=-1
for(i=0;i<=l;i++){
var h=document.loadHandlers[i]
if(typeof(h)!='function'){
var bPar=(h.indexOf('(')==-1)
eval(h+(bPar ? '();' : ';'))}
else{
h()}}}