simple code for the page to go to top.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.toTop.js"></script>
<script>
$.toTop({
css: {
border: '1px dotted gray',
padding: 5
},
image: 'toTop.png'
});
</script>
you need an image toTop.png
change the right paths to image and jquery.toTop.js
change image padding, border
place code in theme templates.
if the jquery presents then delete this line
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
thats all.