var c_offset = 0;
function findPos(name){
    c_top = $("a[name="+name+"]");
    if(c_top.length){
        var gotoY = $(c_top[0]).offset().top - 210;
        window.scrollTo(0,gotoY);
    } else {
        document.location.replace("/#"+name)
        return true;
    }
}

$(document).ready(function(){
    c_offset = $("#sidebar").offset().top;
    if(document.location.hash){
        findPos(document.location.hash.substr(1));
    }
});