var ns=document.layers ? 1 : 0;
var ie=document.all ? 1: 0;

function MoveHandler(evnt) {
Xpos=(ns)?evnt.pageX:event.x+document.body.scrollLeft;
Ypos=(ns)?evnt.pageY:event.y+document.body.scrollTop;
}

if (ns) {
window.captureEvents(Event.MOUSEMOVE);
window.onMouseMove=MoveHandler;
}
else{
document.onmousemove=MoveHandler;
}

var positionY = 10;
var positionX = 10;
var yBase = 200;
var xBase = 200;
var delay = 10;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 50;
var Ypos = 50;
var j = 0;
function animateLogo() {
if (ns) {
yBase = window.innerHeight/4 ;
xBase = window.innerWidth/4;
}
else {
yBase = document.body.clientHeight/4;
xBase = document.body.clientWidth/4;
}

for ( j = 0 ; j < 8 ; j++ ) {

positionY = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
positionX = Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

if (ns) {
eval("document.layers.p"+j+".top = "+positionY);
eval("document.layers.p"+j+".left ="+positionX);
}
else {
eval("document.all.p"+j+".style.top = "+positionY);
eval("document.all.p"+j+".style.left ="+positionX);
}

}
currStep += step;
setTimeout("animateLogo()", delay);
}
animateLogo();
