
var HinweisAusrichtung = false;
var Maus_X,Maus_Y;

// ---- Position von Elementen herausfinden ----

function absLeft(el) { return (el.offsetParent) ? el.offsetLeft+absLeft(el.offsetParent) : el.offsetLeft; }
function absTop(el)  { return (el.offsetParent) ? el.offsetTop+absTop(el.offsetParent) : el.offsetTop; }

function KoordinatenAnwenden(IDvon,IDnach) {
 document.getElementById(IDnach).style.left = absLeft(document.getElementById(IDvon)) + 250;
 document.getElementById(IDnach).style.top = absTop(document.getElementById(IDvon)) + 45;
 if( navigator.appName == "Netscape" ) { document.getElementById(IDnach).style.left = absLeft(document.getElementById(IDvon)) - 80; }
}
// ---------------------------------------------








 // ---- Mausbewegung festhalten und speichern: ----

 function mouse_pos(e) {
  if(!e) e = window.event;
  var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ? 
  window.document.documentElement : window.document.body;
  return {
  MausY : e.pageY ? e.pageY : e.clientY + body.scrollTop - body.clientTop,
  MausX : e.pageX ? e.pageX : e.clientX + body.scrollLeft  - body.clientLeft }
 }

 function showMousePos(e){
  var p = mouse_pos(e);
  Maus_X = p.MausX;
  Maus_Y = p.MausY;
  SetBoxPosition();
 }

 window.document.onmousemove = showMousePos;

 // ------------------------------------------------




 function SetBoxPosition() {
  if( Maus_X <10000 && Maus_Y < 10000 ) {
  if( HinweisAusrichtung==true ) {
  document.getElementById('DIV_Hinweis').style.left=Maus_X-10-document.getElementById('DIV_Hinweis').clientWidth;
  document.getElementById('DIV_Hinweis').style.top=Maus_Y+10;
  } else {
  document.getElementById('DIV_Hinweis').style.left=Maus_X+10;
  document.getElementById('DIV_Hinweis').style.top=Maus_Y+10;
  }}
 }
