MouseX = 0;
MouseY = 0;
activeTip = 0;
lines = 0;
init_tooltip = 0; 

onload = hidetip; 
onunload = hidetip; 
document.write ('<div id="tooltip" style="position:absolute; top:-100px;left-100px">&nbsp;</div>'); 

function showtip (which) {

	if (init_tooltip == 0) {
		document.onmousemove = MousePosition;
		document.onmouseout = hidetip;

		t = Array();
		t[1] = 'Suchbeispiele:<br />- Lenovo T61<br />- Acer Travelmate<br />- Mac Book<br />- Dell 2GB Poweredge 1850';
		t[2] = 'Lieferzeit 1-2 Werktage!';
		t[3] = 'Klicken Sie hier, wenn Sie dieses Upgrade bestellen möchten';
		t[4] = 'Sofort bestellen<br />Nur mit Login m&ouml;glich!';
		t[5] = 'Projektangebot anfordern<br />Frage zum Produkt<br />Aktuelle Preise finden Sie stets online';
		t[6] = 'Am einfachsten ist, sie wählen das Upgrade mit der höchsten Taktfrequenz.<br />Weshalb? Erfahren Sie wenn Sie diesem Link folgen';
		t[7] = 'Lieferzeit 1-3 Werktage!';
		t[8] = 'Bitte geben Sie hier die Kapazität an,<br />bitte geben Sie auch an ob es sich um MB oder GB handelt';
		t[9] = 'Diese Informationen, und auch die genaue Modellbezeichung,<br />finden Sie zumeist auf dem Gehäuse oder einem Typenschild auf der Rückseite des Gerätes.';		
		l = Array();
		l[1] = 1;
		l[2] = 0;
		l[3] = 0;
		l[4] = 0;
		l[5] = 0;
		l[6] = 0;

		lines = l[which];
		with (document.getElementById ('tooltip')) {

			style.display = "inline";
			innerHTML = t[which];

			if (which!=1) {
				style.width = "auto";
				style.whiteSpace  = "nowrap";
			}
		}
	}
	activeTip = 1;
	init_tooltip = 1;
}

function MousePosition(e) {

	if (init_tooltip == 0) return;

	if (document.all) {
		MouseX=event.x + document.body.scrollLeft;
		MouseY=event.y + document.body.scrollTop;
	}	else {
		MouseX=e.pageX;
		MouseY=e.pageY;
	}

	with (document.getElementById ('tooltip')) {
		style.top = MouseY +  10  - getBoxHeight() + 'px';
		style.left = MouseX +  10 + 'px';
	}
}


function getBoxHeight () {
	// line-height + padding-top + padding-bottom
	for (i=0,h=0; i < lines; i++)
	h += 12;
	return (h + 6);
}

function hidetip () {
	init_tooltip=0;
	if (activeTip == 1) {
		document.getElementById('tooltip').style.display = "none";
		activeTip = 0;
	}
}

function showPrdImage(imgid, garantie) {
	var elmMaster = document.getElementById("prdimgdivmaster");
	var elmgar = document.getElementById("prdimgimggar");
	var elm = document.getElementById("prdimgdiv");
	var elmimg = document.getElementById("prdimgimg");
	var img = document.getElementById(imgid);
	
	elmimg.src = img.src;
	elmimg.title = img.title;
	if (garantie)
	  elmgar.style.display='list-item';
	else
	  elmgar.style.display='none';
	elm.style.top=(findPosY(img) - elmMaster.offsetTop) + "px";
	elm.style.display='block';
	showPrdImage_timer(10);
	return false; 
}
function showPrdImage_timer(i) {
  var elm = document.getElementById("prdimgdiv");
  if (i > 0) {
	elm.style.width=356 * (11-i)/10  + "px";
	i--;
	var timeout = window.setTimeout("showPrdImage_timer(" + i + ")", 10);
  } else {
	elm.style.width="356px";
  }
}
function hidePrdImage() {
	var elm = document.getElementById("prdimgdiv");
	elm.style.display='none';
	return false; 
}
 function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
 }

