function Menubar(pm_objectname, pm_name, pm_barprefix, pm_itemprefix, pm_cleartime) {
	this.objectname = pm_objectname;
	this.name = pm_name;
	this.barprefix = pm_barprefix;
	this.itemprefix = pm_itemprefix;
	this.cleartime = pm_cleartime;
	this.cleartimer = void(0);
	this.directions= new Array(1,0,0,0,0,0,0,0,0,0);		// 1: horizontal, 0: vertikal
	this.active = new Array(10);				// list of active menu-layers; je level eines, max 10 levels
	
	this.menubar_over = ibMenubarOver;
	this.menubar_out = ibMenubarOut;
	this.menubar_check = ibMenubarCheck;
}

function ibMenubarOver(id) {
	if (typeof(id) != "string") return;
	var tl = id.replace(this.itemprefix,this.barprefix);	// name ziellayer ermitteln
	// deletetimer abbrechen
	window.clearTimeout(this.cleartimer);

	// alle layers mit mindestens gleich langem, abweichenden präfix ausblenden
	for (i=0;i<this.active.length;i++) {
		if (typeof(this.active[i]) == "string") {
			if (this.active[i].length >= tl.length && this.active[i].substr(0,tl.length) != tl) 
				DH_hideLayer(this.active[i]);
		}
	}

	var tlobj = DH_getLayer(tl);
	if (typeof(tlobj) != "object") return;			// no submenu then return

	var linkobj = DH_getLayer(id);
	if (typeof(linkobj) != "object") return;		// link not found then return

	var linklevel = (id.length - this.itemprefix.length) / 2 - 1;

//	mb=linkobj.offsetParent.id;
	mbobj = DH_getLayerDirect(linkobj.offsetParent);
	if (1 == this.directions[linklevel]) {
		tlobj.moveTo(linkobj.posInitialLeft, mbobj.posInitialTop + mbobj.getHeight() +2 );
	}
	else {
		tlobj.moveTo(linkobj.posInitialLeft + mbobj.getWidth() +2 , linkobj.posInitialTop);
	}
	
	DH_showLayer_fast(tlobj);
	
	var tlevel = (tl.length - this.barprefix.length) / 2;
	this.active[tlevel] = tl;
}

function ibMenubarOut(id) {
	this.cleartimer = window.setTimeout("eval('" + this.objectname + "').menubar_check()",this.cleartime);
}

function ibMenubarCheck() {
	for (i=this.active.length;i>=0;i--) {
		if (typeof(this.active[i]) == "string") {
			DH_hideLayer(this.active[i]);
			this.active[i] = void(0);
			this.cleartimer = window.setTimeout("eval('" + this.objectname + "').menubar_check()",this.cleartime);
			return;
		}

	}
}