nn = (document.layers)? true:false
ie = (document.all)? true:false


var litem=null, ltop, lbottom, lleft, lright;

function getRelTop(which) {
		var el = document.all(which);
		var t = el.offsetTop;
		while (el.offsetParent != null) {
			el = el.offsetParent;
			t += el.offsetTop;
			if (el.tagName == 'BODY') break;
		} return t;
}

function getRelLeft(which) {
		var el = document.all(which); var t = el.offsetLeft;
		while (el.offsetParent != null) {
			t += el.offsetParent.offsetLeft;
			if (el.offsetParent.tagName == 'BODY') break;
			el = el.offsetParent;
		} return t;
}

function showTip() {
	var lyr = document.all["dienstTip"].style;
	var lyrHgt = document.all["dienst"].offsetHeight;
	lyr.top = getRelTop("dienst") + lyrHgt + 0;
	lyr.left = getRelLeft("dienst") - 296;
	document.all["dienstTip"].style.visibility = "visible";
	ltop = document.all["dienstTip"].style.pixelTop;
	lleft = document.all["dienstTip"].style.pixelLeft;
	lright = lleft + document.all["dienstTip"].clientWidth;
	lbottom = ltop + document.all["dienstTip"].clientHeight;
	litem = "dienst";
//	alert(lleft + ","  + ltop   + "," + lright + "," +lbottom)
}

function hideTip(which) { 
	document.all[which+'Tip'].style.visibility = "hidden";
	litem = null;
}

function mouseMove() {
	mx = event.x; 
	my = event.y;
	if(litem) {
	 	if(mx < lleft - 15 || mx > lright + 15 || my < ltop - 25 || my > lbottom + 15) { hideTip(litem); }
	}
}

		document.onmousemove = mouseMove;
