﻿
jQuery(function( $ ){
    jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
        return -c * ((t=t/d-1)*t*t*t - 1) + b;
    };

    //the scrolled div
    var target = $('#content').get(0);
    
    // Need to reset position to (0,0), as firefox has issues here
    target.scrollLeft = target.scrollTop = 0;
    
    // Handle initial scroll (ie, hash in the url)
    $.localScroll.hash({
        target: target,
        queue: true,
        duration: 1500
    });

    $.localScroll({
        target: target,             // selector or jquery object
        queue: true,
        duration: 1000,
        easing: 'easeOutQuart',
        hash: false                 // false will prevent #name from appearing in url
    });
});


function href() { 
    $('.primary li a').children().each(
        function(){
            $(this).addClass('scrolling').siblings('ul').children('li').children('a').removeClass('scrolling');
            $(this).parents('li').siblings('li').children('a').removeClass('scrolling');
        }
    );
}


$(document).ready(function(){
    $('.primary li a').click(function() {
        $(this).addClass('scrolling').siblings('ul').children('li').children('a').removeClass('scrolling');
        $(this).parents('li').siblings('li').children('a').removeClass('scrolling');
    });
});


