try to change your main xml like this
<krpano debugmode="true" showlog="true">
<events name="click4angles" keep="true" onclick="screentosphere(mouse.x,mouse.y,mouseath,mouseatv);roundval(mouseath,3);roundval(mouseatv,3);debug('ath=',mouseath,'atv=',mouseatv);" />
.... your stuff ...
</krpano>