/**
 * @desc Applies the scrollTo JQ plugin to the navigation rightbar
 * allowing a fluent navigation between multiple services found
 * on the same page.
 *
 * @author Steven Rosato
 */
$(function() {
    /* scrolling options for all items */
    scrollOptions = {
        duration: 800,
        offset: { top: -60 }
    };

    /* sets of from/to items mapped to the navigation */
    items = new Array(
        {
            from: '#menu-services-hosting',
            to:   '#services .hosting-content'
        },
        {
            from: '#menu-services-consultation',
            to:   '#services .consultation'
        }
    );

    /* scrolling */
    $.each(items, function(index, item) {
        $(item.from).click(function() {
            $.scrollTo(item.to, scrollOptions);
            return false;
        });
    });
});