// SOURCE---> http://css-tricks.com/snippets/jquery/smooth-scrolling/
//Enabling Smooth Scrolling on all pages for Internal Links Only
//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");
//       //perform animated scrolling
//       $('html,body').animate(
//       {
//               //get top-position of target-element and set it as scroll target
//               scrollTop: $(target).offset().top
//       //scrolldelay: 2 seconds
//       },2000,function()
//       {
//               //attach the hash (#jumptarget) to the pageurl
//               location.hash = target;
//       });
//
//}
//
//$(document).ready(function()
//{
//       $('a[href*=#]').bind("click", jump);
//       return false;
//});
$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 2000);
                return false;
            }
        }
    });
});
