// ////////////////////////////////////////////////////////////////////////:
// script by Gerard Ferrandez - ge1doot - July 2000
// http://www.dhteumeuleu.com
// ////////////////////////////////////////////////////////////////////////:
document.onselectstart = new Function("return false");

var object = new Array();
var xm = 0;
var ym = 0;

var mouseAdjustment_x = 0; // Horisontal
var mouseAdjustment_y = 10; // vertical

document.onmousemove = function(e){
    if (window.event) e = window.event;
    xm = (e.x || e.clientX) + mouseAdjustment_x;
    ym = (e.y || e.clientY) + mouseAdjustment_y;
}
function CObj(N,img){
    o = document.createElement("img");
    o.setAttribute('class','imgSnake');
    o.src = img.src;
    document.body.appendChild(o);
    this.img = o.style;

    this.N   = N;
    this.OmW = img.width/2;
    this.OmH = img.height/4;
    this.ddx = 0;
    this.ddy = 0;
    this.PX  = xm;
    this.PY  = ym;
    this.x   = 0;
    this.y   = 0;
    this.sto = "object[" + N + "].ge1doot();";

    this.ge1doot = function (){
        with (this) {
            if(N==0){
                x0 = xm + mouseAdjustment_x;
                y0 = ym + mouseAdjustment_y;
            } else {
                x0 = object[N-1].x;
                y0 = object[N-1].y;
            }
            x = PX+=(ddx+=((x0-PX-ddx*4))/10);
            y = PY+=(ddy+=((y0-PY-ddy*4))/10);

            img.left = x - OmW;
            img.top  = y - OmH;

            setTimeout(sto, 16);
        }
    }
    this.ge1doot()
}

function startMouseTrail() {
    xm = document.body.offsetWidth  / 2;
    ym = document.body.offsetHeight / 2;
    if (!mouseTrailNumRepeat) N = 50;
    else N = mouseTrailNumRepeat;
    for(i=0;i<N;i++){
        if(i==0 || i==N-1)I=document.getElementById("MP"); else I=document.getElementById("Om");
        object[i] = new CObj(i,I);
    }
}