//Edit the informaiton between the quotes below with the path to your image.

var imagePath = "http://www.goebel-hotels.com/layout/tooltiparrow.gif";
var ie=document.all;

function LadeToolTip(){

$(document).ready(function() {
						   
var thealinks = document.getElementsByTagName("a");
if (!thealinks) { return; }

for(var x=0;x!=thealinks.length;x++){

if(thealinks[x].className == "ToolTipID"){
thealinks[x].setAttribute("tooltiptext","<img src='"+thealinks[x].rel+"'>");
thealinks[x].setAttribute("tooltipbild",thealinks[x].rel);
thealinks[x].onmouseover=function gomouseover(){ddrivetip(this.getAttribute("tooltiptext")); ddrivebild(this.getAttribute("tooltipbild"))};
thealinks[x].onmouseout=function gomouseout(){hideddrivetip();};

}
}
						   });
}
document.write('<div id="theToolTip"></div>'); //write out tooltip DIV
document.write('<img id="ToolTipPointer" src="'+imagePath+'">'); //write out pointer image

var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;
if (ie||ns6) {
	var tipobj=document.all? document.all["theToolTip"] : document.getElementById? document.getElementById("theToolTip") : "";
}

///////////////////////////////

function ddrivetip(thetext){
if (ns6||ie){
tipobj.innerHTML=thetext;
enabletip=true;
return false;
}
}

// Füllt globale Variable "tipbild" mit dem Wert der Funktion gomouseover()
function ddrivebild(tooltipbild){
if (ns6||ie){
tipbild = tooltipbild;
enabletip=true;
return false;
}
}

///////////////////////////////

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
};

///////////////////////////////





function positiontip(e){

//Mausposition X-Achse
  if (!e)
     e = window.event;
  if (document.dokumentElement) {
    var maus  = e.clientX + "px";
	var mausy  = e.clientY + "px";
  } else if (window.document.body) {
    var maus = e.clientX ;
	var mausy = e.clientY ;
  }
//

if (enabletip){
var nondefaultpos=false;
var scrollHeighty;
var scrollWidthx;

// Fensterbreite
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth;
var winwidthhalbe=winwidth / 2;

var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight;
var winheighthalbe=winheight / 2;
//

//Scollposition X und Y-Achse
if (self.pageYOffset) // all except Explorer
{
	scrollWidthx = self.pageXOffset;
	scrollHeighty = self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
{
	scrollWidthx = document.documentElement.scrollLeft;
	scrollHeighty = document.documentElement.scrollTop;
}
else if (document.documentElement && document.documentElement.scrollLeft)
	// Explorer 6 Strict
{
	scrollWidthx = document.documentElement.scrollLeft;
	scrollHeighty = document.documentElement.scrollTop;
}
else if (document.body) // all other Explorers
{
	scrollWidthx = document.body.scrollLeft;
	scrollHeighty = document.body.scrollTop;
}

// Liest den rel-Inhalt des a-Tags aus
var bild = new Image();
bild.src = tipbild;
var bildbreite = bild.width;
var bildhoehe = bild.height;

// Positioniert den ToolTip
if (maus > winwidthhalbe){
tipobj.style.left=scrollWidthx+maus-bildbreite-60+"px";}
else {tipobj.style.left=scrollWidthx+maus+60+"px";}

if (mausy > winheighthalbe){
tipobj.style.top=scrollHeighty+mausy-bildhoehe+"px";}
else {tipobj.style.top=scrollHeighty+mausy+"px";}

// Zeigt den Tip oder nicht
nondefaultpos=true;
tipobj.style.visibility="visible";
var bildbreite = 0;
var bildhoehe = 0;
}
}

/////////////////////////////////

function hideddrivetip(){
if (ns6||ie){
enabletip=false;
tipobj.style.visibility="hidden";
tipobj.style.left="-1000px";
tipobj.style.backgroundColor='';
tipobj.style.width='';
}
}

document.onmousemove=positiontip;

