var isIE = document.all?true:false;
var fps = 40;

function slide(eleId, varX, varY, transTime) {
	if(eleId) {
		j = 0;
		oDiv = document.getElementById(eleId);
		startX = oDiv.style.left.replace(/px/, "") * 1;
		startY = oDiv.style.top.replace(/px/, "") * 1;
		approxSteps = fps * (transTime / 1000);
		delay = transTime / approxSteps;
		sinInc = (Math.PI/2) / approxSteps;
		moveX = varX - startX;
		moveY = varY;
	}
	if (j <= approxSteps) {
		var posX = startX + Math.ceil(Math.sin(j * sinInc) * moveX);
		var posY = startY + Math.ceil(Math.sin(j * sinInc) * moveY);
		oDiv.style.left = posX + "px";
		oDiv.style.top = posY + "px";
		j++;
		setTimeout("slide()", delay);
	} else {
		return;
	}
}
function SetupMenu() {
	if (!isIE) document.captureEvents(Event.MOUSEMOVE);
	document.getElementById("menu").onmousemove = getMousePosition;
	document.getElementById("menu").onmouseout = function () { slide('arrow', 225, 0, 4000); };
}

function getMousePosition(e) {
  var _x;
  var _y;
  if (!isIE) {
	_x = e.pageX;
	_y = e.pageY;
  }
  if (isIE) {
	_x = event.clientX + document.body.scrollLeft;
	_y = event.clientY + document.body.scrollTop;
  }
  
  slide('arrow', _x, 0, 4000);
}