﻿/// <reference path="jquery-1.3.2.min.js"/>
$(document).ready(function() {
    //    $('#scrollPage').click(function() {
    //        var elementClicked = $(this).attr("href");
    //        var destination = $(elementClicked).offset().top;
    //        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
    //        return false;
    //    });

    $("a").each(function(index) {
        if ($(this)[0].id.indexOf("scrollPage") !== -1) {
            $(this).click(function() {
                var elementClicked = $(this).attr("href");
                var destination = $(elementClicked).offset().top;
                $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
                return false;
            });
        }
    });

    $('#scrollSpring').click(function() {
        var elementClicked = $(this).attr("href");
        var destination = $(elementClicked).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
        return false;
    });

    $('#scrollClassic').click(function() {
        var elementClicked = $(this).attr("href");
        var destination = $(elementClicked).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
        return false;
    });

    $('#scrollPremier').click(function() {
        var elementClicked = $(this).attr("href");
        var destination = $(elementClicked).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
        return false;
    });

    $('#scrollFreshen').click(function() {
        var elementClicked = $(this).attr("href");
        var destination = $(elementClicked).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination - 20 }, 500);
        return false;
    });
});
