floatX=40;
floatY=40;
layerwidth=500;
layerheight=635;
delayspeed=1;
NS=false;
IE=(document.all);
if (!IE) {NS=(document.getElementById);}
function adjust() {
	if (NS) {
		if (lastX==-1 || delayspeed==0)
		{
			lastX=window.pageXOffset + floatX;
			lastY=window.pageYOffset + floatY;
		}
		else
		{
			var dx=Math.abs(window.pageXOffset+floatX-lastX);
			var dy=Math.abs(window.pageYOffset+floatY-lastY);
			var d=Math.sqrt(dx*dx+dy*dy);
			var c=Math.round(d/10);
			if (window.pageXOffset+floatX>lastX) {lastX=lastX+delayspeed+c;}
			if (window.pageXOffset+floatX<lastX) {lastX=lastX-delayspeed-c;}
			if (window.pageYOffset+floatY>lastY) {lastY=lastY+delayspeed+c;}
			if (window.pageYOffset+floatY<lastY) {lastY=lastY-delayspeed-c;}
		}
		document.getElementById('floatLayer').style.left=lastX;
		document.getElementById('floatLayer').style.top=lastY;
	}
	else if (IE){
		if (lastX==-1 || delayspeed==0)
		{
			lastX=document.body.scrollLeft + floatX;
			lastY=document.body.scrollTop + floatY;
		}
		else
		{
			var dx=Math.abs(document.body.scrollLeft+floatX-lastX);
			var dy=Math.abs(document.body.scrollTop+floatY-lastY);
			var d=Math.sqrt(dx*dx+dy*dy);
			var c=Math.round(d/10);
			if (document.body.scrollLeft+floatX>lastX) {lastX=lastX+delayspeed+c;}
			if (document.body.scrollLeft+floatX<lastX) {lastX=lastX-delayspeed-c;}
			if (document.body.scrollTop+floatY>lastY) {lastY=lastY+delayspeed+c;}
			if (document.body.scrollTop+floatY<lastY) {lastY=lastY-delayspeed-c;}
		}
		document.all['floatLayer'].style.posLeft = lastX;
		document.all['floatLayer'].style.posTop = lastY;
	}
	setTimeout('adjust()',0);
}

function define()
{
	if (NS)
	{
		floatX=window.innerWidth-ifloatX-layerwidth-20;
		floatY=ifloatY;
	}
	if (IE)
	{
		floatX=document.body.offsetWidth-ifloatX-layerwidth-20;
		floatY=ifloatY;
	}
}
