Hola
cdurandu
Te doy un par de pistas en plan rápido, porque ando mal de tiempo. Prueba cambiando:
var anchopanta=window.document.body.clientWidth;
por:
var anchopanta=window.document.body.clientHeight;
y:
texto.style.left=posicion;
por:
texto.style.top=posicion;
Saludos,