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 Praefix 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) 
				fnDHTML_HideLayer(this.active[i]);
		}
	}

	var tlobj = fnDHTML_GetLayer(tl);
	if (typeof(tlobj) != "object") return;			// no submenu then return

	var linkobj = fnDHTML_GetLayer(id);
	if (typeof(linkobj) != "object") return;		// link not found then return

	var linklevel = (id.length - this.itemprefix.length) / 3 - 1;

//	mb=linkobj.offsetParent.id;
	mbobj = fnDHTML_GetLayer_Direct(linkobj.offsetParent);
	if (1 == this.directions[linklevel]) {
		//tlobj.moveTo(linkobj.posInitialLeft +0 , mbobj.posInitialTop + mbobj.getHeight() +3 );
	}
	else {
		//tlobj.moveTo(linkobj.posInitialLeft + mbobj.getWidth() +0 , linkobj.posInitialTop +3);
	}

	fnDHTML_ShowLayer(tlobj.id);
//	fnDHTML_showLayer_fast(tlobj); //zu schnell fuer mozilla
	
	var tlevel = (tl.length - this.barprefix.length) / 3;
	this.active[tlevel] = tl;
}

function ibMenubarOut(id) {
//	ibctDebug(id, "out");
	window.clearTimeout(this.cleartimer);
	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") {
			fnDHTML_HideLayer(this.active[i]);
			this.active[i] = void(0);
			this.cleartimer = window.setTimeout("eval('" + this.objectname + "').menubar_check()",this.cleartime);
			return;
		}

	}
}


