var bAgentNetscape4 = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bAgentExplorer4 = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
var yBase = window.innerHeight/2;
var xBase = window.innerWidth/2;
var delay = 20;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 10;
var Ypos = 10;
var j = 0;

function MoveHandlerN(evnt) {
		Xpos = evnt.pageX ;
		Ypos = evnt.pageY ;
}
function MoveHandlerIE(evnt) {
		Xpos = window.event.x ;
		Ypos = window.event.y ;
}
function FlyBabyFlyN() {
	yBase = window.innerHeight / 4 ;
	xBase = window.innerWidth / 4;

	document.layerDot.top =  Ypos + Math.cos( ( 20 * Math.sin( currStep / ( 20 + j ) ) ) + j * 70 ) * yBase * (Math.sin( 10 + currStep / 10 ) + 0.2 ) * Math.cos( ( currStep + j * 25 ) / 10);
	document.layerDot.left =  Xpos + Math.sin( ( 20 * Math.sin( currStep / 20 ) ) + j * 70 ) * xBase * (Math.sin( 10 + currStep / (10 + j ) ) + 0.2 ) * Math.cos( (currStep + j * 25 ) / 10);
	currStep += step;
}
function FlyBabyFlyIE() {
//	yBase = window.innerHeight / 4 ;
//	xBase = window.innerWidth / 4;

	layerDot.style.top =  Ypos + Math.cos( ( 20 * Math.sin( currStep / ( 20 + j ) ) ) + j * 70 ) * 150 * (Math.sin( 10 + currStep / 10 ) + 0.2 ) * Math.cos( ( currStep + j * 25 ) / 10);
	layerDot.style.left =  Xpos + Math.sin( ( 20 * Math.sin( currStep / 20 ) ) + j * 70 ) * 200 * (Math.sin( 10 + currStep / (10 + j ) ) + 0.2 ) * Math.cos( (currStep + j * 25 ) / 10);
	currStep += step;
}
function InvokeDot() {
	if(bAgentNetscape4){
		window.captureEvents(Event.MOUSEMOVE);
		window.onMouseMove = MoveHandlerN;
		setInterval("FlyBabyFlyN()", delay) ;
	}else if (bAgentExplorer4){
		window.document.onmousemove = MoveHandlerIE;
		setInterval("FlyBabyFlyIE()", delay) ;
	}else return;
}

