IE4=(document.all)
NS4=(document.layers)
NS6=document.getElementById
Mac=(navigator.appVersion.indexOf("Mac")!=-1)
ddmenu_ok=topfrys=false
closetimer=null
topaaben=1
topZ=0
topantal=8

// Her sættes bredden af det område DropDown menuen skal arbejde i
// d.v.s. at du kan venstrestille menuen ved at gøre området meget bredt 
// og tilpasse den til en centreret tabel ved at justere bredden til den samme som
// tabellen
topcontentW=1800

topoffsetW=100




function topstartIt(){
	if(IE4&&!Mac){
		for(z=0;z<document.all.length;z++){
			oldEl=document.all(z)
			topZ=Math.max(oldEl.style.zIndex,topZ)
		}
		topZ++
	}
	topredo()
	if(window.topeftermenu)topeftermenu()
}
function topredo(){
	topoffsetW=topoffset()
	topposition()
}
function topposition(){
	if(NS4)
		for(i=1;i<=topantal;i++)
			eval("document.m"+i).moveTo(ddmenu_xPos[i-1]+topoffsetW,ddmenu_yPos)


			
	else if(!NS6)
		for(i=1;i<=topantal;i++){
			topmenu=eval("m"+i)
			topmenu.style.pixelLeft=ddmenu_xPos[i-1]+topoffsetW
			topmenu.style.pixelTop=ddmenu_yPos
			topmenu.style.zIndex=topZ
		}
}

function topoffset(){
	topwinW=NS4?window.innerWidth-16:IE4?document.body.offsetWidth-20:document.body.offsetWidth
	return(topwinW<topcontentW)?0:Math.floor(eval((topwinW-topcontentW)/2))
}

function toppopop(id){
	if(ddmenu_ok){
		clearTimeout(closetimer)
		for(i=1;i<=topantal;i++)
			topflickmenu(i,false)
		topflickmenu(id,true)
		topaaben=id
		if(NS4)
			topflickdivsNS(false)
		else{
			if(window.bannernoflick!=1)
				topflickbanner(false)
			topflickdivs(false)
		}
		topfrys=false
	}
}
// Her bestemmes hvor lang tid DropDown menuen skal stå efter musen har forladt den, i millisekunder
function topover(){clearTimeout(closetimer)}
function topud(){
	if(ddmenu_ok&&!topfrys)
		closetimer=setTimeout("topluk("+topaaben+")",100)
}
function topluk(id){
	clearTimeout(closetimer)
	topflickmenu(id,false)
	if(NS4)
		topflickdivsNS(true)
	else{
		topflickbanner(true)
		topflickdivs(true)
	}
}

function topflickmenu(id,vis){
	if(NS4)
		eval("document.m"+id).visibility=(vis)?"show":"hide"
	else if(NS6){
		m = document.getElementById("m"+id)
		m.style.left=ddmenu_xPos[id-1]+topoffsetW
		m.style.top=ddmenu_yPos
		m.onmouseover=topover
		m.onmouseout=topud
		m.style.visibility=(vis)?"visible":"hidden"
	}
	else{
		eval("m"+id).style.visibility=(vis)?"visible":"hidden"
		eval("m"+id).style.zIndex=10000
	}
}
function topflickbanner(vis){
	iframe_Count=1
	topframe=NS6?document.getElementById("bannertable"+iframe_Count):eval("document.all.bannertable"+iframe_Count)
	while(topframe){
		topframe.style.visibility=(vis)?"":"hidden"
		iframe_Count++
		topframe=NS6?document.getElementById("bannertable"+iframe_Count):eval("document.all.bannertable"+iframe_Count)
	}
}
function topflickdivs(vis){
	tophidediv_Count=1
	topdiv=NS6?document.getElementById("tophidediv"+tophidediv_Count):eval("document.all.tophidediv"+tophidediv_Count)
	while(topdiv){
		topdiv.style.visibility=(vis)?"":"hidden"
		tophidediv_Count++
		topdiv=NS6?document.getElementById("tophidediv"+tophidediv_Count):eval("document.all.tophidediv"+tophidediv_Count)
	}
}
function topflickdivsNS(vis){
	tophidediv_Count=1
	topdiv=eval("document.tophidediv"+tophidediv_Count)
	while(topdiv){
		topdiv.visibility=(vis)?"show":"hide"
		tophidediv_Count++
		topdiv=eval("document.tophidediv"+tophidediv_Count)
	}
}
window.onload=topstartIt
window.onresize=topredo

// *****************************************************************************


if (navigator.appVersion < '4')
    {
     document.write("<table width=100% border=1 cellpadding=0 cellspacing=0><tr><td height=34 align=left>")
document.write("Indhold for gamle browsere")
document.write("</td></tr></table>")
	       			    }
						
function stoperrormsg(){
return true
}
window.onerror=stoperrormsg						

// Din websides adresse f.eks.: http://www.elfoflash.dk/
root=""



function topdivhead(w){
// Ved at justere "cellpadding" kan du ændre kantens bredde
	return "<table width="+w+" border=0 cellspacing=0 cellpadding=0><tr><td class=menuborder ><table width="+(w-2)+" border=0 cellspacing=0 cellpadding=5><tr><td class=ddmenubox>"
}
function ddmenu(id){
	if(NS4){
		a="&nbsp;<a class=menupunktns onmouseover=t_over() target=_top href="+root+""
		b=c=""+a
	}
	else{
		a="&nbsp;<a class=menupunkt"+id+" onmouseover=topover() target=_top href="+root+""
		b="&nbsp;<a class=menupunkt"+id+" style=font-size:10px onmouseover=topover() target=_top href="+root+""
		c="&nbsp;<a class=menupunkt"+id+" style=font-size:10px onmouseover=topover() target=_top href="+root+""
	}
}

navi=null

if(IE4||NS4||NS6){
topmenuson=true
// *****************************************************************************
// Her bestemmes placeringen af den enkelte DropDown menu
ddmenu_xPos=new Array(30,137,248,366,480,590,705,800)
topantal=8
thisURL=location.href
thisURLesc=escape(thisURL)

// Her bestemmes afstand til toppen af browser-vinduet
if(NS4)
ddmenu_yPos=170
if(NS6)
ddmenu_yPos=170
else
ddmenu_yPos=170

// *****************************************************************************
// Her følger de enkelte DropDown menuer med links (1-8)
// Her er det meget enkelt at tilføje flere links

//Boks 1 dd menu
ddmenu(1)
divhtml=topdivhead(94)+c+"index.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;Om Elfo</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m1>"+divhtml+"</td></tr></table></td></tr></table></div>")


//Boks 2 dd menu
ddmenu(2)
divhtml=topdivhead(94)+c+"flash.htm><b>Flashlamper</b></a>"
divhtml+="<br>"+b+"flash.htm#Quant><b>Quant</b></a>"
divhtml+="<br>"+b+"flash.htm#Quantpro><b>Quant Pro</b></a>" 
divhtml+="<br>"+b+"flash.htm#Miqro200><b>Miqro 200</b></a>"
divhtml+="<br>"+b+"flash.htm#Miqropro><b>Miqro Pro</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m2>"+divhtml+"</td></tr></table></td></tr></table></div>")

//Boks 3 dd menu
ddmenu(3)
divhtml=topdivhead(94)+c+"Reflektorer.htm><b>Reflektorer</b></a>"
divhtml+="<br>"+b+"Reflektorer.htm#forsatser><b>Forsatser</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m3>"+divhtml+"</td></tr></table></td></tr></table></div>")

//Boks 4 dd menu
ddmenu(4)
divhtml=topdivhead(94)+c+"Softbokse.htm><b>Softbokse</b></a>"
divhtml+="<br>"+b+"Softbokse.htm#louvre><b>Louvre/biceller</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m4>"+divhtml+"</td></tr></table></td></tr></table></div>")

//Boks 5 dd menu
ddmenu(5)
divhtml=topdivhead(94)+c+"Stativer.htm><b>Til lampe</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m5>"+divhtml+"</td></tr></table></td></tr></table></div>")

//Boks 6 dd menu
ddmenu(6)
divhtml=topdivhead(94)+c+"Tilbehoer.htm><b>Tilbehør</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m6>"+divhtml+"</td></tr></table></td></tr></table></div>")

//Boks 7 dd menu
ddmenu(7)
divhtml=topdivhead(94)+c+"galleri.htm><b>Billedeksempler</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m7>"+divhtml+"</td></tr></table></td></tr></table></div>")


//Boks 8 dd menu
ddmenu(8)
divhtml=topdivhead(94)+c+"Info.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Priser</b></a>"
divhtml+="<br>"+b+"Info.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Købsvilkår</b></a>"
divhtml+="<br>"+b+"Info.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FAQ</b></a>"
divhtml+="<br>"+b+"Info.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link til Elfo</b></a>"
divhtml+="<br>"+b+"Info.htm><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Webstedet</b></a>"
divhtml+="<br><img src="+root+"afstand.gif width=100 height=3>"
document.write("<div id=m8>"+divhtml+"</td></tr></table></td></tr></table></div>")

// DropDown menuer STOP

//******************************************************************************
if(NS4)
	for(i=1;i<=topantal;i++){
		eval("document.m"+i).onmouseover=topover
		eval("document.m"+i).onmouseout=topud
	}
else if(!NS6)
	for(i=1;i<=topantal;i++){
		eval("document.all.m"+i).onmouseover=topover
		eval("document.all.m"+i).onmouseout=topud
	}

if(Mac)
	topposition()
else if(!NS6)
	topredo()
if(window.nomenu!=1)ddmenu_ok=true
}

if(!window.topoenr)topoenr=0


//******************************************************************************
// Her skrives HTML'en til menu-boksene
// Dette er udseendet for den enkelte boks bortset fra farverne
function top_box(id,sti,titel){
	return "<td class="+((id==topoenr)?"menuvalg":("oe"+id))+" align=center width=100 height=13><a  class="+((id==topoenr)?"menuvalg":"menu")+" onMouseOver=toppopop("+id+") onMouseOut=topud() target=_top href="+sti+"><img src="+root+" afstand.gif width=110 height=2 border=0><br>"+titel+"<img src="+root+" afstand.gif width=100 height=3 border=0></a></td>"
}
html="<span id=topmenudiv><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>"

// Dette er tabellen der indeholder de øverste menu-bokse
html+="<table width=880 border=0 cellpadding=0 cellspacing=0><tr><td class=toptabel height=53 align=left><IMG SRC=images/Topimage/Topimage.jpg a name='top' WIDTH=880 HEIGHT=98 ALT='Elfo Flash Danmark' Logo BORDER=0,5 VSPACE=0 HSPACE=0>"

// Her kan du sætte baggrundsfarven bag menuboksene
html+="<table border=0 cellpadding=0 cellspacing=0 BGCOLOR='cococo' WIDTH='100%'><tr><TD>"
html+="<table border=0 cellpadding=0 cellspacing=0 BGCOLOR='cococo'>"

html+="<tr>"
html+=top_box(1,thisURL,"&nbsp; <b>forside</b> &nbsp;")
html+=top_box(2,thisURL,"&nbsp; <b>flashlamper</b> &nbsp;")
html+=top_box(3,thisURL,"&nbsp; <b>reflektorer</b> &nbsp;")
html+=top_box(4,thisURL,"&nbsp; <b>softbokse</b> &nbsp;")
html+=top_box(5,thisURL,"&nbsp; <b>stativer</b> &nbsp;")
html+=top_box(6,thisURL,"&nbsp; <b>tilbehør</b> &nbsp;")
html+=top_box(7,thisURL,"&nbsp; <b>galleri</b> &nbsp;")
html+=top_box(8,thisURL,"&nbsp; <b>info</b> &nbsp;")

html+="</TD></TR></TABLE></TABLE></TR></tr></table></td></tr></table>"
html+="</td></tr></table></span>"

document.write(html)
