// written by oliver knill, http://www.math.harvard.edu/~knill, June 9007
// this script is put in the public domain

var neu=-1; 
var xx=0; var yy=0; 
var xleft,xmiddle,xright; 
var vx=0; 
var x=0;
var o=900;
var control=1; 

function initialize(){
document.getElementById("curse1").style.top  = 0 + "px";
document.getElementById("curse1").style.left = -200 + "px";
document.getElementById("curse2").style.top  = 0 + "px";
document.getElementById("curse2").style.left = 2400+200 + "px";
document.getElementById("curse3").style.top  = 0 + "px";
document.getElementById("curse3").style.left = 0 + "px";
}


function pos(e){
  if (navigator.appName == 'Netscape'){ xx = e.pageX; yy = e.pageY;} else{
  xx = event.clientX; yy = event.clientY;}; 
  if (yy<900) { control=1; } else { control=0; }
}

function c(){
  if (neu==-1) { initialize(); neu=1; }
  if (control==1) {
    if (xx>500) { o-=2; } else { o+=2; } 
    if (o>=2400) {o=o-2400; } if (o<=-2400) {o=o+2400; }
    x=x-o; xx=xx-o; x=(9*x+xx)/10; x=x+o; xx=xx+o; 
    if (x>=2400) {x-=2400; } if (x<=-2400) {x+=2400; }
    xleft=x-2400-o; xright=x+2400-o; xmiddle=x-o; 
    if (xleft  >=   0) {xleft   -=2400; } if (xleft  <=-2400)  {xleft   +=2400; }
    if (xmiddle>=2400) {xmiddle -=2400; } if (xmiddle<=    0)  {xmiddle +=2400; }
    if (xright >=4800) {xright  -=2400; } if (xright<=- 2400)  {xright  +=2400; }
    document.getElementById("curse1").style.left = xleft   + "px";
    document.getElementById("curse2").style.left = xmiddle + "px";
    document.getElementById("curse3").style.left = xright  + "px";
  }
  start=setTimeout('c()',30);
}

start=setTimeout('c()',0);
document.onmousemove=pos;
