/*
 *Cursor Trailer II (By Kurt at kurt.grigg@virgin.net)
 *Modified and featured on Dynamicdrive.com
 *For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
 */

 window.document.onmousemove = mousemove;

 ///no need to edit below/////////
 var amount=5;
 var ypos=0;
 var xpos=0;
 var Ay=0;
 var Ax=0;
 var By=0;
 var Bx=0;
 var Cy=0;
 var Cx=0;
 var Dy=0;
 var Dx=0;
 var Ey=0;
 var Ex=0;

 for (var i = 0; i < amount; i++) {
  document.write('<div id="bee'+i+'" style="position:absolute;top:-500;left:0;"><img galleryimg="no" src="images/logo/biene-cursor.gif"></div>');
 }

 function mousemove(_event) {

	_event = getEvent(_event);

	ypos = document.body.scrollTop|window.pageYOffset;
	xpos = document.body.scrollLeft|window.pageXOffset;
  ypos+= parseInt(_event.clientY);
  xpos+= parseInt(_event.clientX);

 }

function makefollow(){
  var o;
  o = getObject('bee0'); o.style.top=Ay; o.style.left=Ax;
  o = getObject('bee1'); o.style.top=By; o.style.left=Bx;
  o = getObject('bee2'); o.style.top=Cy; o.style.left=Cx;
  o = getObject('bee3'); o.style.top=Dy; o.style.left=Dx;
  o = getObject('bee4'); o.style.top=Ey; o.style.left=Ex;

	top.window.status = 'X = ' + xpos + ', Y = ' + ypos;
}

/**
 * Beschafft das Objekt zum Namen 
 */
function getObject(_id) {

	if (document.all) {
		return document.all[_id];
	}

	return document.getElementById(_id);
}


/**
 * Liefert browserneutral das Event-Objekt
 */
function getEvent(_e) {
	
	if (window.event) {
		return window.event;
	}

	return _e;
}



function move() {

	Ey = Math.round(Ey+=((ypos-70)-Ey)*2/2); Ex = Math.round(Ex+=((xpos-90)-Ex)*2/2);
	Dy = Math.round(Dy+=(Ey - Dy)*2/4);      Dx = Math.round(Dx+=(Ex - Dx)*2/4);
	Cy = Math.round(Cy+=(Dy - Cy)*2/6);      Dx = Math.round(Cx+=(Dx - Cx)*2/6);
	By = Math.round(By+=(Cy - By)*2/8);      Bx = Math.round(Bx+=(Cx - Bx)*2/8);
	Ay = Math.round(Ay+=(By - Ay)*2/10);     Ax = Math.round(Ax+=(Bx - Ax)*2/10);

	makefollow();

  setTimeout('move()',15);
}

move();

