i couldn't understand your question exactly but maybe this will give you an idea.
$('html,body').animate({scrollTop:$("#masthead").offset().top},'slow');
<script type="text/javascript">
setInterval(function(){
$("#main").load("select.php?id='.$_GET['id'].' #main");
$('html,body').animate({scrollTop:$("#main").offset().top},'slow');
}, 3000)
</script>