this function is based on jquery 1.6.1 of mine,but i think its fit for most of the jqeury versions
function goToIdByScroll(id){
$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}//scrol by the element ID
function goToAnchorByScroll(id) {
$('html,body').animate({ scrollTop: $('a[href$="' + id+'"]').offset().top }, 'slow');
}//scrol by the anchor that in the href