// Funktionen für die Darstellung eines Hilfe-Links

function showtip(hovered,event)
{
	var title_text = hovered.getAttribute('title');
	var abstract_text = hovered.getAttribute('abstract');
	
	if ( title_text ) {
		if ( !abstract_text ) {
			abstract_text = title_text;
			hovered.setAttribute('abstract', title_text);
		}
		hovered.setAttribute('title', '');
		hovered.title = '';
	}
	
	if(!abstract_text)
		return; 
	
	hovered.setAttribute('alt', '');
	
	// Event-handling code for cross-browser support
	var mouse_event = event ? event : window.event;
	
	var tooltip = document.getElementById("tooltip");
	if ( !tooltip ) {
		tooltip = document.createElement('div');
		tooltip.setAttribute('id', 'tooltip');
		tooltip.style.textAlign = 'left';
		tooltip.style.position = 'absolute';
		tooltip.style.fontFamily = '\'Lucida Grande\', Helvetica';
		tooltip.style.fontSize = '11px';
		tooltip.style.visibility = 'hidden';
		tooltip.style.zIndex = '200';
		tooltip.style.backgroundColor = "#FDFEC8";
		tooltip.style.border = '1px solid #aaa';
		tooltip.style.padding = '3px';
		tooltip.style.maxWidth = '300px';
		document.body.appendChild(tooltip);
	}
	tooltip.innerHTML = abstract_text;
	
	var xcoord = 0;
	var ycoord = 0;
	
	if (mouse_event.pageX || mouse_event.pageY) {
	 	xcoord = event.pageX;
	 	ycoord = event.pageY;
	} else if(mouse_event.clientX || mouse_event.clientY) {
		xcoord = mouse_event.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
		ycoord = mouse_event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	}
	
	tooltip.style.left = xcoord + 4 + "px";
	tooltip.style.top = ycoord + 10 + "px";
	tooltip.style.visibility = "visible";
}

function hidetip()
{
	var tooltip = document.getElementById("tooltip");
	if ( !tooltip )
		return;
	tooltip.innerHTML = '';
	tooltip.style.visibility="hidden";
}
