var slideTime = 700;
var floatAtBottom = true;

window.onload = function()
{
  winOnResize() // set initial position
  xAddEventListener(window, 'resize', winOnResize, false);
  xAddEventListener(window, 'scroll', winOnScroll, false);
}
function winOnResize() {
winOnScroll();
}
function winOnScroll() {
  var y = xScrollTop();
  if (floatAtBottom) {
    y += xClientHeight() - xHeight('linktotop')-50;
	//y += xClientHeight() - 190;

  }
  xSlideTo('linktotop', 910, y, slideTime);
}
