$(document).ready(function () {

    $(".scroll").click(function (event) {
            //prevent the default action for the click event
            event.preventDefault();

            //get the full url - like mysitecom/index.htm#home
            var full_url = this.href;

            //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
            var parts = full_url.split("#");
            var trgt = parts[1];

            //get the top offset of the target anchor
            var target_offset = $("#" + trgt).offset();
            var target_top = target_offset.top;

            //goto that anchor by setting the body scroll top to anchor top
            $('html, body').animate({
                scrollTop: target_top
            }, 1000);
        });
   


    $(".gallery").hover(function () { //On hover...
        var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'           
        //Set a background image(thumbOver) on the &lt;a&gt; tag 
        $(this).find("a.thumb").css({
            'background': 'url(' + thumbOver + ') no-repeat center bottom'
        });
        //Fade the image to 0 
        $(this).find("span").stop().fadeTo('normal', 0, function () {
            $(this).hide() //Hide the image after fade
        });
    }, function () { //on hover out...
        //Fade the image to 1 
        $(this).find("span").stop().fadeTo('normal', 1).show();
    });

});
