	//Globale Variablen
	Menu.itemSpacing = 1	//FONTDEFNITIONEN, Zellabstaende
	Menu.fontname = 'tahoma, arial, helvetica, sans-serif'
	Menu.fontsize = 9
	Menu.fonweight = 'bold'
	Menu.visibility = 'inherit'
         Menu.zindex = 5
	Menu.color = new Object()	//FARBDEFINITIONEN
	Menu.color.textNormal = '#003366'	//Text-Color normal
	Menu.color.textSelected = '#FFFFFF'// Text-Color on
	Menu.color.bgNormal = '#D2E6F8'	//BG-Color normal
	Menu.color.bgSelected = '#0000A0'	//BG-Color on
	Menu.color.bgRollover = '#BBDBFF'	//BG-Color over
	Menu.color.bg = '#C0C0C0'	//???

	Menu.ready = false
	Menu.count = 0	//Zählvariable für Menü

function Menu() {

	this.name = "Menu"+(Menu.count++)	//Name des Menüs (für id-Attribut)
	this.obj = this.name + "MenuObject"
	eval(this.obj + "=this")

		this.x = arguments[0]	// waagrechte Position des Menu
		this.y = arguments[1] 	// senkrechte Position des Menu
		this.w = arguments[2]	// Menubreite
		this.itemH = arguments[3]	//Hoehe des Menueintrages
		this.tempitems = new Array()	//Liste der Menüeintrage
		this.tempitems = arguments[4]
		this.links = new Array()	//Liste der Links zu den Menüeintragen
		this.links = arguments[5]

		this.h = 0		//Gesamthöhe des Menüs
		this.visibility = (is.ns)? 'hide' : 'hidden'	//Sichtbarkeit des Menu
                 this.zindex = 2       // frt

		this.offsetX = 0
		this.offsetY = 1
		this.vis = false // Maus auf Menü = falsch
		this.selectedIndex = null	//Index des Menüeintrages

		this.items = new Array()
	    for(var i=0; i<this.tempitems.length;i++){
			this.h += this.itemH /*+Menu.itemSpacing*/// Gesamthöhe des Menüs
			this.items[i] = new Array()
			this.items[i].y = i*this.itemH /*+ i*Menu.itemSpacing*/	//senkrechte Position des Eintrages
			this.items[i].selected = false
			this.items[i].text = this.tempitems[i]
			this.items[i].textSelected = '<div class="'+this.name+'TextSelected">'+this.tempitems[i]+'</div>'	//Text des Menüeintrag
			this.items[i].textNormal = '<div class="'+this.name+'TextNormal">'+this.tempitems[i]+'</div>'	//Text des Menüeintrag in HTML
		}
	this.build = MenuBuild
	this.activate = MenuActivate
	this.over = ItemOver
	this.out = ItemOut
	this.down = ItemDown
	this.Menuover = MenuShow
	this.Menuout = MenuHide
	this.onSelect = MenuRedirect
}
//dynamisches HTML und CSS werden ermittelt
function MenuBuild() {
	//CSS
	this.css = ''	//css wird als String initialisiert
	this.css += css1(this.name+'List',this.x,this.y,this.w,this.h,Menu.color.bg,this.zindex,this.visibility)	//Style für Gesamtmenü
	for (var i=0;i<this.items.length;i++) {
		this.css += css1(this.name+'Item'+i,0,this.items[i].y,this.w,this.itemH,Menu.color.bgNormal,Menu.zindex)	//Style für Menüeintrag
		this.css += css1(this.name+'ItemC'+i,0,this.items[i].y,this.w,this.itemH)
	}
	//font-family:"'+Menu.fontname+'"; wurde entfernt, wegen Problemen bei NS
	this.css += '.'+this.name+'TextNormal {font-size:'+Menu.fontsize+'pt; font-weight:"' +Menu.fontweight+'"; color:'+Menu.color.textNormal+'; background-color:transparent;}\n'+
	'.'+this.name+'TextSelected {font-family:"'+Menu.fontname+'"; font-size:'+Menu.fontsize+'pt; font-weight:"' +Menu.fontweight+'"; color:'+Menu.color.textSelected+'; background-color:transparent;}\n'
	//HTML
	this.div = '<div id="'+this.name+'List">\n'
	for (i=0;i<this.items.length;i++) {
		if(is.ie) this.div += '<div id="'+this.name+'Item'+i+'"><a href="'+this.links[i]+'" style="text-decoration: none" >'+this.items[i].textNormal+'</a></div>\n'
		else 	  this.div += '<div id="'+this.name+'Item'+i+'">'+this.items[i].textNormal+'</div>\n'
		//wird verwendet, wenn Menüeinträge nicht als Link gekennzeichnet sind
		//if(is.cursorOk) this.div += '<div id="'+this.name+'Item'+i+'" style="cursor:pointer">'+this.items[i].textNormal+'</div>\n'
		//else			  this.div += '<div id="'+this.name+'Item'+i+'">'+this.items[i].textNormal+'</div>\n'

		this.div += '<div id="'+this.name+'ItemC'+i+'"></div>\n'
	}
	this.div += '</div>'
}

function MenuActivate() {
//alert("ich aktivere")
	this.lyr = new DynLayer(this.name+'List')
	//alert(this.name+'List')
	//alert("so far")
	this.lyr.event.onmouseover = new Function(this.obj+'.Menuover(); return false;')
	this.lyr.event.onmouseout = new Function(this.obj+'.Menuout(); return false;')

	for (var i=0;i<this.items.length;i++) {
		this.items[i].lyr = new DynLayer(this.name+'Item'+i)
		this.items[i].lyr.setbg = DynLayerSetbg
		this.items[i].lyre = new DynLayer(this.name+'ItemC'+i)
		if (is.ns) {
		this.items[i].lyre.event.captureEvents(Event.MOUSEDOWN)
		this.items[i].lyre.event.onmouseover = new Function(this.obj+'.over('+i+'); return false;')
		this.items[i].lyre.event.onmouseout = new Function(this.obj+'.out('+i+'); return false;')
		this.items[i].lyre.event.onmousedown = new Function(this.obj+'.down('+i+'); return false;')
		}
		else{
		this.items[i].lyr.event.onmouseover = new Function(this.obj+'.over('+i+'); return false;')
		this.items[i].lyr.event.onmouseout = new Function(this.obj+'.out('+i+'); return false;')
		this.items[i].lyr.event.onmousedown = new Function(this.obj+'.down('+i+'); return false;')
		}
	}
	this.lyr.css.visibility = this.visibility
		Menu.ready = true
	
	//alert(Menu.ready)
}

function MenuHide() {
	this.vis = false
	this.lyr.hide()
}
function MenuShow() {
	this.vis = true
	this.lyr.show()
}
function ItemOver(i) {
	if (!this.items[i].selected) this.items[i].lyr.setbg(Menu.color.bgRollover)	// wenn Eintrag selected=false dann BG-Color auf Rollover setzen
}
function ItemOut(i) {
	if (!this.items[i].selected) this.items[i].lyr.setbg(Menu.color.bgNormal)	// wenn Eintrag selected=false dann BG-Color auf normal setzen
}
//wird verwendet wenn Menüeinträge nicht als Link gekennzeichnet sind
function ItemDown(i) {
	this.value = this.links[i]
	this.onSelect()
}
function MenuRedirect() {
	location.href = this.value	// der Link wird übergeben
}
function DynLayerSetbg(color) {
	if (is.ns) this.doc.bgColor = color
	else if (is.ie) this.css.backgroundColor = color
}
