I think is 'length' instead of 'Length' =
for (var i = 0; i < allLinks.Length; i++) {
could you try to make the DOM ready first, if not then when you assigned var xPos, yPos and call on init become not reference.
if you`re okay I give some other but using jquery :
$(function () {
$("a").hover(function (event) {
alert(event.target.href);
});
});
So it only call ajax when the user hover to that element instead we initialize to all ajax call during page load.
Hope it helps