//  --------------------------------------
// globals
var selectedItem = null;

if(window.event)
{
	document.onmouseover = mOver;
	document.onmouseout = mOut;
}

function mOver() {
	var eSrc = window.event.srcElement;
	if (eSrc.className == "item") {
		window.event.srcElement.className = "highlight";
	}
	return true;
}

function mOut() {
 	var eSrc = window.event.srcElement ;
	if (eSrc.className == "highlight") {
		window.event.srcElement.className = "item";
	}
}

// ---------- markieren des angeklickten Bereichs:

function getReal(el, type, value) {
	temp = el;
	while ((temp != null) && (temp.tagName != "BODY")) {
		if (eval("temp." + type) == value) {
			el = temp;
			return el;
		}
		temp = temp.parentElement;
	}
	return el;
}

function getDivByName(el, value) {
	temp = el;
	anzahl = temp.length;
	while (anzahl > 0) {
		if (temp[anzahl-1].id == value) {
			el = temp[anzahl-1];
			return el;
		}
		anzahl--;
	}
	return el;
}

function highlightSubItem(el) {
	if(!el)
	  return;
//	el.style.fontWeight = "bold";
//	el.style.background = "#dedede";
//	el.style.background = "none";
//	el.style.color      = "#01B3EE"; //"highlighttext";
//	el.style.color      = "black"; //"highlighttext";

	selectedItem = el;
}

function restoreSubItem(el) {
	el.style.fontWeight     = "normal";
	el.style.background = "none";
	el.style.color      = "menutext";
	selectedItem = null;
}

function high(elId) {
	if(window.event)
		el = getReal(window.event.srcElement, "ID", elId);
	else
		if(document.all)
			el = getDivByName(eval(document.all.tags("font")),elId);
		else
			return;

	if (selectedItem != null)
		restoreSubItem(selectedItem);
	highlightSubItem(el);
}

//  --------------------------------------

