var time;

function top()
{
	$('html, body').animate({scrollTop:0,scrollLeft:0},{duration:time,easing:"easeOutBounce"});
}

$(document).ready(function()
{

	time = Math.round($("body").attr("scrollHeight")/$("body").attr("clientWidth")*800);

	$(".to_top a").click( function(){ top(this); return false; } );

});
