var $page = $('html, body');
$('a[href*="#form"]').click(function() {
$page.animate({
scrollTop: $($.attr(this, 'href')).offset().top-200
}, 800);
return false;
});
$("#form").on("click","a", function (event) {
event.preventDefault();
var id = $(this).attr('href'),
top = $(id).offset().top;
top = top + ($(window).height() - $(id).height());
$('body,html').animate({scrollTop: top}, 1500);
});