/*************** Script functions in this file **************
Filename: news_clip.js; as of Donnerstag,
  FUNCTION:                                               LINE:
  move()                                                   53   
  moveDiv(x,y)                                             101  
  whereIsTheMouse(e)                                       38   
************ (end Script functions in this file) ***********/

var isIE = (document.all)?(true):(false);
var isNS = (document.layers)?(true):(false);
var isW3C = (document.getElementById && !isIE)?(true):(false);
var isMac = (navigator.userAgent.indexOf("Mac") != -1)?(true):(false);
var NOANIMATION = (typeof NOANI != 'undefined')?(true):(false);

registerMouseMoveHandler(mouseMove2);

/*
if (isIE || isW3C && !NOANIMATION)
{
 document.onmousemove = whereIsTheMouse;
}
else if (isNS && !NOANIMATION)
{
 document.captureEvents(Event.MOUSEMOVE);
 document.onmousemove = whereIsTheMouse;
}
*/

if (isIE) var delay = 10;
if (isNS) var delay = 10;
if (isW3C) var delay = 10;
var mouseX;
var mouseY;
var orgX;
var orgY;
var newX;
var newY;
var ORGX = endX = (isIE)?(764):(769);
var ORGY = endY = (isIE)?(4):(10);
var isFirstCall = true;
var which;

function mouseMove2(e) {
 if (e) event = e;   //for Netscape
 if (isNS)
 {
  mouseX = event.pageX;
  mouseY = event.pageY;
 }
 else
 {
  mouseX = event.clientX;
  mouseY = event.clientY;
 }
}

function move()
{
 if (arguments[0]) which = arguments[0];
 if (isFirstCall && !isMac && !NOANIMATION)
 {
  if (isIE) document.all(which).style.position = "absolute";
  orgX = mouseX;
  orgY = mouseY;
  isFirstCall = false;
  if (isNS || isW3C)
  {
   endX = endX-mouseX;
   endY = endY-mouseY;
   orgX = orgY = 0;
  }
 }
 if ( (orgY >= endY+1) && !isMac && !NOANIMATION)
 {
  newX  = orgX+((endX-orgX)/(delay));
  newY  = orgY+((endY-orgY)/(delay));
  moveDiv(newX,newY);
  orgX = newX;
  orgY = newY;
  setTimeout('move()',20);
 }
 else
 {
  orgX = newX = orgY = newY = 0;
  isFirstCall = true;
  if (isNS)
  {
   document.layers[which].visibility = "hide";
   endX = ORGX;
   endY = ORGY;
  }
  else if (isIE)
  {
   document.all(which).style.visibility = "hidden";
  }
  else if (isW3C)
  {
   document.getElementById(which).style.visibility = "hidden";
   endX = ORGX;
   endY = ORGY;
  }
 }
}
function moveDiv(x,y)
{
 if (isNS)
 {
  document.layers[which].left = x;
  document.layers[which].top = y;
 }
 else if (isIE)
 {
  document.all(which).style.left = x;
  document.all(which).style.top = y;
 }
 else if (isW3C)
 {
  document.getElementById(which).style.left = x;
  document.getElementById(which).style.top = y;
 }
}