//Anonymous function that is applied to all internal-links
var jump = function(e) {
    //prevent the "normal" behaviour which would be a "hard" jump
    e.preventDefault();
    //Get the target
    var target = $(this).attr("href");
    if (target == '#inline1' || target == '#inline2' || target == '#inline3' || target == '#inline4') {
    }
    else {
        //perform animated scrolling
        $('html').animate(
       {
           //get top-position of target-element and set it as scroll target
           scrollTop: $(target).offset().top
           //scrolldelay: 2 seconds
       }, 1000, function() {
           //attach the hash (#jumptarget) to the pageurl
           location.hash = target;
       });
    }

}

$(document).ready(function()
{
       $('a[href*=#]').bind("click", jump);
       return false;
});
