var x,y,xs,ys;

function DOMEventGetClientX(e) {
  if (document.all)                  return window.event.screenX;
  else if (document.getElementById)  return e.screenX;
  else if (document.layers)          return e.screenX;
}

function DOMEventGetDocumentX(e) {
  if (document.all)                  return window.event.x;
  else if (document.getElementById)  return e.pageX;
  else if (document.layers)          return e.pageX;
}

function DOMEventGetDocumentY(e) {
  if (document.all)                  return window.event.y;
  else if (document.getElementById)  return e.pageY -window.pageYOffset;
  else if (document.layers)          return e.pageY;
}

function DOMEventGetClientY(e) {
  if (document.all)                  return window.event.screenY;
  else if (document.getElementById)  return e.screenY;
  else if (document.layers)          return e.screenY;
}

if (document.layers) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = trackMouse;

function trackMouse(e) {
  x = DOMEventGetClientX(e);
  y = DOMEventGetClientY(e);
  xs = DOMEventGetDocumentX(e);
  ys = DOMEventGetDocumentY(e);
}

function editwin(URL,breite, hoehe){
  editWin = open(URL,"TextInput","width=" + breite +",height=" + hoehe +",left="+(x-430)+",top="+y+",toolbar=no,scrollbars,status=no,location=no");
  editWin.focus();
}

function editwinstat(URL,breite, hoehe){
  editWin = open(URL,"TextInput","width=" + breite +",height=" + hoehe +",left="+(x-xs)+",top="+(y-ys)+",toolbar=no,scrollbars,status=no,location=no");
  editWin.focus();
}

function editwinstatslide(URL,breite, hoehe){
  editWin = open(URL,"SlideShow","width=" + breite +",height=" + hoehe +",left="+(x-xs)+",top="+(y-ys)+",toolbar=no,scrollbars,status=no,location=no");
  editWin.focus();
}
