/*
Cross browser cursor trailer script
By Brian Caputo (brian.caputo@dynamic-depot.com)
Visit Dynamic Depot @ www.dynamic-depot.com
*/
V5=document.getElementById;B=document.all;C=document.layers;D=document.all&&window.print;E=V5&&!document.all;cC=new Array();
T1=new Array('../images/cursor/trail1.gif',38,35, '../images/cursor/trail2.gif',30,31, '../images/cursor/trail3.gif' ,28,26, '../images/cursor/trail4.gif',22,21, '../images/cursor/trail5.gif',16,16, '../images/cursor/trail6.gif',10,10);
nos=parseInt(T1.length/3);
rate=100;
for (i=0;i<nos;i++)
createCell('CUR'+i,i*10,i*10,T1[i*3+1],T1[i*3+2],'<img src="'+T1[i*3]+'" width='+T1[(i*3+1)]+' height='+T1[(i*3+2)]+' border=0>')
function cycle(){for (i=0;i<(nos-1);i++){moveCell('CUR'+i,getXpos('CUR'+(i+1)),getYpos('CUR'+(i+1)))}}
function newPos(e){moveCell('CUR'+(nos-1),((B)?event.clientX+document.body.scrollLeft:e.pageX)+2,((B)?event.clientY+document.body.scrollTop:e.pageY)+2)}	//Here is the line I changed so both IE & NS move it over 2 pixels off the pointers tip thus allowing linkage!
if(document.layers)document.captureEvents(Event.MOUSEMOVE);
if (B)document.body.onscroll=newPos;
document.onmousemove=newPos;
setInterval('cycle()',rate);

function createCell(N, Xp, Yp, W, H, Ht, O) {
    if (B || C || D || E) {
        with (document) {
            if (C) {
                write("<layer name='" + N + "' left=" + Xp + " top=" + Yp + " width=" + W + " height=" + H);
            } else {
                write("<div id='" + N + "' style='position:absolute; left:" + Xp + "; top:" + Yp + "; width:" + W + "; height:" + H);
            }
            write((C) ? ">" : "'>");
            write(Ht);
        }
        if (!O) {
            closeCell();
        }
        cC[cC.length] = N;
    }
}
;

function moveCell(N, Xp, Yp) {
    D = getCell(N);
    D.left = Xp;
    D.top = Yp;
}
;

function getYpos(N) {
    return (parseInt(getCell(N).top));
}
;

function getXpos(N) {
    return (parseInt(getCell(N).left));
}
;

function closeCell() {
    document.write((!C) ? "</div>" : "</layer>");
}
;

function getCell(N) {
    if (C) {
        XX = C[N];
    }
    if (document.getElementById) {
        XX = document.getElementById(N).style;
    }
    if (B) {
        XX = B[N].style;
    }
    if (XX == null && C) {
        rr = C.length;
        for (i = 0; i < rr; i++) {
            XX = C[i].document.layers;
            if (XX) {
                XX = XX[N];
            }
            if (XX) {
                return XX;
            }
        }
    }
    return XX;
}


function getObject2(N) {
    if (E) {
        e = document.getElementById(N);
    } else {
        e = (C) ? C[N] : B[N];
    }
    if (!e && C) {
        rr = C.length;
        for (i = 0; i < rr; i++) {
            e = C[i].document.layers;
            if (e) {
                e = e[N];
            }
            if (e) {
                return e;
            }
        }
    }
    return e;
}

