спасибо сделал:
function positionTop(element) {
var offsetTop = 0;
do offsetTop += element.offsetTop; while (element = element.offsetParent);
return offsetTop;
}
function anchor(id_comm) {
var div = document.getElementById(id_comm);
var top = positionTop(div);
var html = document.documentElement
html.scrollTop = top-screen.height/2;
}