// Funktionen Tauschen und Tooltip
function tauschen(bild, bild_id, bildunterschrift, bildunterschrift_id, artikel_nummer, titel, link_id) {
 	document.getElementById(bild_id).src = "images/artikel/thumb/"+bild;
 	document.getElementById(bildunterschrift_id).firstChild.data = bildunterschrift;
         var neues_ziel="windmuehlenmesser-details.php?artikel_nummer="+artikel_nummer;
         var altes_ziel=document.getElementById(link_id).href;
 	document.getElementById(link_id).href=neues_ziel;
 	}

function tauschen2(bild, bild_id, bildunterschrift, bildunterschrift_id, artikel_nummer, titel, link_id) {
 	document.getElementById(bild_id).src = "images/artikel/big/"+bild;
 	document.getElementById(bildunterschrift_id).firstChild.data = bildunterschrift;
 	var neues_ziel="windmuehlenmesser-details.php?artikel_nummer="+artikel_nummer;
 	var altes_ziel=document.getElementById(link_id).href;
         var neue_druckversion="windmuehlenmesser-details.php?druckversion&artikel_nummer="+artikel_nummer;
 	document.getElementById(link_id).href=neues_ziel;
         document.getElementById("druckversion_id").href=neue_druckversion;
 	}

function getScrollPos() {
   if (document.body.scrollTop != undefined && navigator.appName.indexOf("Explorer") != -1 ) {
      var res = (document.compatMode != "CSS1Compat") ? document.body : document.documentElement;
      return {x : res.scrollLeft, y : res.scrollTop};
   }
   else {
      return {x : window.pageXOffset, y : window.pageYOffset};
   }

}

function showToolTip(e, text) {
	var scr = getScrollPos();
	var cordX = e.clientX + scr.x;
	var cordY = e.clientY + scr.y;
	var correctorY = e.clientY + document.getElementById("tooltip").offsetHeight + 20 - window.innerHeight;

         document.getElementById("tooltip").style.border = "solid black 1px";
	document.getElementById("tooltip").innerHTML = text;
	document.getElementById("tooltip").style.position = "absolute";
	document.getElementById("tooltip").style.left = ( cordX + 10 ) + "px";

	if ( correctorY > 0 ) {
		document.getElementById("tooltip").style.top = ( cordY - correctorY ) + "px";
	} else {
		document.getElementById("tooltip").style.top = ( cordY + 10 ) + "px";
	}

	document.getElementById("tooltip").style.visibility = "visible";
}

function hideToolTip() {
	document.getElementById("tooltip").innerHTML = "";
         document.getElementById("tooltip").style.left =0;
         document.getElementById("tooltip").style.top =0;
         document.getElementById("tooltip").style.border = "none red 1px";
}