jQuery(document).ready(function () {
    // jQuery SmoothScroll | Version 10-04-30
    jQuery('a#currentSong').click(function () {

        // duration in ms
        var duration = 800;

        // easing values: swing | linear
        var easing = 'swing';

        // get / set parameters
        var newHash = this.hash;
        var target = jQuery(this.hash).offset().top;
        var oldLocation = window.location.href.replace(window.location.hash, '');
        var newLocation = this;

        // make sure it's the same location
        if (oldLocation + newHash == newLocation) {
            // animate to target and set the hash to the window.location after the animation
            jQuery('html:not(:animated),body:not(:animated)').animate({ scrollTop:target }, duration, easing, function () {

                // add new hash to the browser location
                window.location.href = newLocation;
            });

            // cancel default click action
            return false;
        }
    });

    var audioPlaylist = new Playlist("2", [
        
    ]);

    jQuery("div.currentTrack").toggle(function () {
            var daHeight = jQuery(window).height() - 100;
            jQuery("#playlist").animate({bottom:daHeight}, 500);
            jQuery(".currentTrack p").animate({opacity:0});
            jQuery("div.currentTrack").addClass("currentTrack2").removeClass("currentTrack");
            jQuery("a.open").addClass("arrowDown").removeClass("open");
        },
        function () {
            jQuery("#playlist").animate({bottom:0}, 500);
            jQuery(".currentTrack2 p").animate({opacity:100}, 800);
            jQuery("div.currentTrack2").addClass("currentTrack").removeClass("currentTrack2");
            jQuery("a.arrowDown").addClass("open").removeClass("arrowDown");
        });

    jQuery(".song").click(function() {
        audioPlaylist.playlistAdd($(this).attr("data-songtitle"), $(this).attr("data-songartist"), $(this).attr("data-oga"));
    });
});
