function getDivPos(menuId) {
	// Liefert 0, 1, 2 oder 3 zurück, je nachdem, welche Position
	// der Menüpunkt von oben hat (Afrika=0, etc.)
	pos = -1;
	for (var i=0; i<maxItems; i++) {
		if (menuIds[i]==aktMenuId) pos = i;
	}
	return pos;
}

function toggleInvisible(welchesDiv) {
	document.getElementById('menu_active_'+welchesDiv).style.display='none';
	document.getElementById('submenu_'+welchesDiv).style.display='none';
}

function toggleVisible(welchesDiv) {
	for (var i=0; i<maxItems; i++) {
		toggleInvisible(i);
	}
	document.getElementById('menu_active_'+welchesDiv).style.display='block';
	if (aktMenuId) {
		pos = getDivPos(aktMenuId);
		if (pos==welchesDiv) {
			if (subMenuActive) {
				document.getElementById('submenu_'+welchesDiv).style.display='block';
			}
		}
	}
}

function initMenu() {
	if (aktMenuId) {
		pos = getDivPos(aktMenuId);
		if( pos > -1 ) toggleVisible(pos);
	}
}

function hover(welchesDiv) {
	toggleVisible(welchesDiv);
}

function leave(welchesDiv) {
	if (aktMenuId) {
		pos = getDivPos(aktMenuId);
		if (welchesDiv != pos) {
			toggleInvisible(welchesDiv);
			if( pos > -1 ) toggleVisible(pos);
		}
	}
	else {
		toggleInvisible(welchesDiv);
	}
}