wmtt = null;

document.onmousemove = updateWMTT;

function Werteliste(querystring) {
  if(querystring == '') return;
  var wertestring = decodeURI(querystring);
  wertestring = wertestring.slice(1);
  var paare = wertestring.split("&");
  for (var i=0; i < paare.length; i++) {
    var name = paare[i].substring(0, paare[i].indexOf("="));
    var wert = paare[i].substring(paare[i].indexOf("=")+1, paare[i].length);
    this[name] = wert;
  }
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function updateWMTT(e) {

	x = (document.all) ? window.event.clientX + document.documentElement.scrollLeft : e.pageX;
	y = (document.all) ? window.event.clientY + document.documentElement.scrollTop  : e.pageY;

	// MM_displayStatusMsg('x='+x+' / y='+y+' / scrolly='+document.documentElement.scrollTop);
	
	// mit neuem Offset, da Haupcontainer absolut positioniert ist	
	// Offset nicht anwenden, wenn innerhalb des Katalogs, dazu URL-Parameter vkfcat abfragen
	// var liste = new Werteliste(window.location.search);	
	offset_x = 15;
	offset_y = 2;
	
    if (wmtt != null) {
		// Breite des Tooltips feststellen um diese dann noch von der x-Position abzuziehen
		breite = wmtt.offsetWidth;
		
		// X-Wert für linksbündige Anzeige
		// wmtt.style.left = (x - offset_x - breite) + "px";
		wmtt.style.left = (x + offset_x) + "px";
		wmtt.style.top 	= (y + offset_y) + "px";
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block"
}

function hideWMTT() {
	wmtt.style.display = "none";
}

